.history-launch {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  width: 100%;
  margin-top: 18px;
  padding: 12px;
  border: 1px solid #b5ccba;
  border-radius: 5px;
  background: #193834;
  color: #fafbf7;
  font-size: 12px;
  font-weight: 650;
}
.history-launch span {
  font-size: 10px;
  font-weight: 400;
}
.history-launch:hover {
  background: #246052;
}
.history-dialog {
  width: min(1180px, calc(100vw - 48px));
  height: min(900px, calc(100dvh - 48px));
  max-width: none;
  max-height: none;
  border: 1px solid #bacdbb;
  border-radius: 12px;
  padding: 0;
  background: #fafbf7;
  color: #193834;
  box-shadow: 0 20px 90px #11251c55;
}
.history-dialog::backdrop {
  background: #102d27a6;
  backdrop-filter: blur(3px);
}
.history-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  padding: 24px 28px 20px;
  border-bottom: 1px solid #dce5d8;
  background: linear-gradient(110deg, #eaf1e4, #fafbf7);
}
.history-header h2 {
  font:
    400 30px Georgia,
    serif;
  margin: 9px 0;
}
.history-header p {
  font-size: 12px;
  color: #586d61;
  margin: 0;
  line-height: 1.5;
}
.history-close {
  border: 1px solid #cad8c8;
  background: #fffdf7;
  border-radius: 50%;
  height: 32px;
  width: 32px;
  font-size: 22px;
  color: #345949;
  flex: none;
}
.history-layout {
  display: grid;
  grid-template-columns: 260px minmax(0, 1fr);
  height: calc(100% - 131px);
}
.history-search {
  border-right: 1px solid #dce5d8;
  padding: 22px 20px;
  overflow: auto;
  background: #f2f6ee;
}
.history-search label,
.history-content > section > label {
  display: block;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.6px;
  text-transform: uppercase;
  color: #476653;
  margin-bottom: 7px;
}
.history-search label:not(:first-child) {
  margin-top: 19px;
}
.history-search input[type='search'] {
  margin: 0;
}
.history-sites {
  display: flex;
  flex-direction: column;
  gap: 5px;
}
.history-site {
  display: block;
  width: 100%;
  text-align: left;
  border: 1px solid transparent;
  border-radius: 5px;
  background: transparent;
  color: #214e3e;
  padding: 10px;
  font-size: 12px;
  line-height: 1.4;
}
.history-site:hover {
  background: #e6eedf;
}
.history-site[aria-current='true'] {
  background: #fffdf7;
  border-color: #9fbda1;
}
.history-site small {
  display: block;
  font-size: 10px;
  color: #637663;
  margin-top: 4px;
  overflow-wrap: anywhere;
}
.history-content {
  padding: 22px 28px 28px;
  overflow: auto;
  min-width: 0;
}
.history-content h3 {
  font:
    400 25px Georgia,
    serif;
  margin: 7px 0 18px;
  line-height: 1.25;
}
.history-note {
  font-size: 11px;
  line-height: 1.6;
  color: #60705f;
  overflow-wrap: anywhere;
}
.history-status {
  font-size: 13px;
  line-height: 1.6;
  padding: 12px 14px;
  background: #edf2e8;
  border-radius: 5px;
  margin: 0 0 20px;
}
.history-status:empty {
  display: none;
}
.history-status[data-error='true'] {
  background: #fff1d8;
  color: #744d1d;
  border: 1px solid #e3c996;
}
.history-window {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: 13px;
  font-size: 11px;
  color: #58705d;
}
.history-window button,
.history-secondary {
  padding: 7px 10px;
  border: 1px solid #c5d5c1;
  border-radius: 4px;
  background: #fffdf7;
  color: #285640;
  font-size: 11px;
}
.history-summary {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  margin: 19px 0 10px;
}
.history-summary > div {
  border-left: 2px solid #9fbda0;
  padding-left: 11px;
  min-width: 105px;
}
.history-summary strong {
  display: block;
  font-size: 19px;
  font-weight: 550;
  letter-spacing: -0.3px;
}
.history-summary span {
  display: block;
  font-size: 10px;
  color: #60705f;
  margin-top: 4px;
}
.history-chart {
  position: relative;
  min-height: 45px;
  background: #fffefb;
  border: 1px solid #e0e7dc;
  border-radius: 5px;
  overflow: hidden;
}
.history-chart svg {
  display: block;
  width: 100%;
  height: auto;
  min-height: 220px;
}
.history-chart .chart-axis {
  fill: #6c7a69;
  font-size: 11px;
  font-family: Inter, 'Segoe UI', sans-serif;
}
.history-chart .chart-grid {
  stroke: #e6ece1;
  stroke-width: 1;
}
.history-chart .chart-points {
  fill: #237b68;
  fill-opacity: 0.7;
}
.history-chart .chart-censored {
  fill: #b37822;
  fill-opacity: 0.95;
}
.history-chart .chart-event {
  fill: #bd653b;
  fill-opacity: 0.8;
}
.history-tooltip {
  position: absolute;
  left: 12px;
  top: 8px;
  max-width: calc(100% - 24px);
  background: #193834f5;
  color: #fffdf7;
  border-radius: 4px;
  padding: 8px 10px;
  font-size: 11px;
  line-height: 1.5;
  pointer-events: none;
  white-space: pre-line;
  z-index: 1;
}
.history-context {
  border-top: 1px solid #dce5d8;
  margin-top: 20px;
  padding-top: 18px;
  font-size: 12px;
  line-height: 1.65;
}
.history-context h4 {
  font-size: 13px;
  margin: 0 0 8px;
}
.history-context p {
  margin: 7px 0 13px;
}
.history-context ul {
  padding-left: 19px;
}
.history-context li {
  margin-bottom: 7px;
}
.history-context details {
  font-size: 11px;
}
.history-context a {
  overflow-wrap: anywhere;
}
.history-context .history-pending {
  background: #f3efdf;
  color: #75612d;
  padding: 8px 11px;
  border-radius: 4px;
}
.history-reference {
  border-left: 2px solid #b7c8a8;
  padding-left: 13px;
  margin: 12px 0;
}
.history-reference strong {
  font-size: 11px;
}
.history-content summary {
  cursor: pointer;
  font-size: 12px;
  color: #2b5844;
  font-weight: 650;
  padding: 12px 0;
}
.history-table-wrap {
  overflow: auto;
  max-height: 300px;
  border: 1px solid #e0e7da;
  border-radius: 4px;
}
.history-content table {
  border-collapse: collapse;
  width: 100%;
  font-size: 10px;
  white-space: nowrap;
  background: #fffefb;
  text-align: left;
}
.history-content th {
  position: sticky;
  top: 0;
  background: #eaf1e5;
  font-weight: 650;
  padding: 9px;
}
.history-content td {
  padding: 8px 9px;
  border-top: 1px solid #e4ebdf;
  max-width: 230px;
  white-space: normal;
  overflow-wrap: anywhere;
}
.history-downloads {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  padding-top: 12px;
  font-size: 11px;
}
.history-downloads button:disabled {
  opacity: 0.5;
  cursor: default;
}
#history-more-rows {
  margin-top: 10px;
}
.history-empty {
  font-size: 12px;
  line-height: 1.6;
  padding: 20px;
  color: #61775f;
}
@media (max-width: 800px) {
  .history-dialog {
    width: calc(100vw - 20px);
    height: calc(100dvh - 20px);
  }
  .history-header {
    padding: 18px;
  }
  .history-header h2 {
    font-size: 25px;
  }
  .history-layout {
    grid-template-columns: 210px minmax(0, 1fr);
    height: calc(100% - 123px);
  }
  .history-content {
    padding: 20px;
  }
  .history-search {
    padding: 20px 14px;
  }
  .history-window {
    flex-wrap: wrap;
  }
}
@media (max-width: 580px) {
  .history-dialog {
    width: 100vw;
    height: 100dvh;
    border-radius: 0;
    border: 0;
    margin: 0;
  }
  .history-header {
    padding: 17px;
  }
  .history-header h2 {
    font-size: 23px;
  }
  .history-layout {
    display: block;
    height: calc(100% - 121px);
    overflow: auto;
  }
  .history-search {
    border-right: 0;
    border-bottom: 1px solid #dce5d8;
    overflow: visible;
    padding: 16px;
  }
  .history-search label:not(:first-child) {
    margin-top: 12px;
  }
  .history-sites {
    max-height: 180px;
    overflow: auto;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 3px;
  }
  .history-site {
    padding: 8px;
    font-size: 11px;
  }
  .history-content {
    overflow: visible;
    padding: 20px 16px;
  }
  .history-content h3 {
    font-size: 23px;
  }
  .history-summary {
    gap: 13px;
  }
  .history-summary > div {
    min-width: 80px;
  }
  .history-summary strong {
    font-size: 17px;
  }
  .history-chart svg {
    min-height: 190px;
  }
  .history-launch {
    max-width: 320px;
  }
}

.history-dialog[open] {
  display: flex;
  flex-direction: column;
}
.history-header {
  flex-shrink: 0;
}
.history-layout {
  flex: 1;
  min-height: 0;
  height: auto;
}

.chart-bucket-gap {
  fill: #b8996820;
  stroke: #a9916b66;
  stroke-width: 0.5;
}
