.timeline-scroll {
  max-height: 65vh;
  overflow: auto;
}
.timeline.week {
  min-width: 660px;
}
.timeline-head {
  display: grid;
  grid-template-columns: 56px repeat(7, minmax(0, 1fr));
  position: sticky;
  top: 0;
  background: white;
  z-index: 5;
  border-bottom: 1px solid var(--line);
}
.timeline.day .timeline-head {
  grid-template-columns: 56px 1fr;
}
.timeline-head button {
  border: 0;
  background: white;
  border-radius: 0;
  font-size: 11px;
  color: var(--muted);
}
.timeline-head strong {
  display: block;
  font-size: 19px;
  color: var(--text);
  margin-top: 4px;
}
.timeline-head .is-today strong {
  color: var(--primary);
}
.timeline-body {
  display: grid;
  grid-template-columns: 56px repeat(7, minmax(0, 1fr));
}
.timeline.day .timeline-body {
  grid-template-columns: 56px 1fr;
}
.hours span {
  display: block;
  height: 64px;
  padding-top: 5px;
  font-size: 10px;
  text-align: center;
  color: #9ca3af;
}
.time-column {
  height: 1536px;
  position: relative;
  border-left: 1px solid #edf1f5;
}
.timeline-body:has(.consult-point) .time-column {
  height: 1580px; /* Keep late-night consultation cards inside the timeline. */
}
.time-slot {
  display: block;
  border: 0;
  border-bottom: 1px solid #edf1f5;
  border-radius: 0;
  height: 64px;
  width: 100%;
  background: transparent;
  padding: 0;
}
.time-event {
  position: absolute;
  z-index: 2;
  background: #eee8fa;
  border: 0;
  border-left: 3px solid var(--regular);
  border-radius: 4px;
  padding: 5px;
  text-align: left;
  font-size: 11px;
  overflow: hidden;
  min-height: 0;
  line-height: 1.4;
  color: #4b2394;
}
.time-event strong {
  font-size: 11px;
  display: block;
}
.time-event small {
  font-size: 10px;
  display: block;
}
.time-event.urgent {
  background: #fff0e5;
  border-color: var(--urgent);
  color: #a34f18;
}
.time-event.check {
  background: #e4f4f1;
  border-color: var(--check);
  color: #166e63;
}
.now-line {
  position: absolute;
  left: 0;
  right: 0;
  border-top: 1px solid #e24a4a;
  pointer-events: none;
  z-index: 3;
}
.now-line:before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #e24a4a;
  position: absolute;
  top: -4px;
  left: -3px;
}

/* Consultations are time points, with no task lifecycle or duration. */
html[data-surface="staff"] .day-dots .consult-dot {
  background: #247d88;
  border-radius: 1px;
  transform: rotate(45deg);
}
.task-card.consult-card {
  border-left: 3px solid #247d88;
  background: #f2f9fa;
}
.consult-card .time-block { color: #247d88; }
.consult-card .time-block small { font-size: 10px; white-space: nowrap; }
.consult-card .consult-badge { color: #176b77; background: #deeff1; }
.consult-record-icon { width: 13px; height: 13px; margin-right: 4px; vertical-align: -2px; color: #247d88; flex: none; }
.consult-summary {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.consult-copy { min-width: 0; }
.consult-point, .consult-month, .consult-undated {
  background: #e7f4f5;
  color: #176b77;
  border-color: #247d88;
}
.consult-point { border-left-style: dotted; padding: 2px 5px; line-height: 1.2; }
.consult-point strong, .consult-point small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.consult-point .consult-summary { font-size: 10px; }
.consult-unknown {
  display: grid;
  grid-template-columns: 56px repeat(7, minmax(0, 1fr));
  border-bottom: 1px solid var(--line);
  background: #f8fbfc;
}
.timeline.day .consult-unknown { grid-template-columns: 56px 1fr; }
.consult-unknown > div { min-width: 0; padding: 4px; border-left: 1px solid #edf1f5; }
.consult-unknown-label { font-size: 10px; color: var(--muted); padding: 8px 4px; text-align: center; }
.consult-undated { display: block; width: 100%; margin-bottom: 3px; padding: 6px; text-align: left; }
.consult-undated strong, .consult-undated small { display: block; font-size: 10px; }
.consult-undated strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.consult-undated .consult-summary { font-size: 10px; }
