/* Wedjat operator console. Instrument-panel aesthetic, same family as the
   onepager: dark slate paper, warm ink, traffic-light signal. No external fonts.
   The redesign serves a non-technical reader first: verdict, glance cards, the
   estate map, then plain-language findings with progressive disclosure to proof. */

:root {
  --bg:        #0b0f12;
  --bg-raise:  #11171c;
  --panel:     #141b21;
  --line:      #233038;
  --line-soft: #1a242b;
  --ink:       #e8edf0;
  --ink-soft:  #9fb0b8;
  --ink-mute:  #62757e;

  /* the signal: traffic-light semantics everyone reads */
  --go:        #36e07f;  /* green: clear / good */
  --go-deep:   #1f9c57;
  --go-glow:   rgba(54, 224, 127, 0.28);
  --hold:      #f0b429;  /* amber: attention */
  --hold-glow: rgba(240, 180, 41, 0.26);
  --stop:      #ef5350;  /* red: exposed / action needed */
  --stop-glow: rgba(239, 83, 80, 0.26);
  --cyan:      #4fc3dc;  /* interactive accent */

  --ease: cubic-bezier(.22,.61,.36,1);
  --mono: ui-monospace, "SF Mono", "JetBrains Mono", "Cascadia Code", Menlo, Consolas, monospace;
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Inter, Roboto, Helvetica, Arial, sans-serif;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }

/* The [hidden] attribute must always win. A panel given an explicit display
   (e.g. .proof-body { display: grid }) otherwise overrides the UA
   [hidden]{display:none} rule, so toggling .hidden flips the attribute but the
   panel stays on screen. This keeps every disclosure honest: hidden means gone. */
[hidden] { display: none !important; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 15px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  /* faint instrument grid, matching the onepager */
  background-image:
    linear-gradient(var(--line-soft) 1px, transparent 1px),
    linear-gradient(90deg, var(--line-soft) 1px, transparent 1px);
  background-size: 64px 64px;
  background-position: center -1px;
  background-attachment: fixed;
}
body::before {
  content: "";
  position: fixed; inset: 0; z-index: -1; pointer-events: none;
  background: radial-gradient(120% 80% at 50% 0%, transparent 35%, var(--bg) 82%);
}

.mono { font-family: var(--mono); }

/* -- accessibility ------------------------------------------------------- */
.skip-link {
  /* Hide off the top, not the left: left:-999px widens the page and adds a
     default horizontal scrollbar. Off-top keeps it accessible with no overflow. */
  position: absolute; left: 8px; top: -60px;
  background: var(--cyan); color: var(--bg);
  padding: 8px 14px; z-index: 100; font-weight: 600;
}
.skip-link:focus { left: 8px; top: 8px; }

:focus-visible { outline: 2px solid var(--cyan); outline-offset: 2px; border-radius: 4px; }

/* -- topbar -------------------------------------------------------------- */
.topbar {
  display: flex; align-items: center; justify-content: space-between;
  gap: 16px; padding: 12px 20px;
  background: rgba(11,15,18,0.85);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
  position: sticky; top: 0; z-index: 20;
}
.brand {
  display: flex; align-items: center; gap: 10px;
  text-decoration: none; color: var(--ink);
}
.brand-eye { display: block; flex: none; }
.brand-name { font-family: var(--mono); font-weight: 700; letter-spacing: 0.18em; }
.brand-sub { color: var(--ink-mute); font-size: 12px; }

/* primary top nav (engagements / activity) */
.topnav { display: flex; gap: 4px; margin-left: auto; margin-right: 8px; }
.topnav-link {
  font-family: var(--mono); font-size: 12.5px; letter-spacing: .03em;
  color: var(--ink-soft); text-decoration: none;
  padding: 6px 12px; border-radius: 7px;
  border: 1px solid transparent;
  transition: color .14s var(--ease), border-color .14s var(--ease), background .14s var(--ease);
}
.topnav-link:hover { color: var(--ink); border-color: var(--line); }
.topnav-link.active {
  color: var(--cyan); border-color: rgba(79,195,220,.35);
  background: rgba(79,195,220,.07);
}

.status { display: flex; align-items: center; gap: 8px; font-size: 12.5px; }
.dot {
  width: 9px; height: 9px; border-radius: 50%;
  background: var(--ink-mute); flex: none;
}
.dot.ok   { background: var(--go);   box-shadow: 0 0 8px 1px var(--go-glow); }
.dot.down { background: var(--stop); box-shadow: 0 0 8px 1px var(--stop-glow); }

/* the reusable signal light */
.light-dot {
  width: 10px; height: 10px; border-radius: 50%; flex: none;
  background: var(--ink-mute);
}
.light-dot.green   { background: var(--go);   box-shadow: 0 0 8px 1px var(--go-glow); }
.light-dot.amber   { background: var(--hold); box-shadow: 0 0 8px 1px var(--hold-glow); }
.light-dot.red     { background: var(--stop); box-shadow: 0 0 8px 1px var(--stop-glow); }
.light-dot.neutral { background: var(--ink-mute); box-shadow: none; }

.eye-svg { color: var(--ink-soft); }

/* -- breadcrumbs --------------------------------------------------------- */
.crumbs {
  padding: 10px 20px;
  font-family: var(--mono); font-size: 12.5px; color: var(--ink-mute);
  border-bottom: 1px solid var(--line-soft);
  display: flex; flex-wrap: wrap; gap: 6px; align-items: center;
}
.crumbs a { color: var(--cyan); text-decoration: none; }
.crumbs a:hover { text-decoration: underline; }
.crumbs .sep { color: var(--ink-mute); opacity: 0.6; }
.crumbs .here { color: var(--ink-soft); }

/* -- main layout --------------------------------------------------------- */
main { padding: 22px 20px 40px; max-width: 1080px; margin: 0 auto; }
main:focus { outline: none; }

h1.view-title { font-size: 20px; margin: 0 0 4px; font-weight: 650; }
.view-meta { color: var(--ink-mute); font-size: 13px; margin: 0 0 18px; word-break: break-all; }

.section-h {
  font-size: 13px; text-transform: uppercase; letter-spacing: .12em;
  color: var(--ink-mute); margin: 0 0 6px; font-weight: 650;
}
.section-lede { color: var(--ink-soft); font-size: 14px; margin: 0 0 16px; max-width: 64ch; }

/* -- engagement / run list cards ----------------------------------------- */
.cards { display: grid; gap: 12px; }
.card {
  display: block; width: 100%; text-align: left;
  background: var(--panel); border: 1px solid var(--line);
  border-left: 3px solid var(--line); border-radius: 10px;
  padding: 14px 16px; color: inherit; font: inherit;
  text-decoration: none; cursor: pointer;
  transition: border-color .14s var(--ease), transform .06s var(--ease), background .14s var(--ease);
}
.card:hover { border-color: var(--cyan); border-left-color: var(--cyan); background: #161e25; }
.card:active { transform: translateY(1px); }
.card-title { font-size: 15px; color: var(--ink); font-weight: 600; word-break: break-word; }
.card-sub { font-size: 11.5px; color: var(--ink-mute); margin-top: 3px; word-break: break-all; }
.card-row { display: flex; flex-wrap: wrap; gap: 14px; margin-top: 9px; color: var(--ink-soft); font-size: 12.5px; }
.card-row .k { color: var(--ink-mute); }

/* -- pills --------------------------------------------------------------- */
.pill {
  display: inline-block; font-family: var(--mono); font-size: 11px;
  letter-spacing: .04em; padding: 2px 8px; border-radius: 999px;
  border: 1px solid var(--line); color: var(--ink-soft); background: var(--bg-raise);
}
.pill.go   { color: var(--go);   border-color: rgba(54,224,127,.4); }
.pill.hold { color: var(--hold); border-color: rgba(240,180,41,.4); }
.pill.stop { color: var(--stop); border-color: rgba(239,83,80,.4); }
.pill.cyan { color: var(--cyan); border-color: rgba(79,195,220,.4); }

/* =======================================================================
   1. VERDICT
   ======================================================================= */
.verdict {
  display: flex; align-items: center; gap: 18px;
  background: linear-gradient(180deg, var(--panel), var(--bg-raise));
  border: 1px solid var(--line); border-radius: 14px;
  padding: 20px 22px; margin: 0 0 18px;
}
.verdict-lens {
  flex: none; display: grid; place-items: center;
  width: 76px; height: 76px; border-radius: 50%;
  border: 1.5px solid var(--line);
}
.verdict-lens.tone-go   { border-color: var(--go-deep);  box-shadow: 0 0 30px var(--go-glow),  inset 0 0 22px rgba(54,224,127,0.06); }
.verdict-lens.tone-hold { border-color: rgba(240,180,41,.5); box-shadow: 0 0 30px var(--hold-glow), inset 0 0 22px rgba(240,180,41,0.06); }
.verdict-lens.tone-stop { border-color: rgba(239,83,80,.5);  box-shadow: 0 0 30px var(--stop-glow), inset 0 0 22px rgba(239,83,80,0.06); }
.verdict-lens .eye-svg { color: var(--ink); }

.verdict-body { min-width: 0; }
.verdict-status { display: flex; align-items: center; gap: 8px; margin-bottom: 6px; }
.verdict-status-word {
  font-family: var(--mono); font-size: 11.5px; letter-spacing: .16em;
  text-transform: uppercase; color: var(--ink-soft);
}
.verdict-line { margin: 0; font-size: 18px; line-height: 1.45; color: var(--ink); }

/* =======================================================================
   2. AT-A-GLANCE CARDS
   ======================================================================= */
.glance { margin: 0 0 22px; }
.glance-grid {
  display: grid; gap: 12px;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
}
.glance-card {
  background: var(--panel); border: 1px solid var(--line);
  border-radius: 12px; overflow: hidden;
}
.glance-head {
  width: 100%; display: grid;
  grid-template-columns: auto 1fr auto; align-items: center;
  gap: 6px 10px; padding: 14px 14px;
  background: transparent; border: 0; color: inherit; font: inherit;
  text-align: left; cursor: pointer;
}
.glance-head .light-dot { grid-row: 1 / span 2; }
.glance-big {
  font-size: 26px; font-weight: 650; line-height: 1; color: var(--ink);
  font-variant-numeric: tabular-nums;
}
.glance-label { grid-column: 2; color: var(--ink-soft); font-size: 13px; }
.glance-chevron {
  grid-row: 1 / span 2; color: var(--ink-mute); font-size: 12px;
  transition: transform .16s var(--ease);
}
.glance-head.open .glance-chevron { transform: rotate(90deg); }
.glance-head:hover { background: #161e25; }
.glance-explain {
  padding: 0 14px 14px; color: var(--ink-soft); font-size: 13px;
  border-top: 1px solid var(--line-soft);
}
.glance-explain p { margin: 12px 0 0; }

/* =======================================================================
   3. THE ESTATE MAP
   ======================================================================= */
.estate { margin: 0 0 24px; }
.map-stage {
  position: relative; overflow: hidden;
  display: grid; grid-template-columns: auto 1fr 1fr;
  gap: 16px; align-items: start;
  background:
    radial-gradient(90% 130% at 0% 50%, rgba(54,224,127,0.05), transparent 55%),
    linear-gradient(180deg, var(--panel), var(--bg-raise));
  border: 1px solid var(--line); border-radius: 14px;
  padding: 18px;
}

.map-apex {
  display: grid; place-items: center; gap: 6px;
  align-self: center; padding: 14px 12px;
  border: 1px solid var(--go-deep); border-radius: 12px;
  background: rgba(54,224,127,0.05);
  box-shadow: 0 0 26px var(--go-glow);
  min-width: 0;
}
.map-apex .eye-svg { color: var(--ink); }
.map-apex-name { font-size: 12px; color: var(--ink); word-break: break-all; text-align: center; }
.map-apex-tag {
  font-family: var(--mono); font-size: 10px; letter-spacing: .14em;
  text-transform: uppercase; color: var(--go);
}

.map-col { display: grid; gap: 8px; align-content: start; min-width: 0; }
.map-col-head {
  display: flex; align-items: center; gap: 8px;
  font-family: var(--mono); font-size: 11.5px; letter-spacing: .06em;
  color: var(--ink-soft); text-transform: uppercase;
  padding-bottom: 4px;
}

.map-node {
  position: relative;
  display: grid; gap: 2px;
  padding: 9px 11px; border-radius: 8px;
  background: var(--bg-raise);
  border: 1px solid var(--line-soft);
  border-left: 3px solid var(--ink-mute);
  min-width: 0;
}
.map-node.tone-go   { border-left-color: var(--go); }
.map-node.tone-hold { border-left-color: var(--hold); }
.map-node.tone-stop { border-left-color: var(--stop); }
.map-node.tone-lead {
  border-left-color: var(--ink-mute);
  border-style: dashed; opacity: .92;
}
.map-node-name { font-size: 12px; color: var(--ink); word-break: break-all; }
.map-node-note { font-size: 11px; color: var(--ink-mute); }
.map-node .light-dot { position: absolute; top: 11px; right: 10px; }

.map-empty { color: var(--ink-mute); font-size: 12px; padding: 9px 11px; font-family: var(--mono); }

/* the reveal sweep: a soft scan line that crosses the stage once on load */
.map-sweep {
  position: absolute; top: 0; bottom: 0; left: -30%; width: 28%;
  pointer-events: none;
  background: linear-gradient(90deg, transparent, var(--go-glow), transparent);
  opacity: 0;
}
.map-stage.swept .map-sweep { animation: sweep 1100ms var(--ease) 1 forwards; }
@keyframes sweep {
  0%   { left: -30%; opacity: 0; }
  12%  { opacity: .9; }
  88%  { opacity: .9; }
  100% { left: 102%; opacity: 0; }
}

/* nodes fade/slide in, staggered, as the sweep passes */
.map-node {
  opacity: 0; transform: translateY(8px);
  transition: opacity .45s var(--ease), transform .45s var(--ease);
  transition-delay: calc(var(--i, 0) * 70ms + 200ms);
}
.map-stage.swept .map-node,
.map-stage.no-motion .map-node { opacity: 1; transform: none; }

.map-legend {
  display: flex; flex-wrap: wrap; gap: 8px 18px;
  margin-top: 12px; font-size: 12px; color: var(--ink-soft);
}
.legend-item { display: inline-flex; align-items: center; gap: 7px; }

/* =======================================================================
   4. FINDINGS, TRANSLATED
   ======================================================================= */
.translated { margin: 0 0 24px; }
.item {
  background: var(--panel); border: 1px solid var(--line);
  border-radius: 10px; margin-bottom: 10px; overflow: hidden;
}
.item[open] { border-color: var(--line); }
.item-summary {
  display: grid; grid-template-columns: auto 1fr auto;
  align-items: center; gap: 10px;
  padding: 14px 16px; cursor: pointer; list-style: none;
}
.item-summary::-webkit-details-marker { display: none; }
.item-summary:hover { background: #161e25; }
.item-title { display: flex; flex-wrap: wrap; align-items: baseline; gap: 8px; min-width: 0; }
.item-title-text { font-size: 15px; font-weight: 600; color: var(--ink); }
.item-count { font-size: 12px; color: var(--ink-mute); font-family: var(--mono); }
.item-sev {
  font-family: var(--mono); font-size: 10.5px; letter-spacing: .08em;
  text-transform: uppercase; padding: 3px 9px; border-radius: 999px;
  border: 1px solid var(--line); white-space: nowrap;
}
.item-sev.sev-stop { color: var(--stop); border-color: rgba(239,83,80,.4); }
.item-sev.sev-hold { color: var(--hold); border-color: rgba(240,180,41,.4); }
.item-sev.sev-go   { color: var(--go);   border-color: rgba(54,224,127,.4); }

.item-meaning {
  padding: 0 16px 14px; color: var(--ink-soft); font-size: 14px;
  border-top: 1px solid var(--line-soft);
}
.item-meaning p { margin: 12px 0 0; }
.item-meaning strong { color: var(--ink); font-weight: 600; }
.item-hosts { margin-top: 12px; display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.item-hosts-label { color: var(--ink-mute); font-size: 12.5px; }
.host-chip {
  font-size: 11.5px; padding: 2px 8px; border-radius: 6px;
  background: var(--bg-raise); border: 1px solid var(--line); color: var(--ink-soft);
  word-break: break-all;
}

/* progressive disclosure: the proof */
.item-proof { padding: 0 16px 16px; }
.proof-btn {
  font-family: var(--mono); font-size: 12px; letter-spacing: .04em;
  color: var(--cyan); background: transparent;
  border: 1px solid var(--line); border-radius: 7px;
  padding: 7px 13px; cursor: pointer;
  transition: border-color .14s var(--ease);
}
.proof-btn:hover { border-color: var(--cyan); }
.proof-body { margin-top: 12px; display: grid; gap: 14px; }

.evidence-block {
  background: var(--bg-raise); border: 1px solid var(--line-soft);
  border-radius: 8px; padding: 12px;
}
.evidence-subject { font-size: 12px; margin-bottom: 10px; word-break: break-all; }
.ev-type { color: var(--cyan); }
.ev-subj { color: var(--ink-mute); }

.argv {
  font-size: 12.5px; background: #06090b; border: 1px solid var(--line);
  border-radius: 6px; padding: 10px 12px; color: var(--go);
  white-space: pre-wrap; word-break: break-all; margin: 0 0 12px;
}
.argv::before { content: "$ "; color: var(--ink-mute); }

.kv { display: grid; grid-template-columns: max-content 1fr; gap: 5px 14px; }
.kv dt { color: var(--ink-mute); font-size: 12px; }
.kv dd { margin: 0; font-size: 12.5px; word-break: break-all; }
.hash { color: var(--cyan); }

.raw-toggle { margin-top: 10px; }
.raw-toggle summary { cursor: pointer; color: var(--cyan); font-size: 12px; font-family: var(--mono); }
.raw {
  font-size: 12px; line-height: 1.45; background: #06090b;
  border: 1px solid var(--line); border-radius: 6px; padding: 12px 14px;
  color: var(--ink-soft); white-space: pre-wrap; word-break: break-word;
  max-height: 420px; overflow: auto; margin: 10px 0 0;
}
.ev-permalink { display: inline-block; margin-top: 10px; color: var(--cyan); font-size: 12px; text-decoration: none; }
.ev-permalink:hover { text-decoration: underline; }

.no-evidence-note {
  color: var(--hold); font-family: var(--mono); font-size: 12.5px;
  padding: 10px 12px; border: 1px dashed rgba(240,180,41,.4); border-radius: 6px;
}

/* -- run meta + finding deep-link panels --------------------------------- */
.run-meta {
  background: var(--panel); border: 1px solid var(--line-soft);
  border-radius: 10px; padding: 14px 16px; margin-top: 8px;
}
.run-meta summary {
  cursor: pointer; color: var(--ink-soft); font-size: 13px; font-weight: 600;
}
.run-meta .kv { margin-top: 12px; }

.panel {
  background: var(--panel); border: 1px solid var(--line);
  border-radius: 10px; padding: 16px; margin: 0 0 16px;
}
.panel h2 {
  font-size: 13px; text-transform: uppercase; letter-spacing: .1em;
  color: var(--ink-mute); margin: 0 0 12px; font-weight: 650;
}
.plain-panel p { margin: 0 0 10px; color: var(--ink-soft); font-size: 14px; }
.plain-panel p:last-child { margin-bottom: 0; }
.plain-panel strong { color: var(--ink); }
.evidence-panel { border-color: var(--go-deep); }
.evidence-panel h2 { color: var(--go); }

.finding-head { display: flex; align-items: center; gap: 10px; }
.finding-head .view-title { margin: 0; }

.data-block { margin-top: 8px; }
.data-block summary { cursor: pointer; color: var(--cyan); font-size: 12.5px; font-family: var(--mono); }
.data-block .raw { margin-top: 10px; }

/* =======================================================================
   ACTIVITY FEED (cross-engagement audit stream)
   ======================================================================= */
.feed { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.feed-row { margin: 0; }
.feed-link {
  display: flex; align-items: flex-start; gap: 12px;
  background: var(--panel); border: 1px solid var(--line);
  border-left: 3px solid var(--line); border-radius: 10px;
  padding: 12px 14px; text-decoration: none; color: inherit;
  transition: border-color .14s var(--ease), background .14s var(--ease);
}
.feed-link:hover { border-color: var(--cyan); border-left-color: var(--cyan); background: #161e25; }
.feed-glyph {
  flex: none; font-size: 16px; line-height: 1.4; width: 20px; text-align: center;
  color: var(--ink-mute);
}
.feed-glyph.tone-go   { color: var(--go); }
.feed-glyph.tone-hold { color: var(--hold); }
.feed-glyph.tone-stop { color: var(--stop); }
.feed-main { min-width: 0; flex: 1; }
.feed-top { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; }
.feed-kind {
  display: inline-flex; align-items: center; gap: 6px;
  font-family: var(--mono); font-size: 11px; letter-spacing: .06em;
  text-transform: uppercase; color: var(--ink-soft);
}
.feed-ts { font-size: 11.5px; color: var(--ink-mute); }
.feed-summary { font-size: 14px; color: var(--ink); margin-top: 4px; word-break: break-word; }
.feed-eng { font-size: 11px; color: var(--ink-mute); margin-top: 3px; word-break: break-all; }
.feed-open {
  flex: none; align-self: center; font-size: 11.5px; color: var(--cyan);
  white-space: nowrap;
}

/* -- reveal-on-load (the orchestrated entrance) -------------------------- */
.reveal-step {
  opacity: 0; transform: translateY(12px);
  transition: opacity .5s var(--ease), transform .5s var(--ease);
}
.reveal-step.in { opacity: 1; transform: none; }

/* -- states -------------------------------------------------------------- */
.empty, .loading, .error {
  padding: 26px; text-align: center; color: var(--ink-mute);
  font-family: var(--mono); font-size: 13px;
}
.error { color: var(--stop); }
.loading.small, .error.small { padding: 12px; text-align: left; font-size: 12px; }

/* -- footer -------------------------------------------------------------- */
.footnote {
  max-width: 1080px; margin: 0 auto; padding: 18px 20px 40px;
  color: var(--ink-mute); font-size: 12.5px;
  border-top: 1px solid var(--line-soft);
}

/* -- responsive ---------------------------------------------------------- */
@media (max-width: 760px) {
  .map-stage { grid-template-columns: 1fr; }
  .map-apex { justify-self: start; }
  .map-sweep { display: none; }
}
@media (max-width: 560px) {
  main { padding: 16px 14px 32px; }
  .topbar { flex-wrap: wrap; gap: 8px; }
  .brand-sub { display: none; }
  .topnav { margin-left: 0; margin-right: 0; order: 3; width: 100%; }
  .topnav-link { flex: 1; text-align: center; }
  .feed-open { display: none; }
  .verdict { flex-direction: column; align-items: flex-start; gap: 14px; }
  .verdict-line { font-size: 16px; }
  .glance-grid { grid-template-columns: 1fr; }
  .item-summary { grid-template-columns: auto 1fr; }
  .item-sev { grid-column: 2; justify-self: start; margin-top: 2px; }
  .kv { grid-template-columns: 1fr; gap: 1px 0; }
  .kv dt { margin-top: 8px; }
}

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; scroll-behavior: auto !important; animation: none !important; }
  .reveal-step { opacity: 1; transform: none; }
  .map-node { opacity: 1; transform: none; }
  /* keep a static glow on lenses so the signal still reads */
  .verdict-lens.tone-go   { box-shadow: 0 0 18px var(--go-glow); }
  .verdict-lens.tone-hold { box-shadow: 0 0 18px var(--hold-glow); }
  .verdict-lens.tone-stop { box-shadow: 0 0 18px var(--stop-glow); }
}

/* -- sign-in / not-authorized screens ------------------------------------ */
.auth-panel { max-width: 460px; margin: 40px auto; }
.auth-methods { display: flex; flex-direction: column; gap: 10px; margin: 18px 0 12px; }
.auth-btn {
  display: block; text-align: center; text-decoration: none;
  padding: 11px 14px; border-radius: 8px;
  border: 1px solid var(--go-deep); color: var(--go);
  background: rgba(54,224,127,0.06); font-weight: 600;
  transition: background .15s ease, box-shadow .15s ease;
}
.auth-btn:hover { background: rgba(54,224,127,0.14); box-shadow: 0 0 18px var(--go-glow); }
.auth-btn.ghost { border-color: #555; color: #bbb; background: transparent; }
.auth-btn.ghost:hover { background: rgba(255,255,255,0.04); box-shadow: none; }
.auth-fineprint { font-size: 12px; color: #888; margin: 6px 0 0; }

/* -- launch: New run button + the launch view ---------------------------- */
/* The privileged, scan-launching path. Instrument-panel styling: the gates are
   visible, the kill switch is loud, nothing animates that would obscure state. */

.view-head {
  display: flex; align-items: center; justify-content: space-between;
  gap: 14px; flex-wrap: wrap; margin-bottom: 2px;
}
.view-head .view-title { margin: 0; }

.btn-primary {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 9px 15px; border-radius: 8px;
  border: 1px solid var(--go-deep); color: var(--go);
  background: rgba(54,224,127,0.07); font-weight: 600; font-size: 13.5px;
  text-decoration: none; cursor: pointer;
  transition: background .14s var(--ease), box-shadow .14s var(--ease);
}
.btn-primary:hover { background: rgba(54,224,127,0.15); box-shadow: 0 0 16px var(--go-glow); }
.btn-primary:active { transform: translateY(1px); }
.btn-primary[disabled], .btn-primary[aria-disabled="true"] {
  border-color: var(--line); color: var(--ink-mute);
  background: var(--bg-raise); cursor: not-allowed; box-shadow: none;
}
.btn-glyph { font-weight: 700; line-height: 1; }

/* A quieter secondary action next to .btn-primary. Same shape, cyan accent,
   transparent fill: it reads as "also available" without competing. Used for
   the server-rendered report export on the run-detail view. */
.btn-ghost {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 9px 15px; border-radius: 8px;
  border: 1px solid var(--line); color: var(--cyan);
  background: transparent; font-weight: 600; font-size: 13.5px;
  font-family: inherit; text-decoration: none; cursor: pointer;
  transition: background .14s var(--ease), border-color .14s var(--ease);
}
.btn-ghost:hover { background: rgba(79,195,220,0.08); border-color: var(--cyan); }
.btn-ghost:active { transform: translateY(1px); }
.btn-ghost[disabled] { color: var(--ink-mute); cursor: progress; border-color: var(--line); }

/* The scope picker: a radiogroup of cards. */
.launch-picker { display: grid; gap: 10px; margin: 0 0 22px;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); }
.scope-card {
  text-align: left; cursor: pointer; font: inherit; color: inherit;
  background: var(--panel); border: 1px solid var(--line);
  border-left: 3px solid var(--line); border-radius: 10px; padding: 12px 14px;
  transition: border-color .14s var(--ease), background .14s var(--ease);
}
.scope-card:hover { border-color: var(--cyan); border-left-color: var(--cyan); background: #161e25; }
.scope-card.selected { border-color: var(--go-deep); border-left-color: var(--go); background: rgba(54,224,127,0.05); }
.scope-card.denied { border-left-color: var(--stop); }
.scope-card-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.scope-card-name { font-weight: 600; color: var(--ink); word-break: break-word; }
.scope-card-file { font-size: 11px; color: var(--ink-mute); margin-top: 3px; word-break: break-all; }
.scope-card-hosts { font-size: 11.5px; color: var(--ink-soft); margin-top: 6px; word-break: break-all; }
.scope-card-flag { font-size: 11.5px; color: var(--stop); margin-top: 6px; font-weight: 600; }

/* The pre-flight panel: the gates, made visible. */
.preflight { display: grid; gap: 16px; }
.preflight-kv { margin: 0; }
.preflight-block { display: grid; gap: 6px; }
.preflight-label {
  font-size: 12px; text-transform: uppercase; letter-spacing: .1em;
  color: var(--ink-mute); font-weight: 650;
}
.preflight-note { font-size: 12.5px; color: var(--ink-mute); margin: 2px 0 0; max-width: 70ch; }
.chip-row { display: flex; flex-wrap: wrap; gap: 6px; }
.muted { color: var(--ink-mute); font-size: 12.5px; }

.tech-chip {
  font-size: 11.5px; padding: 2px 9px; border-radius: 999px;
  border: 1px solid var(--line); background: var(--bg-raise);
}
.tech-chip.allow { color: var(--go); border-color: rgba(54,224,127,.4); }
.tech-chip.deny  { color: var(--stop); border-color: rgba(239,83,80,.4);
  text-decoration: line-through; text-decoration-thickness: 1.5px; opacity: .85; }

/* The kill-switch banner: loud, when automated scanning is denied. */
.launch-blocked {
  border: 1px solid rgba(239,83,80,.5); border-left: 3px solid var(--stop);
  background: rgba(239,83,80,0.07); color: var(--ink);
  padding: 12px 14px; border-radius: 9px; font-size: 13.5px; line-height: 1.5;
}

.launch-controls { display: flex; align-items: center; gap: 14px; flex-wrap: wrap;
  margin-top: 4px; padding-top: 14px; border-top: 1px solid var(--line-soft); }
.launch-status { font-family: var(--mono); font-size: 12.5px; color: var(--ink-soft); }
.launch-status.running { color: var(--hold); }
.launch-status.done    { color: var(--go); }
.launch-status.error   { color: var(--stop); }
.launch-link { color: var(--cyan); text-decoration: none; font-weight: 600; }
.launch-link:hover { text-decoration: underline; }

/* =======================================================================
   THE REPORT (the customer deliverable)
   On screen it wears the instrument-panel theme, same family as the run
   view. The @media print block at the very bottom strips the app chrome and
   re-renders it ink-on-paper for the browser's Save-as-PDF.
   ======================================================================= */

/* The "Download report (PDF)" action on the run-detail view. */
.run-actions { display: flex; justify-content: flex-end; gap: 10px; flex-wrap: wrap; margin: 0 0 14px; }

/* On-screen action bar inside the report view: back link + Save as PDF. */
.report-actionbar {
  display: flex; align-items: center; justify-content: space-between;
  gap: 14px; flex-wrap: wrap; margin: 0 0 20px;
}
.report-back { color: var(--cyan); text-decoration: none; font-size: 13px; font-family: var(--mono); }
.report-back:hover { text-decoration: underline; }

.report { max-width: 100%; }

.report-titleblock { margin: 0 0 22px; padding: 0 0 18px; border-bottom: 1px solid var(--line); }
.report-brand { display: flex; align-items: center; gap: 12px; margin: 0 0 14px; }
.report-brand .eye-svg { color: var(--ink); }
.report-brand-name { font-family: var(--mono); font-weight: 700; letter-spacing: 0.18em; font-size: 15px; }
.report-brand-sub { color: var(--ink-mute); font-size: 12px; }
.report-title { font-size: 22px; font-weight: 650; margin: 0 0 14px; line-height: 1.3; }

.report-meta { display: grid; grid-template-columns: max-content 1fr; gap: 6px 18px; margin: 0; }
.report-meta-row { display: contents; }
.report-meta dt { color: var(--ink-mute); font-size: 12.5px; }
.report-meta dd { margin: 0; font-size: 13px; color: var(--ink-soft); word-break: break-word; }

.report-verdict {
  display: grid; gap: 8px;
  background: linear-gradient(180deg, var(--panel), var(--bg-raise));
  border: 1px solid var(--line); border-left: 3px solid var(--line);
  border-radius: 12px; padding: 16px 18px; margin: 0 0 24px;
}
.report-verdict.tone-go   { border-left-color: var(--go); }
.report-verdict.tone-hold { border-left-color: var(--hold); }
.report-verdict.tone-stop { border-left-color: var(--stop); }
.report-verdict-word {
  display: flex; align-items: center; gap: 8px;
  font-family: var(--mono); font-size: 11.5px; letter-spacing: .14em;
  text-transform: uppercase; color: var(--ink-soft);
}
.report-verdict-line { margin: 0; font-size: 16px; line-height: 1.5; color: var(--ink); }

.report-h2 {
  font-size: 13px; text-transform: uppercase; letter-spacing: .12em;
  color: var(--ink-mute); font-weight: 650; margin: 28px 0 12px;
}

.report-table { width: 100%; border-collapse: collapse; margin: 0 0 8px; font-size: 13px; }
.report-table th, .report-table td {
  text-align: left; padding: 9px 10px; border-bottom: 1px solid var(--line-soft);
  vertical-align: top;
}
.report-table th {
  color: var(--ink-mute); font-size: 11px; text-transform: uppercase;
  letter-spacing: .08em; font-weight: 650;
}
.report-table td { color: var(--ink-soft); word-break: break-word; }

.report-finding {
  background: var(--panel); border: 1px solid var(--line);
  border-left: 3px solid var(--line); border-radius: 10px;
  padding: 16px 18px; margin: 0 0 14px;
  break-inside: avoid; page-break-inside: avoid;
}
.report-finding.tone-go   { border-left-color: var(--go); }
.report-finding.tone-hold { border-left-color: var(--hold); }
.report-finding.tone-stop { border-left-color: var(--stop); }
.report-finding-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin: 0 0 10px; }
.report-finding-title { font-size: 16px; font-weight: 600; margin: 0; flex: 1; min-width: 0; word-break: break-word; }
.report-finding-n { color: var(--ink-mute); }
.report-finding-sev {
  font-family: var(--mono); font-size: 10.5px; letter-spacing: .08em;
  text-transform: uppercase; padding: 3px 9px; border-radius: 999px;
  border: 1px solid var(--line); white-space: nowrap;
}
.report-finding-sev.sev-stop { color: var(--stop); border-color: rgba(239,83,80,.4); }
.report-finding-sev.sev-hold { color: var(--hold); border-color: rgba(240,180,41,.4); }
.report-finding-sev.sev-go   { color: var(--go);   border-color: rgba(54,224,127,.4); }

.report-finding-meta { display: grid; grid-template-columns: max-content 1fr; gap: 4px 16px; margin: 0 0 12px; }
.report-finding-meta dt { color: var(--ink-mute); font-size: 12px; }
.report-finding-meta dd { margin: 0; font-size: 12.5px; color: var(--ink-soft); word-break: break-word; }
.report-finding p { margin: 0 0 9px; font-size: 13.5px; color: var(--ink-soft); line-height: 1.55; }
.report-finding strong { color: var(--ink); font-weight: 600; }

.report-proof-h { font-size: 11.5px; text-transform: uppercase; letter-spacing: .1em; color: var(--go); margin: 14px 0 8px; font-weight: 650; }
.report-proof {
  background: var(--bg-raise); border: 1px solid var(--line-soft);
  border-radius: 8px; padding: 12px; margin: 0 0 10px;
  break-inside: avoid; page-break-inside: avoid;
}
.report-proof:last-child { margin-bottom: 0; }
.report-proof-subject { font-size: 12px; color: var(--ink-mute); margin: 0 0 8px; word-break: break-all; }
.report-argv {
  font-size: 12.5px; background: #06090b; border: 1px solid var(--line);
  border-radius: 6px; padding: 10px 12px; color: var(--go);
  white-space: pre-wrap; word-break: break-all; margin: 0 0 10px;
}
.report-argv::before { content: "$ "; color: var(--ink-mute); }
.report-proof-kv { display: grid; grid-template-columns: max-content 1fr; gap: 4px 14px; margin: 0; }
.report-proof-kv dt { color: var(--ink-mute); font-size: 11.5px; }
.report-proof-kv dd { margin: 0; font-size: 12px; word-break: break-all; }
.report-proof-absent {
  color: var(--hold); font-family: var(--mono); font-size: 12px;
  padding: 8px 10px; border: 1px dashed rgba(240,180,41,.4); border-radius: 6px;
}

.report-recs { margin: 0; padding-left: 0; list-style: none; display: grid; gap: 12px; }
.report-rec {
  background: var(--panel); border: 1px solid var(--line); border-radius: 10px;
  padding: 14px 16px; break-inside: avoid; page-break-inside: avoid;
}
.report-rec-head { display: flex; align-items: center; gap: 10px; justify-content: space-between; margin: 0 0 8px; }
.report-rec-title { font-weight: 600; color: var(--ink); }
.report-rec-sev { font-family: var(--mono); font-size: 10.5px; letter-spacing: .08em; text-transform: uppercase; color: var(--ink-mute); }
.report-rec p { margin: 0 0 6px; font-size: 13px; color: var(--ink-soft); line-height: 1.5; }
.report-rec strong { color: var(--ink); }

.report-leads { margin: 0; padding-left: 18px; display: grid; gap: 6px; font-size: 13px; color: var(--ink-soft); }
.report-lead-via { color: var(--ink-mute); }
.report-lede { color: var(--ink-soft); font-size: 13.5px; margin: 0 0 12px; max-width: 70ch; }
.report-clear { color: var(--ink-soft); font-size: 13.5px; margin: 0; }
.report-empty { color: var(--ink-mute); font-size: 13px; }

.report-footer { margin-top: 28px; padding-top: 16px; border-top: 1px solid var(--line); color: var(--ink-mute); }
.report-footer p { margin: 0 0 6px; font-size: 12.5px; }
.report-footer-meta { color: var(--ink-soft); }
.report-footer-note { font-size: 12px; max-width: 78ch; }

/* =======================================================================
   PRINT: the deliverable, ink-on-paper.
   Save-as-PDF defaults to printing the dark instrument-panel background,
   which wastes toner and reads poorly on paper. In report-mode we drop ALL
   app chrome (topbar, crumbs, footer, the on-screen action bar) and re-skin
   the report as dark ink on white, with page breaks that never split a
   finding or its proof across a page.

   Phase 2 seam: the same report model (buildReport) can be rendered
   server-side to identical HTML and run through WeasyPrint for a one-click
   server PDF. That path reuses these print rules. Not built here.
   ======================================================================= */
@media print {
  /* Hide app chrome and any on-screen-only control. */
  .topbar, .crumbs, .footnote, .skip-link,
  .no-print, .report-actionbar, .run-actions { display: none !important; }

  /* Paper, not instrument panel. White page, dark ink, no grid, no glow. */
  html, body {
    background: #fff !important;
    background-image: none !important;
    color: #15191c !important;
  }
  body::before { display: none !important; }
  main { padding: 0 !important; max-width: 100% !important; margin: 0 !important; }
  main:focus { outline: none; }

  /* Only the report prints. Belt and suspenders: in report-mode the view holds
     just the report and the (hidden) action bar. */
  .report { color: #15191c; }

  /* Re-skin every report surface for paper. Light card fills, hairline
     borders, retained left-accent so severity still reads in grayscale. */
  .report-titleblock { border-bottom: 1px solid #c8ced2; }
  .report-brand .eye-svg,
  .report-brand-name { color: #15191c !important; }
  .report-brand-sub, .report-meta dt, .report-meta dd,
  .report-h2, .report-finding-meta dt, .report-finding-meta dd,
  .report-finding p, .report-rec p, .report-leads,
  .report-lede, .report-clear, .report-footer p,
  .report-table th, .report-table td, .report-verdict-word {
    color: #2b3236 !important;
  }
  .report-title, .report-finding-title, .report-rec-title,
  .report-finding strong, .report-rec strong { color: #15191c !important; }
  .report-h2 { color: #3a4247 !important; border-bottom: 1px solid #e2e6e8; padding-bottom: 4px; }

  .report-verdict, .report-finding, .report-rec, .report-proof {
    background: #fafbfb !important; border: 1px solid #d4d9dc !important;
    box-shadow: none !important;
  }
  /* Keep the colored left accent so high/medium/clear still reads on paper. */
  .report-verdict, .report-finding { border-left-width: 3px !important; }
  .report-verdict.tone-go,   .report-finding.tone-go   { border-left-color: #1f9c57 !important; }
  .report-verdict.tone-hold, .report-finding.tone-hold { border-left-color: #b07d09 !important; }
  .report-verdict.tone-stop, .report-finding.tone-stop { border-left-color: #c0322f !important; }
  .report-verdict-line { color: #15191c !important; }

  .report-finding-sev, .report-rec-sev { color: #3a4247 !important; border-color: #c8ced2 !important; }

  /* The replayable command: a code block readable on paper, command in dark
     green ink so it still reads as "the proof you can run". */
  .report-argv {
    background: #f1f3f4 !important; border: 1px solid #d4d9dc !important;
    color: #14622f !important;
  }
  .report-argv::before { color: #6a7479 !important; }
  .report-proof-kv dt, .report-proof-subject { color: #4a5358 !important; }
  .report-proof-kv dd { color: #2b3236 !important; }
  .report-proof-absent { color: #8a5e00 !important; border-color: #d6b34a !important; }

  .report-table th { border-bottom: 1px solid #c8ced2 !important; }
  .report-table td { border-bottom: 1px solid #e2e6e8 !important; }
  .report-footer { border-top: 1px solid #c8ced2 !important; }
  .report-footer-meta { color: #15191c !important; }

  /* The signal dots: keep them as solid ink so they reproduce in grayscale,
     drop the glow which prints as a muddy halo. */
  .light-dot { box-shadow: none !important; }
  .light-dot.green   { background: #1f9c57 !important; }
  .light-dot.amber   { background: #b07d09 !important; }
  .light-dot.red     { background: #c0322f !important; }
  .light-dot.neutral { background: #8a939a !important; }

  /* Page breaks: never split a finding, a recommendation, or a proof block
     across a page. Keep a heading with the content under it. */
  .report-finding, .report-rec, .report-proof,
  .report-table tr { break-inside: avoid; page-break-inside: avoid; }
  .report-h2, .report-finding-title { break-after: avoid; page-break-after: avoid; }
  .report-titleblock { break-after: avoid; page-break-after: avoid; }

  @page { margin: 16mm 14mm; }
}
