@font-face { font-family: Aeonik; src: url(/fonts/Aeonik-Regular.woff2) format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: Aeonik; src: url(/fonts/Aeonik-Medium.woff2) format("woff2"); font-weight: 500; font-display: swap; }
@font-face { font-family: Aeonik; src: url(/fonts/Aeonik-Bold.woff2) format("woff2"); font-weight: 700; font-display: swap; }

:root {
  /* Vembit tokens (vembit-www/src/original.css) */
  --bg: #060510;
  --card: #12111a;
  --card-2: #161522;
  --line: #cbd0eb1a;
  --line-2: #cbd0eb29;
  --text: #f7f7f7;
  --muted: #9899a3;
  --faint: #5d6069;
  --accent: #516af6;
  --accent-soft: #516af629;
  --green: #21c95e;
  --green-soft: #21c95e26;
  --red: #ff622e;
  --red-soft: #ff622e24;
  --warn: #ffc74f;
  --warn-soft: #ffc74f1f;
  --radius: 14px;
  --radius-sm: 9px;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font: 15px/1.5 Aeonik, ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  -webkit-font-smoothing: antialiased; min-height: 100vh; display: flex; flex-direction: column;
}
a { color: inherit; }
button, input, select { font: inherit; color: inherit; }
.num, td, .tile b { font-variant-numeric: tabular-nums; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

/* ---------- top bar ---------- */
.top { position: sticky; top: 0; z-index: 10; background: rgba(6, 5, 16, .92); backdrop-filter: blur(8px); border-bottom: 1px solid var(--line); }
.top-in { max-width: 1160px; margin: 0 auto; padding: 0 20px; height: 58px; display: flex; align-items: center; gap: 22px; }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; font-weight: 500; letter-spacing: -.01em; font-size: 17px; white-space: nowrap; }
.brand svg { width: 26px; height: 26px; flex: none; }
.brand small { font-size: 11px; color: var(--muted); border: 1px solid var(--line-2); border-radius: 99px; padding: 1px 8px; font-weight: 400; letter-spacing: .02em; }
.nav { display: flex; gap: 4px; margin-left: 6px; }
.nav a { text-decoration: none; color: var(--muted); padding: 6px 12px; border-radius: 8px; font-size: 14px; }
.nav a:hover { color: var(--text); background: var(--card); }
.nav a.on { color: var(--text); background: var(--card-2); }
.top-right { margin-left: auto; display: flex; align-items: center; gap: 12px; font-size: 13px; color: var(--muted); }
.chip { border: 1px solid var(--line-2); border-radius: 99px; padding: 3px 10px; white-space: nowrap; }
.linkbtn { background: none; border: 0; color: var(--muted); cursor: pointer; padding: 6px 4px; font-size: 13px; }
.linkbtn:hover { color: var(--text); }

/* ---------- layout ---------- */
main { width: 100%; max-width: 1160px; margin: 0 auto; padding: 28px 20px 40px; flex: 1; }
.grid { display: grid; gap: 16px; }
.g2 { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
.g-score { grid-template-columns: 340px minmax(0, 1fr); }
.g2.top { align-items: start; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; min-width: 0; }
.card h2, .card h3 { margin: 0 0 14px; font-size: 15px; font-weight: 500; letter-spacing: -.005em; display: flex; align-items: baseline; gap: 4px 10px; flex-wrap: wrap; }
.card h2 .sub, .card h3 .sub { color: var(--muted); font-weight: 400; font-size: 13px; }
.card h2 .right, .card h3 .right { margin-left: auto; }
.page-h { display: flex; align-items: baseline; gap: 14px; margin: 0 0 18px; flex-wrap: wrap; }
.page-h h1 { margin: 0; font-size: 24px; font-weight: 500; letter-spacing: -.02em; }
.page-h p { margin: 0; color: var(--muted); font-size: 14px; }
.stack > * + * { margin-top: 16px; }
.muted { color: var(--muted); }
.faint { color: var(--faint); }
.small { font-size: 13px; }
.xs { font-size: 12px; }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 12px; }
.row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.spacer { flex: 1; }

/* ---------- forms ---------- */
.seg { display: inline-flex; background: var(--bg); border: 1px solid var(--line); border-radius: 10px; padding: 3px; gap: 2px; }
.seg button { background: none; border: 0; padding: 7px 14px; border-radius: 7px; color: var(--muted); cursor: pointer; font-size: 14px; }
.seg button.on { background: var(--card-2); color: var(--text); box-shadow: inset 0 0 0 1px var(--line-2); }
.field { display: flex; gap: 10px; margin-top: 14px; }
.input { flex: 1; min-width: 0; height: 46px; background: var(--bg); border: 1px solid var(--line-2); border-radius: 10px; padding: 0 14px; font-size: 15px; outline: none; }
.input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.input::placeholder { color: var(--faint); }
.btn { height: 46px; padding: 0 20px; border-radius: 10px; border: 0; background: var(--accent); color: #fff; font-weight: 500; cursor: pointer; white-space: nowrap; display: inline-flex; align-items: center; gap: 8px; text-decoration: none; font-size: 14px; }
.btn:hover { filter: brightness(1.08); }
.btn:disabled { opacity: .55; cursor: default; filter: none; }
.btn.ghost { background: var(--card-2); color: var(--text); box-shadow: inset 0 0 0 1px var(--line-2); }
.btn.sm { height: 34px; padding: 0 12px; font-size: 13px; border-radius: 8px; }
.err { color: var(--red); font-size: 14px; margin-top: 10px; min-height: 1px; }
.hint { color: var(--muted); font-size: 13px; margin-top: 10px; }

/* ---------- signals legend (home) ---------- */
.legend { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 10px; }
.legend div { background: var(--bg); border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 12px; }
.legend b { display: block; font-weight: 500; font-size: 13px; }
.legend span { display: block; color: var(--muted); font-size: 12px; margin-top: 4px; line-height: 1.4; }
.legend i { font-style: normal; color: var(--faint); font-size: 11px; float: right; }

/* ---------- tables ---------- */
.tbl-wrap { overflow-x: auto; margin: 0 -20px; padding: 0 20px; }
table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
th { text-align: left; color: var(--muted); font-weight: 400; font-size: 12px; padding: 8px 10px; border-bottom: 1px solid var(--line); white-space: nowrap; }
td { padding: 10px; border-bottom: 1px solid var(--line); white-space: nowrap; }
tr:last-child td { border-bottom: 0; }
td.r, th.r { text-align: right; }
tbody tr.click { cursor: pointer; }
tbody tr.click:hover td { background: #ffffff05; }
tr.flagged td { background: var(--red-soft); }
tr.subject td { box-shadow: inset 0 1px 0 var(--accent), inset 0 -1px 0 var(--accent); }
.trunc { max-width: 280px; overflow: hidden; text-overflow: ellipsis; }

/* ---------- pills ---------- */
.pill { display: inline-flex; align-items: center; gap: 6px; border-radius: 99px; padding: 2px 10px; font-size: 12.5px; font-weight: 500; white-space: nowrap; }
.pill::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.v-organic { color: var(--green); background: var(--green-soft); }
.v-anomalies { color: var(--warn); background: var(--warn-soft); }
.v-botted { color: var(--red); background: var(--red-soft); }
.v-unknown, .v-running, .v-error { color: var(--muted); background: var(--card-2); }
.v-error { color: var(--red); }
.plat { font-size: 11.5px; color: var(--muted); border: 1px solid var(--line-2); border-radius: 6px; padding: 1px 7px; white-space: nowrap; }
.tag { display: inline-block; font-size: 11px; border-radius: 5px; padding: 1px 6px; margin: 2px 4px 0 0; background: var(--card-2); color: var(--muted); }
.tag.bad { background: var(--red-soft); color: var(--red); }
.tag.warn { background: var(--warn-soft); color: var(--warn); }

/* ---------- score card ---------- */
.score-card { display: flex; flex-direction: column; align-items: center; text-align: center; }
.dial { width: 100%; max-width: 270px; }
.verdict { font-size: 20px; font-weight: 500; letter-spacing: -.01em; margin-top: 2px; }
.conf { color: var(--muted); font-size: 13px; margin-top: 6px; }
.conf b { color: var(--text); font-weight: 500; }
.actions { display: flex; gap: 8px; flex-wrap: wrap; justify-content: center; margin-top: 16px; }
.watchbox { margin-top: 14px; font-size: 12.5px; color: var(--muted); background: var(--bg); border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 8px 12px; width: 100%; text-align: left; }

/* ---------- subject card ---------- */
.subj-h { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.subj-h .handle { font-size: 18px; font-weight: 500; letter-spacing: -.01em; }
.subj-title { color: var(--muted); font-size: 14px; margin: 8px 0 0; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.tiles { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; margin-top: 16px; }
.tile { background: var(--bg); border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 10px 12px; min-width: 0; }
.tile span { display: block; color: var(--muted); font-size: 12px; }
.tile b { display: block; font-size: 19px; font-weight: 500; letter-spacing: -.01em; margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tile em { font-style: normal; color: var(--faint); font-size: 11.5px; }
.meta { display: flex; gap: 16px; flex-wrap: wrap; color: var(--muted); font-size: 13px; margin-top: 12px; }

/* ---------- reasons ---------- */
.reasons { list-style: none; margin: 0; padding: 0; }
.reasons li { display: grid; grid-template-columns: 10px minmax(0, 1fr) 72px; gap: 12px; align-items: start; padding: 11px 0; border-top: 1px solid var(--line); }
.reasons li:first-child { border-top: 0; padding-top: 2px; }
.reasons .dot { width: 8px; height: 8px; border-radius: 50%; margin-top: 7px; }
.reasons .flag .dot { background: var(--red); }
.reasons .info .dot { background: var(--warn); }
.reasons .ok .dot { background: var(--green); }
.reasons .txt { font-size: 14px; }
.reasons .sig { display: block; color: var(--faint); font-size: 11.5px; margin-top: 2px; }
.reasons .pts { text-align: right; font-size: 13px; color: var(--muted); }
.reasons .flag .pts { color: var(--red); font-weight: 500; }
.sevbar { height: 3px; background: var(--card-2); border-radius: 2px; margin-top: 6px; overflow: hidden; }
.sevbar i { display: block; height: 100%; background: var(--red); }
.breakdown { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 8px; margin-top: 16px; }
.breakdown div { background: var(--bg); border: 1px solid var(--line); border-radius: 8px; padding: 8px 10px; }
.breakdown span { display: block; font-size: 11.5px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.breakdown b { font-weight: 500; font-size: 14px; }
.breakdown em { font-style: normal; color: var(--faint); font-size: 12px; }
.breakdown .na b { color: var(--faint); font-weight: 400; font-size: 12.5px; }
.notes { margin: 14px 0 0; padding: 10px 12px; background: var(--bg); border: 1px solid var(--line); border-radius: var(--radius-sm); font-size: 12.5px; color: var(--muted); list-style: none; }
.notes li + li { margin-top: 4px; }

/* ---------- charts ---------- */
.chart { width: 100%; height: auto; display: block; overflow: visible; }
.chart text { fill: var(--muted); font-size: 11px; font-family: Aeonik, system-ui, sans-serif; }
.chart .ax { stroke: var(--line-2); stroke-width: 1; }
.chart .grid { stroke: var(--line); stroke-width: 1; }
.chart-legend { display: flex; gap: 14px; flex-wrap: wrap; font-size: 12px; color: var(--muted); margin-top: 8px; }
.chart-legend i { display: inline-block; width: 10px; height: 10px; border-radius: 2px; margin-right: 6px; vertical-align: -1px; }
.ratio + .ratio { margin-top: 18px; }
.rbar { position: relative; padding: 8px 0 18px; }
.rtrack { position: relative; height: 10px; background: var(--card-2); border-radius: 3px; }
.rtrack i { position: absolute; top: 0; bottom: 0; }
.rz-bad { left: 0; background: var(--red); opacity: .22; border-radius: 3px 0 0 3px; }
.rz-ok { background: var(--green); opacity: .3; }
.rflag { width: 0; border-left: 1.5px dashed var(--red); top: -3px !important; bottom: -3px !important; }
.rval { width: 3px; margin-left: -1.5px; background: var(--text); top: -6px !important; bottom: -2px !important; border-radius: 2px; }
.rval::before { content: ""; position: absolute; top: -5px; left: -3px; width: 9px; height: 9px; border-radius: 50%; background: inherit; }
.rval.bad { background: var(--red); }
.rlabels { position: absolute; left: 0; right: 0; bottom: 0; height: 14px; font-size: 11px; color: var(--muted); }
.rlabels span { position: absolute; transform: translateX(-50%); white-space: nowrap; }
.rlabels span.bad { color: var(--red); }
.ratio-h { display: flex; justify-content: space-between; font-size: 13px; margin-bottom: 6px; gap: 8px; }
.ratio-h b { font-weight: 500; }

/* ---------- comments ---------- */
.cstats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; margin-bottom: 14px; }
.clist { list-style: none; margin: 0; padding: 0; max-height: 520px; overflow-y: auto; }
.clist li { padding: 9px 0; border-top: 1px solid var(--line); font-size: 13.5px; }
.clist li:first-child { border-top: 0; }
.clist .who { color: var(--muted); font-size: 12px; }
.clist.two { column-count: 2; column-gap: 32px; max-height: none; }
.clist.two li { break-inside: avoid; }
.clist.two li:first-child { border-top: 1px solid var(--line); }
.clist.two li:nth-child(1) { border-top: 0; }
.clist li.bad .ctext { color: #ffd7c9; }
.ctext { word-break: break-word; }

/* ---------- progress ---------- */
.progress { max-width: 560px; margin: 40px auto; text-align: center; }
.bar { height: 3px; background: var(--card-2); border-radius: 2px; overflow: hidden; margin: 18px 0; }
.bar i { display: block; height: 100%; width: 35%; background: var(--accent); animation: slide 1.3s ease-in-out infinite; }
@keyframes slide { 0% { transform: translateX(-100%); } 100% { transform: translateX(300%); } }
.steps { list-style: none; padding: 0; margin: 0; text-align: left; display: inline-block; font-size: 14px; color: var(--muted); }
.steps li { padding: 3px 0; }
.steps li.done { color: var(--text); }
.steps li.done::before { content: "✓ "; color: var(--green); }
.steps li.now::before { content: "· "; color: var(--accent); }

/* ---------- login ---------- */
.login { max-width: 380px; margin: 9vh auto 0; }
.login .card { padding: 28px; }
.login h1 { font-size: 22px; font-weight: 500; margin: 14px 0 4px; letter-spacing: -.02em; }
.login p { margin: 0 0 18px; color: var(--muted); font-size: 14px; }
.login .input, .login .btn { width: 100%; }
.login .btn { justify-content: center; margin-top: 10px; }

/* ---------- footer ---------- */
.foot { border-top: 1px solid var(--line); color: var(--faint); font-size: 12.5px; }
.foot-in { max-width: 1160px; margin: 0 auto; padding: 16px 20px; display: flex; gap: 16px; flex-wrap: wrap; justify-content: space-between; }
details.method { margin-top: 4px; }
details.method summary { cursor: pointer; color: var(--muted); font-size: 13px; }
details.method ul { margin: 10px 0 0; padding-left: 18px; color: var(--muted); font-size: 13px; }
details.method li { margin: 3px 0; }
.toast { position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%); background: var(--card-2); border: 1px solid var(--line-2); padding: 9px 16px; border-radius: 10px; font-size: 13.5px; z-index: 50; }

/* ---------- responsive ---------- */
@media (max-width: 900px) {
  .g-score, .g2 { grid-template-columns: minmax(0, 1fr); }
  .legend { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .breakdown { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 600px) {
  body { font-size: 14.5px; }
  .top-in { padding: 0 14px; gap: 10px; height: 54px; }
  .brand small, .top-right .chip { display: none; }
  .nav { margin-left: 0; }
  .nav a { padding: 6px 9px; }
  main { padding: 18px 14px 32px; }
  .card { padding: 16px; }
  .tbl-wrap { margin: 0 -16px; padding: 0 16px; }
  .field { flex-direction: column; }
  .btn { justify-content: center; }
  .tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .cstats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .breakdown { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .legend { grid-template-columns: minmax(0, 1fr); }
  .reasons li { grid-template-columns: 10px minmax(0, 1fr) 54px; gap: 10px; }
  .page-h h1 { font-size: 21px; }
  .card h2 .sub, .card h3 .sub { flex-basis: 100%; }
  .card h2 .right { margin-left: 0; }
  .trunc { max-width: 170px; }
  .clist.two { column-count: 1; }
  .chart.scaled text { font-size: 17px; }
}
