/* MickeyJS demo — forensic console aesthetic.
   Single stylesheet, no build step, no external fonts (CSP forbids them). */

:root {
  --bg: #06080b;
  --bg-elev: #0c1016;
  --bg-elev-2: #11161f;
  --line: #1b2330;
  --line-soft: #151c26;
  --fg: #ccd6e2;
  --fg-dim: #8195ab;
  --fg-faint: #5a6b7f;

  --automated: #ff4d5e;
  --likely: #ff8f3c;
  --suspicious: #f5c33b;
  --inconclusive: #58a6ff;
  --clean: #3fb950;

  --definitive: #ff4d5e;
  --strong: #ff8f3c;
  --moderate: #f5c33b;
  --weak: #7f8ea3;
  --info: #4b5b6e;

  --mono: ui-monospace, "SF Mono", SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
  --sans: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --radius: 10px;
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background:
    radial-gradient(1100px 520px at 50% -10%, #101923 0%, transparent 70%),
    var(--bg);
  color: var(--fg);
  font-family: var(--sans);
  font-size: 15px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

a { color: #7cc4ff; text-decoration: none; }
a:hover { text-decoration: underline; }

/* ── Top bar ─────────────────────────────────────────────────── */

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 18px 24px;
  border-bottom: 1px solid var(--line);
  background: rgba(6, 8, 11, 0.85);
  backdrop-filter: blur(8px);
  position: sticky;
  top: 0;
  z-index: 20;
}

.brand { display: flex; align-items: center; gap: 13px; }

.mark {
  width: 30px; height: 30px;
  fill: none;
  stroke: #59d6c6;
  stroke-width: 1.6;
  stroke-linecap: round;
  stroke-linejoin: round;
  filter: drop-shadow(0 0 7px rgba(89, 214, 198, 0.35));
}

.topbar h1 {
  margin: 0;
  font-size: 17px;
  font-weight: 650;
  letter-spacing: 0.09em;
  text-transform: uppercase;
}

.tagline {
  margin: 0;
  font-size: 12px;
  color: var(--fg-faint);
  font-family: var(--mono);
}

.topbar-actions { display: flex; align-items: center; gap: 12px; }

.version {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--fg-faint);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 2px 10px;
}

.ghost-btn {
  font-size: 13px;
  color: var(--fg-dim);
  border: 1px solid var(--line);
  border-radius: 7px;
  padding: 6px 13px;
}
.ghost-btn:hover { color: var(--fg); border-color: #2b3646; text-decoration: none; }

/* ── Layout ──────────────────────────────────────────────────── */

main {
  max-width: 1080px;
  margin: 0 auto;
  padding: 26px 22px 70px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.panel {
  background: var(--bg-elev);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 20px 22px;
}

.panel h2, .panel h2.inline {
  margin: 0 0 4px;
  font-size: 12px;
  font-weight: 650;
  letter-spacing: 0.13em;
  text-transform: uppercase;
  color: var(--fg-dim);
  display: inline-block;
}

.panel-hint {
  margin: 0 0 16px;
  font-size: 13.5px;
  color: var(--fg-faint);
  max-width: 74ch;
}

.count-badge {
  font-family: var(--mono);
  font-size: 11px;
  background: var(--bg-elev-2);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 1px 8px;
  color: var(--fg-dim);
  letter-spacing: 0;
  margin-left: 6px;
}

details > summary {
  cursor: pointer;
  list-style: none;
  display: flex;
  align-items: center;
  gap: 8px;
}
details > summary::-webkit-details-marker { display: none; }
details > summary::before {
  content: "▸";
  color: var(--fg-faint);
  font-size: 11px;
  transition: transform 0.15s ease;
}
details[open] > summary::before { transform: rotate(90deg); }
details > summary h2 { margin: 0; }

.empty { color: var(--fg-faint); font-size: 13.5px; margin: 0; font-style: italic; }

/* ── Verdict card ────────────────────────────────────────────── */

.verdict-card {
  display: flex;
  gap: 30px;
  align-items: center;
  background: linear-gradient(160deg, var(--bg-elev-2), var(--bg-elev));
  border: 1px solid var(--line);
  border-left: 3px solid var(--verdict-color, var(--inconclusive));
  border-radius: var(--radius);
  padding: 26px 28px;
  flex-wrap: wrap;
}

.gauge-wrap { position: relative; width: 132px; height: 132px; flex: none; }

.gauge { width: 132px; height: 132px; transform: rotate(-90deg); }

.gauge-track {
  fill: none;
  stroke: #182130;
  stroke-width: 9;
}

.gauge-fill {
  fill: none;
  stroke: var(--verdict-color, var(--inconclusive));
  stroke-width: 9;
  stroke-linecap: round;
  stroke-dasharray: 326.7;
  stroke-dashoffset: 326.7;
  transition: stroke-dashoffset 0.6s cubic-bezier(0.22, 1, 0.36, 1), stroke 0.4s ease;
  filter: drop-shadow(0 0 8px color-mix(in srgb, var(--verdict-color, #58a6ff) 45%, transparent));
}

.gauge-label {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0;
}

.gauge-score {
  font-family: var(--mono);
  font-size: 34px;
  font-weight: 600;
  color: var(--verdict-color, var(--fg));
  line-height: 1;
}

.gauge-unit { font-family: var(--mono); font-size: 11px; color: var(--fg-faint); }

.verdict-body { flex: 1 1 340px; min-width: 0; }

.verdict-name {
  font-family: var(--mono);
  font-size: 22px;
  font-weight: 600;
  letter-spacing: 0.02em;
  color: var(--verdict-color, var(--fg));
  text-transform: lowercase;
}

.verdict-summary { margin: 6px 0 16px; color: var(--fg-dim); font-size: 14.5px; max-width: 62ch; }

.stat-row { display: flex; gap: 26px; flex-wrap: wrap; margin-bottom: 18px; }
.stat { display: flex; flex-direction: column; }
.stat-n { font-family: var(--mono); font-size: 19px; color: var(--fg); line-height: 1.2; }
.stat-l { font-size: 11px; text-transform: uppercase; letter-spacing: 0.09em; color: var(--fg-faint); }

.controls { display: flex; gap: 9px; flex-wrap: wrap; }

.btn {
  font-family: var(--sans);
  font-size: 13px;
  font-weight: 500;
  color: #06080b;
  background: #59d6c6;
  border: 1px solid #59d6c6;
  border-radius: 7px;
  padding: 7px 15px;
  cursor: pointer;
  transition: filter 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}
.btn:hover { filter: brightness(1.1); }

.btn-ghost {
  background: transparent;
  color: var(--fg-dim);
  border-color: var(--line);
}
.btn-ghost:hover { color: var(--fg); border-color: #2b3646; filter: none; }
.btn-ghost[aria-pressed="true"] { color: #59d6c6; border-color: #2c6960; background: #0d1f1d; }

/* ── Attribution ─────────────────────────────────────────────── */

.attribution { display: flex; flex-direction: column; gap: 11px; }

.attr-row { display: grid; grid-template-columns: 190px 1fr 52px; gap: 14px; align-items: center; }

.attr-name { font-family: var(--mono); font-size: 13px; color: var(--fg); }
.attr-name small { display: block; color: var(--fg-faint); font-size: 11px; }

.attr-bar { height: 7px; background: #141b25; border-radius: 999px; overflow: hidden; }
.attr-bar span {
  display: block;
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, #ff8f3c, #ff4d5e);
  transition: width 0.5s cubic-bezier(0.22, 1, 0.36, 1);
}
.attr-pct { font-family: var(--mono); font-size: 12.5px; color: var(--fg-dim); text-align: right; }

/* ── Family grid ─────────────────────────────────────────────── */

.family-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
  gap: 11px;
}

.family {
  border: 1px solid var(--line-soft);
  border-radius: 8px;
  padding: 13px 14px;
  background: var(--bg-elev-2);
  border-left: 2px solid var(--tone, var(--info));
}

.family-name { font-size: 12.5px; color: var(--fg-dim); }
.family-count {
  font-family: var(--mono);
  font-size: 21px;
  color: var(--tone, var(--fg-faint));
  line-height: 1.3;
}
.family-key { font-family: var(--mono); font-size: 10.5px; color: var(--fg-faint); letter-spacing: 0.05em; }

/* ── Interaction pad ─────────────────────────────────────────── */

.pad {
  position: relative;
  height: 190px;
  border: 1px dashed #27313f;
  border-radius: 8px;
  background:
    repeating-linear-gradient(45deg, #0b1017 0 10px, #0d131b 10px 20px);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;
  cursor: crosshair;
  overflow: hidden;
  outline: none;
}
.pad:focus-visible { border-color: #59d6c6; }

.pad-hint {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--fg-faint);
  letter-spacing: 0.09em;
  text-transform: uppercase;
  pointer-events: none;
}

.pad-counters {
  display: flex;
  gap: 18px;
  flex-wrap: wrap;
  justify-content: center;
  font-family: var(--mono);
  font-size: 12px;
  color: var(--fg-faint);
  pointer-events: none;
}
.pad-counters b { color: #59d6c6; font-weight: 600; }

/* ── Signals ─────────────────────────────────────────────────── */

.signals { display: flex; flex-direction: column; gap: 7px; }

.signal {
  border: 1px solid var(--line-soft);
  border-left: 3px solid var(--tone);
  border-radius: 7px;
  background: var(--bg-elev-2);
  overflow: hidden;
}

.signal > summary {
  display: grid;
  grid-template-columns: 88px 1fr auto;
  gap: 13px;
  align-items: baseline;
  padding: 11px 14px;
}
.signal > summary::before { display: none; }

.sig-tier {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--tone);
  border: 1px solid color-mix(in srgb, var(--tone) 40%, transparent);
  border-radius: 999px;
  padding: 1px 0;
  text-align: center;
}

.sig-main { min-width: 0; }
.sig-label { font-size: 14px; color: var(--fg); }
.sig-id { font-family: var(--mono); font-size: 11.5px; color: var(--fg-faint); word-break: break-all; }
.sig-at { font-family: var(--mono); font-size: 11px; color: var(--fg-faint); white-space: nowrap; }

.sig-body { padding: 0 14px 14px 14px; border-top: 1px solid var(--line-soft); }
.sig-note { margin: 12px 0; font-size: 13.5px; color: var(--fg-dim); max-width: 78ch; }
.sig-meta { font-family: var(--mono); font-size: 11.5px; color: var(--fg-faint); margin: 0 0 10px; }
.sig-actors { display: flex; gap: 6px; flex-wrap: wrap; margin: 0 0 10px; }
.sig-actor {
  font-family: var(--mono);
  font-size: 11px;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 1px 9px;
  color: var(--fg-dim);
}

.json {
  font-family: var(--mono);
  font-size: 11.5px;
  line-height: 1.5;
  background: #070a0e;
  border: 1px solid var(--line-soft);
  border-radius: 7px;
  padding: 12px 14px;
  overflow-x: auto;
  color: #9fb4c9;
  margin: 0;
  max-height: 380px;
}

/* ── Tables ──────────────────────────────────────────────────── */

.probe-table { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 13px; }
th, td {
  text-align: left;
  padding: 7px 12px 7px 0;
  border-bottom: 1px solid var(--line-soft);
  white-space: nowrap;
}
th { color: var(--fg-faint); font-weight: 500; font-size: 11px; text-transform: uppercase; letter-spacing: 0.08em; }
td.mono { font-family: var(--mono); font-size: 12px; color: var(--fg-dim); }

.status { font-family: var(--mono); font-size: 11px; }
.status-ok { color: var(--clean); }
.status-timeout { color: var(--suspicious); }
.status-error { color: var(--automated); }
.status-skipped, .status-not-run { color: var(--fg-faint); }

.kv { display: grid; grid-template-columns: minmax(140px, 220px) 1fr; gap: 5px 18px; font-size: 13px; }
.kv dt { color: var(--fg-faint); font-family: var(--mono); font-size: 12px; }
.kv dd { margin: 0; font-family: var(--mono); font-size: 12px; color: var(--fg-dim); word-break: break-word; }

footer { color: var(--fg-faint); font-size: 12.5px; text-align: center; padding-top: 6px; }
footer p { max-width: 70ch; margin: 0 auto; }

@media (max-width: 640px) {
  .verdict-card { gap: 20px; padding: 20px; }
  .signal > summary { grid-template-columns: 78px 1fr; }
  .sig-at { display: none; }
  .attr-row { grid-template-columns: 130px 1fr 46px; }
  .kv { grid-template-columns: 1fr; }
  .kv dd { margin-bottom: 8px; }
}

@media (prefers-reduced-motion: reduce) {
  .gauge-fill, .attr-bar span { transition: none; }
}
