/* Public demo dashboard: framework-free, polished. Uses tokens.css. */
* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  background: var(--paper); color: var(--ink);
  font-family: var(--font-body); font-size: 15px; line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; }
.wrap { max-width: 1180px; margin: 0 auto; padding: 0 24px; }
.mono { font-family: var(--font-mono); }
h1, h2, h3 { font-family: var(--font-head); font-weight: 600; letter-spacing: -0.02em; line-height: 1.1; }

/* ---- top bar ---- */
header.top { position: sticky; top: 0; z-index: 30; background: rgba(244,245,247,.86);
  backdrop-filter: blur(10px); border-bottom: 1px solid var(--line); }
.top-in { display: flex; align-items: center; justify-content: space-between; height: 60px; gap: 16px; }
.brand { display: flex; align-items: center; gap: 10px; font-family: var(--font-head); font-weight: 700; font-size: 18px; text-decoration: none; }
.brand svg { width: 22px; height: 22px; }
.demo-pill { font-family: var(--font-mono); font-size: 11px; letter-spacing: .12em; text-transform: uppercase;
  color: var(--red-ink); background: #fbe7e4; border: 1px solid #f3cfc9; padding: 4px 9px; border-radius: 100px; }
.top-links { display: flex; gap: 22px; align-items: center; font-size: 14px; }
.top-links a:not(.btn) { color: var(--ink-soft); text-decoration: none; border-bottom: 2px solid transparent; padding-bottom: 3px; }
.top-links a:not(.btn):hover { color: var(--ink); }
.top-links a:not(.btn).current { color: var(--ink); font-weight: 600; border-bottom-color: var(--red); }
.lang { display: inline-flex; gap: 8px; align-items: center; }
.lang a.on { color: var(--ink); font-weight: 600; cursor: default; border-bottom: none; }

/* ---- banner ---- */
.banner { background: var(--ink); color: #EDEFF2; font-size: 13px; }
.banner .wrap { padding-top: 9px; padding-bottom: 9px; display: flex; gap: 10px; align-items: center; }
.banner .dot { width: 7px; height: 7px; border-radius: 100px; background: var(--red); flex: 0 0 auto; }
.banner b { color: #fff; }

/* ---- tabs ---- */
nav.tabs { border-bottom: 1px solid var(--line); background: var(--paper); position: sticky; top: 60px; z-index: 20; }
.tabs-in { display: flex; gap: 4px; }
.tab { appearance: none; background: none; border: 0; border-bottom: 2px solid transparent;
  font: 500 14px/1 var(--font-body); color: var(--ink-soft); padding: 16px 14px; cursor: pointer; }
.tab:hover { color: var(--ink); }
.tab[aria-selected="true"] { color: var(--ink); border-bottom-color: var(--red); }
.view { padding: 30px 0 80px; }
.view[hidden] { display: none; }
.view-head { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; margin-bottom: 18px; flex-wrap: wrap; }
.view-head h2 { font-size: 22px; }
.view-head .sub { color: var(--ink-soft); font-size: 13.5px; }

/* ---- cards / grid ---- */
.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 14px; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--r); padding: 16px 18px; }
.card .k { font-family: var(--font-mono); font-size: 11px; letter-spacing: .1em; text-transform: uppercase; color: var(--ink-soft); }
.card .v { font-family: var(--font-head); font-size: 26px; font-weight: 600; margin-top: 4px; }
.card .v small { font-size: 14px; color: var(--ink-soft); font-weight: 500; }
.panel { background: var(--card); border: 1px solid var(--line); border-radius: var(--r); padding: 20px 22px; margin-top: 18px; }
.panel h3 { font-size: 15px; margin-bottom: 14px; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
@media (max-width: 800px){ .grid2 { grid-template-columns: 1fr; } }

/* ---- chips ---- */
.chip { font-family: var(--font-mono); font-size: 11px; letter-spacing: .06em; text-transform: uppercase;
  padding: 3px 8px; border-radius: 100px; white-space: nowrap; display: inline-block; }
.chip.sev-critical { background: var(--sev-critical-bg); color: var(--sev-critical-ink); }
.chip.sev-high { background: var(--sev-high-bg); color: var(--sev-high-ink); }
.chip.sev-medium { background: var(--sev-medium-bg); color: var(--sev-medium-ink); }
.chip.sev-low { background: var(--sev-low-bg); color: var(--sev-low-ink); }
.chip.st-new { background: var(--st-new-bg); color: var(--st-new-ink); }
.chip.st-open { background: var(--st-open-bg); color: var(--st-open-ink); }
.chip.st-regressed { background: var(--st-regressed-bg); color: var(--st-regressed-ink); }
.chip.st-resolved { background: var(--st-resolved-bg); color: var(--st-resolved-ink); }
.chip.st-accepted { background: var(--st-accepted-bg); color: var(--st-accepted-ink); }
.chip.owasp { background: var(--paper-2); color: var(--ink-soft); }

/* ---- filters ---- */
.filters { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-bottom: 16px; }
.filters .group { display: flex; gap: 6px; align-items: center; }
.filters .lbl { font-family: var(--font-mono); font-size: 10.5px; letter-spacing: .12em; text-transform: uppercase; color: var(--ink-soft); margin-right: 2px; }
.toggle { appearance: none; border: 1px solid var(--line); background: var(--card); color: var(--ink-soft);
  font: 500 12px/1 var(--font-body); padding: 6px 10px; border-radius: 100px; cursor: pointer; }
.toggle[aria-pressed="true"] { background: var(--ink); color: #fff; border-color: var(--ink); }
.search { border: 1px solid var(--line); background: var(--card); border-radius: var(--r); padding: 7px 11px; font: 14px var(--font-body); min-width: 200px; flex: 1; }

/* ---- findings list ---- */
.finding { background: var(--card); border: 1px solid var(--line); border-radius: var(--r); margin-bottom: 10px; overflow: hidden; }
.finding > summary { list-style: none; cursor: pointer; padding: 13px 16px; display: flex; align-items: center; gap: 12px; }
.finding > summary::-webkit-details-marker { display: none; }
.finding > summary:hover { background: var(--paper); }
.finding .id { font-family: var(--font-mono); font-size: 11px; color: var(--ink-soft); }
.finding .title { font-weight: 600; flex: 1; min-width: 0; }
.finding .chev { color: var(--ink-soft); transition: transform .15s; }
.finding[open] .chev { transform: rotate(90deg); }
.finding .body { border-top: 1px solid var(--line); padding: 4px 18px 18px; }
.fld { margin-top: 14px; }
.fld .k { font-family: var(--font-mono); font-size: 10.5px; letter-spacing: .1em; text-transform: uppercase; color: var(--ink-soft); margin-bottom: 4px; }
.fld .val { font-size: 14px; }
.fld pre { background: #0e1117; color: #e6e8ec; font-family: var(--font-mono); font-size: 12px; line-height: 1.5;
  padding: 12px 14px; border-radius: var(--r); overflow-x: auto; white-space: pre-wrap; word-break: break-word; }
.muted { color: var(--ink-soft); }

/* ---- bars (telemetry) ---- */
.bars { display: flex; flex-direction: column; gap: 9px; }
.bar-row { display: grid; grid-template-columns: 130px 1fr 64px; align-items: center; gap: 10px; font-size: 13px; }
.bar-row .name { color: var(--ink-soft); font-family: var(--font-mono); font-size: 11.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bar-track { background: var(--paper-2); border-radius: 100px; height: 9px; overflow: hidden; }
.bar-fill { height: 100%; background: var(--red); border-radius: 100px; }
.bar-fill.ok { background: var(--verified); }
.bar-row .num { text-align: right; font-family: var(--font-mono); font-size: 12px; }

/* ---- table ---- */
table.tbl { width: 100%; border-collapse: collapse; background: var(--card); border: 1px solid var(--line); border-radius: var(--r); overflow: hidden; }
table.tbl th { text-align: left; font: 600 10.5px/1 var(--font-mono); letter-spacing: .1em; text-transform: uppercase; color: var(--ink-soft); padding: 12px 14px; border-bottom: 1px solid var(--line); background: var(--paper); }
table.tbl td { padding: 12px 14px; border-bottom: 1px solid var(--line); font-size: 13.5px; vertical-align: middle; }
table.tbl tr:last-child td { border-bottom: 0; }
table.tbl tbody tr.click { cursor: pointer; }
table.tbl tbody tr.click:hover { background: var(--paper); }
.tbl-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; }

/* ---- timeline ---- */
.timeline { list-style: none; padding-left: 6px; border-left: 2px solid var(--line); margin: 6px 0 4px 6px; }
.timeline li { position: relative; padding: 4px 0 12px 18px; font-size: 13px; }
.timeline li::before { content: ""; position: absolute; left: -7px; top: 8px; width: 10px; height: 10px; border-radius: 100px; background: var(--ink-soft); border: 2px solid var(--paper); }
.timeline li.st-new::before, .timeline li.st-open::before, .timeline li.st-regressed::before { background: var(--red); }
.timeline li.st-resolved::before { background: var(--verified); }
.timeline li .date { font-family: var(--font-mono); font-size: 11.5px; color: var(--ink-soft); margin-right: 8px; }

/* ---- coverage grid ---- */
.cov { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 10px; }
.cov .cell { border: 1px solid var(--line); border-radius: var(--r); padding: 12px 14px; background: var(--card); }
.cov .cell.zero { opacity: .5; }
.cov .code { font-family: var(--font-mono); font-size: 11px; color: var(--ink-soft); }
.cov .name { font-size: 13px; font-weight: 600; margin: 2px 0 8px; }
.cov .count { font-family: var(--font-head); font-size: 20px; font-weight: 600; }
.cov .count small { font-size: 12px; color: var(--ink-soft); font-weight: 500; }

/* ---- buttons / report ---- */
.btn { display: inline-flex; align-items: center; gap: 8px; background: var(--red); color: #fff; text-decoration: none;
  font-weight: 600; font-size: 14px; padding: 9px 15px; border-radius: var(--r); border: 0; cursor: pointer; }
.btn.ghost { background: transparent; color: var(--ink); border: 1px solid var(--line); }
.btn.ghost:hover { background: var(--paper-2); }
.report-actions { display: flex; gap: 10px; margin: 4px 0 14px; flex-wrap: wrap; }
.report-frame { width: 100%; height: 70vh; border: 1px solid var(--line); border-radius: var(--r); background: #fff; }
.risks { margin: 8px 0 0 0; padding-left: 18px; }
.risks li { margin: 5px 0; }
.kv { display: grid; grid-template-columns: max-content 1fr; gap: 4px 16px; font-size: 13.5px; }
.kv dt { color: var(--ink-soft); font-family: var(--font-mono); font-size: 11.5px; }

footer.foot { border-top: 1px solid var(--line); padding: 26px 0; color: var(--ink-soft); font-size: 13px; }
.loading { color: var(--ink-soft); padding: 40px 0; text-align: center; }

/* ---- mobile ---- */
@media (max-width: 640px) {
  .wrap { padding: 0 16px; }
  .hide-sm { display: none; }
  header.top { position: static; }            /* avoid sticky-offset overlap with the tabs */
  .top-in { height: 54px; }
  .brand { font-size: 16px; gap: 8px; }
  .demo-pill { font-size: 10px; padding: 3px 7px; }
  .top-links { gap: 0; }

  nav.tabs { position: sticky; top: 0; }
  .tabs-in { overflow-x: auto; -webkit-overflow-scrolling: touch; scrollbar-width: none; }
  .tabs-in::-webkit-scrollbar { display: none; }
  .tab { padding: 13px 12px; white-space: nowrap; flex: 0 0 auto; }

  .view { padding: 22px 0 64px; }
  .view-head h2 { font-size: 20px; }
  .cards { grid-template-columns: repeat(2, 1fr); gap: 10px; }
  .card { padding: 13px 14px; }
  .card .v { font-size: 22px; }
  .panel { padding: 16px; }

  /* charts: shrink the label gutter so bars stay usable on a phone */
  .bar-row { grid-template-columns: 84px 1fr 42px; gap: 8px; }
  .bar-row .name { font-size: 10.5px; }

  /* tables scroll horizontally instead of crushing */
  table.tbl { min-width: 540px; font-size: 12.5px; }
  table.tbl th, table.tbl td { padding: 10px 12px; }

  .report-frame { height: 62vh; }
  .cov { grid-template-columns: 1fr 1fr; }
  .finding > summary { flex-wrap: wrap; gap: 8px; padding: 12px 14px; }
  .finding .title { flex-basis: 100%; order: 3; }
}

