:root {
  --background: #020302;
  --surface: #0a0c0a;
  --surface-raised: #111411;
  --border: rgba(255, 255, 255, 0.09);
  --border-active: rgba(204, 255, 0, 0.42);
  --text: #f7f8f5;
  --text-muted: #92988f;
  --lime: #ccff00;
  --lime-soft: rgba(204, 255, 0, 0.09);
  --danger: #ff6767;
  --radius-sm: 10px;
  --radius-md: 16px;
  --radius-lg: 24px;
  --sidebar-width: 264px;
}

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

html {
  color-scheme: dark;
  background: var(--background);
}

body {
  margin: 0;
  min-width: 320px;
  min-height: 100dvh;
  background:
    radial-gradient(circle at 72% 0%, rgba(204, 255, 0, 0.06), transparent 28rem),
    var(--background);
  color: var(--text);
  font-family: "Inter", sans-serif;
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

button,
input,
textarea {
  font: inherit;
}

button,
a {
  touch-action: manipulation;
}

button {
  cursor: pointer;
}

a {
  color: inherit;
  text-decoration: none;
}

svg {
  display: block;
}

:focus-visible {
  outline: 3px solid var(--lime);
  outline-offset: 3px;
}

.skip-link {
  position: fixed;
  top: 8px;
  left: 8px;
  z-index: 999;
  transform: translateY(-150%);
  padding: 10px 14px;
  border-radius: 8px;
  background: var(--lime);
  color: #000;
  font-weight: 700;
}

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

.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;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-family: "Plus Jakarta Sans", sans-serif;
  font-size: 20px;
  font-weight: 800;
  letter-spacing: -0.04em;
}

.brand img {
  object-fit: contain;
  filter: brightness(0) invert(1);
}

.brand strong {
  color: var(--lime);
}

.eyebrow,
.lab-label {
  color: var(--lime);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.primary-button,
.secondary-button {
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 0 18px;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  font-size: 13px;
  font-weight: 700;
  transition: background-color 180ms ease, border-color 180ms ease, color 180ms ease, transform 180ms ease;
}

.primary-button {
  background: var(--lime);
  color: #050605;
}

.primary-button:hover {
  background: #ddff51;
  transform: translateY(-1px);
}

.primary-button:disabled {
  cursor: wait;
  opacity: 0.56;
  transform: none;
}

.primary-button.compact {
  min-height: 42px;
}

.secondary-button {
  background: rgba(255, 255, 255, 0.04);
  border-color: var(--border);
  color: var(--text);
}

.secondary-button:hover {
  border-color: var(--border-active);
  background: var(--lime-soft);
}

.text-button {
  min-height: 44px;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--text-muted);
  text-align: left;
}

.text-button:hover {
  color: var(--text);
}

.connect-screen {
  min-height: 100dvh;
  display: grid;
  place-items: center;
  padding: 24px;
  background:
    linear-gradient(rgba(255, 255, 255, 0.025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.025) 1px, transparent 1px);
  background-size: 40px 40px;
}

.connect-card {
  width: min(100%, 620px);
  padding: clamp(30px, 7vw, 64px);
  border: 1px solid var(--border);
  border-radius: 28px;
  background: rgba(7, 9, 7, 0.94);
  box-shadow: 0 40px 100px rgba(0, 0, 0, 0.46);
}

.connect-card .eyebrow {
  display: block;
  margin-top: 56px;
}

.connect-card h1 {
  max-width: 520px;
  margin: 12px 0 18px;
  font-family: "Plus Jakarta Sans", sans-serif;
  font-size: clamp(38px, 7vw, 64px);
  line-height: 0.98;
  letter-spacing: -0.065em;
}

.connect-card > p {
  color: var(--text-muted);
}

.connect-card .primary-button {
  width: 100%;
  margin-top: 24px;
}

.connect-card .security-note {
  margin: 18px 0 0;
  font-size: 12px;
}

.app-shell {
  min-height: 100dvh;
}

.sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  z-index: 40;
  width: var(--sidebar-width);
  display: flex;
  flex-direction: column;
  padding: 28px 20px 20px;
  border-right: 1px solid var(--border);
  background: rgba(4, 5, 4, 0.94);
  backdrop-filter: blur(20px);
}

.brand-sidebar {
  padding: 0 10px;
}

.lab-label {
  margin: 48px 12px 14px;
  color: var(--text-muted);
}

.side-nav {
  display: grid;
  gap: 6px;
}

.nav-item {
  min-height: 48px;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 14px;
  border: 1px solid transparent;
  border-radius: 11px;
  background: transparent;
  color: var(--text-muted);
  font-size: 14px;
  text-align: left;
  transition: 180ms ease;
}

.nav-item svg {
  width: 19px;
  height: 19px;
  fill: currentColor;
}

.nav-item:hover,
.nav-item.active {
  color: var(--text);
  background: rgba(255, 255, 255, 0.045);
}

.nav-item.active {
  border-color: var(--border-active);
  color: var(--lime);
}

.sidebar-footer {
  margin-top: auto;
  padding: 18px 10px 0;
  border-top: 1px solid var(--border);
}

.connection-indicator {
  display: flex;
  align-items: flex-start;
  gap: 10px;
}

.connection-indicator div {
  min-width: 0;
}

.connection-indicator strong,
.connection-indicator span {
  display: block;
}

.connection-indicator strong {
  font-size: 12px;
}

.connection-indicator div span {
  overflow: hidden;
  color: var(--text-muted);
  font-size: 11px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.status-dot {
  width: 8px;
  height: 8px;
  flex: 0 0 auto;
  margin-top: 5px;
  border-radius: 50%;
  background: var(--lime);
  box-shadow: 0 0 14px rgba(204, 255, 0, 0.55);
}

.sidebar-footer .text-button {
  margin-top: 12px;
  font-size: 12px;
}

.main-content {
  min-height: 100dvh;
  margin-left: var(--sidebar-width);
  padding: 0 clamp(20px, 4vw, 56px) 64px;
}

.topbar {
  min-height: 112px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 22px 0;
  border-bottom: 1px solid var(--border);
}

.topbar h1 {
  margin: 4px 0 0;
  font-family: "Plus Jakarta Sans", sans-serif;
  font-size: clamp(24px, 3vw, 34px);
  letter-spacing: -0.05em;
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.panel {
  display: none;
  padding-top: 32px;
}

.panel.active {
  display: block;
}

.notice {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 24px;
  padding: 16px 18px;
  border: 1px solid var(--border-active);
  border-radius: var(--radius-md);
  background: var(--lime-soft);
}

.notice strong,
.notice span {
  display: block;
}

.notice span {
  color: var(--text-muted);
  font-size: 13px;
}

.metrics-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
}

.metric-card,
.surface {
  border: 1px solid var(--border);
  background: linear-gradient(145deg, rgba(255, 255, 255, 0.035), rgba(255, 255, 255, 0.012));
}

.metric-card {
  min-height: 178px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 22px;
  border-radius: var(--radius-md);
}

.metric-card.featured {
  border-color: var(--border-active);
  background: linear-gradient(145deg, rgba(204, 255, 0, 0.13), rgba(204, 255, 0, 0.025));
}

.metric-card > span,
.metric-card small {
  color: var(--text-muted);
  font-size: 12px;
}

.metric-card strong {
  margin: 16px 0;
  font-family: "Plus Jakarta Sans", sans-serif;
  font-size: clamp(28px, 3.5vw, 42px);
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.06em;
}

.content-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.7fr) minmax(280px, 0.8fr);
  gap: 14px;
  margin-top: 14px;
}

.surface {
  border-radius: var(--radius-lg);
  overflow: hidden;
}

.surface-heading {
  min-height: 86px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 20px 24px;
  border-bottom: 1px solid var(--border);
}

.surface-heading h2,
.compact-surface h2 {
  margin: 4px 0 0;
  font-family: "Plus Jakarta Sans", sans-serif;
  font-size: 20px;
  letter-spacing: -0.04em;
}

.insight-list {
  padding: 4px 24px 12px;
}

.insight-item {
  width: 100%;
  min-height: 86px;
  display: grid;
  grid-template-columns: 36px 1fr 24px;
  align-items: center;
  gap: 14px;
  padding: 14px 0;
  border: 0;
  border-bottom: 1px solid var(--border);
  background: transparent;
  color: var(--text);
  text-align: left;
}

.insight-item:last-child {
  border-bottom: 0;
}

.insight-item:hover {
  color: var(--lime);
}

.insight-item svg {
  width: 20px;
  height: 20px;
}

.insight-index {
  color: var(--lime);
  font-size: 11px;
  font-weight: 700;
}

.insight-item strong,
.insight-item div span {
  display: block;
}

.insight-item strong {
  font-size: 14px;
}

.insight-item div span {
  margin-top: 3px;
  color: var(--text-muted);
  font-size: 12px;
}

.compact-surface {
  padding: 24px;
}

.status-list {
  margin: 30px 0 0;
}

.status-list div {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  padding: 16px 0;
  border-bottom: 1px solid var(--border);
}

.status-list dt,
.status-list dd {
  margin: 0;
  font-size: 12px;
}

.status-list dt {
  color: var(--text-muted);
}

.status-list dd {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  max-width: 56%;
  overflow-wrap: anywhere;
  text-align: right;
}

.status-list .status-dot {
  margin-top: 0;
}

.search-form {
  display: flex;
  gap: 8px;
}

input,
textarea {
  width: 100%;
  min-height: 44px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.035);
  color: var(--text);
}

input {
  min-width: 220px;
  padding: 0 14px;
}

textarea {
  resize: vertical;
  padding: 13px 14px;
}

input::placeholder,
textarea::placeholder {
  color: #6f756c;
}

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

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

th,
td {
  padding: 16px 24px;
  border-bottom: 1px solid var(--border);
  text-align: left;
  vertical-align: middle;
}

th {
  color: var(--text-muted);
  font-size: 10px;
  letter-spacing: 0.11em;
  text-transform: uppercase;
}

td {
  font-variant-numeric: tabular-nums;
}

tbody tr:hover {
  background: rgba(255, 255, 255, 0.022);
}

.table-title {
  display: block;
  max-width: 360px;
  font-weight: 600;
}

.table-subtitle {
  display: block;
  margin-top: 3px;
  color: var(--text-muted);
  font-size: 11px;
}

.badge {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 0 9px;
  border: 1px solid var(--border);
  border-radius: 99px;
  color: var(--text-muted);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.badge.success {
  border-color: var(--border-active);
  background: var(--lime-soft);
  color: var(--lime);
}

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

.icon-button {
  width: 44px;
  height: 44px;
  display: inline-grid;
  place-items: center;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.04);
  color: var(--text);
}

.icon-button svg {
  width: 22px;
  fill: currentColor;
}

.mobile-only {
  display: none;
}

.toast {
  position: fixed;
  right: 24px;
  bottom: 24px;
  z-index: 100;
  max-width: min(380px, calc(100vw - 48px));
  padding: 14px 16px;
  border: 1px solid var(--border-active);
  border-radius: var(--radius-sm);
  background: #111511;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5);
  font-size: 13px;
}

@media (max-width: 1120px) {
  .metrics-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

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

@media (max-width: 820px) {
  .sidebar {
    transform: translateX(-105%);
    transition: transform 220ms ease;
  }

  .sidebar.open {
    transform: translateX(0);
  }

  .main-content {
    margin-left: 0;
  }

  .mobile-only {
    display: inline-grid;
  }

  .topbar {
    justify-content: flex-start;
  }

  .topbar-actions {
    margin-left: auto;
  }
}

@media (max-width: 600px) {
  .main-content {
    padding-inline: 16px;
  }

  .topbar {
    min-height: 96px;
    gap: 12px;
  }

  .topbar .eyebrow,
  #store-link {
    display: none;
  }

  .topbar h1 {
    font-size: 22px;
  }

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

  .metric-card {
    min-height: 150px;
  }

  .notice,
  .responsive-heading {
    align-items: stretch;
    flex-direction: column;
  }

  .search-form {
    width: 100%;
  }

  .search-form input {
    min-width: 0;
  }

  th,
  td {
    padding-inline: 16px;
  }

}

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