/* LLCorp GovCon Dashboard — design system extracted from llcorp.commdata.us */
:root {
  --navy: #0e2645;
  --navy-2: #143256;
  --navy-3: #1d4374;
  --gold: #c9a86a;
  --gold-2: #b08f4f;
  --ink: #1a2330;
  --ink-2: #45556a;
  --ink-3: #7a8aa0;
  --paper: #ffffff;
  --paper-2: #f6f8fb;
  --paper-3: #eaeef4;
  --line: #d8dee8;
  --green: #198754;
  --amber: #d97706;
  --red: #dc2626;
  --shadow: 0 1px 2px rgba(14,38,69,.05), 0 8px 24px rgba(14,38,69,.06);
}
*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Inter", Roboto, "Helvetica Neue", Arial, sans-serif;
  color: var(--ink);
  background: var(--paper-2);
  line-height: 1.5;
  font-size: 14px;
  -webkit-font-smoothing: antialiased;
}
h1, h2, h3, h4 {
  font-family: Georgia, "Times New Roman", serif;
  font-weight: 700;
  letter-spacing: -.01em;
  color: var(--ink);
  margin: 0 0 .5em;
  line-height: 1.2;
}
a { color: var(--navy-3); text-decoration: none; }
a:hover { text-decoration: underline; }
code, .mono {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: .85em;
}

/* ---- Layout ---- */
.topbar {
  background: var(--navy);
  color: rgba(255,255,255,.85);
  padding: .55rem 1.25rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: .5rem 1.25rem;
}
.topbar .brand {
  display: flex; align-items: center; gap: .65rem;
  color: #fff; font-weight: 600;
}
.topbar .brand:hover { text-decoration: none; }
.brand-mark {
  width: 28px; height: 28px;
  background: var(--gold); color: var(--navy);
  border-radius: 5px;
  display: grid; place-items: center;
  font-family: Georgia, serif; font-weight: 700; font-size: 1rem;
}
.brand-text { font-size: .95rem; }
.brand-text small {
  display: block; color: rgba(255,255,255,.65);
  font-size: .7rem; letter-spacing: .08em; text-transform: uppercase;
  font-weight: 500;
}
.topbar .meta {
  display: flex; gap: 1rem; flex-wrap: wrap; align-items: center;
  font-size: .82rem;
}
.topbar .meta span { color: rgba(255,255,255,.7); }
.topbar .meta strong { color: var(--gold); margin-right: .35rem; font-weight: 600; }
.topnav {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;            /* allow links to wrap inside the nav */
  row-gap: .35rem;            /* tighter vertical when wrapped */
}
.topnav a {
  color: rgba(255,255,255,.85); font-size: .88rem; font-weight: 500;
  padding: .35rem .65rem; border-radius: 4px;
  white-space: nowrap;        /* don't break individual link labels */
}
.topnav a:hover { background: rgba(255,255,255,.1); color: #fff; text-decoration: none; }

/* On narrow screens, give the nav + global search their own full-width
   rows so the long nav (Queue · Watchlist · Recompete · ES Radius ·
   Leaderboard · Predictions · Awards · History · Feedback) doesn't
   run off the edge. Brand stays on row 1 with meta; nav drops to row 2;
   search drops to row 3. */
@media (max-width: 1100px) {
  .topnav,
  .topbar .global-search {
    flex-basis: 100%;
    order: 10;                /* push below brand + meta */
  }
  .topbar .global-search {
    margin-top: .25rem;
  }
  .topbar .global-search input {
    flex: 1;
    min-width: 0;             /* let the input shrink in the flexbox */
  }
}
@media (max-width: 600px) {
  /* Very small screens: tighten meta row too */
  .topbar .meta { font-size: .75rem; gap: .65rem; }
  .topnav { gap: .5rem; row-gap: .3rem; }
  .topnav a { padding: .3rem .5rem; font-size: .82rem; }
}
.logout-link {
  background: none; border: 1px solid rgba(255,255,255,.25); color: rgba(255,255,255,.7);
  padding: .25rem .65rem; border-radius: 4px; font-size: .75rem; cursor: pointer;
  font-family: inherit;
}
.logout-link:hover { background: rgba(255,255,255,.1); color: #fff; }

.container { max-width: 1280px; margin: 0 auto; padding: 1.5rem 1.25rem 4rem; }

/* ---- Summary strip ---- */
.summary {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: .75rem;
  margin-bottom: 1.5rem;
}
.stat {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: .9rem 1rem;
}
.stat .num {
  font-family: Georgia, serif;
  font-size: 1.6rem;
  color: var(--ink);
  display: block;
  line-height: 1.1;
}
.stat .label {
  font-size: .72rem;
  color: var(--ink-3);
  text-transform: uppercase;
  letter-spacing: .08em;
  display: block;
  margin-top: .2rem;
}
.stat.pursue .num { color: var(--green); }
.stat.urgent .num { color: var(--red); }
.stat.gap .num { color: var(--amber); }

/* ---- Section / category groups ---- */
.section { margin-bottom: 2.5rem; }
.section-header {
  display: flex; align-items: baseline; gap: .75rem;
  margin-bottom: .85rem;
  padding-bottom: .5rem;
  border-bottom: 2px solid var(--line);
}
.section-header h2 {
  margin: 0;
  font-size: 1.15rem;
  font-family: -apple-system, sans-serif;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: var(--navy);
}
.section-header .count {
  background: var(--paper-3);
  color: var(--ink-2);
  font-size: .8rem;
  font-weight: 600;
  padding: .15rem .55rem;
  border-radius: 4px;
}
.section-header .hint {
  margin-left: auto;
  font-size: .8rem;
  color: var(--ink-3);
}
.section-llcorp .section-header h2 { color: var(--navy); }
.section-tusco .section-header h2 { color: var(--gold-2); }
.section-direct .section-header h2 { color: var(--ink-2); }

/* ---- Tusco Priority section — pinned at top of queue ---- */
.section-tusco-priority {
  border: 2px solid #b91c1c;
  border-radius: 10px;
  padding: .75rem 1rem 1rem 1rem;
  background: linear-gradient(180deg, #fff5f5 0%, #ffffff 35%);
  margin-bottom: 1.5rem;
}
.section-tusco-priority .section-header h2 { color: #b91c1c; }

/* ---- Pre-Sol Watch — Pre-Sols/SS/Special Notices kept visible after
   SAM archives them, so Bruce can watch for follow-up RFPs ---- */
.section-pre-sol-watch {
  border: 2px solid #7c3aed;
  border-radius: 10px;
  padding: .75rem 1rem 1rem 1rem;
  background: linear-gradient(180deg, #f5f3ff 0%, #ffffff 35%);
  margin-bottom: 1.5rem;
}
.section-pre-sol-watch .section-header h2 { color: #6d28d9; }

/* ---- Manual Pulls section — operator-initiated lookups, pinned ---- */
.section-manual-pulls {
  border: 2px solid #0ea5e9;
  border-radius: 10px;
  padding: .75rem 1rem 1rem 1rem;
  background: linear-gradient(180deg, #f0f9ff 0%, #ffffff 35%);
  margin-bottom: 1.5rem;
}
.section-manual-pulls .section-header h2 { color: #0369a1; }
.badge-manual-pull {
  background: #0369a1;
  color: white;
  font-weight: 600;
}
.badge-followup-posted {
  background: #16a34a;
  color: white;
  font-weight: 700;
  text-decoration: none;
}
.badge-followup-posted:hover { background: #14803a; }
.badge-predecessor {
  background: #7c3aed;
  color: white;
  font-weight: 600;
  text-decoration: none;
}
.badge-predecessor:hover { background: #6d28d9; }
/* Global search bar in the topbar */
.global-search input:focus {
  outline: 2px solid var(--accent, #c9a86a);
  border-color: transparent;
}
.priority-lanes {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}
@media (max-width: 900px) {
  .priority-lanes { grid-template-columns: 1fr; }
}
.priority-lane {
  background: white;
  border-radius: 8px;
  padding: .5rem .75rem .75rem;
  border: 1px solid #e5e7eb;
}
.priority-lane-llcorp { border-top: 3px solid #1d4ed8; }
.priority-lane-tusco  { border-top: 3px solid #b45309; }
.lane-header {
  display: flex;
  align-items: baseline;
  gap: .5rem;
  flex-wrap: wrap;
  margin-bottom: .5rem;
  padding-bottom: .35rem;
  border-bottom: 1px solid #f0f0f0;
}
.lane-header h3 {
  margin: 0;
  font-size: 1rem;
  letter-spacing: .01em;
}
.priority-lane-llcorp .lane-header h3 { color: #1d4ed8; }
.priority-lane-tusco  .lane-header h3 { color: #b45309; }
.lane-header .hint {
  margin-left: auto;
  font-size: .75rem;
  color: var(--ink-3);
}

/* New badges introduced by Tusco-priority spec v3 */
.badge-tusco-priority {
  background: #fef3c7;
  color: #7c2d12;
  border: 1px solid #f59e0b;
  font-weight: 700;
}
.badge-geo {
  background: #f3f4f6;
  color: #374151;
  border: 1px solid #d1d5db;
  font-weight: 500;
}
.badge-geo-home {
  background: #ecfdf5;
  color: #065f46;
  border-color: #10b981;
}
.badge-handoff {
  background: #ede9fe;
  color: #5b21b6;
  border: 1px solid #c4b5fd;
  font-weight: 500;
}

/* PWS Screener — auto-extracted scope summary on cards + detail page */
.card-pws-summary {
  margin: .35rem 0 .15rem 0;
  padding: .35rem .6rem;
  background: #f9fafb;
  border-left: 2px solid #d1d5db;
  border-radius: 3px;
  font-size: .82rem;
  color: var(--ink-2);
  line-height: 1.35;
}
.card-pws-summary em { color: var(--ink); font-style: italic; }

.badge-fit-tusco        { background: #ecfdf5; color: #065f46; border: 1px solid #6ee7b7; }
.badge-fit-llcorp       { background: #eef2ff; color: #3730a3; border: 1px solid #a5b4fc; }
.badge-fit-partner_only { background: #fef3c7; color: #92400e; border: 1px solid #fde68a; }
.badge-fit-out_of_scope { background: #fef2f2; color: #991b1b; border: 1px solid #fca5a5; font-weight: 600; }

/* PWS Screener card on opp detail page */
.screener-card {
  border: 1px solid #e5e7eb;
  border-radius: 6px;
  padding: .85rem 1rem;
  margin: 1rem 0;
  background: white;
}
.screener-fit-tusco        { border-left: 4px solid #10b981; }
.screener-fit-llcorp       { border-left: 4px solid #6366f1; }
.screener-fit-partner_only { border-left: 4px solid #f59e0b; }
.screener-fit-out_of_scope { border-left: 4px solid #ef4444; background: #fef9f9; }
.screener-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: .75rem;
  margin-bottom: .55rem;
}
.screener-header h3 { margin: 0; font-size: 1rem; }
.screener-header h3 small { font-weight: 500; margin-left: .35rem; font-size: .82rem; color: var(--ink-2); }
.screener-cost { font-size: .75rem; color: var(--ink-3); font-family: 'Menlo', 'Consolas', monospace; }
.screener-summary {
  font-size: .92rem;
  line-height: 1.45;
  color: var(--ink);
  margin-bottom: .65rem;
  padding-bottom: .5rem;
  border-bottom: 1px dashed #e5e7eb;
}
.screener-fields { margin: 0; }
.screener-fields dt { color: var(--ink-3); font-weight: 600; font-size: .75rem; text-transform: uppercase; margin-top: .35rem; }
.screener-fields dd { margin: .15rem 0 0 0; font-size: .87rem; }

/* Attachment list on opp detail page — surfaces locally cached PDFs */
.attachment-list {
  margin: 0;
  padding-left: 1rem;
  font-size: .87rem;
  list-style: none;
}
.attachment-list li {
  margin: .25rem 0;
  padding-left: 0;
}
.attachment-list a {
  color: var(--navy);
  text-decoration: none;
}
.attachment-list a:hover { text-decoration: underline; }
.attachment-list .att-size { color: var(--ink-3); font-size: .82em; margin-left: .35rem; }
.attachment-list li.att-error { color: #b91c1c; }
.att-pending {
  background: #fef3c7;
  border-left: 3px solid #f59e0b;
  padding: .55rem .75rem;
  margin-bottom: .5rem;
  border-radius: 4px;
  font-size: .85rem;
  color: #78350f;
}
.att-pending .att-spinner { display: inline-block; animation: spin 1.6s linear infinite; }
.att-pending strong { display: block; color: #92400e; }
.att-pending small { display: block; color: #78350f; font-size: .8rem; margin-top: .25rem; }
.att-footer { margin-top: .5rem; font-size: .8rem; color: var(--ink-3); }
@keyframes spin { to { transform: rotate(360deg); } }

/* Tusco-member view banner — Greg's tailored landing page indicator */
.tusco-view-banner {
  background: #fef3c7;
  border-left: 4px solid #f59e0b;
  padding: .65rem 1rem;
  margin-bottom: 1rem;
  border-radius: 4px;
  font-size: .9rem;
  color: #78350f;
}
.tusco-view-banner strong { color: #92400e; }

/* Pipeline Funnel — 30-day conversion visualization on the queue page */
.funnel-card {
  background: white;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  padding: 1rem 1.25rem;
  margin-bottom: 1.5rem;
}
.funnel-header {
  display: flex;
  align-items: baseline;
  gap: .75rem;
  margin-bottom: .85rem;
}
.funnel-header h3 {
  margin: 0;
  font-size: 1rem;
  color: var(--navy);
}
.funnel-header h3 small { color: var(--ink-3); font-weight: 400; font-size: .82rem; }
.funnel-header .hint { font-size: .8rem; color: var(--ink-3); }
.funnel-row {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: .5rem;
}
@media (max-width: 700px) {
  .funnel-row { grid-template-columns: repeat(2, 1fr); }
}
.funnel-step {
  position: relative;
  background: #f9fafb;
  border-radius: 6px;
  padding: .65rem .75rem;
  overflow: hidden;
  min-height: 4.5rem;
}
.funnel-bar {
  position: absolute;
  top: 0;
  left: 0;
  bottom: 0;
  background: linear-gradient(90deg, rgba(20,58,107,0.14), rgba(20,58,107,0.06));
  border-right: 2px solid rgba(20,58,107,0.3);
  z-index: 0;
}
.funnel-step-future .funnel-bar {
  background: repeating-linear-gradient(45deg, #f3f4f6, #f3f4f6 6px, #ffffff 6px, #ffffff 12px);
  border-right: none;
  width: 100%;
}
.funnel-step .funnel-num {
  position: relative;
  z-index: 1;
  display: block;
  font-size: 1.75rem;
  font-weight: 700;
  color: var(--navy);
  line-height: 1;
}
.funnel-step-future .funnel-num { color: var(--ink-3); }
.funnel-step .funnel-label {
  position: relative;
  z-index: 1;
  display: block;
  font-size: .75rem;
  color: var(--ink-2);
  margin-top: .25rem;
  text-transform: uppercase;
  letter-spacing: .04em;
}

/* Recompete Radar — description-led row layout (refactor 2026-05-13).
   Lead with what the contract is for, then incumbent + value + window. */
.recompete-filters {
  display: flex;
  flex-wrap: wrap;
  gap: .35rem;
  align-items: center;
  margin: .35rem 0 1rem 0;
  padding: .5rem .65rem;
  background: #f9fafb;
  border-radius: 6px;
  font-size: .82rem;
}
.recompete-filters .rf-label { color: var(--ink-3); margin-right: .15rem; }
.recompete-filters .rf-sep {
  display: inline-block; width: 1px; height: 1.2rem; background: #d1d5db; margin: 0 .5rem;
}
.recompete-filters .rf-chip {
  padding: .25rem .65rem;
  border: 1px solid #d1d5db;
  border-radius: 999px;
  background: white;
  color: var(--ink-2);
  text-decoration: none;
  font-weight: 500;
}
.recompete-filters .rf-chip:hover { background: #f3f4f6; border-color: #9ca3af; }
.recompete-filters .rf-chip.is-active {
  background: var(--navy); color: white; border-color: var(--navy);
}

.recompete-list {
  display: flex;
  flex-direction: column;
  gap: .55rem;
}
.rc-row {
  background: white;
  border: 1px solid #e5e7eb;
  border-left: 3px solid #cbd5e1;
  border-radius: 6px;
  padding: .65rem .85rem;
  transition: border-left-color .15s;
}
.rc-row:hover { border-left-color: var(--navy); }
.rc-row.rc-urgent { border-left-color: #b45309; background: #fffbeb; }
.rc-row-header {
  display: flex;
  align-items: baseline;
  gap: .5rem;
  margin-bottom: .3rem;
}
.rc-title {
  margin: 0;
  font-size: 1rem;
  font-weight: 600;
  line-height: 1.3;
  flex: 1;
  min-width: 0;
}
.rc-title a { color: var(--ink); text-decoration: none; }
.rc-title a:hover { color: var(--navy); text-decoration: underline; }
.rc-actions { display: flex; gap: .35rem; flex-shrink: 0; }
.rc-link-ext {
  font-size: .78rem;
  color: var(--ink-3);
  padding: .15rem .5rem;
  border: 1px solid #e5e7eb;
  border-radius: 4px;
  text-decoration: none;
  white-space: nowrap;
}
.rc-link-ext:hover { color: var(--navy); border-color: var(--navy); background: #f9fafb; }

.rc-meta, .rc-timeline {
  display: flex;
  flex-wrap: wrap;
  gap: .25rem 1rem;
  font-size: .82rem;
  color: var(--ink-2);
  margin-top: .25rem;
}
.rc-meta > span { white-space: nowrap; }
.rc-incumbent strong { color: var(--ink); }
.rc-uei { color: var(--ink-3); font-size: .85em; margin-left: .25rem; }
.rc-value { color: #166534; font-weight: 600; font-variant-numeric: tabular-nums; }
.rc-naics { color: var(--ink-3); }
.rc-window strong { color: var(--ink); }
.rc-window-status { font-weight: 500; }
.rc-pop-end { color: var(--ink-3); }

.rc-rationale {
  margin-top: .4rem;
  font-size: .8rem;
}
.rc-rationale > summary {
  color: var(--ink-3);
  cursor: pointer;
  user-select: none;
  padding: .15rem 0;
}
.rc-rationale > summary:hover { color: var(--navy); }
.rc-rationale p {
  margin: .35rem 0 .1rem 0;
  padding: .5rem .75rem;
  background: #f9fafb;
  border-radius: 4px;
  color: var(--ink-2);
  line-height: 1.45;
}

/* Watch button (per-user bookmark, separate from triage) */
.opp-watch-row {
  margin: .35rem 0 .4rem 0;
  display: flex;
  justify-content: flex-end;
}
.act-watch {
  background: #fff;
  color: #6b7280;
  border: 1px solid #d1d5db;
  padding: .3rem .7rem;
  border-radius: 4px;
  font-size: .8rem;
  cursor: pointer;
}
.act-watch:hover {
  background: #f9fafb;
  color: #374151;
  border-color: #9ca3af;
}
.act-watch.is-watched {
  background: #fef3c7;
  color: #92400e;
  border-color: #f59e0b;
  font-weight: 600;
}
.act-watch.is-watched:hover {
  background: #fde68a;
}
.badge-watching {
  background: #fef3c7;
  color: #92400e;
  border: 1px solid #f59e0b;
  font-weight: 600;
}

/* "Sent to Tusco" inline form */
.tusco-handoff-form {
  display: flex;
  gap: .4rem;
  margin: .5rem 0 .35rem 0;
  padding: .35rem .5rem;
  background: #fafaf9;
  border-radius: 5px;
  border: 1px dashed #d6d3d1;
}
.tusco-handoff-form input[type=text] {
  flex: 1;
  min-width: 0;
  padding: .3rem .5rem;
  font-size: .85rem;
  border: 1px solid #d1d5db;
  border-radius: 4px;
}
.act-handoff {
  background: #5b21b6;
  color: white;
  border: 1px solid #4c1d95;
  padding: .3rem .6rem;
  border-radius: 4px;
  font-size: .8rem;
  cursor: pointer;
  white-space: nowrap;
}
.act-handoff:hover { background: #4c1d95; }
.act-tag-sent_to_tusco {
  background: #ede9fe;
  color: #5b21b6;
}

/* ---- Opportunity card ---- */
.opp-list {
  display: grid;
  grid-template-columns: 1fr;
  gap: .65rem;
}
.opp-card {
  background: #fff;
  border: 1px solid var(--line);
  border-left: 3px solid var(--ink-3);
  border-radius: 8px;
  padding: 1rem 1.1rem;
  transition: box-shadow .12s ease, border-color .12s ease;
  text-decoration: none;
  color: inherit;
  display: block;
}
.opp-card:hover {
  text-decoration: none;
  box-shadow: var(--shadow);
  border-left-color: var(--navy-3);
}
.opp-card.score-high { border-left-color: var(--green); }
.opp-card.score-mid  { border-left-color: var(--amber); }
.opp-card.score-low  { border-left-color: var(--ink-3); }
.opp-card .row1 {
  display: flex; gap: .65rem;
  align-items: baseline;
  margin-bottom: .35rem;
}
.opp-card .score {
  background: var(--navy);
  color: var(--gold);
  font-family: Georgia, serif;
  font-weight: 700;
  font-size: 1.1rem;
  padding: .15rem .55rem;
  border-radius: 5px;
  min-width: 2.5rem;
  text-align: center;
  flex-shrink: 0;
}
.opp-card.score-high .score { background: var(--green); color: #fff; }
.opp-card .title {
  font-weight: 600;
  color: var(--ink);
  flex: 1;
  line-height: 1.3;
}
/* Structured card layout — four fixed rows, predictable order.
   Each row has a single purpose so the eye finds the same signal in the
   same spot card-to-card. Added 2026-05-12 replacing the chaotic flex-wrap
   .meta-row + .badges combo that let location/agency/badges land wherever. */

/* All card rows share spacing rhythm */
.opp-card .card-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: .35rem .8rem;
  margin-top: .4rem;
  font-size: .82rem;
}

/* Row 1 — CONTEXT (location + contracting org). Most prominent — slightly
   larger text + emphasized location. */
.opp-card .card-row-context {
  font-size: .88rem;
  color: var(--ink);
  margin-top: .5rem;
}
.opp-card .ctx-item { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.opp-card .ctx-location { font-weight: 600; color: var(--ink); }
.opp-card .ctx-location.is-home {
  color: #166534;
  background: #ecfdf5;
  padding: .05rem .45rem;
  border-radius: 4px;
  border: 1px solid #86efac;
}
.opp-card .ctx-location.ctx-empty { font-weight: 400; color: var(--ink-3); font-style: italic; }
.opp-card .ctx-location .dim { font-weight: 400; color: var(--ink-3); font-size: .85em; }
.opp-card .ctx-org { color: var(--ink-2); flex: 1; min-width: 0; }

/* Row 2 — SPECS (procurement facts). Tight, monospace-friendly. */
.opp-card .card-row-specs { color: var(--ink-2); }
.opp-card .spec-item { white-space: nowrap; }
.opp-card .spec-label { color: var(--ink-3); font-size: .78em; text-transform: uppercase; letter-spacing: .04em; }
.opp-card .spec-due { font-weight: 600; }
.opp-card .spec-due.urgent  { color: var(--red); }
.opp-card .spec-due.soon    { color: var(--amber); }
.opp-card .spec-due.overdue { color: var(--red); text-decoration: line-through; }
.opp-card .dim { color: var(--ink-3); font-style: italic; }

/* Row 3 — TAGS (system labels). Same as old .badges container but with
   predictable badge ordering in the template. */
.opp-card .card-row-tags { gap: .35rem; }

/* Row 4 — STATE (human-actioned bookmarks). Only renders when populated. */
.opp-card .card-row-state {
  gap: .35rem;
  border-top: 1px dashed #e5e7eb;
  padding-top: .35rem;
  margin-top: .5rem;
}
.badge {
  display: inline-block;
  padding: .2rem .55rem;
  border-radius: 4px;
  font-size: .72rem;
  font-weight: 600;
  letter-spacing: .03em;
  white-space: nowrap;
}
.badge-pursue   { background: #e7f5ee; color: #136f3b; }
.badge-tusco    { background: #fdf2e1; color: #8a6420; }
.badge-direct   { background: #ecf0f6; color: #45556a; }
.badge-review   { background: #fff7e6; color: #8a6420; }
.badge-pass     { background: #f3f5f9; color: #7a8aa0; }
.badge-gap      { background: #fef2e2; color: #b04a08; border: 1px solid #f8c995; }
.badge-keyword  { background: #ecf2ff; color: #2845a3; border: 1px solid #c9d4ff; }
/* Keyword source category — shows whether the hit came from Tusco's
   existing list (least differentiated) or from a Bruce/LLCorp expansion
   (Bruce's edge over Tusco's pipeline). */
.badge-kwcat-tusco_authoritative   { background: #fdf2e1; color: #8a6420; border: 1px solid #e5c98a; }
.badge-kwcat-oem_certifications    { background: #fdf2e1; color: #8a6420; border: 1px solid #e5c98a; }
.badge-kwcat-llcorp_wheelhouse     { background: #e7f5ee; color: #136f3b; border: 1px solid #a7d8ba; }
.badge-kwcat-llcorp_wheelhouse_extended { background: #e7f5ee; color: #136f3b; border: 1px solid #a7d8ba; }
.badge-kwcat-federal_program       { background: #e9f5ff; color: #0a4884; border: 1px solid #afd0ec; }
.badge-kwcat-adjacent_es           { background: #f3ecff; color: #5a2a9b; border: 1px solid #d6c0f5; }
.badge-kwcat- { background: var(--paper-3); color: var(--ink-2); }
.badge-watchlist{ background: #ffe9e9; color: #a01818; border: 1px solid #f9b9b9; }
.badge-presol   { background: #e9f5ff; color: #0a4884; }
.badge-sourcessought { background: #fff4dd; color: #8a4a08; }
.badge-special  { background: #ffe0e0; color: #a01010; }
.badge-saide    { background: var(--paper-3); color: var(--ink-2); }

/* ---- Opp detail page ---- */
.opp-detail h1 { font-size: 1.6rem; margin-bottom: .25rem; }
.opp-detail .subline {
  color: var(--ink-3);
  font-size: .85rem;
  margin-bottom: 1.5rem;
}
.opp-grid {
  display: grid;
  grid-template-columns: 1.5fr 1fr;
  gap: 2rem;
}
@media (max-width: 800px) { .opp-grid { grid-template-columns: 1fr; } }
.field-block {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 1.25rem;
  margin-bottom: 1rem;
}
.field-block h3 {
  font-family: -apple-system, sans-serif;
  font-size: .8rem;
  font-weight: 700;
  color: var(--gold-2);
  letter-spacing: .12em;
  text-transform: uppercase;
  margin-bottom: .85rem;
}
.field-block dl {
  margin: 0;
  display: grid;
  grid-template-columns: max-content 1fr;
  gap: .35rem 1rem;
  font-size: .9rem;
}
.field-block dt {
  color: var(--ink-3);
  text-transform: uppercase;
  letter-spacing: .04em;
  font-size: .72rem;
  align-self: center;
}
.field-block dd { margin: 0; color: var(--ink); }
.field-block dd.mono { font-family: ui-monospace, monospace; font-size: .85rem; }
.score-bar {
  display: flex; align-items: center; gap: 1rem;
  margin-bottom: 1rem;
}
.score-big {
  font-family: Georgia, serif;
  font-size: 3.5rem;
  font-weight: 700;
  color: var(--navy);
  line-height: 1;
  background: linear-gradient(180deg, var(--navy), var(--navy-3));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.score-bar .info { flex: 1; }
.score-bar .info .reco {
  font-family: Georgia, serif;
  font-size: 1.3rem;
  color: var(--navy);
}
.score-bar .info .status {
  font-size: .85rem;
  color: var(--ink-3);
  text-transform: uppercase;
  letter-spacing: .06em;
  margin-top: .15rem;
}
.json-block {
  background: var(--navy);
  color: #d8e1ee;
  padding: 1rem;
  border-radius: 6px;
  font-family: ui-monospace, monospace;
  font-size: .78rem;
  white-space: pre-wrap;
  word-break: break-word;
  overflow-x: auto;
  max-height: 400px;
  overflow-y: auto;
}
.btn {
  display: inline-block;
  padding: .55rem 1rem;
  border-radius: 6px;
  font-weight: 600;
  font-size: .85rem;
  background: var(--navy);
  color: #fff !important;
  text-decoration: none;
}
.btn:hover { background: var(--navy-2); text-decoration: none; }
.btn-outline {
  background: transparent;
  color: var(--navy) !important;
  border: 1.5px solid var(--navy);
}
.btn-outline:hover { background: var(--navy); color: #fff !important; }

/* ---- Phase C: filter bar ---- */
.filter-bar {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: .85rem 1rem;
  margin-bottom: 1.25rem;
  display: grid;
  gap: .55rem;
}
.filter-row {
  display: flex; flex-wrap: wrap; gap: .5rem;
  align-items: center;
}
.filter-bar input[type=text],
.filter-bar select {
  padding: .45rem .65rem;
  border: 1px solid var(--line);
  border-radius: 5px;
  font-size: .85rem;
  font-family: inherit;
  background: #fff;
  color: var(--ink);
}
.filter-bar input[type=text]:focus,
.filter-bar select:focus {
  outline: none; border-color: var(--navy-3);
  box-shadow: 0 0 0 3px rgba(29,67,116,.12);
}
.filter-bar .filter-q { flex: 1; min-width: 200px; }
.filter-bar .check {
  display: inline-flex; align-items: center; gap: .35rem;
  font-size: .85rem; color: var(--ink-2);
  padding: .35rem .55rem;
  border: 1px solid var(--line);
  border-radius: 5px;
  cursor: pointer;
}
.filter-bar .check input { margin: 0; }
.filter-bar .btn { padding: .45rem 1.1rem; font-size: .85rem; }
.filter-bar .btn-outline { padding: .45rem 1.1rem; font-size: .85rem; }

/* ---- Phase B: action buttons + post-action states ---- */
.opp-card-wrap { /* container so HTMX swaps don't double-wrap */ }
.opp-card { display: flex; flex-direction: column; gap: .65rem; padding-bottom: .65rem; }
.opp-link {
  display: block;
  text-decoration: none; color: inherit;
  padding: 1rem 1.1rem .35rem;
  margin: -1rem -1.1rem 0;
}
.opp-link:hover { text-decoration: none; }
.opp-actions {
  display: flex; gap: .35rem; flex-wrap: wrap;
  padding: 0 1.1rem;
  border-top: 1px solid var(--paper-3);
  padding-top: .55rem;
}
.opp-actions-detail {
  border-top: none; padding: 1rem 0; gap: .5rem;
  margin-bottom: 1rem;
}
.act {
  background: #fff;
  border: 1px solid var(--line);
  color: var(--ink-2);
  padding: .35rem .7rem;
  border-radius: 5px;
  font-size: .78rem;
  font-weight: 600;
  cursor: pointer;
  transition: all .12s ease;
  font-family: inherit;
}
.act:hover { border-color: var(--navy-3); }
.act-pursue:hover  { background: #136f3b; color: #fff; border-color: #136f3b; }
.act-tusco:hover   { background: #8a6420; color: #fff; border-color: #8a6420; }
.act-defer:hover   { background: var(--ink-3); color: #fff; border-color: var(--ink-3); }
.act-pass:hover    { background: #a01818; color: #fff; border-color: #a01818; }
.act-undo:hover    { background: var(--navy-3); color: #fff; border-color: var(--navy-3); }
.act-watch:hover   { background: #d97706; color: #fff; border-color: #d97706; }
.act-watching {
  background: #fff8e1;
  border-color: #d97706;
  color: #92400e;
}
.act-watching:hover { background: #fde68a; border-color: #b45309; color: #78350f; }
.opp-actions-detail .act { font-size: .9rem; padding: .55rem 1rem; }

.opp-decided { opacity: .7; background: var(--paper-3); }
.opp-decided.opp-decided-triaged_pursue { background: #f0faf3; border-left-color: #198754 !important; opacity: 1; }
.opp-decided.opp-decided-triaged_route_to_tusco { background: #fdf6e8; border-left-color: var(--gold-2) !important; opacity: .9; }
.opp-decided.opp-decided-deferred { background: #f3f5f9; border-left-color: var(--ink-3) !important; }
.opp-decided.opp-decided-triaged_pass { opacity: .55; background: var(--paper-3); }

.decided-tag {
  display: inline-block;
  padding: .35rem .7rem;
  border-radius: 5px;
  font-size: .78rem;
  font-weight: 600;
  letter-spacing: .03em;
  margin-right: auto;
}
.decided-triaged_pursue           { background: #136f3b; color: #fff; }
.decided-triaged_route_to_tusco   { background: var(--gold-2); color: #fff; }
.decided-deferred                 { background: var(--ink-3); color: #fff; }
.decided-triaged_pass             { background: var(--ink-2); color: #fff; }

/* ---- History page ---- */
.history-table {
  width: 100%; border-collapse: collapse;
  background: #fff; border: 1px solid var(--line);
  border-radius: 8px; overflow: hidden;
}
.history-table th {
  text-align: left; padding: .75rem 1rem;
  background: var(--navy); color: #fff;
  font-size: .75rem; letter-spacing: .08em; text-transform: uppercase;
  font-weight: 600;
}
.history-table td { padding: .75rem 1rem; border-top: 1px solid var(--line); font-size: .88rem; vertical-align: top; }
.history-table tr:hover { background: var(--paper-2); }
.act-tag {
  display: inline-block; padding: .15rem .55rem; border-radius: 4px;
  font-size: .7rem; font-weight: 700; letter-spacing: .05em;
}
.act-tag-pursue          { background: #e7f5ee; color: #136f3b; }
.act-tag-route_to_tusco  { background: #fdf2e1; color: #8a6420; }
.act-tag-defer           { background: #f3f5f9; color: #45556a; }
.act-tag-pass            { background: #ffe9e9; color: #a01818; }
.act-tag-reset           { background: #ecf2ff; color: #2845a3; }

.timeline { margin: 0; padding: 0; list-style: none; }
.timeline li {
  padding: .45rem 0;
  border-bottom: 1px solid var(--paper-3);
  display: flex; gap: .55rem; align-items: center; flex-wrap: wrap;
  font-size: .85rem;
}
.timeline li:last-child { border-bottom: none; }

/* ==== Analyst brief — inline on opp detail ==== */
.brief-trigger { font-size: .85rem; padding: .55rem 1rem; }
.brief-spinner {
  display: none;
  margin: 1rem 0;
  padding: .85rem 1rem;
  background: var(--paper-3);
  border-left: 3px solid var(--gold);
  border-radius: 4px;
  font-size: .85rem;
  color: var(--ink-2);
}
.brief-spinner.htmx-request,
.htmx-request .brief-spinner,
.htmx-request.brief-spinner { display: block; }
.brief-spinner small { color: var(--ink-3); margin-left: .5rem; }
.brief-card {
  background: #fff;
  border: 1px solid var(--line);
  border-left: 3px solid var(--gold);
  border-radius: 8px;
  margin: 1rem 0 1.5rem;
  overflow: hidden;
}
.brief-header {
  background: var(--paper-2);
  padding: .65rem 1rem;
  border-bottom: 1px solid var(--line);
  display: flex; align-items: baseline; gap: .75rem;
  flex-wrap: wrap;
}
.brief-header strong { color: var(--navy); font-family: Georgia, serif; }
.brief-meta { color: var(--ink-3); font-size: .72rem; font-family: ui-monospace, monospace; }
.brief-body { padding: 1rem 1.25rem; line-height: 1.55; font-size: .92rem; }
.brief-body h2 { font-size: 1.05rem; margin: 1rem 0 .35rem; color: var(--navy); }
.brief-body h3 { font-size: .95rem; margin: 1rem 0 .35rem; color: var(--navy-2); }
.brief-body h4 { font-size: .88rem; margin: .85rem 0 .25rem; color: var(--ink); font-family: -apple-system, sans-serif; text-transform: uppercase; letter-spacing: .04em; }
.brief-body p { margin: 0 0 .85rem; color: var(--ink); }
.brief-body p:last-child { margin-bottom: 0; }
.brief-body strong { color: var(--ink); font-weight: 600; }
.brief-error { padding: 1rem 1.25rem; color: #a01818; background: #fff0f0; }

/* ==== Feedback widget — floating bottom-right ==== */
#fb-widget {
  position: fixed;
  right: 1rem;
  bottom: 1rem;
  z-index: 9000;
  font-family: inherit;
}
#fb-widget .fb-pill {
  display: none;
  align-items: center;
  gap: .35rem;
  background: var(--navy);
  color: var(--gold);
  border: 1px solid rgba(255,255,255,.2);
  border-radius: 999px;
  padding: .55rem 1rem;
  font-size: .85rem;
  font-weight: 600;
  box-shadow: 0 4px 14px rgba(14,38,69,.35);
  cursor: pointer;
  font-family: inherit;
  transition: transform .12s ease, box-shadow .15s ease;
}
#fb-widget .fb-pill:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 18px rgba(14,38,69,.45);
}
#fb-widget .fb-pill-icon { font-size: 1rem; }
#fb-widget.fb-collapsed .fb-pill { display: inline-flex; }
#fb-widget.fb-collapsed .fb-panel { display: none; }
#fb-widget .fb-panel {
  width: min(360px, 90vw);
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 10px;
  box-shadow: 0 10px 40px rgba(14,38,69,.30);
  overflow: hidden;
}
#fb-widget .fb-header {
  background: var(--navy);
  color: #fff;
  padding: .65rem .9rem;
  font-size: .9rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
#fb-widget .fb-header strong { color: var(--gold); font-weight: 600; }
#fb-widget .fb-close {
  background: none;
  border: none;
  color: rgba(255,255,255,.7);
  font-size: 1.4rem;
  cursor: pointer;
  line-height: 1;
  padding: 0 .25rem;
}
#fb-widget .fb-close:hover { color: #fff; }
#fb-widget .fb-body { padding: .85rem .9rem; }
#fb-widget .fb-tagline {
  font-size: .8rem;
  color: var(--ink-3);
  margin: 0 0 .6rem;
}
#fb-widget textarea {
  width: 100%;
  padding: .55rem .7rem;
  border: 1px solid var(--line);
  border-radius: 5px;
  font-family: inherit;
  font-size: .9rem;
  resize: vertical;
  min-height: 70px;
}
#fb-widget textarea:focus {
  outline: none;
  border-color: var(--navy-3);
  box-shadow: 0 0 0 3px rgba(29,67,116,.15);
}
#fb-widget .fb-actions {
  display: flex;
  align-items: center;
  gap: .5rem;
  margin-top: .55rem;
}
#fb-widget .fb-context {
  flex: 1;
  font-size: .72rem;
  color: var(--ink-3);
  font-family: ui-monospace, monospace;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
#fb-widget .fb-actions .btn {
  padding: .4rem 1rem;
  font-size: .82rem;
}
#fb-widget .fb-flash {
  background: #e7f5ee;
  color: #136f3b;
  padding: .5rem .75rem;
  border-radius: 5px;
  font-size: .85rem;
  margin-top: .55rem;
}
#fb-widget .fb-foot {
  margin-top: .65rem;
  padding-top: .55rem;
  border-top: 1px solid var(--paper-3);
  font-size: .75rem;
  text-align: right;
}
#fb-widget .fb-foot a { color: var(--ink-3); }

/* ==== Mobile: tablet breakpoint ==== */
@media (max-width: 800px) {
  /* History / Awards tables — let them scroll horizontally instead of cramping */
  .history-table {
    display: block;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    white-space: nowrap;
  }
  .history-table th, .history-table td { white-space: normal; }
}

/* ==== Mobile: phone breakpoint ==== */
@media (max-width: 600px) {
  body { font-size: 13px; }
  .topbar {
    padding: .55rem .9rem;
    flex-direction: column;
    align-items: stretch;
    gap: .35rem;
  }
  .topbar .brand { gap: .55rem; }
  .topbar .brand-text { font-size: .85rem; }
  .topbar .brand-text small { font-size: .65rem; }
  .topnav {
    gap: 0;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    white-space: nowrap;
    padding: 0 .15rem .15rem;
    margin: 0 -.15rem;
    /* fade the right edge so users see there's more to scroll */
    -webkit-mask-image: linear-gradient(to right, black 88%, transparent 100%);
            mask-image: linear-gradient(to right, black 88%, transparent 100%);
  }
  .topnav a {
    padding: .3rem .45rem;
    font-size: .76rem;
    flex-shrink: 0;
  }
  .topbar .meta {
    font-size: .7rem;
    flex-wrap: wrap;
    gap: .35rem .85rem;
  }
  .topbar .meta strong { margin-right: .2rem; }
  .container { padding: .9rem .8rem 5.5rem; }   /* extra bottom for fb pill clearance */
  .summary { grid-template-columns: repeat(2, 1fr); gap: .5rem; }
  .stat { padding: .65rem .75rem; }
  .stat .num { font-size: 1.3rem; }
  .stat .label { font-size: .65rem; }
  .opp-card { padding: .85rem .9rem; }
  .opp-card .row1 { flex-wrap: wrap; gap: .45rem; }
  .opp-card .title { font-size: .92rem; }
  .opp-card .score { font-size: 1rem; padding: .15rem .45rem; }
  .opp-card .meta-row { font-size: .76rem; gap: .3rem .65rem; }
  .opp-actions { flex-wrap: wrap; gap: .3rem; padding: 0 .9rem; padding-top: .55rem; }
  .act { padding: .3rem .55rem; font-size: .72rem; }

  /* Filter bar: stack rows + full-width inputs */
  .filter-bar {
    padding: .65rem .65rem;
    width: 100%;
    box-sizing: border-box;
  }
  .filter-row {
    gap: .35rem;
    width: 100%;
    box-sizing: border-box;
  }
  /* All form controls share these on phone — overflow-safe sizing */
  .filter-bar input[type=text],
  .filter-bar select {
    flex: 1 1 calc(50% - .2rem);
    min-width: 0;       /* allow shrinking inside flex */
    width: 100%;
    max-width: 100%;
    padding: .45rem .5rem;
    font-size: .82rem;
    box-sizing: border-box;
    text-overflow: ellipsis;
  }
  .filter-bar .filter-q { flex: 1 1 100%; }
  .filter-bar .check {
    font-size: .78rem;
    padding: .3rem .4rem;
    flex: 1 1 calc(50% - .2rem);
    min-width: 0;
    max-width: 100%;
    box-sizing: border-box;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }
  .filter-bar .btn, .filter-bar .btn-outline {
    flex: 1 1 calc(50% - .2rem);
    min-width: 0;
    max-width: 100%;
    text-align: center;
    box-sizing: border-box;
    padding: .5rem .5rem;
    font-size: .82rem;
  }

  /* Section headers */
  .section-header { flex-wrap: wrap; gap: .35rem .55rem; padding-bottom: .35rem; }
  .section-header h2 { font-size: .95rem; }
  .section-header .hint {
    margin-left: 0; flex: 1 1 100%;
    font-size: .72rem;
  }

  /* Opp detail */
  .opp-detail h1 { font-size: 1.25rem; }
  .score-bar { flex-wrap: wrap; gap: .65rem; }
  .score-big { font-size: 2.6rem; }
  .field-block { padding: .9rem; }
  .field-block dl { font-size: .82rem; }

  /* Feedback widget — keep it tappable but unobtrusive on phone */
  #fb-widget { right: .65rem; bottom: .65rem; }
  #fb-widget .fb-pill {
    padding: .5rem .85rem;
    font-size: .8rem;
  }
  #fb-widget .fb-panel {
    width: calc(100vw - 1.3rem);    /* 100vw minus right + left margin */
    max-width: 360px;
  }
  #fb-widget .fb-tagline { font-size: .75rem; }
  #fb-widget textarea { font-size: 16px; }   /* prevents iOS auto-zoom on focus */
}

/* ============================================================
   Mobile-overflow defenses (2026-05-16) — JV flagged cards
   extending past viewport on phone. Adds belt-and-suspenders
   max-widths and wrap behavior so no element can push wider
   than its container regardless of inline-style flexbox decisions.
   ============================================================ */

/* Never let the page horizontally scroll */
html, body { overflow-x: hidden; max-width: 100vw; }

/* The opp-list grid cells should never overflow */
.opp-list { max-width: 100%; }
.opp-list > * { min-width: 0; max-width: 100%; }
.opp-card-wrap { max-width: 100%; min-width: 0; }
.opp-card { max-width: 100%; overflow-wrap: break-word; word-break: break-word; }
.opp-card .title { overflow-wrap: break-word; word-break: break-word; min-width: 0; }

@media (max-width: 600px) {
  /* Tighter container padding so cards have more room */
  .container { padding: 1rem .6rem 4rem; }

  /* Title row should wrap when the title is long */
  .opp-card .row1 { flex-wrap: wrap; gap: .45rem; }
  .opp-card .row1 .title { flex: 1 1 100%; min-width: 0; }

  /* All card rows: tighten gap so badges have more room before wrapping */
  .opp-card .card-row { gap: .35rem .5rem; }

  /* Context row — agency org needs to wrap on tiny screens */
  .opp-card .card-row-context { font-size: .82rem; }
  .opp-card .ctx-org { white-space: normal; min-width: 0; overflow-wrap: break-word; }

  /* Spec items can wrap their internal label/value pairs */
  .opp-card .spec-item { white-space: normal; overflow-wrap: anywhere; }

  /* Tenant-specific chip header above each card — let chips stack
     vertically instead of side-by-side when both are wide. */
  .opp-list > div > div[style*="space-between"] {
    flex-wrap: wrap !important;
    justify-content: flex-start !important;
  }

  /* Tenant set-aside legend at top of CEI's queue: stack each chip
     on its own row instead of trying to fit four on one line. */
  div[style*="Set-aside key"] {
    flex-direction: column !important;
    align-items: flex-start !important;
  }
  div[style*="Set-aside key"] > span {
    max-width: 100%;
    overflow-wrap: break-word;
    white-space: normal !important;
  }

  /* Profile card NAICS/Geography rows — already wrap, but enforce */
  .container > div > div[style*="flex-wrap:wrap"] { max-width: 100%; }

  /* Anything with inline padding+border that could overflow */
  span[style*="border-radius"], div[style*="border-radius"] {
    max-width: 100%;
    overflow-wrap: break-word;
  }
}

/* Even narrower phones (iPhone SE / older Android) */
@media (max-width: 380px) {
  .opp-card { padding: .8rem .75rem; }
  .opp-card .row1 .score { font-size: .95rem; padding: .1rem .4rem; }
  .topbar .brand-text small { display: none; }   /* hide subtitle */
}

/* ── Lane badges (ES / PS) ── per Bruce 2026-05-27.
   Render in the opp card title row as small color-coded chips so the
   operator can triage Electronic Security vs Perimeter Security opps
   at a glance. Auto-classified from title + description keywords. */
.lane-badge {
  display: inline-block;
  padding: .05rem .35rem;
  border-radius: .25rem;
  font-size: .68rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  margin-right: .25rem;
  vertical-align: middle;
  white-space: nowrap;
}
.lane-es { background: #dbeafe; color: #1e3a8a; border: 1px solid #93c5fd; }
.lane-ps { background: #ffedd5; color: #9a3412; border: 1px solid #fdba74; }
