:root {
  color-scheme: dark;
  font-family: Inter, ui-sans-serif, system-ui, sans-serif;
  color: #ededed;
  background: #0a0a0a;
  font-synthesis: none;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }

body {
  position: relative;
  min-height: 100vh;
  margin: 0;
  background-color: #07090b;
  background-image: linear-gradient(rgb(3 6 9 / 30%), rgb(3 6 9 / 52%)), url("/assets/img/bg.jpg");
  background-position: center;
  background-size: cover;
  background-attachment: fixed;
  isolation: isolate;
}

body::before {
  position: fixed;
  z-index: -1;
  inset-block: 0;
  left: 50%;
  width: min(1180px, calc(100% - 48px));
  background: #0a0a0a;
  content: "";
  transform: translateX(-50%);
}

.topbar,
main {
  width: min(1180px, calc(100% - 48px));
  margin-inline: auto;
  padding-inline: 10px;
}

.topbar {
  min-height: 58px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  border-bottom: 1px solid #252525;
}

.brand {
  color: inherit;
  text-decoration: none;
  font-size: 23px;
  font-weight: 750;
  letter-spacing: -.06em;
}

.brand span { color: #e5484d; }

.topbar-side,
.topnav { display: flex; align-items: center; }
.topbar-side { gap: 24px; }
.topnav a {
  padding-block: 19px;
  border-bottom: 1px solid transparent;
  color: #aaa;
  font-size: 13px;
  text-decoration: none;
}
.topnav a:hover,
.topnav a[aria-current="page"] { border-bottom-color: #e5484d; color: #eee; }

.edition {
  color: #999;
  font-family: ui-monospace, monospace;
  font-size: 11px;
  letter-spacing: .09em;
}

main { padding-block: 24px 96px; }

.page-heading { max-width: 680px; margin: 18px 0 42px; }
.page-heading h1 { margin: 0; font-size: clamp(28px, 5vw, 46px); font-weight: 650; letter-spacing: -.045em; }
.page-heading > p:last-child { margin: 14px 0 0; color: #929292; line-height: 1.6; }
.data-view .stats { margin-top: 0; }

.search-shell {
  padding: 18px;
  border: 1px solid #343434;
  background: #101010;
}

.search-form {
  display: grid;
  grid-template-columns: minmax(180px, .7fr) minmax(260px, 1.5fr) minmax(130px, .45fr) auto;
  gap: 12px;
  align-items: end;
}

.field {
  position: relative;
  display: grid;
  gap: 7px;
}

label {
  display: grid;
  color: #a8a8a8;
  font-size: 14px;
}

input,
select {
  width: 100%;
  min-height: 44px;
  padding: 10px 12px;
  border: 1px solid #444;
  color: #eee;
  background: #090909;
  font: inherit;
}

input:hover,
select:hover { border-color: #606060; }
input:focus,
select:focus { border-color: #a0a0a0; outline: none; }

.suggestions {
  position: absolute;
  z-index: 10;
  top: calc(100% + 5px);
  left: 0;
  right: 0;
  max-height: 260px;
  overflow-y: auto;
  border: 1px solid #484848;
  background: #111;
  box-shadow: 0 18px 36px rgb(0 0 0 / 45%);
}

.suggestion {
  width: 100%;
  min-height: 42px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 9px 11px;
  border: 0;
  border-bottom: 1px solid #292929;
  color: #e5e5e5;
  background: #111;
  text-align: left;
}

.suggestion:last-child { border-bottom: 0; }
.suggestion:hover,
.suggestion[aria-selected="true"] { background: #242424; }
.suggestion small { color: #888; font-size: 12px; }

.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.chips:empty { display: none; }

.chip {
  min-height: 30px;
  padding: 5px 9px;
  border-color: #444;
  color: #d7d7d7;
  background: #1a1a1a;
  font-size: 12px;
}

.chip:hover { border-color: #777; color: #fff; background: #222; }

button {
  min-height: 44px;
  padding: 10px 18px;
  border: 1px solid #e7e7e7;
  color: #111;
  background: #e7e7e7;
  font: inherit;
  cursor: pointer;
  white-space: nowrap;
}

button:hover { background: #fff; }
button:disabled { opacity: .6; cursor: wait; }
:focus-visible { outline: 2px solid #eee; outline-offset: 4px; }

.search-meta {
  min-height: 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  margin-top: 12px;
  color: #858585;
  font-size: 12px;
}

.search-meta p { margin: 0; }
.additional-filters { grid-column: 1 / -1; border-top: 1px solid #303030; }
.additional-filters summary { display: flex; align-items: center; gap: 10px; padding: 14px 0 2px; color: #aaa; font-size: 13px; cursor: pointer; list-style: none; }
.additional-filters summary::-webkit-details-marker { display: none; }
.additional-filters summary::before { content: ""; width: 7px; height: 7px; border-right: 1px solid currentColor; border-bottom: 1px solid currentColor; transform: rotate(-45deg); flex-shrink: 0; transition: transform .15s; }
.additional-filters[open] summary::before { transform: rotate(45deg); }
.additional-filters summary:hover { color: #eee; }
.filter-active { padding: 3px 7px; border: 1px solid #484848; color: #ddd; font-size: 11px; border-radius: 3px; }
.additional-filters-body { display: flex; align-items: flex-start; gap: 16px; padding-top: 16px; }
.additional-filters-body .field { flex: 1; max-width: 440px; }
.filter-help { margin: 0; color: #929292; font-size: 12px; line-height: 1.5; }
.clear-filters { margin-top: 24px; padding-inline: 10px; border-color: #444; color: #ccc; background: transparent; font-size: 12px; }
.clear-filters:hover { background: #242424; }
@media (prefers-reduced-motion: reduce) {
  .additional-filters summary::before { transition: none; }
}
.connection { display: flex; align-items: center; gap: 10px; }

.retry {
  min-height: 44px;
  padding: 8px 4px;
  border: 0;
  color: #9c9c9c;
  background: transparent;
  font-size: 12px;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.retry:hover { color: #eee; background: transparent; }

.results {
  display: grid;
  gap: 8px;
  margin-top: 14px;
}

.results:empty { display: none; }

.results-pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  margin-top: 16px;
}

.results-pagination[hidden] { display: none; }
.results-pagination button { min-height: 38px; padding: 7px 14px; }
.results-pagination button:disabled { cursor: default; }
.results-page-status { min-width: 150px; color: #aaa; font-size: 12px; text-align: center; font-variant-numeric: tabular-nums; }

.result {
  display: grid;
  grid-template-columns: 64px minmax(0, 1fr);
  align-items: center;
  gap: 14px;
  min-height: 82px;
  padding: 9px 14px;
  border: 1px solid #303030;
  color: #ddd;
  background: #0d0d0d;
  text-decoration: none;
}

.result:hover { border-color: #707070; background: #111; }
.result-ship { width: 64px; height: 64px; object-fit: contain; filter: drop-shadow(0 6px 10px rgb(0 0 0 / 45%)); }
.result-content { display: grid; min-width: 0; gap: 8px; }
.result-header { display: grid; grid-template-columns: minmax(160px, .7fr) 1.5fr; align-items: baseline; gap: 18px; }
.result-header strong { color: #eee; font-size: 14px; }
.result span { color: #999; font-size: 12px; }
.system-security { font-variant-numeric: tabular-nums; font-weight: 650; }
.security-high { color: #91d7a3 !important; }
.security-low { color: #f0a35b !important; }
.security-danger { color: #ee6464 !important; }
.result-modules { display: flex; align-items: center; gap: 5px; min-height: 32px; overflow: hidden; }
.result-module-icon { width: 32px; height: 32px; flex: 0 0 32px; object-fit: contain; border: 1px solid #282828; background: #080808; }
.result-module-overflow { display: inline-grid; place-items: center; min-width: 32px; height: 32px; padding: 0 5px; border: 1px solid #303030; color: #aaa !important; background: #151515; }
noscript p { color: #999; font-size: 14px; }

.stats {
  margin-top: 72px;
  padding-top: 20px;
  border-top: 1px solid #252525;
}

.stats-head {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 18px;
}

.kicker {
  margin: 0 0 7px;
  color: #777;
  font-family: ui-monospace, monospace;
  font-size: 11px;
  letter-spacing: .09em;
}

h2 { margin: 0; font-size: 18px; font-weight: 600; }
.stats-period { margin: 0; color: #888; font-size: 12px; }

.stats-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  border: 1px solid #303030;
}

.stats-grid > div {
  display: grid;
  gap: 4px;
  padding: 16px 18px;
  border-right: 1px solid #303030;
}

.stats-grid > div:last-child { border-right: 0; }
.stats-grid strong { font-size: 24px; font-weight: 550; letter-spacing: -.03em; }
.stats-grid span { color: #888; font-size: 12px; }

.top-ships {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  margin-top: 8px;
}

.top-ship {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 12px;
  border: 1px solid #292929;
  color: #bbb;
  font-size: 12px;
}

.top-ship span:last-child { color: #777; }

.detail-view { max-width: 900px; margin-inline: auto; }
.back-link { display: inline-block; margin-bottom: 20px; color: #aaa; font-size: 14px; text-decoration: none; }
.back-link:hover { color: #fff; }
.detail-card { border: 1px solid #343434; background: #101010; }
.detail-head { display: flex; justify-content: space-between; gap: 24px; padding: 22px; border-bottom: 1px solid #303030; }
.ship-identity { display: flex; align-items: center; min-width: 0; gap: 18px; }
.detail-title { min-width: 0; }
.ship-render { width: 104px; height: 104px; flex: 0 0 104px; object-fit: contain; filter: drop-shadow(0 10px 18px rgb(0 0 0 / 45%)); }
.detail-head h1 { margin: 4px 0 8px; font-size: clamp(26px, 5vw, 42px); line-height: 1.05; letter-spacing: -.045em; }
.detail-head p { margin: 0; color: #909090; font-size: 14px; }
.source-link { align-self: start; color: #ddd; font-size: 13px; white-space: nowrap; }
.detail-meta { display: grid; grid-template-columns: repeat(3, 1fr); border-bottom: 1px solid #303030; }
.detail-meta > div { display: grid; gap: 4px; padding: 14px 18px; border-right: 1px solid #303030; }
.detail-meta > div:last-child { border-right: 0; }
.detail-meta span, .fit-group h3 { color: #7f7f7f; font-size: 12px; font-weight: 500; }
.detail-meta strong { font-size: 14px; font-weight: 500; }
.victim-identity { display: flex; align-items: center; gap: 14px; padding: 16px 22px; border-bottom: 1px solid #303030; }
.victim-portrait { width: 64px; height: 64px; flex: 0 0 64px; border-radius: 50%; object-fit: cover; background: #1d1d1d; }
.victim-details { min-width: 0; }
.victim-details h2 { margin: 0 0 5px; font-size: 17px; font-weight: 600; }
.victim-details p { margin: 0; color: #909090; font-size: 13px; }
.fit { padding: 20px 22px 24px; }
.fit-group + .fit-group { margin-top: 20px; }
.fit-group h3 { margin: 0 0 8px; text-transform: uppercase; letter-spacing: .08em; }
.fit-items { display: grid; grid-template-columns: repeat(2, 1fr); gap: 6px; }
.fit-item { display: flex; align-items: center; gap: 10px; min-width: 0; padding: 8px 10px; border: 1px solid #292929; color: #ccc; font-size: 13px; }
.fit-icon { width: 36px; height: 36px; flex: 0 0 36px; object-fit: contain; image-rendering: auto; }
.fit-item-label { display: flex; align-items: baseline; justify-content: space-between; min-width: 0; flex: 1; gap: 12px; }
.fit-item-label span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fit-item small { flex: 0 0 auto; color: #777; }
.fit-empty { margin: 0; color: #777; font-size: 13px; }
.inventory-group { padding-top: 20px; border-top: 1px solid #292929; }
.cargo-quantities { text-align: right; }

@media (max-width: 760px) {
  body::before { width: calc(100% - 28px); }

  .topbar,
  main { width: calc(100% - 28px); }

  .edition { font-size: 9px; }
  main { padding-block: 14px 64px; }
  .search-shell { padding: 14px; }
  .search-form { grid-template-columns: 1fr; }
  .additional-filters summary { flex-wrap: wrap; }
  .additional-filters-body { flex-direction: column; gap: 10px; }
  .additional-filters-body .field { width: 100%; max-width: none; }
  .clear-filters { margin-top: 0; }
  .search-meta { align-items: flex-start; flex-direction: column; gap: 8px; }
  .result { grid-template-columns: 52px minmax(0, 1fr); gap: 10px; }
  .result-ship { width: 52px; height: 52px; }
  .result-header { grid-template-columns: 1fr; gap: 3px; }
  .stats { margin-top: 48px; }
  .stats-head { align-items: flex-start; flex-direction: column; gap: 7px; }
  .stats-grid { grid-template-columns: 1fr; }
  .stats-grid > div { border-right: 0; border-bottom: 1px solid #303030; }
  .stats-grid > div:last-child { border-bottom: 0; }
  .top-ships, .fit-items { grid-template-columns: 1fr; }
  .detail-head { align-items: flex-start; flex-direction: column; }
  .ship-render { width: 76px; height: 76px; flex-basis: 76px; }
  .detail-meta { grid-template-columns: 1fr; }
  .detail-meta > div { border-right: 0; border-bottom: 1px solid #303030; }
  .detail-meta > div:last-child { border-bottom: 0; }
}
