.patient-history .loading-studies {
  
width: 35%;
  
margin: 2em auto 0 auto;
}

.patient-history #patient-demographics {
  margin-bottom: 0.8em;
  display: flex;
  align-items: center;
  gap: 0.3em;
}

.patient-history #patient-demographics .patient-demographics-mismatch {
  color: var(--warn);
  margin-top: 0.2em;
}

.patient-history #timeline-container #timeline-filters {
  display: flex;
  gap: 1em;
}

.patient-history #timeline-wrapper {
  position: relative;
  user-select: none;
}

.patient-history #timeline-wrapper .scroller {
  position: absolute;
  width: 2em;
  height: 1.4em;
  cursor: pointer;
  display: none;
  color: var(--text-color);
  background: var(--dark-grey);
  border-radius: 5px;
  z-index: 2;
  bottom: -1.6em;
}

.patient-history #timeline-wrapper #scroll-left.scroller {
  left: 0;
}

.patient-history #timeline-wrapper #scroll-right.scroller {
  right: 0;
}

.patient-history #timeline-wrapper .scroller .scroller-icon {
  position: absolute;
  top: 50%;
  left: 50%;
  translate: -50% -50%;
}

.patient-history #timeline-wrapper:has(#timeline.overflowing) .scroller {
  display: block;
}

.patient-history #timeline-wrapper:has(#timeline.overflowing.start) #scroll-left.scroller,
.patient-history #timeline-wrapper:has(#timeline.overflowing.end) #scroll-right.scroller {
  display: none;
}

.patient-history #timeline {
  display: grid;
  width: fit-content;
  margin-top: 1.4em;
  align-items: center;
  justify-items: end;
  grid-template-rows: 1fr auto;
  /* position: relative; */
  max-width: calc(100vw - 3em);
  overflow: hidden;
  cursor: grab;
  margin-bottom: 1em;
}

.patient-history #timeline.grabbing {
  cursor: grabbing;
}

.patient-history #timeline .timeline-arrow-head {
  color: var(--secondary);
  position: absolute;
  bottom: 1.9em;
  left: -0.7em;
}

.patient-history #timeline .studies-cell {
  grid-row: 1/2;
  display: flex;
  padding-right: 1em;
  padding-bottom: 1em;
}

.patient-history #timeline .years-cell {
  grid-row: 2/3;
  border-right: 3px solid var(--secondary);
  padding: 0.3em 0.5em 0 0;
  font-size: 0.8em;
  font-weight: 100;
  border-top: 3px solid var(--secondary);
  width: 100%;
  display: flex;
  flex-direction: row;
  justify-content: flex-end;
}

.patient-history #timeline .years-cell .year {
  width: fit-content;
  background: var(--grey);
  position: sticky;
  right: 0;
}

.patient-history #timeline .years-cell:last-child {
  border-radius: 0 5px 0 0;
}

.patient-history #timeline .studies-cell .study-card {
  width: 10em;
  height: 6em;
  border-radius: 0.5em;
  background: var(--dark-grey);
  margin-left: 1em;
  padding: 0.3em;
  cursor: pointer;
  z-index: 2;
  box-sizing: border-box;
  position: relative;
  display: flex;
  justify-content: space-between;
}

.patient-history #timeline.grabbing .studies-cell .study-card {
  cursor: grabbing;
}

.patient-history #timeline .studies-cell .study-card.opened {
  background: var(--primary);
}

.patient-history #timeline .studies-cell .study-card.opened-other-session {
  border: 2px dashed var(--primary);
}

.patient-history #timeline .studies-cell .study-card::after {
  content: "";
  position: absolute;
  bottom: -1em;
  height: 1em;
  z-index: 1;
  left: 50%;
  transform: translateX(-50%);
  background-color: var(--secondary);
  width: 3px;
}

.patient-history #timeline .studies-cell .study-card .study-data {
  display: flex;
  flex-direction: column;
}

.patient-history #timeline .studies-cell .study-card .study-data .study-card-row {
  font-size: 0.8em;
  overflow: hidden;
  white-space: nowrap;
  max-width: 9.5em;
  text-overflow: ellipsis;
}

.patient-history #timeline .studies-cell .study-card .study-data .study-card-row.modalities {
  font-weight: bold;
  flex: 1;
}

.patient-history #timeline .studies-cell .study-card .study-data .study-card-row.accession-number,
.patient-history #timeline .studies-cell .study-card .study-data .study-card-row.morphological-code {
  flex: 1;
}

.patient-history #timeline .studies-cell .study-card .study-data .badges {
  position: absolute;
  top: 0;
  right: 0;
}

.patient-history #timeline .studies-cell .study-card .study-data .badges .badge {
  margin-right: 0.5em;
  color: var(--disabled);
}

.patient-history #timeline .studies-cell .study-card .study-data .badges .badge.mismatch {
  color: var(--warn);
}

.patient-history #timeline .studies-cell .study-card .study-card-toolbar {
  align-self: center;
  padding: 0.3em;
}

.patient-history #change-previous-footer {
  display: flex;
  gap: 1em;
  margin-top: 2em;
  justify-items: end;
  justify-content: flex-end;
  align-items: center;
}

.patient-history #change-previous-footer #disclaimer-container {
  display: flex;
  align-items: center;
  gap: 0.3em;
}

.patient-history #change-previous-footer #disclaimer-container .disclaimer-icon {
  color: var(--danger);
  margin-top: 0.2em;
}