.heading-actions {
  display: flex;
  align-items: center;
  gap: 9px;
}

.secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 11px 17px;
  border: 1px solid #b9ccd9;
  border-radius: 7px;
  background: #fff;
  color: var(--navy);
  font-size: 14px;
  font-weight: 600;
}

.radiologist-panel {
  display: grid;
  grid-template-columns: minmax(170px, 1fr) minmax(170px, 1fr) minmax(170px, 1fr) auto;
  align-items: end;
  gap: 12px;
  padding: 14px 20px;
  border-bottom: 1px solid #e5ebf0;
  background: #f8fbfd;
}

.radiologist-title {
  align-self: center;
}

.radiologist-title strong,
.radiologist-title span {
  display: block;
}

.radiologist-title span {
  margin-top: 2px;
  color: var(--muted);
  font-size: 12px;
}

.radiologist-panel .field {
  gap: 4px;
  font-size: 12px;
}

.addon-tray {
  padding: 12px 20px;
  border-bottom: 1px solid #e5ebf0;
  background: #fffaf0;
}

.addon-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
  color: #6d5410;
  font-size: 13px;
}

.addon-heading span {
  font-size: 11px;
  font-weight: 700;
}

.addon-list {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.addon-card {
  width: min(290px, 100%);
  min-height: 42px;
  height: auto;
}

.addon-drop-zone {
  width: 100%;
  min-height: 36px;
  border: 1px dashed #c3a13a;
  border-radius: 6px;
  background: #fffdf7;
  color: #7a641f;
  font-size: 12px;
}

.addon-list:not(:empty) + .addon-drop-zone {
  margin-top: 8px;
}

.addon-tray.eligible .addon-drop-zone,
.addon-tray.drag-over .addon-drop-zone {
  border-color: #916d00;
  background: #fff2bd;
}

.radiologist-panel input,
.location-field select,
.location-field textarea {
  width: 100%;
  border: 1px solid #bccdda;
  border-radius: 6px;
  background: #fff;
  padding: 9px 10px;
  color: var(--ink);
  font: inherit;
}

.location-field textarea {
  min-height: 72px;
  resize: vertical;
}

.MISC {
  --mod: #b65f24;
  --tint: #fff1e7;
  --edge: #f0c8aa;
}

.column-heads,
.time-row {
  grid-template-columns: 65px repeat(4, minmax(0, 1fr));
}

.slot.has-booking {
  display: grid;
  align-content: stretch;
  gap: 3px;
}

.slot.has-booking .event {
  height: auto;
  min-height: 35px;
}

.slot.double-booked {
  grid-template-rows: repeat(2, minmax(0, 1fr));
}

.double-book-slot {
  min-height: 24px;
  border: 1px dashed var(--mod);
  border-radius: 4px;
  background: var(--tint);
  color: var(--mod);
  font-size: 11px;
  font-weight: 700;
}

.event.status-arrived {
  border-color: #e2b600;
  box-shadow: inset 0 0 0 3px #ffd51f;
}

.event.status-ready {
  border-color: #b82020;
  box-shadow: inset 0 0 0 3px #e12d2d;
}

.event.status-complete,
.event.elapsed {
  border-color: #aeb8c0;
  border-left-color: #7d8992;
  background: #e2e5e8;
  color: #59636b;
}

.event.status-complete .event-location,
.event.status-complete .note-indicator,
.event.status-complete .prior-indicator,
.event.status-complete .grip,
.event.elapsed .event-location,
.event.elapsed .note-indicator,
.event.elapsed .prior-indicator,
.event.elapsed .grip {
  color: #68737b;
}

.event-details {
  display: grid;
  min-width: 0;
  flex: 1;
  gap: 1px;
}

.event-name,
.event-location {
  overflow-wrap: anywhere;
}

.note-indicator {
  position: relative;
  display: inline-block;
  width: 13px;
  height: 13px;
  flex: 0 0 auto;
  border: 1px solid #9d7a00;
  border-radius: 2px 2px 4px 2px;
  background: #ffd84a;
  vertical-align: -2px;
}

.note-indicator::after {
  content: "";
  position: absolute;
  right: -1px;
  bottom: -1px;
  width: 5px;
  height: 5px;
  border: 1px solid #9d7a00;
  border-width: 1px 0 0 1px;
  background: #fff4af;
}

.prior-indicator {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 10px;
  font-weight: 800;
  line-height: 1.2;
}

.prior-indicator.available { color: #176b4e; }
.prior-indicator.missing { color: #a43c22; }

.prior-image-icon {
  position: relative;
  display: inline-block;
  width: 13px;
  height: 11px;
  flex: 0 0 auto;
  border: 1.5px solid currentColor;
  border-radius: 2px;
}

.prior-image-icon::before {
  content: "";
  position: absolute;
  top: 2px;
  right: 2px;
  width: 2px;
  height: 2px;
  border-radius: 50%;
  background: currentColor;
}

.prior-image-icon::after {
  content: "";
  position: absolute;
  left: 2px;
  bottom: 1px;
  width: 7px;
  height: 5px;
  background: currentColor;
  clip-path: polygon(0 100%, 38% 30%, 58% 65%, 75% 42%, 100% 100%);
}

.event-location {
  color: var(--mod);
  font-size: 11px;
  font-weight: 700;
  line-height: 1.2;
}

.location-field {
  margin-top: 14px;
}

.status-badge {
  margin-left: auto;
  padding: 1px 5px;
  border-radius: 9px;
  background: #fff;
  color: #4e5962;
  font-size: 10px;
  font-weight: 700;
  white-space: nowrap;
}

.selection[hidden],
.error[hidden] {
  display: none !important;
}

/* Keep the daily board in one browser window on desktop. The procedure
   library is the only vertically scrolling area. */
@media screen and (min-width: 681px) {
  html,
  body,
  #app {
    height: 100%;
    overflow: hidden;
  }

  #app {
    display: grid;
    grid-template-rows: 54px 54px minmax(0, 1fr);
  }

  .topbar {
    height: 54px;
  }

  .heading {
    width: 100%;
    padding-top: 10px;
    padding-bottom: 10px;
  }

  .heading .eyebrow,
  .heading .subtitle {
    display: none;
  }

  .heading h1 {
    font-size: 23px;
  }

  .heading-actions button {
    padding-top: 7px;
    padding-bottom: 7px;
  }

  .workspace {
    width: 100%;
    height: 100%;
    min-height: 0;
    padding-bottom: 12px;
  }

  .procedure-panel {
    display: flex;
    min-height: 0;
    flex-direction: column;
    padding-top: 0;
    overflow: hidden;
  }

  .procedure-panel .library-head h2 {
    margin: 5px 0;
  }

  .procedure-panel .hint {
    margin: 3px 0 9px;
    font-size: 12px;
    line-height: 1.35;
  }

  #procedure-library {
    min-height: 0;
    flex: 1 1 auto;
    padding-right: 7px;
    overflow-y: auto;
    overscroll-behavior: contain;
    scrollbar-gutter: stable;
  }

  .library-section {
    margin-bottom: 13px;
  }

  .library-section h3 {
    margin-bottom: 4px;
  }

  .library-card {
    min-height: 34px;
    margin-top: 4px;
    padding: 6px 8px;
    font-size: 13px;
  }

  .library-note {
    flex: 0 0 auto;
    margin-top: 8px;
    padding-top: 8px;
  }

  .schedule {
    display: flex;
    min-height: 0;
    flex-direction: column;
  }

  .toolbar {
    flex: 0 0 auto;
    padding: 4px 14px;
  }

  .date-controls button {
    min-width: 30px;
    padding: 4px 6px;
  }

  .date-controls .today {
    padding: 4px 8px;
  }

  .radiologist-panel {
    grid-template-columns: minmax(120px, 1fr) minmax(120px, 1fr) minmax(120px, 1fr) auto;
    flex: 0 0 auto;
    gap: 9px;
    padding: 4px 14px;
  }

  .radiologist-panel .field {
    grid-template-columns: auto minmax(0, 1fr);
    align-items: center;
    gap: 6px;
    min-width: 0;
    font-size: 11px;
  }

  .radiologist-title strong {
    font-size: 14px;
  }

  .radiologist-title span {
    display: none;
  }

  .radiologist-panel input {
    min-width: 0;
    padding: 4px 7px;
  }

  .radiologist-panel .secondary {
    padding: 5px 10px;
  }

  .addon-tray {
    display: grid;
    grid-template-columns: 150px minmax(0, 1fr) minmax(210px, 280px);
    flex: 0 0 auto;
    align-items: center;
    gap: 8px;
    padding-top: 5px;
    padding-bottom: 5px;
  }

  .addon-heading {
    display: block;
    margin: 0;
  }

  .addon-heading span {
    display: block;
    margin-top: 2px;
  }

  .addon-list {
    flex-wrap: nowrap;
    min-width: 0;
    overflow-x: auto;
    overscroll-behavior: contain;
  }

  .addon-card {
    width: 220px;
    min-width: 220px;
    min-height: 34px;
    max-height: 44px;
    padding: 4px 7px;
    overflow: hidden;
    font-size: 12px;
  }

  .addon-list:not(:empty) + .addon-drop-zone {
    margin-top: 0;
  }

  .addon-drop-zone {
    min-height: 34px;
    padding: 4px 7px;
  }

  .board-caption {
    flex: 0 0 auto;
    padding-top: 5px;
    padding-bottom: 5px;
  }

  .selection,
  .error {
    flex: 0 0 auto;
    padding-top: 5px;
    padding-bottom: 5px;
  }

  .board {
    display: grid;
    grid-template-rows: auto repeat(19, minmax(0, 1fr));
    min-height: 0;
    flex: 1 1 auto;
  }

  .column-head {
    height: 31px;
    padding-top: 3px;
    padding-bottom: 3px;
  }

  .column-head strong {
    font-size: 15px;
  }

  .column-head small {
    display: none;
  }

  .time-row {
    min-height: 0;
    overflow: hidden;
  }

  .time-label {
    display: grid;
    place-items: center;
    padding: 0 3px;
    font-size: 11px;
  }

  .slot {
    min-height: 0;
    padding: 1px 3px;
  }

  .empty-slot,
  .slot.has-booking .event {
    min-height: 0;
  }

  .event {
    gap: 3px;
    padding: 1px 6px;
    overflow: hidden;
    font-size: clamp(10px, 1.25vh, 13px);
  }

  .event-details {
    display: flex;
    align-items: center;
    gap: 4px;
    overflow: hidden;
    white-space: nowrap;
  }

  .event-name {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .event-location,
  .prior-indicator,
  .status-badge {
    flex: 0 0 auto;
    font-size: 10px;
  }

  .event .grip {
    flex: 0 0 auto;
  }

  .schedule footer {
    flex: 0 0 auto;
    padding-top: 4px;
    padding-bottom: 4px;
  }
}

@media (max-width: 900px) {
  .radiologist-panel {
    grid-template-columns: 1fr 1fr;
  }

  .radiologist-title,
  .radiologist-panel button {
    grid-column: 1 / -1;
  }
}

@media (max-width: 680px) {
  .heading-actions {
    flex-direction: column;
    align-items: stretch;
  }

  .heading-actions button {
    padding: 10px;
    font-size: 13px;
  }

  .column-heads,
  .time-row {
    grid-template-columns: 47px repeat(4, minmax(0, 1fr));
  }

  .status-badge {
    display: none;
  }

  .radiologist-panel { padding: 12px; }

  .addon-tray { padding: 10px 12px; }
  .addon-card { width: 100%; }
}

@page {
  size: letter landscape;
  margin: 0.2in;
}

@media print {
  * {
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }

  body {
    background: #fff;
    color: #142c40;
    font-size: 8pt;
    overflow: visible;
  }

  .topbar,
  .procedure-panel,
  .heading-actions,
  .toolbar,
  .selection,
  .error,
  .double-book-slot,
  .addon-drop-zone,
  footer {
    display: none !important;
  }

  .radiologist-panel {
    grid-template-columns: auto 1fr 1fr;
    gap: 8px;
    padding: 0 0 4px;
    border: 0;
    background: #fff;
  }

  .radiologist-panel button,
  .radiologist-title span {
    display: none;
  }

  .radiologist-panel input {
    border: 0;
    border-bottom: 1px solid #9cafbc;
    border-radius: 0;
    padding: 1px 3px;
    font-size: 8pt;
    font-weight: 700;
  }

  .radiologist-panel .field,
  .radiologist-title {
    font-size: 8pt;
  }

  .addon-tray {
    padding: 2px 0 4px;
    border: 0;
    background: #fff;
  }

  .addon-heading {
    margin-bottom: 2px;
    font-size: 7pt;
  }

  .addon-heading span {
    font-size: 6pt;
  }

  .addon-list {
    display: flex;
    flex-wrap: nowrap;
    gap: 2px;
    overflow: hidden;
  }

  .addon-card {
    width: auto;
    min-width: 0;
    max-width: 25%;
    min-height: 18px;
    height: 18px;
    flex: 1 1 0;
    padding: 1px 3px;
    font-size: 6pt;
  }

  .addon-card .event-location,
  .addon-card .prior-indicator,
  .addon-card .status-badge,
  .addon-card .grip {
    display: none;
  }

  .heading {
    display: flex;
    align-items: center;
    max-width: none;
    padding: 0 0 4px;
    border-bottom: 2px solid var(--navy);
  }

  .heading h1 {
    font-size: 15pt;
  }

  .heading .eyebrow,
  .heading .subtitle {
    display: none;
  }

  .workspace {
    display: block;
    max-width: none;
    padding: 4px 0 0;
  }

  .schedule {
    overflow: visible;
    border: 0;
    border-radius: 0;
    box-shadow: none;
  }

  .board-caption {
    padding: 1px 0 4px;
    font-size: 9pt;
  }

  .board-caption span {
    font-size: 7pt;
  }

  .board {
    border: 1px solid #9cafbc;
  }

  .column-heads,
  .time-row {
    grid-template-columns: 52px repeat(4, minmax(0, 1fr));
  }

  .column-heads {
    break-after: avoid;
  }

  .column-head {
    height: 30px;
    padding: 2px 6px;
    overflow: hidden;
  }

  .column-head strong {
    font-size: 9pt;
  }

  .column-head small,
  .time-label {
    font-size: 6.5pt;
  }

  .time-row {
    height: 28px;
    min-height: 0;
    overflow: hidden;
    break-inside: avoid;
  }

  .time-label {
    padding: 7px 2px 0;
  }

  .slot {
    padding: 1px;
    overflow: hidden;
  }

  .slot.double-booked {
    grid-template-rows: repeat(2, minmax(0, 1fr));
    gap: 1px;
  }

  .slot.double-booked .event {
    min-height: 0;
    height: 12px;
    padding: 0 2px;
    font-size: 5.5pt;
  }

  .slot.double-booked .event-location,
  .slot.double-booked .note-indicator,
  .slot.double-booked .prior-indicator,
  .slot.double-booked .status-badge,
  .slot.double-booked .grip {
    display: none;
  }

  .empty-slot,
  .event {
    min-height: 0;
    height: 25px;
  }

  .event {
    gap: 3px;
    padding: 1px 4px;
    overflow: hidden;
    font-size: 7.5pt;
  }

  .event-details {
    display: flex;
    align-items: center;
    gap: 4px;
    overflow: hidden;
    white-space: nowrap;
  }

  .event-name {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .event-location,
  .note-indicator,
  .prior-indicator,
  .status-badge {
    flex: 0 0 auto;
    font-size: 6.5pt;
  }

  .status-badge {
    padding: 0 3px;
  }

  .event .grip {
    display: none;
  }
}
