/* ============================================================================
   Investigation console (OathNet-style) — dark-first layout, Tribastion brand
   ============================================================================ */
.invest { display: grid; grid-template-columns: 288px 1fr; gap: 18px; align-items: start; }
@media (max-width: 980px) { .invest { grid-template-columns: 1fr; } .ipside { order: 2; } }

/* ---- left IP sidebar ---- */
.ipside { display: flex; flex-direction: column; gap: 12px; position: sticky; top: 76px; max-height: calc(100vh - 96px); overflow-y: auto; padding-right: 4px; }
.ipside h3 { font-size: 12px; text-transform: uppercase; letter-spacing: .08em; color: var(--text-faint); margin: 2px 2px 0; }
.ipcard { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 12px 13px; }
.ipcard .ip { font-family: var(--mono); font-size: 14px; color: var(--brand); font-weight: 600; display: flex; align-items: center; gap: 7px; }
.ipcard .ip .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--brand); box-shadow: 0 0 8px var(--brand); flex: none; }
.ipcard .kv { display: grid; grid-template-columns: auto 1fr; gap: 3px 10px; margin-top: 9px; font-size: 12px; }
.ipcard .kv .k { color: var(--text-faint); text-transform: uppercase; letter-spacing: .04em; font-size: 10.5px; }
.ipcard .kv .v { color: var(--text); text-align: right; font-weight: 550; word-break: break-all; }
.ipcard .count { margin-left: auto; font-size: 11px; color: var(--text-faint); }

/* ---- summary cards ---- */
.sumrow { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-bottom: 16px; }
@media (max-width: 700px) { .sumrow { grid-template-columns: 1fr; } }
.sumcard { position: relative; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 18px 20px; overflow: hidden; }
.sumcard .ic { width: 40px; height: 40px; border-radius: 11px; display: grid; place-items: center; background: var(--brand-tint); color: var(--brand); font-size: 19px; margin-bottom: 12px; }
.sumcard .ic.warn { background: rgba(234,88,12,.14); color: var(--warn); }
.sumcard h2 { font-size: 16px; margin: 0; }
.sumcard .sub { color: var(--text-faint); font-size: 12.5px; margin: 1px 0 12px; }
.sumcard .big { font-family: var(--display); font-size: 40px; font-weight: 700; line-height: 1; font-variant-numeric: tabular-nums; }
.sumcard .big small { font-size: 14px; color: var(--text-dim); font-weight: 500; margin-left: 6px; }
.sumcard .mini { display: flex; gap: 18px; margin-top: 12px; flex-wrap: wrap; }
.sumcard .mini div { font-size: 12.5px; color: var(--text-dim); }
.sumcard .mini b { color: var(--text); font-variant-numeric: tabular-nums; }

/* ---- sections ---- */
.section { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); margin-bottom: 16px; overflow: hidden; }
.section > .head { display: flex; align-items: center; gap: 12px; padding: 15px 18px; border-bottom: 1px solid var(--border); }
.section > .head .ic { width: 34px; height: 34px; border-radius: 9px; display: grid; place-items: center; background: var(--surface-2); color: var(--text-dim); font-size: 16px; flex: none; }
.section > .head .t { font-family: var(--display); font-weight: 650; }
.section > .head .st { color: var(--text-faint); font-size: 12px; }
.section > .head .r { margin-left: auto; display: flex; gap: 8px; align-items: center; }
.section > .body { padding: 16px 18px; }
.loaded-pill { padding: 5px 11px; border-radius: 999px; background: rgba(234,88,12,.12); color: var(--warn); font-size: 12px; font-weight: 600; }

.subtabs { display: flex; gap: 6px; margin-bottom: 14px; flex-wrap: wrap; }
.subtabs a { display: flex; align-items: center; gap: 7px; padding: 8px 14px; border-radius: var(--radius-sm); background: var(--surface-2); color: var(--text-dim); font-weight: 560; font-size: 13px; }
.subtabs a.on { background: var(--brand-tint); color: var(--brand); }
.subtabs a .b { padding: 0 7px; border-radius: 999px; background: rgba(127,127,127,.14); font-size: 11px; }
.subtabs a.on .b { background: var(--brand); color: var(--on-brand); }

/* ---- credential card ---- */
.cred { border: 1px solid var(--border); border-radius: var(--radius); padding: 15px 16px; margin-bottom: 12px; background: var(--surface-2); }
.cred .top { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 10px; }
.tag { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border-radius: 7px; font-size: 11px; font-weight: 700; letter-spacing: .02em; }
.tag.stealer { background: rgba(234,88,12,.14); color: #fb923c; }
.tag.matched { background: var(--surface); color: var(--text-faint); border: 1px solid var(--border); font-weight: 500; }
.tag.infected { background: rgba(220,38,38,.14); color: #f87171; }
.cred .loc { color: var(--text-dim); font-size: 12px; display: flex; align-items: center; gap: 5px; }
.cred .when { margin-left: auto; color: var(--text-faint); font-size: 11.5px; text-align: right; font-family: var(--mono); }
.cred .url { font-family: var(--mono); font-size: 13px; color: var(--brand); word-break: break-all; margin-bottom: 12px; }
.cred .fields { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
@media (max-width: 600px) { .cred .fields { grid-template-columns: 1fr; } }
.fld .lbl { font-size: 10.5px; text-transform: uppercase; letter-spacing: .05em; color: var(--text-faint); margin-bottom: 3px; display: flex; align-items: center; gap: 5px; }
.fld .val { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 9px 11px; font-family: var(--mono); font-size: 12.5px; word-break: break-all; min-height: 20px; }
.fld .val.pw { color: #f87171; }
.cred .foot { display: flex; gap: 8px; margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--border); flex-wrap: wrap; }

/* ---- victim card ---- */
.vic .grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px 22px; margin-bottom: 4px; }
@media (max-width: 600px) { .vic .grid2 { grid-template-columns: 1fr; } }
.vic .name { font-family: var(--mono); font-size: 14px; font-weight: 600; margin-bottom: 12px; display: flex; align-items: center; gap: 8px; word-break: break-all; }
.chipset { display: flex; flex-wrap: wrap; gap: 6px; }
.chipset .c { background: var(--surface); border: 1px solid var(--border); border-radius: 7px; padding: 4px 9px; font-family: var(--mono); font-size: 11.5px; }
.creds-badge { padding: 3px 9px; border-radius: 999px; background: rgba(234,88,12,.12); color: #fb923c; font-size: 11px; font-weight: 700; }

/* ---- victim detail ---- */
.vhead { display: flex; align-items: flex-start; gap: 14px; flex-wrap: wrap; margin-bottom: 16px; }
.vhead .ic { width: 44px; height: 44px; border-radius: 11px; background: var(--brand-tint); color: var(--brand); display: grid; place-items: center; font-size: 20px; flex: none; }
.vhead h1 { font-family: var(--mono); font-size: 19px; margin: 0; word-break: break-all; }
.signals { display: grid; grid-template-columns: repeat(5, 1fr); gap: 12px; margin-bottom: 18px; }
@media (max-width: 820px) { .signals { grid-template-columns: repeat(2, 1fr); } }
.signal { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 14px 16px; }
.signal .l { font-size: 11px; text-transform: uppercase; letter-spacing: .05em; color: var(--text-faint); display: flex; align-items: center; gap: 6px; }
.signal .n { font-family: var(--display); font-size: 28px; font-weight: 700; margin-top: 6px; font-variant-numeric: tabular-nums; }
.signal.hot .n { color: #fb923c; }
.vtabs { display: flex; gap: 4px; border-bottom: 1px solid var(--border); margin: 4px 0 16px; flex-wrap: wrap; }
.vtabs a { padding: 9px 15px; color: var(--text-dim); font-weight: 560; border-bottom: 2px solid transparent; }
.vtabs a.on { color: var(--brand); border-bottom-color: var(--brand); }
.kvbox { display: grid; grid-template-columns: 170px 1fr; gap: 10px 16px; }
.kvbox .k { color: var(--text-faint); font-size: 12px; }
.kvbox .v { font-size: 13px; word-break: break-all; }
.artifact { display: inline-flex; align-items: center; gap: 6px; padding: 5px 11px; border-radius: 999px; border: 1px solid var(--border); font-size: 12px; margin: 3px 5px 3px 0; color: var(--text-faint); }
.artifact.on { color: var(--brand); border-color: var(--brand-tint-2); background: var(--brand-tint); }
.backlink { display: inline-flex; align-items: center; gap: 6px; color: var(--text-dim); font-size: 13px; margin-bottom: 12px; }
.navpip { display: inline-block; margin-left: 5px; padding: 1px 7px; border-radius: 999px; background: var(--warn); color: #fff; font-size: 11px; font-weight: 700; }
.kw { display: flex; align-items: center; gap: 12px; padding: 13px 15px; border: 1px solid var(--border); border-radius: var(--radius); margin-bottom: 10px; background: var(--surface); }
.kw .term { font-family: var(--mono); font-weight: 600; }
.kw .meta { color: var(--text-faint); font-size: 12px; }
.kw .r { margin-left: auto; display: flex; gap: 8px; align-items: center; }
.st-requested { background: rgba(234,88,12,.14); color: #fb923c; }
.st-approved { background: rgba(22,163,74,.14); color: var(--ok); }
.st-rejected { background: rgba(220,38,38,.14); color: #f87171; }
.st-paused { background: var(--surface-2); color: var(--text-faint); }
.cols-3 { display: grid; grid-template-columns: repeat(3,1fr); gap: 16px; }
@media (max-width: 760px){ .cols-3 { grid-template-columns: 1fr; } }
.signal-dot { width: 12px; height: 12px; border-radius: 50%; flex: none; background: var(--text-faint); }
.signal-dot.on { background: var(--ok); box-shadow: 0 0 10px var(--ok); }
.signal-dot.off { background: var(--bad); box-shadow: 0 0 10px var(--bad); }
.qbar { display: flex; height: 12px; border-radius: 6px; overflow: hidden; background: var(--surface-2); border: 1px solid var(--border); }
.qbar > i { display: block; height: 100%; }
.qbar .q-done { background: var(--ok); }
.qbar .q-pending { background: #fb923c; }
.qbar .q-skip { background: var(--text-faint); }
.qbar .q-fail { background: var(--bad); }

/* ---- Professional file viewer ---- */
.fileico { width: 40px; height: 40px; border-radius: 10px; background: var(--brand-tint); color: var(--brand); display: grid; place-items: center; flex: none; }
.filemeta { display: flex; gap: 16px; flex-wrap: wrap; margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--border); color: var(--text-dim); font-size: 12.5px; }
.filemeta b { color: var(--text); }
.codeblock { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); overflow: auto; max-height: 70vh; }
.codetable { width: 100%; border-collapse: collapse; font-family: var(--mono); font-size: 12.5px; }
.codetable td.ln { user-select: none; text-align: right; color: var(--text-faint); padding: 1px 12px 1px 14px; width: 1%; white-space: nowrap; border-right: 1px solid var(--border); background: var(--surface-2); position: sticky; left: 0; }
.codetable td.lc { padding: 1px 14px; white-space: pre-wrap; word-break: break-word; color: var(--text); }
.codetable tr:hover td.lc { background: var(--brand-tint); }

/* ================= Interlink graph / pivots ================= */
/* A pivotable atom. Clickable ones glow on hover; static ones read as plain. */
.echip { display: inline-flex; align-items: center; gap: 5px; background: var(--surface); border: 1px solid var(--border);
  border-radius: 7px; padding: 3px 9px; font-family: var(--mono); font-size: 11.5px; line-height: 1.5;
  color: var(--text); text-decoration: none; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
a.echip { border-color: var(--brand-tint-2); color: var(--brand-700); cursor: pointer; transition: background .12s, border-color .12s; }
a.echip:hover { background: var(--brand-tint); border-color: var(--brand); }
a.echip::before { content: "↗"; font-size: 10px; opacity: .5; }
.echip.is-static { color: var(--text-dim); }
.echip.echip-ip::before, a.echip.echip-ip::before { content: "📡"; }
.echip.echip-email::before, a.echip.echip-email::before { content: "✉"; }
.echip.echip-domain::before, a.echip.echip-domain::before { content: "🌐"; }
.echip.echip-username::before, a.echip.echip-username::before { content: "👤"; }
.echip.echip-hwid::before, a.echip.echip-hwid::before { content: "🖥"; }
.echip.echip-password::before, a.echip.echip-password::before { content: "🔑"; }
.echip.echip-url::before, a.echip.echip-url::before { content: "🔗"; }

/* helper line under a raw list explaining what it's for */
.hint { font-size: 12px; color: var(--text-dim); margin: 2px 0 8px; }
.hint b { color: var(--text); font-weight: 600; }

/* ipcard: make it a pivot link */
a.ipcard { display: block; text-decoration: none; transition: border-color .12s, transform .06s; }
a.ipcard:hover { border-color: var(--brand); }
.ipcard .pivot-cta { margin-top: 8px; font-size: 11px; color: var(--brand-700); display: flex; align-items: center; gap: 5px; }
.ipcard .vcount { font-size: 11px; color: var(--text-dim); }

/* ---- Investigation landing ---- */
.intel-summary { display: flex; gap: 10px; flex-wrap: wrap; margin: 6px 0 18px; }
.intel-summary .pill { background: var(--surface); border: 1px solid var(--border); border-radius: 999px; padding: 6px 14px; font-size: 12.5px; color: var(--text-dim); }
.intel-summary .pill b { color: var(--text); font-size: 14px; }
.intel-search { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 16px; }
.intel-search input[type=text] { flex: 1; min-width: 240px; padding: 11px 14px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); color: var(--text); font-size: 14px; }
.intel-search select { padding: 11px 12px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); color: var(--text); }
.pivot-cols { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 14px; }
.pivot-col h4 { margin: 0 0 8px; font-size: 12px; text-transform: uppercase; letter-spacing: .06em; color: var(--text-faint); display: flex; align-items: center; gap: 6px; }
.pivot-list { display: flex; flex-direction: column; gap: 6px; }
.pivot-row { display: flex; align-items: center; justify-content: space-between; gap: 8px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 8px 11px; text-decoration: none; color: var(--text); transition: border-color .12s; }
.pivot-row:hover { border-color: var(--brand); }
.pivot-row .val { font-family: var(--mono); font-size: 12.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pivot-row .badges { display: flex; gap: 5px; flex: none; }
.pivot-row .mini { font-size: 10.5px; color: var(--text-dim); background: var(--surface-2); border-radius: 5px; padding: 1px 6px; white-space: nowrap; }

/* ---- Entity page ---- */
.ehead { display: flex; align-items: flex-start; gap: 16px; flex-wrap: wrap; margin-bottom: 6px; }
.ehead .eic { width: 52px; height: 52px; border-radius: 13px; background: var(--brand-tint); display: grid; place-items: center; font-size: 26px; flex: none; }
.ehead .eval { font-family: var(--mono); font-size: 20px; font-weight: 650; word-break: break-all; color: var(--text); }
.ehead .ekind { font-size: 12px; text-transform: uppercase; letter-spacing: .06em; color: var(--text-faint); }
.emetrics { display: flex; gap: 20px; flex-wrap: wrap; margin: 14px 0 20px; }
.emetric { min-width: 96px; }
.emetric .n { font-size: 22px; font-weight: 700; color: var(--text); }
.emetric .l { font-size: 11.5px; color: var(--text-dim); text-transform: uppercase; letter-spacing: .04em; }
.related-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 8px; }
.related-chip { display: flex; align-items: center; justify-content: space-between; gap: 8px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 7px 10px; text-decoration: none; color: var(--text); transition: border-color .12s; }
.related-chip:hover { border-color: var(--brand); }
.related-chip .rv { font-family: var(--mono); font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.related-chip .rc { font-size: 10.5px; color: var(--brand-700); background: var(--brand-tint); border-radius: 5px; padding: 1px 6px; flex: none; }
