:root {
  --bg: #0d0f11;
  --surface: #131619;
  --border: #1e2328;
  --muted: #3a4048;
  --text: #c9d1d9;
  --dim: #6e7681;
  --accent: #58a6ff;
  --green: #3fb950;
  --yellow: #d29922;
  --red: #f85149;
  --purple: #bc8cff;

  --font: monospace;
}

*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  font-size: 13px;
  line-height: 1.6;
  min-height: 100vh;
}

/* ── Header ── */
header {
  border-bottom: 1px solid var(--border);
  padding: 18px 28px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

.logo {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
}

.logo-icon {
  display: block;
  width: 28px;
  height: 28px;
  border: 1.5px solid var(--accent);
  border-radius: 4px;
  display: grid;
  place-items: center;
  font-size: 14px;
  color: var(--accent);
  flex-shrink: 0;
}

.logo-text {
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: #fff;
}

.logo-sub {
  font-size: 11px;
  color: var(--dim);
  letter-spacing: 0.04em;
}

nav {
  display: flex;
  gap: 6px;
}

.sponsor {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 6px 12px;
  background: #58a6ff08;
  border: 1px solid #58a6ff22;
  border-radius: 5px;
  text-decoration: none;
  transition: all 0.15s;
}

.sponsor:hover {
  background: #58a6ff12;
  border-color: #58a6ff55;
}

.sponsor-label {
  font-size: 9px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
  padding: 1px 4px;
  border: 1px solid var(--border);
  border-radius: 2px;
  flex-shrink: 0;
}

.sponsor-body {
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.sponsor-name {
  font-size: 12px;
  font-weight: 700;
  color: var(--accent);
  letter-spacing: 0.04em;
}

.sponsor-desc {
  font-size: 10px;
  color: var(--dim);
}

.sponsor-arrow {
  font-size: 11px;
  color: var(--muted);
  margin-left: 2px;
  transition: transform 0.15s;
}

.sponsor:hover .sponsor-arrow {
  transform: translateX(3px);
  color: var(--accent);
}

.nav-link {
  font-family: var(--font);
  font-size: 11px;
  color: var(--dim);
  text-decoration: none;
  padding: 4px 10px;
  border: 1px solid transparent;
  border-radius: 4px;
  transition: all 0.15s;
}

.nav-link:hover {
  color: var(--text);
  border-color: var(--border);
  background: var(--surface);
}

/* ── Main layout ── */
main {
  max-width: 1400px;
  margin: 0 auto;
  padding: 32px 28px;
}

/* ── Command bar ── */
.cmd-bar {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 24px;
}

.prompt {
  color: var(--green);
  font-size: 13px;
  user-select: none;
  flex-shrink: 0;
}

.cmd-title {
  font-size: 18px;
  font-weight: 700;
  color: #fff;
  letter-spacing: 0.02em;
}

.cmd-cursor {
  display: inline-block;
  width: 10px;
  height: 18px;
  background: var(--accent);
  margin-left: 4px;
  vertical-align: middle;
  animation: blink 1.1s step-end infinite;
}

@keyframes blink {
  50% {
    opacity: 0;
  }
}

/* ── Description ── */

#description {
  font-size: 14px;
  line-height: 1.5;
  color: var(--dim);
  margin-bottom: 24px;
}

/* ── Ecosystem tabs ── */
.ecosystem-bar {
  display: flex;
  align-items: center;
  gap: 0;
  border: 1px solid var(--border);
  border-radius: 6px;
  overflow: hidden;
  width: fit-content;
  margin-bottom: 24px;
}

.eco-tab {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 7px 16px;
  background: var(--surface);
  border: none;
  border-right: 1px solid var(--border);
  color: var(--dim);
  font-family: var(--font);
  font-size: 12px;
  cursor: pointer;
  transition: all 0.15s;
  position: relative;
}

.eco-tab:last-child {
  border-right: none;
}

.eco-tab .eco-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--muted);
  transition: background 0.15s;
}

.eco-tab.active {
  background: var(--bg);
  color: var(--text);
}

.eco-tab.active .eco-dot {
  background: var(--green);
}

.eco-tab:hover:not(.active) {
  background: var(--border);
  color: var(--text);
}

.eco-tab.soon {
  opacity: 0.45;
  cursor: not-allowed;
}

.eco-tag {
  font-size: 9px;
  padding: 1px 5px;
  border-radius: 3px;
  background: var(--muted);
  color: var(--dim);
  letter-spacing: 0.05em;
}

/* ── Stats row ── */
.stats-row {
  display: flex;
  gap: 1px;
  margin-bottom: 24px;
}

.stat-card {
  flex: 1;
  padding: 14px 18px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 6px;
}

.stat-card:not(:first-child) {
  margin-left: 8px;
}

.stat-label {
  font-size: 10px;
  color: var(--dim);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  margin-bottom: 6px;
}

.stat-value {
  font-size: 22px;
  font-weight: 700;
  color: #fff;
}

.stat-sub {
  font-size: 10px;
  color: var(--dim);
  margin-top: 2px;
}

/* ── Controls ── */
.controls {
  display: flex;
  gap: 10px;
  margin-bottom: 16px;
  align-items: center;
}

.search-wrap {
  position: relative;
  flex: 1;
  max-width: 340px;
}

.search-icon {
  position: absolute;
  left: 10px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--dim);
  font-size: 12px;
}

.search-input {
  width: 100%;
  padding: 7px 12px 7px 30px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 5px;
  color: var(--text);
  font-family: var(--font);
  font-size: 12px;
  outline: none;
  transition: border-color 0.15s;
}

.search-input::placeholder {
  color: var(--muted);
}

.search-input:focus {
  border-color: var(--accent);
}

.sort-select {
  padding: 7px 12px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 5px;
  color: var(--text);
  font-family: var(--font);
  font-size: 12px;
  outline: none;
  cursor: pointer;
}

.result-count {
  margin-left: auto;
  color: var(--dim);
  font-size: 11px;
}

/* ── Table ── */
.table-wrap {
  border: 1px solid var(--border);
  border-radius: 6px;
  overflow-x: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
  min-width: 600px;
}

thead tr {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
}

th {
  padding: 8px;
  text-align: left;
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--dim);
  cursor: pointer;
  user-select: none;
  white-space: nowrap;
}

th:hover {
  color: var(--text);
}

th .sort-arrow {
  margin-left: 4px;
  opacity: 0.4;
}

th.sorted .sort-arrow {
  opacity: 1;
  color: var(--accent);
}

tr {
  border-bottom: 1px solid var(--border);
}

td {
  padding: 8px;
  color: var(--text);
  font-size: 12px;
}

tr:last-child td {
  border-bottom: none;
}

tbody tr {
  transition: background 0.1s;
}

tbody tr:hover td {
  background: #ffffff06;
}

#package-table {
  .icon {
    height: 16px;
    vertical-align: middle;
  }
}

.pkg-name {
  color: var(--accent);
  font-weight: 500;
  text-decoration: none;
}

.pkg-vendor {
  color: var(--dim);
  font-weight: 400;
  text-decoration: none;
}

.score-badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 3px;
  font-size: 11px;
  font-weight: 700;
}

.score-high {
  background: #3fb95018;
  color: var(--red);
}
.score-mid {
  background: #d2992218;
  color: var(--yellow);
}

.date-cell {
  color: var(--dim);
}

.success-cell {
  color: var(--green) !important;
}
.warning-cell {
  color: var(--yellow) !important;
}
.error-cell {
  color: var(--red) !important;
}

.suggestion {
  display: inline-flex;
  align-items: center;
  margin: 4px 2px;
  gap: 5px;
  font-family: var(--font);
  font-size: 11px;
  padding: 2px 4px;
  border-radius: 4px;
  border: 1px solid var(--green);
  cursor: pointer;
  text-decoration: none;
  transition: all 0.15s;
  background: var(--surface);
  color: var(--green);
  white-space: nowrap;

  a {
    color: var(--green);
  }
}

.btn-action {
  display: inline-flex;
  align-items: center;
  margin: 4px;
  gap: 5px;
  font-family: var(--font);
  font-size: 11px;
  padding: 4px 10px;
  border-radius: 4px;
  border: 1px solid var(--border);
  cursor: pointer;
  text-decoration: none;
  transition: all 0.15s;
  background: var(--surface);
  color: var(--dim);
  white-space: nowrap;
}

.btn-action:hover {
  border-color: #d2d2d2;
  color: #fff;
}

.btn-blue {
  border-color: #388bfd44;
  color: var(--accent);
}

.btn-blue:hover {
  background: #388bfd14;
  border-color: var(--accent);
  color: #fff;
}

.btn-green {
  border-color: #3fb95044;
  color: var(--green);
}

.btn-green:hover {
  background: #3fb95014;
  border-color: var(--green);
  color: #fff;
}

.num-cell {
  color: var(--purple);
  font-variant-numeric: tabular-nums;
}

.status-row td {
  text-align: center;
  color: var(--dim);
  padding: 40px;
}

.loading-dots::after {
  content: "...";
  animation: dots 1s steps(4, end) infinite;
}

@keyframes dots {
  0%,
  20% {
    content: "";
  }
  40% {
    content: ".";
  }
  60% {
    content: "..";
  }
  80%,
  100% {
    content: "...";
  }
}

/* ── Footer ── */
footer {
  margin-top: 40px;
  padding: 20px 28px;
  border-top: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 16px;
  color: var(--dim);
  font-size: 11px;
}

footer a {
  color: var(--dim);
  text-decoration: none;
}
footer a:hover {
  color: var(--text);
}

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

/* ── Animations ── */
tbody tr {
  animation: fadeIn 0.2s ease both;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(3px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (max-width: 700px) {
  header {
    flex-direction: column;
    align-items: start;
  }
  .stats-row {
    flex-direction: column;
    gap: 8px;
  }
  .stat-card:not(:first-child) {
    margin-left: 0;
  }
  main {
    padding: 20px 14px;
  }
  header {
    padding: 14px;
  }
}
