/* ===========================================================================
   GGWar console — dark, dense, terminal-adjacent analyst tool.
   Restrained palette: near-black ground, one amber/red high-severity accent,
   one green confirmed-good. No gradients; motion limited to progress + pulse.
   =========================================================================== */

/* The UA rule for [hidden] is display:none at element-selector strength, so any
   class that sets display (.modal-scrim, .site-drawer) silently beats it and
   the element stays on screen however many times JS sets hidden = true.
   Everything here toggles visibility through the hidden attribute, so make it
   authoritative once, globally. */
[hidden] {
  display: none !important;
}

:root {
  --bg:          #0a0b0d;
  --bg-1:        #101216;
  --bg-2:        #161a20;
  --bg-3:        #1d222a;
  --line:        #2a3038;
  --line-soft:   #20252d;
  --fg:          #d7dde5;
  --fg-dim:      #8a94a2;
  --fg-faint:    #5b636e;

  --accent:      #e0922f;   /* amber — high severity / IN */
  --accent-red:  #e5484d;   /* red — restricted / danger  */
  --good:        #3fb96b;   /* green — confirmed          */
  --blue:        #4c8dd6;   /* OUT direction              */
  --grey-pill:   #59616c;   /* BOTH / neutral             */

  --focus:       #6ea8fe;

  --mono: "SFMono-Regular", ui-monospace, "Cascadia Mono", "JetBrains Mono", Consolas, "Liberation Mono", Menlo, monospace;
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;

  --row-h: 30px;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: var(--sans);
  font-size: 13px;
  line-height: 1.4;
  overflow-x: hidden;            /* page body never scrolls horizontally */
}

.mono { font-family: var(--mono); }

.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

/* Focus visibility everywhere */
:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 1px;
}

/* ---------- Buttons ---------- */
.btn {
  font-family: var(--sans);
  font-size: 12px;
  color: var(--fg);
  background: var(--bg-2);
  border: 1px solid var(--line);
  border-radius: 3px;
  padding: 5px 11px;
  cursor: pointer;
}
.btn:hover:not(:disabled) { background: var(--bg-3); border-color: #37404a; }
.btn:disabled { opacity: .4; cursor: not-allowed; }
.btn-accent { border-color: var(--accent); color: var(--accent); }
.btn-accent:hover:not(:disabled) { background: rgba(224,146,47,.12); }
.btn-run { border-color: var(--good); color: var(--good); }
.btn-run:hover:not(:disabled) { background: rgba(63,185,107,.12); }
.btn-stop { border-color: var(--accent-red); color: var(--accent-red); }
.btn-stop:hover:not(:disabled) { background: rgba(229,72,77,.12); }
.btn-icon { padding: 2px 9px; font-size: 18px; line-height: 1; }

/* ---------- Header ---------- */
.app-header {
  display: flex; align-items: center; justify-content: space-between;
  gap: 16px; padding: 9px 16px;
  background: var(--bg-1);
  border-bottom: 1px solid var(--line);
}
.brand { display: flex; align-items: baseline; gap: 12px; }
.brand-mark {
  font-family: var(--mono); font-weight: 700; font-size: 17px;
  letter-spacing: 1px; color: var(--fg);
}
.brand-sub { color: var(--fg-faint); font-size: 11px; }
.case-picker { display: flex; align-items: center; gap: 8px; }
#case-select {
  font-family: var(--mono); font-size: 12px;
  background: var(--bg-2); color: var(--fg);
  border: 1px solid var(--line); border-radius: 3px;
  padding: 5px 8px; min-width: 220px;
}

/* ---------- Restricted strip (non-dismissible) ---------- */
.restricted-strip {
  background: rgba(229,72,77,.08);
  border-top: 1px solid var(--accent-red);
  border-bottom: 1px solid var(--accent-red);
  color: #f0a6a8;
  font-family: var(--mono); font-size: 11px; letter-spacing: .4px;
  text-align: center; padding: 4px 8px;
}

/* ---------- Error strip ---------- */
.error-strip {
  background: rgba(229,72,77,.14);
  border-bottom: 1px solid var(--accent-red);
  color: #f3b0b2; font-family: var(--mono); font-size: 12px;
  padding: 6px 16px;
}

/* ---------- Case bar ---------- */
.case-bar {
  position: relative;
  padding: 8px 16px 0;
  background: var(--bg-1);
  border-bottom: 1px solid var(--line);
}
.case-meta { display: flex; align-items: baseline; gap: 12px; margin-bottom: 6px; }
.case-name { font-weight: 600; font-size: 14px; }
.case-legal { color: var(--fg-faint); font-size: 11px; font-family: var(--mono); }
.case-controls {
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
  padding-bottom: 8px;
}
.status-pill {
  font-family: var(--mono); font-size: 11px; text-transform: uppercase;
  padding: 2px 9px; border-radius: 10px; border: 1px solid var(--line);
  color: var(--fg-dim); letter-spacing: .5px;
}
.status-pill[data-state="running"]  { color: var(--good); border-color: var(--good); }
.status-pill[data-state="running"]::before {
  content: "\25CF"; margin-right: 5px; color: var(--good);
  display: inline-block; animation: pulse 1.4s ease-in-out infinite;
}
.status-pill[data-state="stopping"] { color: var(--accent); border-color: var(--accent); }
.status-pill[data-state="done"]     { color: var(--good); border-color: var(--good); }
.status-pill[data-state="error"]    { color: var(--accent-red); border-color: var(--accent-red); }

@keyframes pulse { 0%,100% { opacity: 1; } 50% { opacity: .25; } }

.counters { font-family: var(--mono); font-size: 12px; color: var(--fg-dim); }
.counters b { color: var(--fg); }
.counters .sep { color: var(--fg-faint); margin: 0 3px; }
.counters .counter { margin-right: 10px; }
.counters .dim { color: var(--fg-faint); }
#cnt-current { max-width: 360px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; display: inline-block; vertical-align: bottom; }

.exports { margin-left: auto; display: flex; gap: 12px; }
.exp-link {
  font-family: var(--mono); font-size: 11px; color: var(--fg-dim);
  text-decoration: none; border-bottom: 1px dotted var(--fg-faint);
}
.exp-link:hover { color: var(--accent); border-color: var(--accent); }

/* Progress bar — 1px animated */
.progress { height: 2px; background: var(--line-soft); }
.progress-fill {
  height: 100%; width: 0%; background: var(--accent);
  transition: width .4s linear;
}

/* ---------- Stat row ---------- */
.stat-row {
  display: grid;
  grid-template-columns: 1.6fr repeat(7, 1fr);
  gap: 8px; padding: 12px 16px;
  background: var(--bg);
}
.tile {
  background: var(--bg-1); border: 1px solid var(--line-soft);
  border-radius: 4px; padding: 8px 10px; min-width: 0;
}
.tile-val { font-family: var(--mono); font-size: 20px; font-weight: 600; color: var(--fg); }
.tile-lbl { font-size: 10px; text-transform: uppercase; letter-spacing: .5px; color: var(--fg-faint); margin-top: 2px; }
.tile-hero {
  background: rgba(63,185,107,.07);
  border: 1px solid var(--good);
  grid-row: span 1;
}
.tile-hero .tile-val { font-size: 34px; color: var(--good); line-height: 1.05; }
.tile-hero .tile-lbl { color: #79c894; }

/* ---------- Tabs ---------- */
.tabs {
  display: flex; gap: 2px; padding: 0 16px;
  background: var(--bg); border-bottom: 1px solid var(--line);
}
.tab {
  background: transparent; border: none; color: var(--fg-dim);
  font-family: var(--sans); font-size: 13px; padding: 9px 14px;
  cursor: pointer; border-bottom: 2px solid transparent; margin-bottom: -1px;
}
.tab:hover { color: var(--fg); }
.tab[aria-selected="true"] { color: var(--fg); border-bottom-color: var(--accent); }

/* ---------- Panels ---------- */
.panels { padding: 12px 16px 80px; }
.panel-toolbar {
  display: flex; align-items: center; gap: 14px; flex-wrap: wrap;
  margin-bottom: 10px;
}
.filter-box {
  flex: 1 1 260px; max-width: 420px;
  background: var(--bg-1); border: 1px solid var(--line);
  color: var(--fg); font-family: var(--mono); font-size: 12px;
  padding: 6px 9px; border-radius: 3px;
}
.toggle { display: inline-flex; align-items: center; gap: 6px; cursor: pointer; user-select: none; color: var(--fg-dim); font-size: 12px; }
.toggle input { accent-color: var(--accent); }

/* ---------- Tables ---------- */
.table-scroll {
  overflow-x: auto; overflow-y: visible;
  border: 1px solid var(--line-soft); border-radius: 4px;
  background: var(--bg-1);
}
.data-table { width: 100%; border-collapse: collapse; min-width: 720px; }
.data-table thead th {
  position: sticky; top: 0;
  background: var(--bg-2); color: var(--fg-dim);
  font-size: 10px; text-transform: uppercase; letter-spacing: .5px;
  text-align: left; padding: 7px 10px; white-space: nowrap;
  border-bottom: 1px solid var(--line); cursor: pointer; user-select: none;
}
.data-table thead th:hover { color: var(--fg); }
.data-table thead th.sorted-asc::after  { content: " \25B2"; color: var(--accent); }
.data-table thead th.sorted-desc::after { content: " \25BC"; color: var(--accent); }
.data-table tbody td {
  padding: 5px 10px; border-bottom: 1px solid var(--line-soft);
  vertical-align: top; font-size: 12px;
}
.data-table tbody tr:hover { background: var(--bg-2); }
.data-table tbody tr.clickable { cursor: pointer; }

.table-caption { color: var(--fg-faint); font-size: 11px; margin: 8px 2px 0; font-style: italic; }

.empty-row td, .empty-state {
  color: var(--fg-faint); text-align: center; padding: 28px 10px !important;
  font-style: italic;
}

/* ---------- Pills ---------- */
.pill {
  display: inline-block; font-family: var(--mono); font-size: 10px;
  padding: 1px 7px; border-radius: 9px; border: 1px solid var(--line);
  text-transform: uppercase; letter-spacing: .3px; white-space: nowrap;
}
.pill-in    { color: var(--accent);   border-color: var(--accent); }
.pill-out   { color: var(--blue);     border-color: var(--blue); }
.pill-both  { color: var(--fg-dim);   border-color: var(--grey-pill); }
.pill-unknown { color: var(--fg-faint); border-color: var(--line); }

.pill-confirmed { color: var(--good);   border-color: var(--good); }
.pill-probable  { color: var(--accent); border-color: var(--accent); }
.pill-candidate { color: var(--fg-faint); border-color: var(--line); opacity: .7; }

.pill-label { color: var(--fg-dim); border-color: var(--line); }
.pill-illegal_betting_confirmed { color: var(--accent-red); border-color: var(--accent-red); }
.pill-probable_betting { color: var(--accent); border-color: var(--accent); }
.pill-compromised_host { color: var(--blue); border-color: var(--blue); }
.pill-suspicious { color: var(--fg-dim); border-color: var(--grey-pill); }

/* Account number — large monospace, click-to-copy */
.acct-num {
  font-family: var(--mono); font-size: 15px; font-weight: 600;
  color: var(--fg); cursor: copy; letter-spacing: .5px;
  border-bottom: 1px dashed transparent;
}
.acct-num:hover { border-bottom-color: var(--fg-faint); }
.acct-num.copied { color: var(--good); }
.acct-copied-flag { color: var(--good); font-size: 10px; margin-left: 6px; }

/* Sites cell expandable */
.sites-cell { }
.sites-toggle {
  background: none; border: none; color: var(--fg-dim); cursor: pointer;
  font-family: var(--mono); font-size: 12px; padding: 0;
}
.sites-toggle:hover { color: var(--accent); }
.sites-list { margin-top: 4px; }
.sites-list .dmn { display: block; font-family: var(--mono); font-size: 11px; color: var(--fg-dim); }

.cloak-flag { color: var(--accent-red); font-family: var(--mono); font-weight: 700; }
.cloak-none { color: var(--fg-faint); }

.dim-cell { color: var(--fg-faint); }
.url-cell { font-family: var(--mono); font-size: 11px; word-break: break-all; max-width: 480px; }

/* Score inline bar */
.scorebar { display: inline-flex; align-items: center; gap: 6px; }
.scorebar .track { width: 60px; height: 6px; background: var(--bg-3); border-radius: 3px; overflow: hidden; }
.scorebar .fill { height: 100%; background: var(--fg-dim); }
.scorebar.hi   .fill { background: var(--accent-red); }
.scorebar.mid  .fill { background: var(--accent); }
.scorebar.low  .fill { background: var(--fg-dim); }
.scorebar .num { font-family: var(--mono); font-size: 11px; width: 20px; text-align: right; }

/* ---------- Provenance summary (links) ---------- */
.provenance-summary { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 10px; }
.prov-chip {
  font-family: var(--mono); font-size: 11px; color: var(--fg-dim);
  background: var(--bg-1); border: 1px solid var(--line-soft);
  border-radius: 3px; padding: 3px 8px;
}
.prov-chip b { color: var(--fg); }

/* ---------- Filter chips ---------- */
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip {
  font-family: var(--mono); font-size: 11px; color: var(--fg-dim);
  background: var(--bg-1); border: 1px solid var(--line);
  border-radius: 12px; padding: 3px 11px; cursor: pointer;
}
.chip:hover { color: var(--fg); }
.chip.active { color: var(--bg); background: var(--accent); border-color: var(--accent); }

/* ---------- Clusters ---------- */
.cluster-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 12px;
}
.cluster-card {
  background: var(--bg-1); border: 1px solid var(--line);
  border-radius: 5px; padding: 12px;
}
.cluster-head { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; margin-bottom: 8px; }
.cluster-label { font-weight: 600; font-size: 14px; }
.cluster-stats { font-family: var(--mono); font-size: 11px; color: var(--fg-dim); }
.cluster-stats b { color: var(--fg); }
.pivots-block { margin: 8px 0; }
.pivots-title { font-size: 10px; text-transform: uppercase; color: var(--fg-faint); letter-spacing: .5px; margin-bottom: 4px; }
.pivot-tag {
  display: inline-block; font-family: var(--mono); font-size: 11px;
  color: var(--accent); background: rgba(224,146,47,.1);
  border: 1px solid var(--accent); border-radius: 3px;
  padding: 2px 8px; margin: 0 4px 4px 0; word-break: break-all;
}
.members-block { margin-top: 8px; border-top: 1px solid var(--line-soft); padding-top: 8px; }
.member-row {
  display: flex; align-items: center; gap: 8px; font-family: var(--mono);
  font-size: 11px; padding: 2px 0; color: var(--fg-dim);
}
.member-row .m-dom { color: var(--fg); flex: 1; word-break: break-all; }
.member-row .m-via { color: var(--fg-faint); }

/* ---------- Site drawer ---------- */
.drawer-scrim {
  position: fixed; inset: 0; background: rgba(0,0,0,.5); z-index: 40;
}
.site-drawer {
  position: fixed; top: 0; right: 0; height: 100vh; width: min(560px, 92vw);
  background: var(--bg-1); border-left: 1px solid var(--line);
  z-index: 41; display: flex; flex-direction: column;
  box-shadow: -8px 0 24px rgba(0,0,0,.4);
}
.drawer-head {
  display: flex; align-items: flex-start; justify-content: space-between;
  gap: 10px; padding: 12px 14px; border-bottom: 1px solid var(--line);
}
.drawer-domain { font-size: 15px; font-weight: 600; word-break: break-all; }
.drawer-sub { color: var(--fg-faint); font-size: 11px; margin-top: 3px; }
.drawer-body { overflow-y: auto; padding: 14px; flex: 1; }

.drawer-section { margin-bottom: 18px; }
.drawer-section h3 {
  font-size: 11px; text-transform: uppercase; letter-spacing: .6px;
  color: var(--fg-dim); margin: 0 0 8px; border-bottom: 1px solid var(--line-soft);
  padding-bottom: 4px;
}
.drawer-section.evidence h3 { color: var(--accent); }

.evidence-item {
  border-left: 2px solid var(--accent); padding: 4px 0 4px 10px;
  margin-bottom: 8px;
}
.evidence-item .ev-top { display: flex; justify-content: space-between; gap: 8px; }
.evidence-item .ev-signal { font-weight: 600; font-size: 12px; }
.evidence-item .ev-weight { font-family: var(--mono); color: var(--accent); font-size: 12px; }
.evidence-item .ev-detail { font-family: var(--mono); font-size: 11px; color: var(--fg-dim); margin-top: 3px; word-break: break-word; }

.mini-list { list-style: none; margin: 0; padding: 0; }
.mini-list li {
  font-family: var(--mono); font-size: 11px; color: var(--fg-dim);
  padding: 3px 0; border-bottom: 1px solid var(--line-soft); word-break: break-all;
}
.mini-list li b { color: var(--fg); }
.capture-hash { color: var(--fg-faint); }

/* ---------- New case modal ---------- */
.modal-scrim {
  position: fixed; inset: 0; background: rgba(0,0,0,.6);
  z-index: 50; display: flex; align-items: flex-start; justify-content: center;
  padding: 40px 16px; overflow-y: auto;
}
.modal {
  background: var(--bg-1); border: 1px solid var(--line); border-radius: 6px;
  width: min(560px, 100%);
}
.modal-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 16px; border-bottom: 1px solid var(--line);
}
.modal-head h2 { margin: 0; font-size: 15px; }
.modal-body { padding: 16px; display: flex; flex-direction: column; gap: 12px; }
.field { display: flex; flex-direction: column; gap: 4px; }
.field > span, .field-sm > span { font-size: 11px; color: var(--fg-dim); }
.field .req { color: var(--accent-red); font-style: normal; margin-left: 4px; font-size: 10px; }
.field input, .field textarea {
  background: var(--bg); border: 1px solid var(--line); color: var(--fg);
  font-family: var(--mono); font-size: 12px; padding: 7px 9px; border-radius: 3px;
}
.field textarea { resize: vertical; }
.settings-grid {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px;
  border: 1px solid var(--line-soft); border-radius: 4px; padding: 10px;
}
.settings-grid legend { font-size: 11px; color: var(--fg-dim); padding: 0 6px; }
.field-sm { display: flex; flex-direction: column; gap: 3px; }
.field-sm input {
  background: var(--bg); border: 1px solid var(--line); color: var(--fg);
  font-family: var(--mono); font-size: 12px; padding: 5px 7px; border-radius: 3px;
}
.switches { display: flex; gap: 18px; flex-wrap: wrap; }
.modal-error {
  background: rgba(229,72,77,.14); border: 1px solid var(--accent-red);
  color: #f3b0b2; font-size: 12px; padding: 7px 10px; border-radius: 3px;
}
.modal-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 4px; }

/* ---------- Log drawer ---------- */
.log-drawer {
  position: fixed; bottom: 0; left: 0; right: 0; z-index: 30;
  background: var(--bg-1); border-top: 1px solid var(--line);
}
.log-toggle {
  width: 100%; text-align: left; background: var(--bg-2); border: none;
  color: var(--fg-dim); font-family: var(--mono); font-size: 11px;
  padding: 6px 16px; cursor: pointer; display: flex; align-items: center; gap: 8px;
}
.log-toggle:hover { color: var(--fg); }
.log-caret { display: inline-block; transition: transform .15s; font-size: 8px; }
.log-toggle[aria-expanded="true"] .log-caret { transform: rotate(180deg); }
.log-count { color: var(--fg-faint); }
.log-body {
  max-height: 220px; overflow-y: auto; padding: 8px 16px;
  font-family: var(--mono); font-size: 11px; background: var(--bg);
}
.log-line { display: flex; gap: 10px; padding: 1px 0; }
.log-line .lt { color: var(--fg-faint); flex: 0 0 auto; }
.log-line .lm { word-break: break-word; }
.log-line.info  .lm { color: var(--fg-dim); }
.log-line.warn  .lm { color: var(--accent); }
.log-line.warn  .ll { color: var(--accent); }
.log-line.error .lm { color: var(--accent-red); }
.log-line.error .ll { color: var(--accent-red); }
.log-line.good  .lm { color: var(--good); }
.log-line .ll { flex: 0 0 46px; text-transform: uppercase; color: var(--fg-faint); }

/* ---------- Responsive down to 1280px ---------- */
@media (max-width: 1280px) {
  .stat-row { grid-template-columns: 1.6fr repeat(3, 1fr); }
}

/* ---------- Engine connector (engine.js) ---------- */
.engine-bar {
  display: flex; align-items: center; gap: 7px; margin-left: 10px;
}
.engine-dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--fg-dim, #6b7684); flex: 0 0 auto;
}
.engine-dot.is-live  { background: var(--accent-green, #3fb950);
                       box-shadow: 0 0 0 2px rgba(63,185,80,.18); }
.engine-dot.is-down  { background: var(--accent-amber, #e3b341); }
.engine-label {
  font-family: var(--mono); font-size: 10.5px; letter-spacing: .3px;
  color: var(--fg-dim, #8b95a3); max-width: 240px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.btn-slim { padding: 3px 8px; font-size: 11px; }

.engine-panel {
  position: fixed; top: 52px; right: 14px; z-index: 60; width: min(390px, 92vw);
  background: var(--bg-1); border: 1px solid var(--line); border-radius: 6px;
  padding: 14px; box-shadow: 0 8px 28px rgba(0,0,0,.55);
  display: flex; flex-direction: column; gap: 8px;
}
.engine-panel label {
  font-size: 11px; letter-spacing: .4px; text-transform: uppercase;
  color: var(--fg-dim, #8b95a3);
}
.engine-panel input {
  width: 100%; padding: 7px 9px; font-family: var(--mono); font-size: 12px;
  color: var(--fg); background: var(--bg-2);
  border: 1px solid var(--line); border-radius: 4px;
}
.engine-actions { display: flex; gap: 8px; }
.engine-hint {
  margin: 0; font-size: 11px; line-height: 1.55; color: var(--fg-dim, #8b95a3);
}
.engine-hint code {
  font-family: var(--mono); font-size: 10.5px;
  background: var(--bg-2); padding: 1px 4px; border-radius: 3px;
}
/* When no engine is connected, anything that would mutate a case is inert. */
body.engine-offline #btn-run,
body.engine-offline #btn-stop,
body.engine-offline #btn-new-case,
body.engine-offline #btn-telegram { opacity: .45; pointer-events: none; }

/* ---------- Live-analyze bar (11b) ---------- */
.live-bar {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
  padding: 8px 16px; background: var(--bg-1);
  border-bottom: 1px solid var(--line);
}
.live-lbl { font-size: 12px; color: var(--fg-dim); letter-spacing: .3px; }
#live-url {
  flex: 1; min-width: 260px; padding: 6px 10px;
  font-family: var(--mono); font-size: 12px; color: var(--fg);
  background: var(--bg-2); border: 1px solid var(--line); border-radius: 4px;
}
.live-msg { font-family: var(--mono); font-size: 11px; color: var(--fg-dim); }

/* ---------- Engine token field ---------- */
.engine-panel label[for="engine-token"] { margin-top: 4px; }

/* ---------- Session (3c) panel ---------- */
.session-note { font-size: 12px; line-height: 1.5; color: var(--fg-dim);
  background: rgba(229,72,77,.06); border: 1px solid var(--line);
  border-radius: 5px; padding: 9px 11px; margin: 0 0 12px; }
.session-result { font-size: 12.5px; line-height: 1.5; margin-top: 10px;
  padding: 9px 11px; border: 1px solid var(--line); border-radius: 5px;
  background: var(--bg-2); }
.session-list { margin-top: 14px; }
.session-list h3 { font-size: 11px; text-transform: uppercase; letter-spacing: .5px;
  color: var(--fg-dim); margin: 0 0 6px; }
.session-row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
  font-size: 12px; padding: 5px 0; border-top: 1px solid var(--line-soft); }
.pill-good { background: rgba(63,185,80,.15); color: #56d364;
  border-color: rgba(63,185,80,.35); }

/* ---------- Discover URLs panel ---------- */
.modal-wide { width: min(840px, 100%); }
.discover-results { margin-top: 12px; max-height: 46vh; overflow-y: auto;
  border: 1px solid var(--line); border-radius: 5px; }
.mini-table { width: 100%; border-collapse: collapse; font-size: 12px; }
.mini-table th { text-align: left; color: var(--fg-dim); font-weight: 600;
  padding: 6px 9px; border-bottom: 1px solid var(--line);
  position: sticky; top: 0; background: var(--bg-1); }
.mini-table td { padding: 5px 9px; border-bottom: 1px solid var(--line-soft); }
.mini-table a { color: var(--fg); text-decoration: none; }
.mini-table a:hover { color: var(--accent); }
.pill-bad  { background: rgba(229,72,77,.15); color: #f0a6a8; border-color: rgba(229,72,77,.4); }
.pill-warn { background: rgba(224,146,47,.15); color: var(--accent); border-color: rgba(224,146,47,.4); }
.pill-mut  { background: var(--bg-3); color: var(--fg-dim); border-color: var(--line); }


/* ---------- Agent auto-login (Session panel) ---------- */
.agent-block { margin: 12px 0; border: 1px solid var(--line); border-radius: 5px; padding: 8px 11px; }
.agent-block summary { cursor: pointer; font-size: 12px; color: var(--accent); }
.session-video img { display: block; }


/* ---------- Operations (fleet) view ---------- */
body.ops-open .case-bar, body.ops-open .stat-row, body.ops-open .tabs,
body.ops-open .panels, body.ops-open #live-bar, body.ops-open .live-analyze { display: none !important; }
#ops-view { padding: 16px 20px 60px; }
.ops-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; }
.ops-head h2 { margin: 0; font-size: 16px; }
.ops-head-actions { display: flex; gap: 8px; }
.ops-kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 10px; margin-bottom: 22px; }
.ops-kpi { background: var(--bg-1); border: 1px solid var(--line-soft); border-radius: 5px; padding: 12px 14px; }
.ops-kpi-val { font-family: var(--mono); font-size: 26px; font-weight: 600; }
.ops-kpi-lbl { font-size: 10px; text-transform: uppercase; letter-spacing: .5px; color: var(--fg-faint); margin-top: 3px; }
.ops-kpi.kpi-bad { border-color: var(--accent-red); } .ops-kpi.kpi-bad .ops-kpi-val { color: #f0a6a8; }
.ops-kpi.kpi-good { border-color: var(--good); } .ops-kpi.kpi-good .ops-kpi-val { color: var(--good); }
.ops-kpi.kpi-warn { border-color: var(--accent); } .ops-kpi.kpi-warn .ops-kpi-val { color: var(--accent); }
.ops-kpi.kpi-live { border-color: var(--good); }
.ops-section { margin-bottom: 26px; }
.ops-title { font-size: 13px; margin: 0 0 4px; display: flex; align-items: center; gap: 8px; }
.ops-hint { font-size: 11.5px; color: var(--fg-dim); margin: 0 0 10px; }
.ops-total { font-size: 11px; color: var(--fg-dim); font-family: var(--mono); }
.ops-empty { color: var(--fg-dim); font-style: italic; padding: 14px; }
.ops-queue { display: flex; flex-direction: column; gap: 6px; }
.work-item { display: flex; align-items: center; gap: 10px; padding: 7px 10px; background: var(--bg-1); border: 1px solid var(--line-soft); border-radius: 4px; font-size: 12px; }
.work-domain { font-weight: 600; }
.work-case { min-width: 120px; }
.work-detail { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.work-actions { display: flex; gap: 6px; }
.btn-slim { padding: 3px 8px; font-size: 11px; }
.ops-controls { display: flex; gap: 8px; margin-bottom: 10px; flex-wrap: wrap; }
.ops-controls input, .ops-controls select { background: var(--bg-2); color: var(--fg); border: 1px solid var(--line); border-radius: 3px; padding: 5px 9px; font-size: 12px; }
.ops-controls #ops-search { min-width: 240px; font-family: var(--mono); }
.ops-table { width: 100%; border-collapse: collapse; font-size: 12px; }
.ops-table th { text-align: left; color: var(--fg-dim); font-weight: 600; padding: 6px 9px; border-bottom: 1px solid var(--line); position: sticky; top: 0; background: var(--bg); }
.ops-table td { padding: 5px 9px; border-bottom: 1px solid var(--line-soft); }
.ops-table a { color: var(--fg); text-decoration: none; } .ops-table a:hover { color: var(--accent); }
.ops-pager { display: flex; align-items: center; gap: 14px; margin-top: 12px; }

.opt{color:var(--fg-faint);font-style:italic;font-weight:400;font-size:10px}

/* ---------- Live run activity (spinner + indeterminate progress) ---------- */
.spin {
  display: inline-block; width: 9px; height: 9px; margin-right: 2px;
  border: 2px solid var(--line); border-top-color: var(--good);
  border-radius: 50%; vertical-align: -1px;
  animation: spin .7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

#cnt-current { color: var(--good); max-width: 520px; }

/* An indeterminate sweep while running with nothing counted yet. */
.progress.indeterminate { position: relative; overflow: hidden; }
.progress.indeterminate .progress-fill { width: 0 !important; }
.progress.indeterminate::after {
  content: ""; position: absolute; top: 0; height: 100%; width: 32%; left: -32%;
  background: var(--accent); opacity: .75; border-radius: 2px;
  animation: indet 1.15s ease-in-out infinite;
}
@keyframes indet { 0% { left: -32%; } 100% { left: 100%; } }

.capture-block{border:1px solid var(--line-soft);border-radius:5px;padding:10px 12px;margin:10px 0;background:var(--bg-1)}
#session-capture-note{margin-top:8px;font-size:12px;color:var(--good)}

.field-note { font-size: 11.5px; color: var(--fg-dim); margin: 0 0 6px; line-height: 1.5; }

.toggle-v2 { margin: 8px 0 2px; padding: 6px 8px; border: 1px solid var(--accent); border-radius: 4px; background: rgba(224,146,47,.06); }

.chk-col { width: 34px; text-align: center; padding-left: 10px; }
.chk-col input { cursor: pointer; }
#sites-to-3c { margin-left: auto; }
.panel-toolbar { display: flex; align-items: center; gap: 10px; }

.login-cell { max-width: 300px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
