/* =========================================================================
   DragonFlyBSD kernel audit — static viewer
   Dark security-tool theme
   ========================================================================= */

:root {
  --bg:        #0a0d12;
  --bg-2:      #0f141b;
  --panel:     #141a23;
  --panel-2:   #1a212c;
  --border:    #232c3a;
  --border-2:  #2e3949;
  --text:      #d6dde8;
  --text-dim:  #9aa5b6;
  --muted:     #6b7689;
  --accent:    #5ad8c0;
  --accent-2:  #4a9eff;
  --danger:    #ff3860;
  --warn:      #ffcf21;
  --ok:        #3ad07a;
  --mono:      "JetBrains Mono", "Fira Code", "SF Mono", "Cascadia Code",
               Menlo, Consolas, "Liberation Mono", monospace;
  --sans:      "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI",
               Roboto, Helvetica, Arial, sans-serif;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  font-size: 14.5px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

body {
  background:
    radial-gradient(1200px 600px at 85% -10%, rgba(90,216,192,.05), transparent 60%),
    radial-gradient(900px 500px at -5% 110%, rgba(74,158,255,.05), transparent 60%),
    var(--bg);
  min-height: 100vh;
}

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

.mono { font-family: var(--mono); }
.small { font-size: 12px; }
.muted { color: var(--muted) !important; }
.hash { color: var(--text-dim); word-break: break-all; }
.hidden { display: none !important; }

code, pre { font-family: var(--mono); }

code {
  background: rgba(255,255,255,.06);
  padding: 1px 5px;
  border-radius: 4px;
  font-size: .9em;
  color: #e6c07b;
}
pre { margin: 0; }

/* ---- top bar ---- */
.topbar {
  display: flex;
  align-items: center;
  gap: 28px;
  padding: 0 28px;
  height: 58px;
  background: rgba(10,13,18,.85);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 50;
}
.brand {
  display: flex; align-items: center; gap: 10px;
  font-weight: 700; color: var(--text);
}
.brand:hover { text-decoration: none; }
.brand-mark {
  color: var(--accent);
  font-size: 22px;
  filter: drop-shadow(0 0 8px rgba(90,216,192,.35));
}
.brand-name { letter-spacing: .2px; font-size: 14px; }

.nav { display: flex; gap: 4px; }
.nav-item {
  color: var(--text-dim);
  padding: 7px 13px;
  border-radius: 7px;
  font-size: 13.5px;
  font-weight: 500;
}
.nav-item:hover { background: var(--panel); color: var(--text); text-decoration: none; }
.nav-item.active { color: var(--accent); background: rgba(90,216,192,.09); }

/* ---- layout ---- */
.container {
  max-width: 1280px;
  margin: 0 auto;
  padding: 28px;
}
.page-head {
  display: flex; align-items: baseline; gap: 16px;
  margin-bottom: 18px;
}
.page-head h1 { margin: 0; font-size: 26px; }
.page-sub { margin-bottom: 16px; }
.page-sub a { color: var(--text-dim); }

.hero {
  display: flex; justify-content: space-between; align-items: flex-end;
  gap: 28px; margin-bottom: 26px;
}
.hero h1 { margin: 0 0 8px; font-size: 30px; letter-spacing: -.5px; }
.lede { color: var(--text-dim); margin: 0; max-width: 760px; }
.lede code { color: var(--accent); }
.hero-stat { text-align: center; padding: 6px 22px; border-left: 1px solid var(--border); }
.stat-num { font-family: var(--mono); font-size: 44px; font-weight: 700; line-height: 1; }
.stat-label { color: var(--muted); font-size: 12px; text-transform: uppercase; letter-spacing: 1px; }

.grid { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; margin-bottom: 18px; }
.grid-2 { margin-top: 18px; }
@media (max-width: 920px) {
  .grid { grid-template-columns: 1fr; }
  .hero { flex-direction: column; align-items: flex-start; }
  .hero-stat { border-left: none; border-top: 1px solid var(--border); padding-top: 10px; }
}

.layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 320px;
  gap: 20px;
}
@media (max-width: 980px) { .layout { grid-template-columns: 1fr; } }

.main-col { min-width: 0; }
.side-col { min-width: 0; }

/* ---- cards ---- */
.card {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 18px 20px;
  margin-bottom: 18px;
  box-shadow: 0 1px 0 rgba(0,0,0,.2);
}
.card.no-pad { padding: 0; }
.card.pad { padding: 16px 20px 0; }
.card h2 {
  margin: 0 0 14px; font-size: 16px; font-weight: 600;
  letter-spacing: .2px;
}
.card-head {
  display: flex; justify-content: space-between; align-items: center;
  margin-bottom: 14px;
}
.card-head h2 { margin: 0; }
.card-total { margin-top: 12px; font-size: 12.5px; color: var(--muted); }
.link { font-size: 12.5px; color: var(--accent-2); }

.muted-card { opacity: .82; }

/* ---- badges ---- */
.badge {
  display: inline-block;
  padding: 2px 9px;
  border-radius: 999px;
  font-size: 11.5px;
  font-weight: 600;
  font-family: var(--mono);
  color: #0a0d12;
  background: var(--muted);
  white-space: nowrap;
  line-height: 1.5;
  vertical-align: middle;
}
.badge.ghost { background: transparent; color: var(--text-dim); border: 1px solid var(--border-2); }
.badge.sev  { letter-spacing: .3px; }
.badge.tag  { background: rgba(255,255,255,.07); color: var(--text-dim); }

/* ---- bars / progress ---- */
.bar-row, .prog-row {
  display: grid;
  grid-template-columns: 78px 1fr 70px;
  align-items: center;
  gap: 10px;
  margin: 6px 0;
}
.bar-label { font-family: var(--mono); font-size: 12px; font-weight: 600; }
.bar-count { font-family: var(--mono); font-size: 12px; text-align: right; color: var(--text-dim); }
.prog-name { font-family: var(--mono); font-size: 12.5px; color: var(--text); }
.prog-count { font-family: var(--mono); font-size: 11.5px; text-align: right; color: var(--muted); }
.bar {
  height: 7px;
  background: var(--bg-2);
  border-radius: 999px;
  overflow: hidden;
  border: 1px solid var(--border);
}
.bar-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
  border-radius: 999px;
  transition: width .4s ease;
}
.prog-overall { margin-bottom: 14px; }
.prog-overall .bar { height: 9px; }
.prog-overall .muted { display: block; margin-top: 5px; }

/* ---- tables ---- */
.tbl { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.tbl thead th {
  text-align: left;
  font-weight: 600;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: .5px;
  font-size: 11px;
  padding: 11px 14px;
  border-bottom: 1px solid var(--border);
  background: var(--bg-2);
}
.tbl tbody td { padding: 10px 14px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.tbl tbody tr:last-child td { border-bottom: none; }
.tbl tbody tr:hover { background: rgba(255,255,255,.025); }
.tbl tbody td.cell-title a { color: var(--text); font-weight: 500; }
.tbl tbody td.cell-title a:hover { color: var(--accent); text-decoration: none; }
.row-sub { color: var(--muted); margin-top: 2px; }

.tbl-grid thead th:first-child,
.tbl-grid tbody td:first-child { padding-left: 20px; }
.tbl-grid thead th:last-child,
.tbl-grid tbody td:last-child { padding-right: 20px; }

/* ---- metadata ---- */
.meta {
  display: grid;
  grid-template-columns: 96px 1fr;
  gap: 6px 14px;
  margin: 0;
}
.meta dt { color: var(--muted); font-size: 11.5px; text-transform: uppercase; letter-spacing: .4px; align-self: center; }
.meta dd { margin: 0; font-size: 13px; word-break: break-word; }
.meta dd .mono { font-size: 12px; color: var(--text-dim); }

/* ---- poc card / kv ---- */
.poc-card .card-head { margin-bottom: 12px; }
.kv {
  display: flex; justify-content: space-between; align-items: center;
  padding: 5px 0;
  border-bottom: 1px dashed var(--border);
  font-size: 13px;
}
.kv:last-of-type { border-bottom: none; }
.kv span { color: var(--muted); }
.kv b { font-weight: 600; }
.verdict-excerpt { margin: 12px 0 0; color: var(--text-dim); font-size: 13px; line-height: 1.5; }

/* ---- finding head ---- */
.finding-head { display: flex; align-items: center; gap: 14px; margin-bottom: 6px; flex-wrap: wrap; }
.finding-head h1 { margin: 0; font-size: 24px; line-height: 1.25; }
.fid {
  font-family: var(--mono);
  font-size: 13px;
  font-weight: 700;
  color: var(--accent);
  background: rgba(90,216,192,.1);
  border: 1px solid rgba(90,216,192,.3);
  padding: 4px 11px;
  border-radius: 7px;
  white-space: nowrap;
}

/* ---- buttons ---- */
.btn {
  display: inline-block;
  padding: 7px 14px;
  border-radius: 7px;
  background: var(--accent);
  color: #06120f !important;
  font-size: 13px;
  font-weight: 600;
  border: 1px solid transparent;
  transition: filter .15s;
}
.btn:hover { filter: brightness(1.1); text-decoration: none; }
.btn.sm { padding: 4px 10px; font-size: 12px; }
.btn.ghost { background: transparent; color: var(--text-dim) !important; border-color: var(--border-2); }
.btn.ghost:hover { border-color: var(--accent); color: var(--accent) !important; }

/* ---- toolbar / filters ---- */
.toolbar {
  display: flex; justify-content: space-between; align-items: center;
  gap: 18px; flex-wrap: wrap;
  margin-bottom: 16px;
}
.search { flex: 1; min-width: 260px; position: relative; }
#search {
  width: 100%;
  background: var(--bg-2);
  border: 1px solid var(--border-2);
  color: var(--text);
  padding: 10px 14px;
  border-radius: 8px;
  font-size: 14px;
  font-family: var(--sans);
  outline: none;
}
#search:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(90,216,192,.12); }
#search-count { position: absolute; right: 12px; top: 50%; transform: translateY(-50%); }
.filters { display: flex; gap: 10px; flex-wrap: wrap; }
.filters label { display: flex; flex-direction: column; font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: .4px; gap: 4px; }
.filters select {
  background: var(--bg-2);
  border: 1px solid var(--border-2);
  color: var(--text);
  padding: 7px 10px;
  border-radius: 7px;
  font-size: 13px;
  font-family: var(--sans);
  outline: none;
  text-transform: none;
  letter-spacing: 0;
}
.filters select:focus { border-color: var(--accent); }

.empty { padding: 50px 20px; text-align: center; color: var(--muted); }

/* ---- grouped findings ---- */
.group { margin-bottom: 30px; }
.group-head { display: flex; align-items: center; gap: 12px; margin: 4px 0 6px; }
.group-head h2 {
  margin: 0; font-size: 17px; font-weight: 600;
  display: flex; align-items: center; gap: 10px;
}
.group-head .count,
.count {
  font-family: var(--mono); font-size: 12.5px; font-weight: 700;
  background: rgba(255,255,255,.08); color: var(--text-dim);
  padding: 2px 9px; border-radius: 999px;
}
.group[data-group="reproduced"] .group-head h2 { color: var(--ok); }
.group[data-group="reproduced"] .group-head .count { background: rgba(58,208,122,.16); color: var(--ok); }
.group[data-group="notreproduced"] .group-head h2 { color: #ff7a1a; }
.group[data-group="notreproduced"] .group-head .count { background: rgba(255,122,26,.16); color: #ff7a1a; }
.group[data-group="unverified"] .group-head h2 { color: var(--text-dim); }
.group-desc {
  color: var(--text-dim); font-size: 13px; line-height: 1.55;
  margin: 0 0 12px; max-width: 860px;
}

/* ---- prose (rendered markdown) ---- */
.prose { font-size: 14.5px; line-height: 1.65; }
.prose h1, .prose h2, .prose h3, .prose h4 { color: var(--text); line-height: 1.3; margin: 22px 0 10px; }
.prose h1 { font-size: 21px; padding-bottom: 6px; border-bottom: 1px solid var(--border); }
.prose h2 { font-size: 18px; }
.prose h3 { font-size: 15.5px; color: var(--accent); }
.prose h4 { font-size: 14px; color: var(--text-dim); text-transform: uppercase; letter-spacing: .5px; }
.prose p { margin: 10px 0; }
.prose ul, .prose ol { margin: 10px 0; padding-left: 22px; }
.prose li { margin: 4px 0; }
.prose strong { color: #fff; }
.prose blockquote {
  margin: 12px 0;
  padding: 4px 16px;
  border-left: 3px solid var(--accent-2);
  background: rgba(74,158,255,.06);
  color: var(--text-dim);
  border-radius: 0 6px 6px 0;
}
.prose hr { border: none; border-top: 1px solid var(--border); margin: 22px 0; }

.prose table {
  border-collapse: collapse;
  width: 100%;
  margin: 14px 0;
  font-size: 13px;
  display: block;
  overflow-x: auto;
}
.prose thead th {
  background: var(--bg-2);
  color: var(--text);
  padding: 8px 12px;
  border: 1px solid var(--border);
  text-align: left;
  white-space: nowrap;
}
.prose tbody td {
  padding: 7px 12px;
  border: 1px solid var(--border);
  vertical-align: top;
}
.prose tbody tr:nth-child(even) { background: rgba(255,255,255,.015); }

/* code blocks (from pygments noclasses) */
.prose .highlight,
.source-view .highlight,
.codehilite {
  border-radius: 8px;
  overflow: auto;
  margin: 12px 0;
  border: 1px solid var(--border);
}
.codehilite pre { padding: 12px 14px; }

.cite {
  color: var(--accent-2);
  border-bottom: 1px dotted var(--accent-2);
}
.cite:hover { background: rgba(74,158,255,.1); text-decoration: none; }

.cite-list { list-style: none; padding: 0; margin: 0; }
.cite-list li {
  font-family: var(--mono);
  font-size: 12.5px;
  padding: 5px 8px;
  border-radius: 5px;
}
.cite-list li:hover { background: var(--bg-2); }

/* ---- evidence / source views ---- */
.evidence-block {
  background: #0b0f15;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 12px 14px;
  font-size: 12.5px;
  color: #b8e0a8;
  overflow: auto;
  white-space: pre-wrap;
  word-break: break-word;
}

.source-view { padding: 0; overflow: hidden; }
.source-view .highlight { margin: 0; border: none; border-radius: 0; }
.source-view table.highlighttable { width: 100%; border-collapse: collapse; }
.source-view .linenos {
  background: var(--bg-2);
  border-right: 1px solid var(--border);
  padding: 0 8px;
  user-select: none;
  vertical-align: top;
}
.source-view .linenos a { color: var(--muted); text-decoration: none; }
.source-view .linenos a:hover { color: var(--accent); }
.source-view .linenodiv pre { font-size: 12px; line-height: 1.5; }
.source-view .code { width: 100%; }
.source-view .code pre { font-size: 12.5px; line-height: 1.5; padding: 0 14px; }
.source-view :target {
  background: rgba(255,207,33,.15);
  box-shadow: -14px 0 0 0 rgba(255,207,33,.15);
}

.artifact-actions, .source-actions {
  display: flex; gap: 10px; margin: 4px 0 14px;
}

/* ---- inline evidence-pack artifacts ---- */
.meta.meta-wide {
  grid-template-columns: repeat(3, 104px 1fr);
}
@media (max-width: 720px) { .meta.meta-wide { grid-template-columns: 96px 1fr; } }

.artifact-list { margin-top: 18px; }
.artifact-inline { padding: 0; overflow: hidden; }
.md-inline { padding: 0; }
.md-inline .md-prose { padding: 16px 20px; }
.md-inline .artifact-head { position: relative; top: auto; }
.artifact-head {
  display: flex; justify-content: space-between; align-items: center;
  gap: 12px; flex-wrap: wrap;
  padding: 11px 18px;
  background: var(--bg-2);
  border-bottom: 1px solid var(--border);
  position: sticky; top: 58px; z-index: 5;
}
.artifact-title { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; min-width: 0; }
.artifact-name { font-weight: 600; color: var(--accent); font-size: 13px; }
.artifact-body {
  max-height: 70vh;
  overflow: auto;
  padding: 0;
}
.artifact-body > .highlight { margin: 0; border: none; border-radius: 0; }
.artifact-body .highlighttable { width: 100%; border-collapse: collapse; }
.artifact-body .linenos {
  background: var(--bg-2); border-right: 1px solid var(--border);
  padding: 0 8px; user-select: none; vertical-align: top;
}
.artifact-body .linenos a { color: var(--muted); text-decoration: none; }
.artifact-body .linenos a:hover { color: var(--accent); }
.artifact-body .linenodiv pre { font-size: 11.5px; line-height: 1.5; }
.artifact-body .code pre { font-size: 12px; line-height: 1.5; padding: 0 14px; }
.artifact-body .codehilite { margin: 0; border: none; border-radius: 0; }
.artifact-body .codehilite pre { font-size: 12px; line-height: 1.5; padding: 10px 14px; }
.artifact-body .prose,
.artifact-body > div:not(.highlight):not(.codehilite) { padding: 14px 18px; }
.artifact-body h1, .artifact-body h2, .artifact-body h3 { margin-top: 14px; }

.log-block {
  background: #0b0f15;
  margin: 0;
  padding: 12px 14px;
  font-family: var(--mono);
  font-size: 12px;
  line-height: 1.5;
  color: #b8e0a8;
  white-space: pre-wrap;
  word-break: break-word;
}

.section-rule {
  display: flex; align-items: center; gap: 14px;
  margin: 34px 0 18px;
  color: var(--muted);
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  font-weight: 600;
}
.section-rule::before, .section-rule::after {
  content: ""; height: 1px; background: var(--border); flex: 1;
}
.section-rule span { color: var(--text-dim); }

/* ---- footer ---- */
.footer {
  max-width: 1280px;
  margin: 40px auto 0;
  padding: 20px 28px;
  border-top: 1px solid var(--border);
  display: flex; justify-content: space-between;
  color: var(--muted);
  font-size: 12px;
}

/* scrollbars */
::-webkit-scrollbar { height: 10px; width: 10px; }
::-webkit-scrollbar-track { background: var(--bg-2); }
::-webkit-scrollbar-thumb { background: var(--border-2); border-radius: 5px; }
::-webkit-scrollbar-thumb:hover { background: #3a4759; }

/* highlight target flash for deep links */
:target { scroll-margin-top: 70px; }
.findings-anchor, .poc-anchor { scroll-margin-top: 70px; }
