* {
  box-sizing: border-box;
}
html,
body {
  margin: 0;
  min-height: 100%;
  background: #000;
  color: #e8e8ef;
  font-family: "JetBrains Mono", ui-monospace, monospace;
}
.cosmos {
  position: fixed;
  inset: 0;
  z-index: 0;
  background:
    radial-gradient(ellipse 130% 85% at 50% 115%, var(--cosmos-glow) 0%, transparent 55%),
    radial-gradient(ellipse 90% 55% at 8% 12%, var(--cosmos-glow-2) 0%, transparent 48%),
    linear-gradient(180deg, #000 0%, #050508 50%, #000 100%);
}
.cosmos::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    radial-gradient(1px 1px at 14% 22%, rgba(255, 255, 255, 0.28), transparent),
    radial-gradient(1px 1px at 76% 14%, rgba(255, 255, 255, 0.22), transparent);
  opacity: 0.75;
}
.wrap {
  position: relative;
  z-index: 1;
  max-width: 46rem;
  margin: 0 auto;
  padding: 1.25rem 1.25rem 2.5rem;
}
.top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  margin-bottom: 1.25rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid rgba(var(--accent-rgb), 0.2);
}
.brand h1 {
  margin: 0;
  font-size: 1.1rem;
  font-weight: 600;
  color: #9cdcfe;
}
.top-meta {
  font-size: 0.72rem;
  color: rgba(156, 220, 254, 0.45);
  font-weight: 500;
}
.top-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
}
.top-links a,
.top-links button {
  color: var(--accent-soft);
  text-decoration: none;
  font-size: 0.78rem;
  font-weight: 500;
  border: 1px solid rgba(var(--accent-rgb), 0.35);
  padding: 0.4rem 0.8rem;
  border-radius: 0.35rem;
  background: rgba(8, 10, 18, 0.6);
  font-family: inherit;
  cursor: pointer;
}
.top-links a:hover,
.top-links button:hover {
  border-color: rgba(var(--accent-rgb), 0.55);
  color: #9cdcfe;
}
.hist-toolbar {
  margin-bottom: 1rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  flex-wrap: wrap;
}
.hist-count {
  font-size: 0.75rem;
  color: rgba(156, 220, 254, 0.5);
}
.hist-list {
  list-style: none;
  margin: 0;
  padding: 0;
  border-radius: 0.5rem;
  border: 1px solid rgba(var(--accent-rgb), 0.28);
  background: rgba(6, 8, 14, 0.75);
  overflow: hidden;
}
.hist-list[hidden] {
  display: none;
}
.hist-item {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 0.65rem 0.85rem;
  align-items: start;
  padding: 0.75rem 0.9rem;
  border-bottom: 1px solid rgba(var(--accent-rgb), 0.12);
}
.hist-item:last-child {
  border-bottom: none;
}
.hist-item:hover {
  background: rgba(var(--accent-rgb), 0.08);
}
.hist-main {
  min-width: 0;
}
.hist-title {
  margin: 0 0 0.25rem;
  font-size: 0.84rem;
  font-weight: 600;
  color: #e8eef8;
  word-break: break-word;
}
.hist-meta {
  font-size: 0.68rem;
  color: rgba(156, 220, 254, 0.45);
  font-variant-numeric: tabular-nums;
}
.hist-src {
  margin: 0.35rem 0 0;
  font-size: 0.62rem;
  color: rgba(156, 220, 254, 0.35);
  word-break: break-all;
  line-height: 1.35;
}
.hist-open {
  flex-shrink: 0;
  border: 1px solid rgba(var(--accent-rgb), 0.45);
  background: linear-gradient(180deg, rgba(var(--accent-rgb), 0.35), rgba(var(--accent-rgb), 0.12));
  color: #9cdcfe;
  font-size: 0.72rem;
  font-weight: 600;
  padding: 0.4rem 0.65rem;
  border-radius: 0.35rem;
  cursor: pointer;
  font-family: inherit;
  white-space: nowrap;
}
.hist-open:hover {
  border-color: rgba(var(--accent-rgb), 0.65);
  color: #fff;
}
.hist-empty {
  margin: 0;
  padding: 2rem 1rem;
  text-align: center;
  font-size: 0.85rem;
  color: rgba(156, 220, 254, 0.45);
  border-radius: 0.5rem;
  border: 1px dashed rgba(var(--accent-rgb), 0.25);
}
.hist-empty[hidden] {
  display: none;
}
.hist-clear-btn {
  color: var(--accent-soft);
  font-size: 0.78rem;
  font-weight: 500;
  border: 1px solid rgba(var(--accent-rgb), 0.35);
  padding: 0.4rem 0.8rem;
  border-radius: 0.35rem;
  background: rgba(8, 10, 18, 0.6);
  font-family: inherit;
  cursor: pointer;
}
.hist-clear-btn:hover {
  border-color: rgba(244, 100, 100, 0.55);
  color: rgba(255, 180, 180, 0.95);
}
