:root {
  --ink: #18212f;
  --muted: #637083;
  --line: #dce2ea;
  --surface: #ffffff;
  --canvas: #f4f6f9;
  --navy: #10263d;
  --blue: #1664d8;
  --blue-soft: #eaf2ff;
  --green: #147a52;
  --green-soft: #e6f6ef;
  --amber: #9a5a00;
  --amber-soft: #fff3d9;
  --red: #b42332;
  --red-soft: #fdebec;
  --radius: 12px;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--ink);
  background: var(--canvas);
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--canvas);
  color: var(--ink);
}

a {
  color: var(--blue);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

:focus-visible {
  outline: 3px solid #73b3ff;
  outline-offset: 3px;
}

.skip-link {
  position: fixed;
  z-index: 1000;
  top: 8px;
  left: 8px;
  padding: 10px 14px;
  color: white;
  background: var(--navy);
  border-radius: 8px;
  transform: translateY(-150%);
}

.skip-link:focus {
  transform: translateY(0);
}

button,
input,
select,
textarea {
  font: inherit;
}

button {
  cursor: pointer;
}

button:disabled {
  cursor: not-allowed;
  opacity: .65;
}

button[aria-busy="true"] {
  cursor: wait;
}

code,
pre {
  font-family: "Cascadia Mono", "SFMono-Regular", Consolas, monospace;
}

pre {
  margin: 0;
  white-space: pre-wrap;
  word-break: break-word;
  font-size: .78rem;
  line-height: 1.45;
}

.topbar {
  height: 68px;
  display: flex;
  align-items: center;
  gap: 34px;
  padding: 0 max(24px, calc((100vw - 1440px) / 2));
  color: white;
  background: var(--navy);
  box-shadow: 0 2px 12px #10263d30;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  color: white;
  font-weight: 750;
  letter-spacing: -.02em;
}

.brand:hover {
  text-decoration: none;
}

.brand-mark {
  display: inline-grid;
  place-items: center;
  width: 34px;
  height: 34px;
  color: white;
  background: var(--blue);
  border-radius: 9px;
  font-size: .77rem;
  letter-spacing: .04em;
  box-shadow: inset 0 0 0 1px #ffffff22;
}

.brand-mark.large {
  width: 52px;
  height: 52px;
  border-radius: 13px;
  font-size: 1rem;
}

.topbar nav {
  display: flex;
  align-self: stretch;
  gap: 5px;
}

.topbar nav a {
  display: flex;
  align-items: center;
  padding: 0 14px;
  color: #cbd8e6;
  border-bottom: 3px solid transparent;
  font-size: .92rem;
}

.topbar nav a:hover,
.topbar nav a.active {
  color: white;
  border-color: #55a0ff;
  text-decoration: none;
}

.account {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 14px;
}

.account>span {
  display: flex;
  flex-direction: column;
  text-align: right;
  font-size: .84rem;
}

.account small {
  color: #aebed0;
  text-transform: uppercase;
  letter-spacing: .06em;
  font-size: .65rem;
}

.page {
  width: min(1440px, calc(100% - 48px));
  min-height: calc(100vh - 128px);
  margin: 0 auto;
  padding: 30px 0 48px;
}

.auth-page {
  min-height: calc(100vh - 46px);
  display: grid;
  place-items: center;
  padding: 30px;
  background: radial-gradient(circle at 20% 15%, #dcecff 0, transparent 30%), linear-gradient(135deg, #f7f9fc, #e8eef6);
}

.footer {
  min-height: 46px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 20px;
  padding: 12px max(24px, calc((100vw - 1440px) / 2));
  color: var(--muted);
  background: #e8ecf2;
  font-size: .75rem;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 8px;
  font-size: clamp(1.65rem, 2.5vw, 2.35rem);
  letter-spacing: -.04em;
}

h2 {
  margin-bottom: 14px;
  font-size: 1.1rem;
  letter-spacing: -.015em;
}

.eyebrow {
  margin-bottom: 6px;
  color: var(--blue);
  font-size: .72rem;
  font-weight: 750;
  text-transform: uppercase;
  letter-spacing: .12em;
}

.page-heading,
.detail-heading {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 24px;
  margin-bottom: 24px;
}

.page-heading p:last-child,
.detail-heading p {
  margin: 0;
  color: var(--muted);
}

.panel {
  margin-bottom: 20px;
  padding: 22px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: 0 3px 12px #22334a0a;
}

.panel.compact {
  padding: 15px 18px;
}

.panel-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 14px;
}

.panel-title h2 {
  margin: 0;
}

.panel-title>span {
  color: var(--muted);
  font-size: .8rem;
}

.button {
  display: inline-flex;
  justify-content: center;
  align-items: center;
  min-height: 38px;
  padding: 8px 14px;
  border: 1px solid transparent;
  border-radius: 8px;
  font-weight: 650;
  font-size: .85rem;
  transition: background .15s, border-color .15s, transform .15s;
}

.button:hover {
  text-decoration: none;
  transform: translateY(-1px);
}

.button.primary {
  color: white;
  background: var(--blue);
}

.button.secondary {
  color: #24405c;
  background: #e8eef5;
  border-color: #d1dae5;
}

.button.ghost {
  color: inherit;
  background: transparent;
  border-color: #ffffff40;
}

.page .button.ghost {
  border-color: var(--line);
}

.button.success {
  color: var(--green);
  background: var(--green-soft);
  border-color: #addfca;
}

.button.warning {
  color: var(--amber);
  background: var(--amber-soft);
  border-color: #eed29e;
}

.button.danger {
  color: var(--red);
  background: var(--red-soft);
  border-color: #edb7bd;
}

.button.small {
  min-height: 32px;
  padding: 5px 10px;
  font-size: .75rem;
}

.button.full {
  width: 100%;
}

.stack-form {
  display: grid;
  gap: 16px;
}

.form-field {
  display: grid;
  gap: 6px;
}

.form-field small {
  color: var(--muted);
  font-size: .72rem;
}

label {
  display: grid;
  gap: 6px;
  color: #39495c;
  font-size: .78rem;
  font-weight: 650;
}

input,
select,
textarea {
  width: 100%;
  padding: 10px 11px;
  color: var(--ink);
  background: white;
  border: 1px solid #cbd4df;
  border-radius: 8px;
  outline: none;
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--blue);
  box-shadow: 0 0 0 3px #1664d81c;
}

textarea {
  resize: vertical;
}

.check {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 9px;
}

.check input {
  width: auto;
}

.login-card {
  width: min(430px, 100%);
  padding: 34px;
  background: white;
  border: 1px solid var(--line);
  border-radius: 16px;
  box-shadow: 0 18px 55px #18304f1c;
}

.login-heading {
  display: flex;
  gap: 14px;
  align-items: center;
  margin-bottom: 28px;
}

.login-heading h1 {
  margin: 0;
  font-size: 1.55rem;
}

.login-heading p {
  margin: 3px 0 0;
  color: var(--muted);
  font-size: .85rem;
}

.security-note {
  margin: 22px 0 0;
  color: var(--muted);
  font-size: .72rem;
  text-align: center;
}

.alert {
  margin-bottom: 18px;
  padding: 11px 14px;
  border: 1px solid #b5d0ef;
  border-radius: 8px;
  color: #194d82;
  background: #edf6ff;
  font-size: .85rem;
}

.alert.error {
  color: var(--red);
  background: var(--red-soft);
  border-color: #edb7bd;
}

.alert.success {
  color: var(--green);
  background: var(--green-soft);
  border-color: #addfca;
}

.alert.warning {
  color: var(--amber);
  background: var(--amber-soft);
  border-color: #eed29e;
}

.hidden {
  display: none !important;
}

.upload-panel {
  display: grid;
  grid-template-columns: minmax(240px, .8fr) 2fr;
  gap: 30px;
  border-left: 4px solid var(--blue);
}

.upload-form {
  display: grid;
  grid-template-columns: 1.5fr 1fr auto;
  align-items: end;
  gap: 12px;
}

.file-drop input {
  padding: 8px;
  background: var(--blue-soft);
  border-style: dashed;
}

.filters {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) 180px 180px auto;
  align-items: end;
  gap: 12px;
}

.table-panel {
  padding: 0;
  overflow: hidden;
}

.table-panel>.panel-title {
  padding: 20px 22px 4px;
}

.table-scroll {
  overflow-x: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
}

th {
  padding: 10px 14px;
  color: var(--muted);
  background: #f7f9fb;
  border-block: 1px solid var(--line);
  font-size: .7rem;
  text-transform: uppercase;
  letter-spacing: .06em;
}

td {
  padding: 13px 14px;
  border-bottom: 1px solid #e8ecf1;
  font-size: .82rem;
  vertical-align: middle;
}

tbody tr:hover {
  background: #f9fbfd;
}

.id-link {
  font-weight: 750;
}

.subject-link {
  display: flex;
  flex-direction: column;
  color: var(--ink);
  max-width: 460px;
}

.subject-link strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.subject-link span {
  margin-top: 3px;
  color: var(--muted);
  font-size: .75rem;
}

.subject-link:hover {
  text-decoration: none;
}

.risk-badge,
.status-badge,
.tag {
  display: inline-flex;
  align-items: center;
  padding: 4px 7px;
  border-radius: 6px;
  color: #48576a;
  background: #edf0f4;
  font-size: .69rem;
  white-space: nowrap;
}

.risk-badge.low,
.tag.success {
  color: var(--green);
  background: var(--green-soft);
}

.risk-badge.suspicious,
.tag.warning {
  color: var(--amber);
  background: var(--amber-soft);
}

.risk-badge.dangerous,
.risk-badge.critical,
.tag.danger {
  color: var(--red);
  background: var(--red-soft);
}

.risk-badge b {
  margin-right: 2px;
  font-size: .86rem;
}

.tag {
  margin: 2px;
}

.pagination {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 14px;
  padding: 14px 20px;
  color: var(--muted);
  font-size: .78rem;
}

.empty-state {
  padding: 55px;
  text-align: center;
  color: var(--muted);
}

.breadcrumb {
  display: flex;
  gap: 8px;
  margin-bottom: 16px;
  color: var(--muted);
  font-size: .78rem;
}

.detail-heading {
  align-items: center;
}

.detail-heading>div:first-child {
  min-width: 0;
}

.detail-heading h1 {
  overflow-wrap: anywhere;
}

.score-card {
  flex: 0 0 160px;
  display: grid;
  place-items: center;
  padding: 14px;
  color: var(--green);
  background: var(--green-soft);
  border: 1px solid #b9dfce;
  border-radius: 12px;
}

.score-card>span {
  color: var(--muted);
  font-size: .7rem;
}

.score-card>strong {
  font-size: 2.2rem;
  line-height: 1.2;
}

.score-card>b {
  font-size: .7rem;
  text-transform: uppercase;
  letter-spacing: .08em;
}

.score-card.suspicious {
  color: var(--amber);
  background: var(--amber-soft);
  border-color: #eed29e;
}

.score-card.low.inconclusive {
  color: var(--amber);
  background: var(--amber-soft);
  border-color: #eed29e;
}

.score-card.dangerous,
.score-card.critical {
  color: var(--red);
  background: var(--red-soft);
  border-color: #edb7bd;
}

.metric-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 14px;
  margin-bottom: 20px;
}

.metric-grid article {
  padding: 16px 18px;
  background: white;
  border: 1px solid var(--line);
  border-radius: 10px;
}

.metric-grid span {
  display: block;
  margin-bottom: 5px;
  color: var(--muted);
  font-size: .72rem;
  text-transform: uppercase;
  letter-spacing: .05em;
}

.metric-grid strong {
  font-size: 1.15rem;
  overflow-wrap: anywhere;
}

.metric-grid.large strong {
  font-size: 1.8rem;
}

.detail-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 360px;
  gap: 20px;
  align-items: start;
}

.detail-side .sticky {
  position: sticky;
  top: 18px;
  z-index: 1;
}

.danger-panel {
  border-left: 4px solid var(--red);
}

.info-panel {
  border-left: 4px solid var(--blue);
}

.break-all {
  word-break: break-all;
}

.muted {
  color: var(--muted);
}

.attachment-list {
  display: grid;
  gap: 12px;
}

.attachment-card {
  padding: 15px;
  border: 1px solid var(--line);
  border-radius: 9px;
}

.attachment-card>div:first-child {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 8px;
}

.attachment-card>div:first-child span {
  color: var(--muted);
  font-size: .75rem;
}

.hashes,
.metadata {
  display: grid;
  grid-template-columns: 90px minmax(0, 1fr);
  gap: 8px 12px;
  margin: 14px 0 0;
}

.hashes dt,
.metadata dt {
  color: var(--muted);
  font-size: .72rem;
}

.hashes dd,
.metadata dd {
  min-width: 0;
  margin: 0;
  font-size: .77rem;
}

.hashes pre {
  max-height: 130px;
  overflow: auto;
  padding: 8px;
  background: #f5f7fa;
  border-radius: 6px;
}

.analysis-list {
  display: grid;
  gap: 8px;
}

details>summary {
  cursor: pointer;
}

.analysis-list details {
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
}

.analysis-list summary {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 20px;
  padding: 11px 13px;
  background: #f8fafc;
}

.analysis-list summary span:first-child {
  display: flex;
  flex-direction: column;
}

.analysis-list summary small {
  color: var(--muted);
}

.analysis-list pre {
  max-height: 340px;
  overflow: auto;
  padding: 14px;
}

.headers {
  display: grid;
  gap: 9px;
  margin-top: 14px;
}

.headers>div {
  display: grid;
  grid-template-columns: 180px minmax(0, 1fr);
  gap: 12px;
  padding: 9px;
  background: #f7f9fb;
  border-radius: 6px;
}

.decision-buttons {
  display: grid;
  gap: 8px;
}

.metadata {
  grid-template-columns: 105px minmax(0, 1fr);
}

.timeline {
  margin: 0;
  padding: 0;
  list-style: none;
}

.timeline li {
  position: relative;
  padding: 0 0 18px 17px;
  border-left: 2px solid #dfe5ec;
}

.timeline li::before {
  content: '';
  position: absolute;
  left: -5px;
  top: 2px;
  width: 8px;
  height: 8px;
  background: var(--blue);
  border-radius: 50%;
}

.timeline li:last-child {
  padding-bottom: 0;
}

.timeline li>div {
  display: flex;
  flex-direction: column;
  font-size: .8rem;
}

.timeline li span,
.timeline time {
  color: var(--muted);
  font-size: .69rem;
}

.timeline details {
  margin-top: 5px;
  font-size: .7rem;
}

.stats-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}

.stats-grid .wide {
  grid-column: 1 / -1;
}

.bars {
  display: grid;
  gap: 14px;
}

.bar-row {
  display: grid;
  grid-template-columns: 120px 1fr 50px;
  align-items: center;
  gap: 12px;
  font-size: .8rem;
}

.bar {
  --bar-color: var(--green);
  display: block;
  width: 100%;
  height: 10px;
  overflow: hidden;
  appearance: none;
  color: var(--bar-color);
  background: #edf0f4;
  border: 0;
  border-radius: 999px;
}

.bar::-webkit-progress-bar {
  background: #edf0f4;
  border-radius: 999px;
}

.bar::-webkit-progress-value {
  background: var(--bar-color);
  border-radius: 999px;
}

.bar::-moz-progress-bar {
  background: var(--bar-color);
  border-radius: 999px;
}

.bar.suspicious {
  --bar-color: #e39822;
}

.bar.dangerous,
.bar.critical {
  --bar-color: #cf4855;
}

.bar.neutral {
  --bar-color: var(--blue);
}

.daily-table {
  display: grid;
}

.daily-table>div {
  display: grid;
  grid-template-columns: 160px 1fr 1fr;
  gap: 20px;
  padding: 10px;
  border-bottom: 1px solid var(--line);
  font-size: .8rem;
}

.settings-panel {
  display: grid;
  grid-template-columns: minmax(300px, 1fr) minmax(280px, .7fr);
  gap: 50px;
}

.settings-note {
  padding: 20px;
  background: #f4f7fa;
  border-radius: 9px;
  color: var(--muted);
}

.settings-note code {
  color: var(--ink);
}

.error-page {
  min-height: 55vh;
  display: grid;
  place-items: center;
  align-content: center;
  text-align: center;
}

.error-page>span {
  color: #cfdae7;
  font-weight: 800;
  font-size: 7rem;
  line-height: 1;
}

@media (max-width: 1050px) {
  .topbar {
    gap: 15px;
  }

  .topbar nav a {
    padding-inline: 8px;
  }

  .account>span {
    display: none;
  }

  .detail-grid {
    grid-template-columns: 1fr;
  }

  .detail-side .sticky {
    position: static;
  }

  .upload-panel {
    grid-template-columns: 1fr;
  }

  .upload-form {
    grid-template-columns: 1fr 1fr;
  }

  .upload-form button {
    grid-column: 1 / -1;
  }
}

@media (max-width: 760px) {
  .topbar {
    height: auto;
    flex-wrap: wrap;
    padding: 12px 18px;
  }

  .topbar nav {
    order: 3;
    width: 100%;
    height: 42px;
  }

  .account {
    margin-left: auto;
  }

  .page {
    width: min(100% - 24px, 1440px);
    padding-top: 20px;
  }

  .page-heading,
  .detail-heading {
    flex-direction: column;
  }

  .score-card {
    width: 100%;
  }

  .metric-grid {
    grid-template-columns: 1fr 1fr;
  }

  .filters,
  .upload-form {
    grid-template-columns: 1fr;
  }

  .upload-form button {
    grid-column: auto;
  }

  .stats-grid,
  .settings-panel {
    grid-template-columns: 1fr;
  }

  .stats-grid .wide {
    grid-column: auto;
  }

  .daily-table>div {
    grid-template-columns: 1fr;
    gap: 3px;
  }

  .headers>div,
  .attachment-card>div:first-child {
    display: block;
  }

  .footer {
    flex-direction: column;
    text-align: center;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition-duration: .01ms !important;
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
  }
}
