/* History: a filterable record table beside insight panels, over the shared scene. */
.history-main {
  padding-top: 26px;
}
.history-hero {
  min-height: 205px;
}
.history-hero h1 {
  font-size: clamp(42px, 4vw, 66px);
  line-height: 1.05;
  letter-spacing: -2px;
  margin: 14px 0 0;
}
.history-hero .intro {
  max-width: 560px;
  font-size: 17px;
  margin-top: 14px;
  line-height: 1.45;
}
.history-hero .intro-sub {
  max-width: 560px;
  font-size: 13px;
  color: #a3b3bf;
  margin: 6px 0 0;
}
.tabs {
  display: flex;
  gap: 4px;
  border: 1px solid #ffffff1c;
  border-radius: 14px;
  background: #0a1116bb;
  padding: 6px;
  width: fit-content;
  max-width: 100%;
  overflow-x: auto;
  backdrop-filter: blur(14px);
}
.tab {
  display: flex;
  align-items: center;
  gap: 9px;
  white-space: nowrap;
  padding: 10px 18px;
  border: 0;
  border-radius: 10px;
  background: none;
  color: #a9bbc8;
  font-size: 13px;
  position: relative;
  transition:
    color 0.2s ease,
    background 0.2s ease;
}
.tab .icon {
  width: 17px;
}
.tab:hover {
  color: #e6eef4;
  background: #ffffff08;
}
.tab.active {
  color: #ff9c3d;
  background: #ff8a1e14;
}
/* The active tab is underlined by a bar that slides between tabs. */
.tab.active:after {
  content: "";
  position: absolute;
  left: 14px;
  right: 14px;
  bottom: 3px;
  height: 2px;
  border-radius: 2px;
  background: linear-gradient(90deg, #ff9c3d, #ff5f00);
  animation: tab-in 0.3s ease-out;
}
@keyframes tab-in {
  from {
    transform: scaleX(0.2);
    opacity: 0;
  }
}
.filter-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin: 16px 0 14px;
}
.filter {
  display: flex;
  align-items: center;
  gap: 9px;
  border: 1px solid #2e3d47;
  border-radius: 11px;
  background: #0a1218c4;
  padding: 0 12px;
  min-height: 42px;
  font-size: 12px;
  color: #b6c5d0;
  transition: border-color 0.2s ease;
}
.filter:hover,
.filter:focus-within {
  border-color: #ff8a1e77;
}
.filter > .icon {
  width: 16px;
  color: #93a6b3;
}
.filter select {
  border: 0;
  background: none;
  color: #e2eaf0;
  font-size: 12px;
  font-family: inherit;
  padding: 10px 4px 10px 0;
  outline-offset: 2px;
}
.filter select option {
  background: #0c141a;
  color: #e2eaf0;
}
.filter.sort {
  margin-left: auto;
}
.filter.compact {
  min-height: 34px;
  font-size: 11px;
}
.filter-clear-btn,
.link-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  height: 42px;
  min-height: 42px;
  max-height: 42px;
  padding: 0 14px;
  margin: 0;
  border-radius: var(--r-pill, 9999px);
  font-size: 12px;
  font-weight: 500;
  font-family: inherit;
  line-height: 1;
  box-sizing: border-box;
  vertical-align: middle;
  white-space: nowrap;
  cursor: pointer;
  text-decoration: none;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: #7d8f9d;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  user-select: none;
}
.filter-clear-btn .icon,
.link-btn .icon {
  width: 13px;
  height: 13px;
  stroke-width: 2.2;
  flex-shrink: 0;
  color: inherit;
  transition: transform 0.2s ease;
}
.filter-clear-btn.is-disabled,
.filter-clear-btn:disabled,
.link-btn:disabled {
  opacity: 1;
  cursor: default;
  pointer-events: none;
  background: rgba(255, 255, 255, 0.02);
  border: 1px dashed rgba(255, 255, 255, 0.1);
  color: var(--ink-subtle);
  box-shadow: none;
}
.filter-clear-btn.is-active,
.filter-clear-btn:not(:disabled):not(.is-disabled) {
  opacity: 1;
  cursor: pointer;
  pointer-events: auto;
  background: linear-gradient(135deg, rgba(255, 106, 0, 0.14), rgba(255, 67, 56, 0.06));
  border: 1px solid rgba(255, 106, 0, 0.38);
  color: #ff9a00;
  box-shadow:
    0 2px 10px rgba(0, 0, 0, 0.25),
    inset 0 1px 0 rgba(255, 255, 255, 0.08);
}
.filter-clear-btn.is-active:hover,
.filter-clear-btn:not(:disabled):not(.is-disabled):hover {
  background: linear-gradient(135deg, rgba(255, 106, 0, 0.24), rgba(255, 67, 56, 0.14));
  border-color: #ff9a0088;
  color: #ffb85a;
  transform: translateY(-1px);
  box-shadow:
    0 4px 16px rgba(255, 106, 0, 0.22),
    0 0 12px rgba(255, 106, 0, 0.15);
}
.filter-clear-btn.is-active:hover .icon,
.filter-clear-btn:not(:disabled):hover .icon {
  transform: rotate(90deg);
}
.filter-clear-btn.is-active:active,
.filter-clear-btn:not(:disabled):active {
  transform: translateY(0);
}
.filter-clear-btn .filter-count[hidden] {
  display: none;
}
.filter-clear-btn .filter-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 17px;
  height: 17px;
  padding: 0 5px;
  border-radius: 9999px;
  background: rgba(255, 106, 0, 0.25);
  border: 1px solid rgba(255, 106, 0, 0.4);
  color: #ffb85a;
  font-size: 11px;
  font-weight: 700;
  line-height: 1;
  margin-left: 2px;
}
.history-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 16px;
}
.h-table {
  padding: 0;
  overflow: hidden;
}
.h-head,
.h-row {
  display: grid;
  /* No grid-template-columns here on purpose: experience.css loads after this
     file and defines its own for `.h-head, .h-row`, so anything set here is
     dead. The live track definition is in experience.css - change it there. */
  align-items: center;
  gap: 12px 8px;
  padding: 0 18px;
  text-align: left;
}
.h-head {
  font-size: 11px;
  letter-spacing: 2px;
  color: #8496a3;
  padding-block: 14px;
  border-bottom: 1px solid #ffffff14;
}
.h-row {
  --r: 0;
  width: 100%;
  border: 0;
  border-bottom: 1px solid #ffffff0e;
  background: none;
  color: inherit;
  font: inherit;
  padding-block: 13px;
  cursor: pointer;
  animation: h-in 0.4s ease-out backwards;
  animation-delay: calc(var(--r) * 0.05s);
  transition:
    background 0.2s ease,
    padding-left 0.2s ease;
}
.h-row:last-child {
  border-bottom: 0;
}
.h-row:hover {
  background: linear-gradient(90deg, #ff8a1e14, transparent 65%);
  padding-left: 24px;
}
.h-row:hover .h-go {
  color: #ff9c3d;
  transform: translateX(3px);
}
@keyframes h-in {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
}
.h-cell {
  min-width: 0;
  font-size: 12px;
  color: #c2cfd9;
}
.h-title {
  display: flex;
  align-items: center;
  gap: 13px;
  min-width: 0;
}
/* Real alert titles run to a full sentence - a DLP match names the policy and
   the document - so the title clamps to two lines instead of growing the row.
   The full text is on the row's title attribute. */
.h-title > span {
  min-width: 0;
}
.h-title b {
  display: block;
  font-size: 13px;
  font-weight: 500;
  color: #eaf1f6;
  /* One line, so every row is the same height and the table stays scannable.
     A two-line clamp still let a short title sit at one line and a long one at
     two, which made the row rhythm uneven. */
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.h-title small {
  display: block;
  font-size: 12px;
  color: #8fa2af;
  margin-top: 3px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.h-type {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.h-type .vendor-logo {
  width: 14px;
  height: 14px;
  flex: none;
  object-fit: contain;
}
.h-mark {
  width: 34px;
  height: 34px;
  flex: none;
  display: grid;
  place-items: center;
  border-radius: 10px;
  border: 1px solid currentColor;
  background: #ffffff06;
}
.h-mark .icon {
  width: 17px;
}
.h-mark.high {
  color: #ff6a5e;
}
.h-mark.med {
  color: #ffab3d;
}
.h-mark.low {
  color: #63b3e8;
}
/* .h-type is deliberately NOT in this rule. It sets `text-overflow: ellipsis`,
   which has no effect on a flex container, so in its 108px track a vendor name
   like "CrowdStrike Falcon" (152px) was hard-cut with no ellipsis to show that
   anything had been dropped. The flex was only centring the icon against the
   text, which an inline icon does just as well - see below. */
.h-sev {
  display: flex;
  align-items: center;
  gap: 8px;
}
.h-type .icon,
.h-sev .icon {
  width: 15px;
  color: #8fa2af;
}
/* Replaces what the flex gave it: baseline alignment and the 8px gap. */
.h-type .icon {
  height: 15px;
  vertical-align: -3px;
  margin-right: 8px;
}
.h-sev.high {
  color: #ff8d82;
}
.h-sev.high .icon {
  color: #ff6a5e;
}
.h-sev.med {
  color: #ffc071;
}
.h-sev.med .icon {
  color: #ffab3d;
}
.h-sev.low {
  color: #9cc9e8;
}
.h-sev.low .icon {
  color: #63b3e8;
}
.h-when {
  font-size: 12px;
  color: #93a6b3;
}
.h-go {
  display: grid;
  place-items: center;
  color: #6f8492;
  transition:
    color 0.2s ease,
    transform 0.2s ease;
}
.h-go .icon {
  width: 17px;
}
.tag {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  border-radius: 30px;
  padding: 5px 11px;
  font-size: 11px;
  border: 1px solid transparent;
}
.tag:before {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: currentColor;
  box-shadow: 0 0 8px currentColor;
}
.tag.done {
  color: #4fdca0;
  border-color: #2c5645;
  background: #0c1b15;
}
.tag.prog {
  color: #5eb8f0;
  border-color: #2b4a61;
  background: #0b1720;
}
.tag.prog:before {
  animation: tag-pulse 1.4s ease-in-out infinite alternate;
}
.tag.gen {
  color: #7ba9e8;
  border-color: #2f4360;
  background: #0c141f;
}
@keyframes tag-pulse {
  from {
    opacity: 0.35;
  }
  to {
    opacity: 1;
  }
}
#no-history {
  padding: 34px 18px;
  margin: 0;
  text-align: center;
  color: #a5b5c1;
  font-size: 13px;
}
.h-summary {
  margin-top: 18px;
  padding: 18px 22px;
}
.insight-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  row-gap: 14px;
}
.insight {
  padding: 4px 12px;
  border-left: 1px solid #ffffff14;
  min-width: 0;
}
.insight:first-child {
  border-left: 0;
  padding-left: 0;
}
.insight b {
  display: block;
  font-size: 27px;
  font-weight: 600;
  letter-spacing: -1px;
  font-variant-numeric: tabular-nums;
}
.insight small {
  display: block;
  font-size: 12px;
  color: #93a6b3;
  margin-top: 3px;
  line-height: 1.35;
}
.insight span {
  display: block;
  margin-top: 2px;
  font-size: 12px;
  line-height: 1.35;
  color: var(--ink-subtle);
}
.h-summary .insight,
.h-summary .insight:first-child {
  padding: 2px 12px 2px 14px;
  border-left: 2px solid var(--edge);
}
.delta {
  display: inline-block;
  font-size: 11px;
  margin-top: 8px;
}
.delta.up {
  color: #4fdca0;
}
.activity {
  list-style: none;
  margin: 0;
  padding: 0;
}
.activity li {
  display: grid;
  grid-template-columns: 16px minmax(0, 1fr) auto;
  gap: 10px;
  align-items: start;
  padding: 10px 0;
  border-top: 1px solid #ffffff10;
}
.activity li:first-child {
  border-top: 0;
}
.activity li:before {
  content: "";
  width: 8px;
  height: 8px;
  margin-top: 5px;
  border-radius: 50%;
  background: #4fdca0;
  box-shadow: 0 0 9px #4fdca066;
}
.activity li.gen:before {
  background: #5eb8f0;
  box-shadow: 0 0 9px #5eb8f066;
}
.activity li.prog:before {
  background: #ff9c3d;
  box-shadow: 0 0 9px #ff9c3d66;
  animation: tag-pulse 1.4s ease-in-out infinite alternate;
}
.activity b {
  display: block;
  font-size: 12px;
  font-weight: 500;
}
.activity small {
  display: block;
  font-size: 12px;
  color: #8fa2af;
  margin-top: 3px;
  overflow-wrap: anywhere;
}
.activity time {
  font-size: 12px;
  color: #8496a3;
  white-space: nowrap;
}
.canvas {
  background: #04090d;
}
footer {
  margin-top: 18px;
  padding-top: 0;
}
@media (max-width: 900px) {
  .h-head {
    display: none;
  }
  .h-row {
    grid-template-columns: minmax(0, 1fr) auto;
    row-gap: 8px;
  }
  .h-title {
    grid-column: 1 / -1;
  }
  .h-when {
    text-align: right;
  }
  .h-go {
    display: none;
  }
  .filter.sort {
    margin-left: 0;
  }
}
@media (prefers-reduced-motion: reduce) {
  .h-row,
  .tab.active:after,
  .tag.prog:before,
  .activity li.prog:before {
    animation: none;
  }
}

/* The shared .arrow is absolutely placed for the Home action cards; inside a text button it sits inline. */
.subtle .arrow {
  position: static;
  margin-left: 6px;
}

/* Table footer: how many alerts are shown, and the way to load more. */
.h-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px 24px;
  flex-wrap: wrap;
  padding: 16px 24px;
  border-top: 1px solid var(--edge);
}
.h-foot-info {
  flex: 1;
  min-width: 240px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.h-count {
  margin: 0;
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
}
.h-progress {
  height: 4px;
  max-width: 320px;
  border-radius: var(--r-pill);
  background: color-mix(in srgb, var(--text) 10%, transparent);
  overflow: hidden;
}
.h-progress span {
  display: block;
  height: 100%;
  width: calc(var(--p, 0) * 100%);
  border-radius: inherit;
  background: var(--ember);
}
.h-note {
  margin: 0;
  font-size: 13px;
  color: var(--muted);
}
.h-note:empty {
  display: none;
}
.insight-note {
  margin: 12px 0 0;
  font-size: 13px;
  color: var(--ink-subtle);
}
