/* Project52 Developer Handbook — internal tool
   Distinct mono + display pair; no purple/cream AI defaults. */
@import url("https://fonts.googleapis.com/css2?family=IBM+Plex+Mono:wght@400;500;600&family=Syne:wght@600;700;800&display=swap");

:root {
  --bg0: #0a0e0c;
  --bg1: #121a16;
  --panel: #162019;
  --panel-2: #1c2921;
  --line: #2a3d32;
  --text: #e8f0ea;
  --muted: #8aa394;
  --accent: #c4f542; /* acid chartreuse — tool, not product */
  --accent-2: #3ecf8e;
  --warn: #f0b429;
  --bad: #ff6b4a;
  --ok: #3ecf8e;
  --partial: #f0b429;
  --stub: #ff6b4a;
  --info: #6ec8ff;
  --mono: "IBM Plex Mono", ui-monospace, monospace;
  --display: "Syne", "Avenir Next", sans-serif;
  --radius: 10px;
  --shadow: 0 12px 40px rgba(0, 0, 0, 0.35);
}

* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
body {
  font-family: var(--mono);
  font-size: 13.5px;
  color: var(--text);
  background:
    radial-gradient(900px 500px at 85% -10%, #1a3328 0%, transparent 55%),
    radial-gradient(700px 400px at -5% 40%, #142018 0%, transparent 50%),
    linear-gradient(165deg, var(--bg0), var(--bg1) 40%, #0d1410);
  line-height: 1.45;
}

a { color: var(--accent-2); text-decoration: none; }
a:hover { color: var(--accent); text-decoration: underline; }

.app-shell {
  display: grid;
  grid-template-columns: 240px 1fr;
  min-height: 100vh;
}

/* Sidebar */
.side {
  border-right: 1px solid var(--line);
  background: rgba(10, 14, 12, 0.85);
  padding: 1.25rem 1rem 2rem;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow: auto;
}
.brand {
  font-family: var(--display);
  font-weight: 800;
  font-size: 1.35rem;
  letter-spacing: -0.03em;
  line-height: 1.15;
  margin: 0 0 0.35rem;
}
.brand span { color: var(--accent); }
.brand-sub {
  color: var(--muted);
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 1.25rem;
}
.badge-dev {
  display: inline-block;
  border: 1px solid var(--warn);
  color: var(--warn);
  padding: 0.15rem 0.45rem;
  border-radius: 4px;
  font-size: 0.68rem;
  letter-spacing: 0.06em;
  margin-bottom: 1rem;
}
.nav-btn {
  display: block;
  width: 100%;
  text-align: left;
  background: transparent;
  border: 1px solid transparent;
  color: var(--text);
  font-family: var(--mono);
  font-size: 0.8rem;
  padding: 0.55rem 0.65rem;
  border-radius: 6px;
  cursor: pointer;
  margin-bottom: 0.25rem;
}
.nav-btn:hover { background: var(--panel); border-color: var(--line); }
.nav-btn.active {
  background: var(--panel-2);
  border-color: var(--accent);
  color: var(--accent);
}
.side-meta {
  margin-top: 1.5rem;
  padding-top: 1rem;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.7rem;
}
.side-meta code { color: var(--info); font-size: 0.68rem; }

/* Main */
.main { padding: 1.5rem 1.75rem 3rem; max-width: 1280px; }
.view { display: none; animation: fade 0.28s ease; }
.view.active { display: block; }
@keyframes fade {
  from { opacity: 0; transform: translateY(4px); }
  to { opacity: 1; transform: none; }
}

.view-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 1.25rem;
}
.view-head h1 {
  font-family: var(--display);
  font-size: 1.65rem;
  font-weight: 700;
  margin: 0;
  letter-spacing: -0.02em;
}
.view-head p { margin: 0.35rem 0 0; color: var(--muted); max-width: 52rem; }

.chip-row { display: flex; flex-wrap: wrap; gap: 0.4rem; }
.chip {
  border: 1px solid var(--line);
  background: var(--panel);
  border-radius: 999px;
  padding: 0.2rem 0.65rem;
  font-size: 0.7rem;
  color: var(--muted);
}
.chip.ok { border-color: var(--ok); color: var(--ok); }
.chip.warn { border-color: var(--warn); color: var(--warn); }
.chip.bad { border-color: var(--bad); color: var(--bad); }
.chip.info { border-color: var(--info); color: var(--info); }

.grid-2 {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 1rem;
}
.grid-3 {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.75rem;
}
@media (max-width: 980px) {
  .app-shell { grid-template-columns: 1fr; }
  .side { position: relative; height: auto; }
  .grid-2, .grid-3 { grid-template-columns: 1fr; }
}

.panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1rem 1.1rem;
  box-shadow: var(--shadow);
}
.panel h2 {
  font-family: var(--display);
  font-size: 1.05rem;
  margin: 0 0 0.75rem;
  font-weight: 700;
}
.panel h3 {
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
  margin: 1rem 0 0.45rem;
}

.verdict {
  font-size: 0.9rem;
  border-left: 3px solid var(--accent);
  padding: 0.65rem 0.85rem;
  background: var(--panel-2);
  border-radius: 0 8px 8px 0;
  margin-bottom: 1rem;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.78rem;
}
th, td {
  text-align: left;
  padding: 0.45rem 0.4rem;
  border-bottom: 1px solid var(--line);
  vertical-align: top;
}
th { color: var(--muted); font-weight: 600; }

.status {
  display: inline-block;
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  padding: 0.12rem 0.4rem;
  border-radius: 4px;
  border: 1px solid;
}
.status.DONE, .status.pass, .status.ok { color: var(--ok); border-color: var(--ok); }
.status.STUB, .status.FAIL, .status.fail, .status.bad, .status.NOT_DONE { color: var(--bad); border-color: var(--bad); }
.status.PARTIAL, .status.partial, .status.partial_pass, .status.warn { color: var(--warn); border-color: var(--warn); }
.status.catalogued, .status.not_probed, .status.info { color: var(--info); border-color: var(--info); }

.score-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.5rem;
  margin-bottom: 1rem;
}
.score-card {
  background: var(--panel-2);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0.75rem;
  text-align: center;
}
.score-card .k { color: var(--muted); font-size: 0.65rem; letter-spacing: 0.08em; text-transform: uppercase; }
.score-card .v { font-family: var(--display); font-size: 1.15rem; margin-top: 0.25rem; font-weight: 700; }

/* Features / modules cards */
.card-list { display: grid; gap: 0.65rem; }
.fcard {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 0.85rem 1rem;
  cursor: pointer;
  transition: border-color 0.15s, transform 0.15s;
}
.fcard:hover { border-color: var(--accent-2); transform: translateY(-1px); }
.fcard .top { display: flex; justify-content: space-between; gap: 0.5rem; align-items: baseline; }
.fcard .id { color: var(--accent); font-size: 0.75rem; }
.fcard .title { font-family: var(--display); font-weight: 700; font-size: 1rem; margin: 0.25rem 0; }
.fcard .meta { color: var(--muted); font-size: 0.72rem; }
.tags { display: flex; flex-wrap: wrap; gap: 0.3rem; margin-top: 0.5rem; }
.tag {
  background: var(--bg0);
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: 0.1rem 0.35rem;
  font-size: 0.65rem;
  color: var(--muted);
}

.detail {
  margin-top: 0.75rem;
  padding-top: 0.75rem;
  border-top: 1px dashed var(--line);
  display: none;
}
.fcard.open .detail { display: block; }

/* Graph */
#cy {
  width: 100%;
  height: min(62vh, 560px);
  background:
    linear-gradient(rgba(42, 61, 50, 0.35) 1px, transparent 1px),
    linear-gradient(90deg, rgba(42, 61, 50, 0.35) 1px, transparent 1px),
    var(--bg0);
  background-size: 24px 24px, 24px 24px, auto;
  border: 1px solid var(--line);
  border-radius: var(--radius);
}
.graph-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 0.65rem;
  align-items: center;
}
.graph-toolbar button {
  font-family: var(--mono);
  font-size: 0.72rem;
  background: var(--panel-2);
  color: var(--text);
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 0.35rem 0.65rem;
  cursor: pointer;
}
.graph-toolbar button:hover { border-color: var(--accent); color: var(--accent); }
.legend-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 0.4rem;
  margin-top: 0.75rem;
  font-size: 0.72rem;
}
.legend-item {
  display: flex; align-items: center; gap: 0.4rem;
  color: var(--muted);
}
.swatch {
  width: 10px; height: 10px; border-radius: 2px; flex-shrink: 0;
}

/* Events */
.filters {
  display: flex; gap: 0.5rem; flex-wrap: wrap; margin-bottom: 0.85rem;
}
.filters input, .filters select {
  font-family: var(--mono);
  background: var(--bg0);
  border: 1px solid var(--line);
  color: var(--text);
  border-radius: 6px;
  padding: 0.4rem 0.55rem;
  font-size: 0.78rem;
}
.filters input { min-width: 220px; flex: 1; }

.layer-cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 0.75rem;
}
.layer-card {
  border: 1px solid var(--line);
  background: var(--panel);
  border-radius: var(--radius);
  padding: 0.9rem;
  position: relative;
  overflow: hidden;
}
.layer-card::before {
  content: "";
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 4px;
  background: var(--accent);
}
.layer-card .lid {
  font-family: var(--display);
  font-size: 1.4rem;
  font-weight: 800;
  color: var(--accent);
}
.layer-card .lname { font-weight: 600; margin: 0.2rem 0; }
.layer-card .ltech { color: var(--info); font-size: 0.72rem; }
.layer-card .lrole { color: var(--muted); font-size: 0.72rem; margin-top: 0.45rem; }

.guide-block {
  margin-top: 1rem;
  padding: 0.85rem 1rem;
  border: 1px dashed var(--line);
  border-radius: var(--radius);
  background: rgba(196, 245, 66, 0.04);
}
.guide-block pre {
  margin: 0.5rem 0 0;
  overflow: auto;
  font-size: 0.72rem;
  background: var(--bg0);
  padding: 0.65rem;
  border-radius: 6px;
  border: 1px solid var(--line);
}

.empty {
  color: var(--muted);
  padding: 1.5rem;
  text-align: center;
  border: 1px dashed var(--line);
  border-radius: var(--radius);
}

.footer-note {
  margin-top: 2rem;
  color: var(--muted);
  font-size: 0.68rem;
  border-top: 1px solid var(--line);
  padding-top: 0.75rem;
}
