.history-intro {
  max-width: 760px;
  margin: 4px 0 16px;
  color: var(--muted);
  line-height: 1.5;
}

.history-summary {
  margin: -8px 0 14px;
  color: #b9c8d6;
  font-size: 12px;
}

.history-day {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 14px 2px 2px;
  color: #90a4b8;
  font-size: 11px;
  font-weight: 850;
  letter-spacing: .1em;
  text-transform: uppercase;
}

.history-day:first-child {
  margin-top: 2px;
}

.history-day::after {
  content: '';
  flex: 1;
  height: 1px;
  background: linear-gradient(90deg, #33465a, transparent);
}

.history-event {
  --event-color: #60758a;
  position: relative;
  display: grid;
  grid-template-columns: 36px minmax(0, 1fr);
  gap: 12px;
  overflow: hidden;
  padding: 14px;
  border-color: #26384b;
  background: linear-gradient(135deg, #121d29, #101820);
}

.history-event::before {
  content: '';
  position: absolute;
  inset: 0 auto 0 0;
  width: 3px;
  background: var(--event-color);
}

.history-event.kind-session { --event-color: var(--green); }
.history-event.kind-command { --event-color: var(--blue); }
.history-event.kind-profile { --event-color: #a678e8; }
.history-event.kind-account { --event-color: #78a9d6; }
.history-event.kind-device { --event-color: #52a8d8; }
.history-event.kind-connection { --event-color: #57c8a0; }
.history-event.kind-error,
.history-event.failed { --event-color: var(--red); border-color: #593038; }

.event-icon {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border: 1px solid color-mix(in srgb, var(--event-color) 55%, #26384b);
  border-radius: 11px;
  background: color-mix(in srgb, var(--event-color) 13%, #101820);
  color: var(--event-color);
  font-size: 13px;
  font-weight: 900;
}

.event-body {
  min-width: 0;
}

.history-event .event-head {
  align-items: baseline;
}

.history-event .event-head strong {
  color: var(--text);
  font-size: 14px;
  line-height: 1.35;
}

.history-event .event-head time {
  flex: 0 0 auto;
  color: #8193a6;
  font-size: 11px;
  font-weight: 700;
  white-space: nowrap;
}

.history-event .event-body > p {
  margin: 6px 0 11px;
  color: #9cadbd;
  font-size: 12px;
  line-height: 1.5;
}

.event-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  color: #77899b;
  font-size: 11px;
}

.event-result {
  flex: 0 0 auto;
  border: 1px solid #31533f;
  border-radius: 999px;
  padding: 3px 7px;
  color: #8ce5b2;
}

.event-result.failed {
  border-color: #71333b;
  color: #ff9099;
}

.event-result.pending {
  border-color: #6b5529;
  color: #f3bd4c;
}

@supports not (color: color-mix(in srgb, red, blue)) {
  .event-icon {
    border-color: #3b5369;
    background: #182532;
  }
}

@media (max-width: 600px) {
  .history-event {
    grid-template-columns: 32px minmax(0, 1fr);
    gap: 10px;
    padding: 12px;
  }

  .event-icon {
    width: 30px;
    height: 30px;
  }

  .history-event .event-head {
    align-items: flex-start;
  }

  .event-meta {
    align-items: flex-start;
  }
}
