:root {
  --ink: #101010;
  --ink-2: #2b2f36;
  --muted: #6b7280;
  --line: #e5e7eb;
  --line-2: #f0f1f3;
  --paper: #f7f8fa;
  --card: #ffffff;
  --blue: #0b3c91;
  --blue-2: #1f6feb;
  --blue-soft: #eaf1ff;
  --ok: #0f8a4b;
  --warn: #a15c00;
  --danger: #c0392b;
  --shadow: 0 8px 24px rgba(16, 16, 16, 0.06);
  --radius: 12px;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: Satoshi, ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  background: var(--paper);
  color: var(--ink);
  min-height: 100vh;
  letter-spacing: -0.01em;
}
a { color: var(--blue); }

/* ------------------------------------------------------------------ chrome */

.topbar {
  background: var(--ink);
  color: #fff;
  display: flex;
  align-items: center;
  gap: 28px;
  padding: 0 28px;
  height: 62px;
  position: sticky;
  top: 0;
  z-index: 20;
}
.topbar .brand {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  color: #fff;
}
.topbar .brand img { height: 20px; width: auto; display: block; }
.topbar .brand span {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: #9aa3af;
  border-left: 1px solid #3a3f47;
  padding-left: 12px;
}
.topnav { display: flex; gap: 6px; margin-left: 8px; }
.topnav a {
  color: #c9ced6;
  text-decoration: none;
  font-size: 14px;
  font-weight: 500;
  padding: 8px 14px;
  border-radius: 8px;
}
.topnav a:hover { background: #1b1f25; color: #fff; }
.topnav a.active { background: var(--blue-2); color: #fff; }
.topbar-right { margin-left: auto; display: flex; align-items: center; gap: 14px; }
.topbar-right form { margin: 0; }
.env-pill {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: #ffd479;
  border: 1px solid #6b5a2a;
  border-radius: 999px;
  padding: 4px 10px;
}
.link-button {
  background: none;
  border: 1px solid #3a3f47;
  color: #c9ced6;
  border-radius: 8px;
  padding: 7px 12px;
  font: inherit;
  font-size: 13px;
  cursor: pointer;
}
.link-button:hover { border-color: #6b7280; color: #fff; }

.main { padding: 26px 28px 60px; max-width: 1560px; margin: 0 auto; }

.page-head { margin-bottom: 18px; }
.page-head h1 { font-size: 26px; margin: 0 0 6px; letter-spacing: -0.02em; }
.page-head p { margin: 0; color: var(--muted); font-size: 14px; max-width: 900px; }

.notice {
  background: var(--blue-soft);
  border: 1px solid #cfe0ff;
  color: #123a7a;
  border-radius: var(--radius);
  padding: 12px 14px;
  font-size: 14px;
  margin-bottom: 16px;
}

.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}
.card-pad { padding: 18px 20px; }

/* ----------------------------------------------------------------- console */

.console { display: grid; gap: 16px; margin-bottom: 22px; }

.controls { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.controls form { margin: 0; }
.btn {
  font: inherit;
  font-weight: 700;
  font-size: 14px;
  border-radius: 10px;
  padding: 11px 18px;
  border: 1px solid transparent;
  cursor: pointer;
  text-decoration: none;
  display: inline-block;
}
.btn-primary { background: var(--blue-2); color: #fff; }
.btn-primary:hover { background: #1a5fd0; }
.btn-dark { background: var(--ink); color: #fff; }
.btn-dark:hover { background: #24282e; }
.btn-ghost { background: #fff; color: var(--ink); border-color: var(--line); }
.btn-ghost:hover { border-color: var(--muted); }
.btn:disabled { opacity: 0.45; cursor: not-allowed; }
.btn-small { padding: 7px 12px; font-size: 13px; font-weight: 600; }

.progress-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 24px;
  align-items: start;
}
.progress-label {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  font-size: 13px;
  color: var(--muted);
  margin-bottom: 8px;
}
.progress-label strong { color: var(--ink); font-size: 15px; }
.bar {
  height: 12px;
  background: var(--line-2);
  border: 1px solid var(--line);
  border-radius: 999px;
  overflow: hidden;
}
.bar-fill {
  height: 100%;
  width: 0;
  background: linear-gradient(90deg, var(--blue), var(--blue-2));
  transition: width 0.5s ease;
}
.bar-fill.running { animation: pulse 1.8s ease-in-out infinite; }
@keyframes pulse { 50% { opacity: 0.72; } }

.activity {
  margin-top: 12px;
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-size: 14px;
  color: var(--ink-2);
}
.activity .dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--muted);
  margin-top: 5px;
  flex: 0 0 auto;
}
.activity.live .dot { background: var(--blue-2); animation: pulse 1.4s ease-in-out infinite; }

.counters { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }
.chip {
  font-size: 12px;
  background: var(--blue-soft);
  border: 1px solid #d8e6ff;
  color: #123a7a;
  border-radius: 999px;
  padding: 5px 11px;
}
.chip.plain { background: #f4f5f7; border-color: var(--line); color: var(--ink-2); }

.stat-row { display: flex; flex-wrap: wrap; gap: 26px; }
.stat .k { font-size: 11px; text-transform: uppercase; letter-spacing: 0.11em; color: var(--muted); }
.stat .v { font-size: 19px; font-weight: 700; }

/* ------------------------------------------------------------------ tables */

.table-wrap { overflow-x: auto; }
table.grid { width: 100%; border-collapse: collapse; font-size: 14px; }
table.grid th, table.grid td {
  padding: 12px 12px;
  border-bottom: 1px solid var(--line-2);
  text-align: left;
  vertical-align: top;
}
table.grid thead th {
  background: #fff;
  border-bottom: 1px solid var(--line);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.09em;
  color: var(--muted);
  font-weight: 700;
  white-space: nowrap;
}
table.grid tbody tr:hover { background: #fbfcfe; }
table.grid td.num { text-align: right; white-space: nowrap; }
.rank { color: var(--muted); font-variant-numeric: tabular-nums; }
.company { font-weight: 700; }
.company a { color: var(--ink); text-decoration: none; }
.company a:hover { color: var(--blue-2); text-decoration: underline; }
.company .meta { display: block; font-weight: 500; font-size: 12px; color: var(--muted); margin-top: 3px; }

.score { font-weight: 700; font-variant-numeric: tabular-nums; }
.score-cell { display: flex; align-items: center; gap: 8px; justify-content: flex-end; }
.score-bar { width: 46px; height: 6px; background: var(--line-2); border-radius: 999px; overflow: hidden; }
.score-bar i { display: block; height: 100%; background: var(--blue-2); }
.cumulative { font-size: 17px; font-weight: 900; color: var(--blue); }
.evidence { min-width: 200px; max-width: 300px; color: var(--ink-2); line-height: 1.45; }

.contact-list { display: grid; gap: 6px; min-width: 220px; }
.contact {
  display: block;
  text-decoration: none;
  color: var(--ink);
  border-left: 2px solid var(--blue-2);
  padding-left: 9px;
  line-height: 1.35;
}
.contact:hover .name { color: var(--blue-2); text-decoration: underline; }
.contact .name { font-weight: 600; font-size: 13px; }
.contact .role { display: block; font-size: 12px; color: var(--muted); }
.contact .fn {
  display: inline-block;
  margin-top: 2px;
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--blue);
  background: var(--blue-soft);
  border-radius: 4px;
  padding: 2px 6px;
}
.contact-empty { font-size: 13px; color: var(--muted); }

.deck-cell { display: grid; gap: 6px; justify-items: start; min-width: 140px; }
.deck-status { font-size: 12px; color: var(--muted); }
.deck-status.building { color: var(--warn); }
.deck-status.failed { color: var(--danger); }

.reviews { margin-top: 16px; border-top: 1px solid var(--line-2); padding-top: 14px; }
.reviews .k {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.11em;
  color: var(--muted);
  margin-bottom: 10px;
}
.review { margin-bottom: 12px; display: flex; flex-wrap: wrap; gap: 8px; align-items: baseline; }
.review p { margin: 0; flex: 1 1 100%; font-size: 13px; color: var(--ink-2); line-height: 1.5; }
.review p.muted { color: var(--muted); font-size: 12px; }
.review ul { margin: 0; flex: 1 1 100%; padding-left: 18px; font-size: 12px; color: var(--muted); }
.review ul li { margin: 2px 0; }

.empty {
  text-align: center;
  padding: 54px 20px;
  color: var(--muted);
}
.empty h2 { color: var(--ink); font-size: 19px; margin: 0 0 8px; }
.empty p { margin: 0 auto 6px; max-width: 620px; font-size: 14px; }

/* ------------------------------------------------------------------- leads */

.lead-groups { display: grid; gap: 16px; }
.lead-card { padding: 18px 20px; }
.lead-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  border-bottom: 1px solid var(--line-2);
  padding-bottom: 12px;
  margin-bottom: 14px;
}
.lead-head h2 { margin: 0; font-size: 18px; }
.lead-head h2 .rank { font-size: 13px; margin-right: 8px; }
.lead-head .scores { font-size: 13px; color: var(--muted); }
.lead-head .scores b { color: var(--blue); }
.people { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 12px; }
.person {
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 13px 14px;
  display: grid;
  gap: 5px;
  text-decoration: none;
  color: inherit;
  background: #fff;
}
.person:hover { border-color: var(--blue-2); box-shadow: 0 4px 14px rgba(31, 111, 235, 0.12); }
.person .fn { justify-self: start; }
.person .name { font-weight: 700; font-size: 15px; }
.person .role { font-size: 13px; color: var(--ink-2); line-height: 1.4; }
.person .url { font-size: 12px; color: var(--blue-2); word-break: break-all; }
.person .snippet { font-size: 12px; color: var(--muted); line-height: 1.45; }

/* ----------------------------------------------------------------- account */

.detail-grid { display: grid; grid-template-columns: minmax(0, 2fr) minmax(280px, 1fr); gap: 18px; }
.event {
  border-bottom: 1px solid var(--line-2);
  padding: 14px 0;
}
.event:last-child { border-bottom: 0; }
.event .top { display: flex; gap: 10px; align-items: baseline; flex-wrap: wrap; }
.event .date { font-variant-numeric: tabular-nums; font-weight: 700; font-size: 13px; }
.event .tag {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  background: var(--blue-soft);
  color: var(--blue);
  border-radius: 4px;
  padding: 2px 6px;
}
.event .tag.tier { background: #f4f5f7; color: var(--ink-2); }
.event h3 { margin: 6px 0 4px; font-size: 15px; }
.event p { margin: 0 0 6px; font-size: 13px; color: var(--ink-2); line-height: 1.5; }
.event .src { font-size: 12px; color: var(--muted); }

/* ------------------------------------------------------------------- login */

.login-wrap {
  min-height: 100vh;
  display: grid;
  place-items: center;
  background: var(--ink);
  padding: 24px;
}
.login-card {
  width: 100%;
  max-width: 380px;
  background: #fff;
  border-radius: 16px;
  padding: 32px;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.4);
}
.login-card img { height: 22px; margin-bottom: 22px; }
.login-card h1 { font-size: 20px; margin: 0 0 6px; }
.login-card p.sub { margin: 0 0 22px; color: var(--muted); font-size: 13px; }
.field { display: grid; gap: 6px; margin-bottom: 14px; }
.field label { font-size: 12px; font-weight: 600; color: var(--ink-2); }
.field input {
  font: inherit;
  padding: 11px 12px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: #fff;
}
.field input:focus { outline: 2px solid var(--blue-2); outline-offset: 1px; border-color: var(--blue-2); }
.login-error {
  background: #fdeceb;
  border: 1px solid #f6c9c4;
  color: var(--danger);
  border-radius: 9px;
  padding: 10px 12px;
  font-size: 13px;
  margin-bottom: 16px;
}
.login-card .btn { width: 100%; margin-top: 6px; }

@media (max-width: 1080px) {
  .progress-row { grid-template-columns: 1fr; }
  .detail-grid { grid-template-columns: 1fr; }
}
