/* ════════════════════════════════════════════════════════════════════════
   QuantShip — Intel Brief (/intel-brief-v2)
   Themed to match /home + /global-macro + /alerts SITREP convention.
   All rules scoped under .ib-root or .ib-* per CLAUDE.md.
   Inter + DM Mono are loaded once globally via external_stylesheets
   in src/main.py — DO NOT re-@import here.
   ════════════════════════════════════════════════════════════════════════ */

.ib-root {
  --bg-0: var(--brand-bg-deep);
  --bg-1: var(--brand-bg-page);
  --bg-2: var(--brand-bg-ink);
  --bg-3: var(--brand-bg-card-mid);
  --line: rgba(117, 174, 178, 0.18);
  --line-dim: rgba(255, 255, 255, 0.06);
  --line-faint: rgba(255, 255, 255, 0.03);
  --cyan: var(--brand-accent);
  --cyan-light: var(--brand-accent-light);
  --cyan-rgb: var(--brand-accent-rgb);
  --amber: var(--brand-sand);
  --amber-light: var(--brand-sand-light);
  --amber-rgb: var(--brand-sand-rgb);
  --red: var(--brand-rust);
  --red-rgb: var(--brand-rust-rgb);
  --green: var(--brand-up);
  --green-rgb: var(--brand-up-rgb);
  --orange: var(--brand-high);
  --txt: var(--brand-text-bright);
  --txt-2: var(--brand-text-body);
  --txt-3: var(--brand-text-tertiary);
  --txt-4: var(--brand-text-dim);
  --mono: var(--brand-font-mono);
  --display: var(--brand-font-sans);

  background: var(--bg-0);
  color: var(--txt);
  font-family: var(--display);
  min-height: 100vh;
  padding: 0;
  position: relative;
  -webkit-font-smoothing: antialiased;
}

.ib-root * { box-sizing: border-box; }

/* Scanlines + grain overlay, matching home/global-macro */
.ib-root::before {
  content: '';
  position: fixed;
  inset: 0;
  pointer-events: none;
  background:
    linear-gradient(transparent, transparent),
    linear-gradient(transparent, transparent);
  background-size: auto, 3px 3px;
  z-index: 9999;
}
.ib-root::after {
  content: '';
  position: fixed;
  inset: 0;
  pointer-events: none;
  background: radial-gradient(ellipse at center, transparent 60%, rgba(0,0,0,0.45) 100%);
  z-index: 9998;
}

.ib-root > * {
  max-width: 1320px;
  margin-left: auto;
  margin-right: auto;
  padding-left: 32px;
  padding-right: 32px;
}

/* ──── Threat banner — SITREP page-head style ─────────────────────────── */
.ib-threat-banner {
  display: flex;
  align-items: center;
  gap: 18px;
  padding-top: 20px !important;
  padding-bottom: 14px !important;
  border-bottom: 1px solid var(--line);
  background: linear-gradient(90deg, rgba(var(--cyan-rgb), 0.06), transparent 60%);
  margin-bottom: 0;
}
.ib-threat-label {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 2.5px;
  color: var(--cyan);
  text-transform: uppercase;
  font-weight: 500;
}
.ib-threat-label::before { content: "▣ "; color: var(--cyan); }
.ib-threat-level {
  font-family: var(--display);
  font-size: 22px;
  font-weight: 500;
  letter-spacing: 0.06em;
  padding: 4px 14px;
  border: 1px solid;
  border-radius: 2px;
  background: rgba(0,0,0,0.3);
  /* color + borderColor set inline by build_threat_banner */
}
.ib-threat-score {
  margin-left: auto;
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 1.5px;
  color: var(--txt-2);
  text-transform: uppercase;
}
.ib-threat-score::before { content: "RISK INDEX · "; color: var(--txt-3); }

/* ──── Agent station strip ────────────────────────────────────────────── */
.ib-agent-strip {
  display: flex;
  align-items: center;
  gap: 16px;
  padding-top: 10px !important;
  padding-bottom: 10px !important;
  border-bottom: 1px solid var(--line-dim);
  background: transparent;
  border-radius: 0;
  margin-bottom: 0;
}
.ib-agent-strip-label {
  font-family: var(--mono);
  font-size: 9px;
  letter-spacing: 2.5px;
  color: var(--txt-3);
  text-transform: uppercase;
}
.ib-agent-strip-label::after { content: " //"; color: var(--txt-4); }
.ib-agent-strip-pills {
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
}
.ib-agent-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 4px 10px;
  background: var(--bg-1);
  border: 1px solid var(--line-dim);
  border-radius: 2px;
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.06em;
  color: var(--txt-2);
  cursor: help;
  text-transform: uppercase;
  transition: border-color 0.15s, color 0.15s;
}
.ib-agent-pill:hover { border-color: var(--cyan); color: var(--txt); }
.ib-agent-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
}
.ib-agent-dot-fresh { background: var(--green); box-shadow: none; }
.ib-agent-dot-stale { background: var(--amber); }
.ib-agent-dot-cold  { background: var(--txt-4); }

/* ──── Curator punchline ──────────────────────────────────────────────── */
.ib-punchline-strip {
  background: var(--bg-1);
  border: 1px solid var(--line);
  border-top: 0;
  padding: 14px 18px !important;
  border-radius: 0;
  margin-bottom: 0;
  position: relative;
}
.ib-punchline-strip::before {
  content: "▣ EXECUTIVE SUMMARY";
  display: block;
  font-family: var(--mono);
  font-size: 9px;
  letter-spacing: 2.5px;
  color: var(--cyan);
  text-transform: uppercase;
  margin-bottom: 8px;
}
.ib-punchline-text {
  font-family: var(--display);
  font-size: 15px;
  line-height: 1.45;
  font-weight: 500;
  color: var(--txt);
}
.ib-punchline-meta {
  display: flex;
  gap: 12px;
  margin-top: 8px;
  font-family: var(--mono);
  font-size: 10px;
  color: var(--txt-3);
  letter-spacing: 0.06em;
}
.ib-punchline-ts { color: var(--txt-3); }

/* ──── Feed ──────────────────────────────────────────────────────────── */
.ib-feed {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding-top: 18px !important;
  padding-bottom: 36px !important;
}

/* ──── Cards ─────────────────────────────────────────────────────────── */
.ib-card {
  background: var(--bg-1);
  border: 1px solid var(--line-dim);
  border-left: 3px solid var(--txt-4);
  border-radius: 2px;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
  position: relative;
}
.ib-card:hover {
  background: var(--bg-2);
  border-color: var(--line);
}
.ib-card-hero {
  display: flex;
  flex-direction: column;
}
.ib-card-inline {
  display: flex;
  flex-direction: row;
  min-height: 110px;
}

.ib-card-text {
  padding: 12px 14px;
  flex: 1;
  min-width: 0;
}

/* Card head — mono caps, like panel-head */
.ib-card-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  font-family: var(--mono);
  font-size: 10px;
  color: var(--txt-3);
  margin-bottom: 6px;
  padding-bottom: 6px;
  border-bottom: 1px solid var(--line-faint);
  letter-spacing: 1.5px;
  text-transform: uppercase;
}
.ib-card-agent-pill {
  background: transparent;
  padding: 0;
  border-radius: 0;
  color: var(--cyan);
  font-weight: 600;
  letter-spacing: 0.12em;
}
.ib-card-meta {
  color: var(--txt-3);
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.06em;
}
.ib-card-meta-sev { color: var(--txt); font-weight: 600; }
.ib-card-meta-score { color: var(--txt-2); }

.ib-card-breaking-chip {
  background: var(--red);
  color: var(--txt);
  padding: 2px 8px;
  border-radius: 2px;
  font-family: var(--mono);
  font-weight: 500;
  font-size: 9px;
  letter-spacing: 1.5px;
}

.ib-card-headline {
  font-family: var(--display);
  font-size: 16px;
  font-weight: 600;
  color: var(--txt);
  line-height: 1.3;
  margin-top: 0;
  margin-bottom: 4px;
}
.ib-card-inline .ib-card-headline { font-size: 14px; line-height: 1.3; }

.ib-card-narrative {
  font-family: var(--display);
  font-size: 12.5px;
  color: var(--txt-2);
  margin-top: 4px;
  line-height: 1.5;
  font-weight: 400;
}

.ib-card-expand {
  font-family: var(--mono);
  font-size: 9px;
  color: var(--cyan);
  margin-top: 10px;
  text-align: right;
  letter-spacing: 2px;
  text-transform: uppercase;
}
.ib-card-expand:hover { color: var(--cyan-light); }

.ib-hidden { display: none; }

/* ──── Visuals ───────────────────────────────────────────────────────── */
.ib-visual { background: var(--bg-2); position: relative; }
.ib-visual-hero { width: 100%; max-height: 280px; overflow: hidden; border-bottom: 1px solid var(--line-dim); }
.ib-visual-thumb { width: 130px; min-width: 130px; aspect-ratio: 4/3; overflow: hidden; border-right: 1px solid var(--line-dim); }
.ib-visual-chart { width: 130px; min-width: 130px; aspect-ratio: 4/3; display: flex; align-items: center; justify-content: center; color: var(--cyan); font-family: var(--mono); font-size: 9px; }

.ib-visual-fallback {
  width: 130px;
  min-width: 130px;
  aspect-ratio: 4/3;
  border-left: 3px solid;
  background:
    repeating-linear-gradient(135deg, var(--bg-1) 0 8px, var(--bg-2) 8px 16px);
  display: flex;
  align-items: center;
  justify-content: center;
}
.ib-visual-fallback::before {
  content: "NO IMAGE";
  font-family: var(--mono);
  font-size: 9px;
  color: var(--txt-4);
  letter-spacing: 2px;
}
/* Hero fallback — wide hatched panel */
.ib-visual-fallback-hero {
  width: 100%;
  min-width: 0;
  height: 160px;
  aspect-ratio: auto;
  border-left: 3px solid;
}

.ib-card-img { width: 100%; height: 100%; object-fit: cover; display: block; }
.ib-card-img-meta {
  position: absolute; top: 8px; left: 8px;
  background: rgba(2,5,5,0.85);
  border: 1px solid var(--line);
  padding: 3px 8px;
  font-family: var(--mono);
  font-size: 9px;
  color: var(--cyan);
  letter-spacing: 1.5px;
  text-transform: uppercase;
}
.ib-card-img-caption {
  padding: 6px 12px;
  font-family: var(--display);
  font-size: 11px;
  color: var(--txt-2);
  background: rgba(2,5,5,0.85);
}

/* ──── Chip row ──────────────────────────────────────────────────────── */
.ib-chip-row { display: flex; gap: 6px; margin-top: 8px; flex-wrap: wrap; align-items: center; }
.ib-chip {
  font-family: var(--mono);
  font-size: 9px;
  padding: 3px 8px;
  border-radius: 2px;
  background: var(--bg-2);
  border: 1px solid var(--line-dim);
  color: var(--txt-2);
  text-transform: uppercase;
  letter-spacing: 1.5px;
  line-height: 1.2;
}
.ib-chip-severity { font-weight: 500; }
.ib-chip-audience { color: var(--txt-3); }
.ib-chip-agent    { color: var(--cyan); border-color: rgba(var(--cyan-rgb), 0.35); }
.ib-chip-sources  { color: var(--txt-3); }
.ib-chip-warn  { background: var(--amber); color: var(--bg-0); border-color: var(--amber); font-weight: 500; }
.ib-chip-stale { background: transparent; color: var(--amber); border-color: var(--amber); }

/* ──── Modal ─────────────────────────────────────────────────────────── */
#ib-detail-modal .modal-content { background: var(--bg-1); color: var(--txt); border: 1px solid var(--line); border-radius: 2px; }
#ib-detail-modal .modal-header  { background: var(--bg-0); border-bottom: 1px solid var(--line); border-radius: 0; padding: 14px 22px; }
#ib-detail-modal .modal-title   { color: var(--txt); font-family: var(--display); font-weight: 600; font-size: 18px; }
#ib-detail-modal .modal-body    { background: var(--bg-1); color: var(--txt); padding: 22px; }
#ib-detail-modal .modal-body h6 { color: var(--cyan); font-family: var(--mono); font-size: 10px; text-transform: uppercase; letter-spacing: 2.5px; margin-top: 18px; margin-bottom: 8px; font-weight: 600; }
#ib-detail-modal .btn-close     { filter: invert(1) grayscale(1) brightness(1.7); }

.ib-detail-narrative { font-family: var(--display); font-size: 13px; line-height: 1.55; color: var(--txt); margin-bottom: 16px; }
.ib-detail-facts { width: 100%; font-family: var(--mono); font-size: 11px; }
.ib-detail-facts th { background: var(--bg-0); padding: 6px 8px; color: var(--txt-3); text-transform: uppercase; letter-spacing: 1.5px; font-size: 9px; font-weight: 500; text-align: left; }
.ib-detail-facts td { padding: 6px 8px; border-bottom: 1px solid var(--line-dim); color: var(--txt-2); vertical-align: top; }
.ib-detail-sources { font-family: var(--mono); font-size: 10px; color: var(--txt-3); padding-left: 0; list-style: none; }
.ib-detail-sources li { margin-bottom: 4px; padding-left: 12px; position: relative; word-break: break-all; }
.ib-detail-sources li::before { content: "§"; position: absolute; left: 0; color: var(--cyan); }
.ib-detail-paired-label { font-family: var(--mono); font-size: 10px; color: var(--cyan); margin-top: 14px; margin-bottom: 4px; text-transform: uppercase; letter-spacing: 2.5px; }
.ib-detail-paired-img { max-width: 100%; border: 1px solid var(--line-dim); border-radius: 0; }
.ib-detail-chat-btn {
  margin-top: 16px;
  background: transparent;
  border: 1px solid var(--cyan);
  color: var(--cyan);
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  padding: 8px 16px;
  border-radius: 2px;
}
.ib-detail-chat-btn:hover:not(:disabled) { background: var(--cyan); color: var(--bg-0); }
.ib-detail-chat-btn:disabled { opacity: 0.4; border-color: var(--line-dim); color: var(--txt-4); }

/* ──── Paired image strip (hero) ─────────────────────────────────────── */
.ib-paired-strip {
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  width: 100%;
  max-height: 280px;
  height: 280px;
  overflow: hidden;
  gap: 1px;
  background: var(--line-dim);
  border-bottom: 1px solid var(--line-dim);
}
.ib-paired-osint, .ib-paired-globe { position: relative; overflow: hidden; background: var(--bg-2); }
.ib-paired-osint .ib-card-img,
.ib-paired-globe .ib-card-img { width: 100%; height: 100%; object-fit: cover; }
.ib-paired-osint .ib-card-img-caption,
.ib-paired-globe .ib-card-img-caption {
  position: absolute; bottom: 0; left: 0; right: 0;
  padding: 6px 12px;
  font-family: var(--display);
  font-size: 11px;
  color: var(--txt);
  background: linear-gradient(180deg, transparent 0%, rgba(2,5,5,0.92) 100%);
}

.ib-paired-globe-empty {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  background:
    repeating-linear-gradient(45deg, var(--bg-1) 0 12px, var(--bg-2) 12px 24px);
  color: var(--txt-4);
  font-family: var(--mono);
  font-size: 10px;
  text-align: center;
  padding: 24px;
  letter-spacing: 1.8px;
  text-transform: uppercase;
}

/* OSINT-only hero (standalone tile) */
.ib-card-hero > .ib-paired-osint:only-child {
  width: 100%; max-height: 280px; height: 280px;
  border-bottom: 1px solid var(--line-dim);
}

/* ──── Severity sparkline (TRACE) ────────────────────────────────────── */
.ib-spark-trail { display: inline-flex; gap: 5px; margin-top: 10px; align-items: center; }
.ib-spark-trail::before {
  content: "TRACE";
  font-family: var(--mono);
  font-size: 9px;
  color: var(--txt-4);
  letter-spacing: 2px;
  margin-right: 8px;
}
.ib-spark-dot { display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: var(--txt-4); }
.ib-spark-dot.ib-spark-critical { background: var(--red); }
.ib-spark-dot.ib-spark-high     { background: var(--amber); }
.ib-spark-dot.ib-spark-normal   { background: var(--txt-3); }
.ib-spark-dot.ib-spark-de-esc   { background: var(--green); }

/* ──── Per-agent layer descriptor ────────────────────────────────────── */
.ib-layer-descriptor {
  font-family: var(--display);
  font-style: italic;
  color: var(--txt-3);
  font-size: 11px;
  margin-top: 10px;
  padding-top: 8px;
  border-top: 1px solid var(--line-faint);
  line-height: 1.4;
}

/* ──── Live timestamp ─────────────────────────────────────────────────── */
.ib-ts {
  color: var(--txt-3);
  font-family: var(--mono);
  font-variant-numeric: tabular-nums;
}

/* ──── New-card glow ─────────────────────────────────────────────────── */
@keyframes ib-card-glow {
  0%   { box-shadow: 0 0 0 0 rgba(var(--cyan-rgb), 0); border-color: var(--cyan); }
  20%  { box-shadow: none; border-color: var(--cyan); }
  100% { box-shadow: 0 0 0 0 rgba(var(--cyan-rgb), 0); border-color: var(--line-dim); }
}
.ib-card-new { animation: ib-card-glow 4s ease-out 1; }

/* ──── TODAY'S BRIEFINGS strip ─────────────────────────────────── */
.ib-briefings-zone {
  margin-top: 22px;
  padding: 0 !important;
  border-top: 1px solid var(--line);
}
.ib-briefings-head {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 2.5px;
  color: var(--cyan);
  text-transform: uppercase;
  padding: 14px 0 10px;
}
.ib-briefings-empty {
  font-family: var(--mono);
  font-size: 10px;
  color: var(--txt-3);
  padding: 20px 0;
  text-align: center;
  letter-spacing: 2px;
}
.ib-briefings-scroller {
  display: flex;
  gap: 12px;
  overflow-x: auto;
  padding-bottom: 12px;
}
.ib-briefings-scroller::-webkit-scrollbar { height: 6px; }
.ib-briefings-scroller::-webkit-scrollbar-track { background: var(--bg-1); }
.ib-briefings-scroller::-webkit-scrollbar-thumb { background: var(--line); border-radius: 3px; }

.ib-briefing-card {
  flex: 0 0 280px;
  background: var(--bg-1);
  border: 1px solid var(--line-dim);
  border-radius: 2px;
  cursor: pointer;
  transition: transform 0.15s, border-color 0.15s;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.ib-briefing-card:hover {
  transform: translateY(-2px);
  border-color: var(--cyan);
}
.ib-briefing-hero-wrap {
  width: 100%;
  aspect-ratio: 16/9;
  overflow: hidden;
  background: var(--bg-2);
  border-bottom: 1px solid var(--line-dim);
}
.ib-briefing-hero {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.ib-briefing-hero-fallback {
  background: repeating-linear-gradient(135deg, var(--bg-1) 0 8px, var(--bg-2) 8px 16px);
}
.ib-briefing-meta {
  padding: 10px 12px 4px;
  font-family: var(--mono);
  font-size: 9px;
  color: var(--txt-3);
  text-transform: uppercase;
  letter-spacing: 1.5px;
}
.ib-briefing-type { color: var(--cyan); font-weight: 600; }
.ib-briefing-subject {
  padding: 4px 12px;
  font-family: var(--display);
  font-size: 13px;
  font-weight: 600;
  color: var(--txt);
  line-height: 1.3;
}
.ib-briefing-teaser {
  padding: 6px 12px;
  font-family: var(--display);
  font-size: 11.5px;
  color: var(--txt-2);
  line-height: 1.4;
  flex: 1;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.ib-briefing-open {
  padding: 6px 12px 12px;
  font-family: var(--mono);
  font-size: 9px;
  color: var(--cyan);
  letter-spacing: 2px;
  text-transform: uppercase;
  text-align: right;
}

/* Briefing iframe modal — needs lighter padding than the detail modal */
#ib-briefing-modal .modal-content { background: var(--bg-1); }
#ib-briefing-modal .modal-body { padding: 0 !important; }

/* ──── WIRE zone ──────────────────────────────────────────────────── */
.ib-wire-zone {
  margin-top: 18px;
  padding: 0 !important;
  border-top: 1px solid var(--line);
}
.ib-wire-head {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 2.5px;
  color: var(--cyan);
  text-transform: uppercase;
  padding: 14px 0 10px;
  border-bottom: 1px solid var(--line-dim);
}
.ib-wire-empty {
  font-family: var(--mono);
  font-size: 10px;
  color: var(--txt-3);
  padding: 16px 0;
  text-align: center;
  letter-spacing: 2px;
}

.ib-wire-row {
  background: var(--bg-1);
  border: 1px solid var(--line-dim);
  border-left: 3px solid var(--txt-4);
  border-radius: 2px;
  cursor: pointer;
  padding: 8px 12px;
  margin-top: 6px;
  transition: border-color 0.15s, background 0.15s;
  position: relative;
}
.ib-wire-row:hover { background: var(--bg-2); border-color: var(--line); }

.ib-wire-meta {
  font-family: var(--mono);
  font-size: 10px;
  color: var(--txt-3);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  margin-bottom: 4px;
}
.ib-wire-source { color: var(--txt-2); }
.ib-wire-region { color: var(--txt-3); text-transform: none; }

.ib-wire-principal {
  font-weight: 500;
  color: var(--cyan);
  border-color: rgba(var(--cyan-rgb), 0.35);
  background: rgba(var(--cyan-rgb), 0.08);
}

.ib-wire-headline {
  font-family: var(--display);
  font-size: 13px;
  font-weight: 500;
  color: var(--txt);
  line-height: 1.4;
  margin-top: 4px;
  margin-bottom: 4px;
}

.ib-wire-source-link {
  font-family: var(--mono);
  font-size: 9px;
  color: var(--cyan);
  letter-spacing: 2px;
  text-transform: uppercase;
  text-decoration: none;
  position: absolute;
  right: 12px;
  bottom: 8px;
}
.ib-wire-source-link:hover { color: var(--cyan-light); }

/* ──── WIRE flash for new entity-hit rows ────────────────────────── */
@keyframes ib-wire-flash {
  0%   { background: rgba(var(--red-rgb), 0.18); border-left-color: var(--red); }
  100% { background: var(--bg-1); border-left-color: var(--txt-4); }
}
.ib-wire-flash { animation: ib-wire-flash 3s ease-out 1; }

/* ──── CRITICAL chip pulse — matches original platform behavior ──────── */
@keyframes ib-chip-critical-pulse {
  0%, 100% { opacity: 1.0; }
  50%      { opacity: 0.65; }
}
.ib-chip-severity[style*="ef4444"],
.ib-chip-severity[style*="EF4444"] { animation: ib-chip-critical-pulse 1.5s ease-in-out infinite; }

/* WIRE row thumbnail (T7) */
.ib-wire-row-flex { display: flex; align-items: center; gap: 10px; }
.ib-wire-thumb {
    width: 40px; height: 40px; object-fit: cover;
    border-radius: 3px; flex-shrink: 0;
    background: #15272a;
}
.ib-wire-row-body { flex: 1; min-width: 0; }

/* Cinematic hero (Slice 2.6) */
.ib-hero-zone {
    position: relative; width: 100%; height: 480px;
    background: #020505; overflow: hidden;
    margin-bottom: 18px; border-bottom: 1px solid #15272a;
}
.ib-hero-iframe { width: 100%; height: 100%; border: 0; display: block; }
.ib-hero-overlay {
    position: absolute; inset: 0; pointer-events: none;
    background: linear-gradient(to bottom, rgba(2,5,5,0.15) 0%, transparent 35%, rgba(2,5,5,0.55) 100%);
}
.ib-hero-sev-chip {
    position: absolute; top: 16px; left: 18px;
    padding: 5px 11px; font-size: 11px; font-weight: 500;
    letter-spacing: 1.5px; color: #fff;
    pointer-events: auto;
}
.ib-hero-sev-critical { background: #b06858; }
.ib-hero-sev-high { background: #c4886a; }
.ib-hero-sev-normal { background: #90bfc4; }
.ib-hero-sev-de-esc { background: #7cb4b9; }
.ib-hero-region {
    position: absolute; top: 16px; right: 18px;
    color: #fff; font-size: 11px; letter-spacing: 1.2px; font-weight: 500;
    text-shadow: none;
    pointer-events: auto;
}
.ib-hero-live {
    margin-left: 6px; color: #c4a46a; animation: ib-hero-pulse 2s infinite;
}
@keyframes ib-hero-pulse { 0%,100% { opacity: 1; } 50% { opacity: 0.4; } }
.ib-hero-text {
    position: absolute; bottom: 22px; left: 22px; right: 200px;
    color: #fff; pointer-events: auto;
}
.ib-hero-headline {
    font-size: 26px; font-weight: 500; line-height: 1.1;
    text-shadow: none;
}
.ib-hero-meta { font-size: 12px; opacity: 0.85; margin-top: 6px; }
.ib-hero-open-link {
    position: absolute; bottom: 22px; right: 22px;
    background: rgba(255,255,255,0.15); color: #fff;
    padding: 6px 12px; font-size: 11px; font-weight: 600;
    text-decoration: none; border-radius: 2px; pointer-events: auto;
}
.ib-hero-open-link:hover { background: rgba(255,255,255,0.25); }

/* ───────────────────────────────────────────────────────────────────
 * Motion polish (Slice 2.6)
 * Controlled by --ib-motion-mode: full | reduced | off
 * Auto-set to reduced via prefers-reduced-motion below.
 * ─────────────────────────────────────────────────────────────────── */
:root { --ib-motion-mode: full; }
@media (prefers-reduced-motion: reduce) {
    :root { --ib-motion-mode: reduced; }
}

/* Ken Burns: every still card image gets a slow zoom-pan */
@keyframes ib-ken-burns {
    0%   { transform: scale(1.00) translate(0%, 0%); }
    50%  { transform: scale(1.03) translate(-3%, -2%); }
    100% { transform: scale(1.00) translate(0%, 0%); }
}
.ib-card-img,
.ib-briefing-hero,
.ib-wire-thumb {
    animation: ib-ken-burns 18s ease-in-out infinite;
    will-change: transform;
}
/* Halve speed under reduced */
@media (prefers-reduced-motion: reduce) {
    .ib-card-img,
    .ib-briefing-hero,
    .ib-wire-thumb {
        animation-duration: 36s;
    }
}
/* Disable entirely under off (manual control for future use) */
:root[style*="--ib-motion-mode: off"] .ib-card-img,
:root[style*="--ib-motion-mode: off"] .ib-briefing-hero,
:root[style*="--ib-motion-mode: off"] .ib-wire-thumb {
    animation: none;
}

/* ════════════════════════════════════════════════════════════════════════
   /intel-brief stream (Slice 2.8) — readability-first redesign

   Design brief: VERY easy to read. Single-column scroll (Twitter pattern).
   Serif body type (Spectral) for paragraph reading at 18px/1.65. Warm-dark
   palette to reduce eye strain (warmer than slate, less pure-black than
   #000). Generous spacing. Restrained color: ONE accent (warm amber) plus
   severity reds. Distinct from generic-dashboard slop.

   Type stack (loaded from Google Fonts via @import below — Spectral is a
   screen-optimized serif by Production Type, distinct from system serifs):
     Spectral 400/600/700  — headlines + body
     DM Mono 500/700 — chips + timestamps + codes (already global)
   ════════════════════════════════════════════════════════════════════════ */

/* Spectral import removed: the editorial cards now use the QDT brand sans (see 00_qdt_brand.css). */

.ib-root-stream {
    /* Warm-dark palette: lower blue cast = less perceived eye strain.
       All text colors hit ≥9:1 against the card bg. */
    --st-text:        var(--brand-text-bright);   /* headlines (warm ivory)               */
    --st-text-body:   var(--brand-text-bright);   /* paragraph body (warm slate-200)      */
    --st-text-meta:   var(--brand-text-body);   /* source + timestamp + chip text       */
    --st-text-muted:  var(--brand-text-tertiary);   /* dot separators only                  */

    --st-bg-page:     var(--brand-bg-page);   /* page bg — slightly warm near-black   */
    --st-bg-card:     var(--brand-bg-card);   /* card bg — readable contrast for text */
    --st-bg-card-hover: var(--brand-bg-card-mid);
    --st-bg-head:     rgba(4, 8, 9, 0.95);

    --st-accent:      var(--brand-sand);   /* single warm accent (amber)           */
    --st-accent-soft: var(--brand-sand-light);
    --st-critical:    var(--brand-rust);
    --st-high:        var(--brand-high);
    --st-good:        var(--brand-accent-light);

    --st-line:        rgba(222, 241, 243, 0.09);
    --st-line-strong: rgba(222, 241, 243, 0.16);

    background: var(--st-bg-page);
    min-height: 100vh;
    color: var(--st-text);
    padding: 0;
    font-family: 'Gotham', 'Montserrat', Arial, sans-serif;
    font-size: 16px;
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
}

/* ── Sticky page head ─────────────────────────────────────────────────── */
.ib-page-head {
    position: sticky;
    top: var(--qs-nav-h, 0px);
    z-index: 50;
    background: var(--st-bg-head);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--st-line-strong);
    padding: 18px 28px 16px;
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 18px;
    max-width: 720px;
    margin: 0 auto;
}

.ib-masthead {
    display: flex;
    align-items: baseline;
    gap: 10px;
}
.ib-masthead-pre {
    font-family: 'DM Mono', ui-monospace, monospace;
    font-size: 11px;
    color: var(--st-accent);
    letter-spacing: 3px;
    font-weight: 500;
    text-transform: uppercase;
}
.ib-masthead-main {
    font-family: 'Gotham', 'Montserrat', Arial, sans-serif;
    font-size: 26px;
    color: var(--st-text);
    font-weight: 500;
    letter-spacing: -0.5px;
    line-height: 1;
}

.ib-stream-meta {
    font-family: 'DM Mono', ui-monospace, monospace;
    font-size: 11px;
    color: var(--st-text-meta);
    letter-spacing: 0.5px;
    font-weight: 500;
}
.ib-stream-meta-n     { color: var(--st-text); font-weight: 500; }
.ib-stream-meta-sep   { color: var(--st-text-muted); }
.ib-stream-meta-img   { color: var(--st-text-meta); }
.ib-stream-meta-live  {
    color: var(--st-good);
    text-transform: uppercase;
    letter-spacing: 1.5px;
    font-weight: 500;
}
.ib-stream-meta-live::before {
    content: '';
    display: inline-block;
    width: 6px; height: 6px;
    border-radius: 50%;
    background: var(--st-good);
    margin-right: 6px;
    margin-bottom: 1px;
    box-shadow: none;
    animation: ib-stream-pulse 2s infinite;
}
@keyframes ib-stream-pulse {
    0%, 100% { opacity: 1; }
    50%      { opacity: 0.35; }
}

/* ── Feed container ───────────────────────────────────────────────────── */
.ib-stream {
    max-width: 720px;
    margin: 0 auto;
    padding: 0 0 120px 0;
}
.ib-stream-list { display: flex; flex-direction: column; }

/* ── Card ─────────────────────────────────────────────────────────────── */
.ib-item {
    background: var(--st-bg-card);
    border-bottom: 1px solid var(--st-line);
    border-left: 3px solid transparent;
    padding: 26px 30px 28px 27px;
    transition: background-color 0.18s ease, border-left-color 0.18s ease;
    position: relative;
    animation: ib-item-fade-in 0.45s ease-out;
}
.ib-item:hover {
    background: var(--st-bg-card-hover);
}
.ib-item-briefing { cursor: pointer; }

@keyframes ib-item-fade-in {
    from { opacity: 0; transform: translateY(6px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* ── Header strip: type chip + severity + source + timestamp ──────────── */
.ib-item-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 14px;
    font-family: 'DM Mono', ui-monospace, monospace;
    font-size: 11px;
    color: var(--st-text-meta);
    letter-spacing: 0.5px;
    flex-wrap: wrap;
}
.ib-item-type {
    padding: 3px 9px;
    font-size: 10px;
    font-weight: 500;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    border-radius: 2px;
    line-height: 1.4;
}
.ib-type-alert       { background: rgba(229, 222, 200, 0.10); color: var(--st-text);     border: 1px solid rgba(222, 241, 243, 0.15); }
.ib-type-agent       { background: rgba(196, 164, 106, 0.18);  color: var(--st-accent-soft); }
.ib-type-briefing    { background: rgba(158, 196, 201, 0.16); color: var(--st-good);   }
.ib-type-zone        { background: rgba(196, 122, 106, 0.18);   color: #d9aaa0; }
.ib-type-chokepoint  { background: rgba(117, 174, 178, 0.18);  color: #9ec4c9; }

.ib-item-risk-chip {
    font-family: 'DM Mono', ui-monospace, monospace;
    font-size: 10px;
    font-weight: 500;
    letter-spacing: 1.5px;
    color: var(--st-critical);
    background: rgba(196, 122, 106, 0.10);
    border: 1px solid rgba(196, 122, 106, 0.30);
    padding: 3px 8px;
    border-radius: 2px;
}
.ib-item-event-count {
    font-family: 'DM Mono', ui-monospace, monospace;
    font-size: 10px;
    color: var(--st-text-meta);
    letter-spacing: 0.5px;
}
.ib-item-region {
    color: var(--st-accent-soft);
    font-weight: 500;
    letter-spacing: 1px;
    text-transform: uppercase;
}
.ib-item-coords {
    font-family: 'DM Mono', ui-monospace, monospace;
    color: var(--st-text-meta);
    font-weight: 500;
    letter-spacing: 0.3px;
}

.ib-item-sev {
    padding: 3px 9px;
    font-size: 10px;
    font-weight: 500;
    letter-spacing: 1.5px;
    color: #fff;
    border-radius: 2px;
    line-height: 1.4;
}
.ib-item-source {
    color: var(--st-text-meta);
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 1px;
}
.ib-item-dot { color: var(--st-text-muted); }
.ib-item-ts  { color: var(--st-text-meta); font-weight: 500; }

/* ── Headline — Spectral serif, large + tight ────────────────────────── */
.ib-item-headline {
    font-family: 'Gotham', 'Montserrat', Arial, sans-serif;
    font-size: 23px;
    line-height: 1.28;
    color: var(--st-text);
    font-weight: 500;
    letter-spacing: -0.3px;
}

/* ── Narrative — paragraph body. Serif aids reading at 18px/1.65 ─────── */
.ib-item-narrative {
    margin-top: 14px;
    font-family: 'Gotham', 'Montserrat', Arial, sans-serif;
    font-size: 18px;
    line-height: 1.65;
    color: var(--st-text-body);
    font-weight: 400;
    max-width: 60ch;
}

/* ── Image ────────────────────────────────────────────────────────────── */
.ib-item-image-wrap {
    margin: 4px 0 18px 0;
    border-radius: 3px;
    overflow: hidden;
    position: relative;
    background: #040809;
    border: 1px solid var(--st-line-strong);
}
.ib-item-image {
    width: 100%;
    max-height: 460px;
    object-fit: cover;
    display: block;
}
.ib-item-ct-badge {
    position: absolute;
    bottom: 10px;
    left: 10px;
    background: rgba(0, 0, 0, 0.78);
    color: var(--st-accent-soft);
    font-family: 'DM Mono', ui-monospace, monospace;
    font-size: 10px;
    letter-spacing: 1.5px;
    padding: 4px 9px;
    border-radius: 2px;
    text-transform: uppercase;
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
}
.ib-item-live-chip {
    position: absolute;
    top: 10px;
    left: 10px;
    padding: 3px 8px;
    font-family: 'DM Mono', monospace;
    font-size: 10px;
    font-weight: 500;
    letter-spacing: 0.08em;
    color: #040809;
    background: #c4a46a;
    border-radius: 3px;
    text-transform: uppercase;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.4);
}

/* ── Footer ───────────────────────────────────────────────────────────── */
.ib-item-foot {
    margin-top: 18px;
    display: flex;
    gap: 18px;
    align-items: center;
}
.ib-item-foot-link {
    font-family: 'DM Mono', ui-monospace, monospace;
    font-size: 11px;
    letter-spacing: 1.2px;
    color: var(--st-accent);
    text-decoration: none;
    text-transform: uppercase;
    font-weight: 500;
}
.ib-item-foot-link:hover {
    color: var(--st-accent-soft);
    text-decoration: underline;
}
.ib-item-briefing-cta { color: var(--st-good); }
.ib-item-briefing-cta:hover { color: #def1f3; }

/* ── Severity coloring on card border (driven by inline style) ────────── */
.ib-item { /* default border color injected by render — see _build_item */ }

/* CRITICAL/HIGH items get a subtle bg tint */
.ib-item[style*="dc2626"] { background: linear-gradient(to right, rgba(196, 122, 106, 0.045), var(--st-bg-card) 12%); }
.ib-item[style*="f97316"] { background: linear-gradient(to right, rgba(196, 136, 106, 0.04),  var(--st-bg-card) 10%); }
.ib-item[style*="dc2626"]:hover,
.ib-item[style*="f97316"]:hover { background: linear-gradient(to right, rgba(196, 122, 106, 0.07), var(--st-bg-card-hover) 12%); }

/* ── Responsive — full-width on narrow screens ────────────────────────── */
@media (max-width: 760px) {
    .ib-page-head    { padding: 14px 18px; }
    .ib-item         { padding: 20px 18px 22px 15px; }
    .ib-item-headline { font-size: 20px; }
    .ib-item-narrative { font-size: 16.5px; line-height: 1.6; }
    .ib-masthead-main { font-size: 22px; }
}
