/* Compact/collapsible stock history controls. */
.history-event-number {
  width: 32px;
  height: 32px;
  flex: 0 0 32px;
  border-radius: 9px;
  background: #bfbfbf;
  color: #fff;
  font-size: .88rem;
  font-weight: 400;
  letter-spacing: 0;
  box-shadow: none;
}

.stock-history-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 14px;
}

.stock-history-heading-copy {
  min-width: 0;
}

.stock-history-heading-copy .title {
  margin-bottom: 4px !important;
}

.stock-history-heading-copy .subtitle {
  max-width: 520px;
  margin: 0 !important;
  color: #85858b;
  line-height: 1.35;
}

.stock-history-switch {
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  gap: 2px;
  padding: 3px;
  border: 1px solid #e2e2e6;
  border-radius: 12px;
  background: #f1f1f3;
}

.stock-history-switch-item {
  min-height: 32px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 11px;
  border-radius: 9px;
  color: #74747a;
  font-size: .72rem;
  font-weight: 700;
  white-space: nowrap;
  transition: background .14s ease, color .14s ease, box-shadow .14s ease;
}

.stock-history-switch-item:hover {
  color: #222226;
  background: rgba(255,255,255,.58);
}

.stock-history-switch-item.is-active {
  background: #fff;
  color: #222226;
  box-shadow: 0 1px 5px rgba(0,0,0,.09);
}

.stock-origin-path {
  margin: 0 0 14px;
  padding: 12px 13px;
  border: 1px solid #e7e7eb;
  border-radius: 14px;
  background: #fafafc;
}

.stock-origin-path-heading {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 9px;
}

.stock-origin-path-heading > span {
  color: #4e4e54;
  font-size: .72rem;
  font-weight: 750;
}

.stock-origin-path-heading > small {
  color: #97979d;
  font-size: .64rem;
}

.stock-origin-chain {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.stock-origin-node {
  display: inline-flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
  padding: 7px 9px;
  border: 1px solid #e3e3e7;
  border-radius: 10px;
  background: #fff;
  color: #505056;
}

.stock-origin-node:hover {
  border-color: #ccccd2;
  color: #202024;
}

.stock-origin-node.is-current {
  border-color: #c8d7ee;
  background: #f3f7fd;
  color: #1f4f86;
}

.stock-origin-node .mono {
  font-size: .68rem;
  font-weight: 700;
}

.stock-origin-node small {
  color: #96969c;
  font-size: .58rem;
  line-height: 1.1;
}

.stock-origin-node.is-current small {
  color: #6e8db1;
}

.stock-origin-arrow {
  color: #aaaab0;
  font-size: .62rem;
}

.history-list-controls {
  display: flex;
  justify-content: flex-end;
}

.history-list-controls .button {
  min-height: 34px;
  border-color: #dedee3;
  color: #56565c;
  font-size: .72rem;
  font-weight: 700;
}

.history-event-header.js-history-event-toggle {
  cursor: pointer;
  transition: background .14s ease, padding .14s ease;
}

.history-event-header.js-history-event-toggle:hover {
  background: #f5f5f7;
}

.history-event-header.js-history-event-toggle:focus-visible {
  outline: 2px solid #7f8a98;
  outline-offset: -2px;
}

.history-event-body {
  display: block;
}

.history-event.is-collapsed .history-event-body {
  display: none;
}

.history-event.is-collapsed .history-event-header {
  padding: 10px 13px;
  border-bottom: 0;
  background: #fbfbfc;
}

.history-event-chevron {
  width: 24px;
  height: 24px;
  display: inline-grid;
  place-items: center;
  flex: 0 0 24px;
  border-radius: 8px;
  color: #8a8a91;
  font-size: .67rem;
  transform: rotate(180deg);
  transition: transform .14s ease, background .14s ease;
}

.history-event-header:hover .history-event-chevron {
  background: #ececf0;
}

.history-event.is-collapsed .history-event-chevron {
  transform: rotate(0deg);
}

@media (max-width: 980px) {
  .stock-history-header {
    flex-direction: column;
  }

  .stock-history-switch {
    width: 100%;
  }

  .stock-history-switch-item {
    flex: 1 1 0;
  }
}

@media (max-width: 720px) {
  .stock-history-switch-item {
    min-height: 34px;
    padding: 0 8px;
    font-size: .68rem;
  }

  .stock-origin-path-heading {
    align-items: flex-start;
    flex-direction: column;
    gap: 2px;
  }

  .stock-origin-chain {
    gap: 5px;
  }

  .stock-origin-arrow {
    transform: scale(.88);
  }

  .history-list-controls {
    justify-content: stretch;
  }

  .history-list-controls .button {
    width: 100%;
  }

  .history-event.is-collapsed .history-event-header {
    padding: 10px 12px;
  }
}
