/* Aerospace Ecosystem Atlas — dark grid theme modeled on the Kumu map */
* { box-sizing: border-box; margin: 0; padding: 0; }
:root {
  --bg: #17191d;
  --bg2: #1e2126;
  --bg3: #24282e;
  --line: #2c3138;
  --text: #d7dbe2;
  --muted: #8d939e;
  --accent: #4ea1ff;
  --card: #b9bec7;
  --danger: #e5636c;
  --ok: #46c28e;
}
html, body { height: 100%; }
body {
  background: var(--bg);
  color: var(--text);
  font: 13px/1.45 -apple-system, "Segoe UI", system-ui, Roboto, sans-serif;
  overflow: hidden;
}
#app { display: flex; flex-direction: column; height: 100vh; }
button { font: inherit; cursor: pointer; }
input, select, textarea { font: inherit; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ── Topbar ─────────────────────────────────────────── */
.topbar {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 14px; background: var(--bg2);
  border-bottom: 1px solid var(--line); flex-wrap: wrap; z-index: 30;
}
.topbar h1 { font-size: 15px; font-weight: 600; letter-spacing: .3px; white-space: nowrap; }
.topbar h1 .count { color: var(--muted); font-weight: 400; font-size: 12px; margin-left: 6px; }
.filterwhy { color: var(--accent); }
.clearfilters { background: none; border: 1px solid var(--danger); color: var(--danger); border-radius: 10px; padding: 0 8px; font-size: 11px; margin-left: 4px; cursor: pointer; }
.clearfilters:hover { background: rgba(229,99,108,.12); }
.searchbox {
  flex: 1 1 200px; max-width: 340px;
  background: var(--bg3); border: 1px solid var(--line); border-radius: 6px;
  color: var(--text); padding: 6px 10px; outline: none;
}
.searchbox:focus { border-color: var(--accent); }
.topbar select {
  background: var(--bg3); color: var(--text); border: 1px solid var(--line);
  border-radius: 6px; padding: 6px 8px; outline: none;
}
.viewtabs { display: flex; border: 1px solid var(--line); border-radius: 6px; overflow: hidden; }
.viewtabs button {
  background: var(--bg3); color: var(--muted); border: 0; padding: 6px 14px;
}
.viewtabs button.active { background: var(--accent); color: #fff; }
.btn {
  background: var(--bg3); color: var(--text); border: 1px solid var(--line);
  border-radius: 6px; padding: 6px 12px; white-space: nowrap;
}
.btn:hover { border-color: var(--muted); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: #fff; font-weight: 600; }
.btn.danger { background: transparent; border-color: var(--danger); color: var(--danger); }
.menuwrap { position: relative; }
.menu {
  position: absolute; right: 0; top: calc(100% + 4px); background: var(--bg3);
  border: 1px solid var(--line); border-radius: 8px; min-width: 220px;
  box-shadow: 0 8px 24px rgba(0,0,0,.5); display: none; z-index: 40; overflow: hidden;
}
.menu.open { display: block; }
.menu a, .menu button {
  display: block; width: 100%; text-align: left; padding: 9px 14px;
  background: none; border: 0; color: var(--text);
}
.menu a:hover, .menu button:hover { background: var(--bg2); text-decoration: none; }
.menu .hint { font-size: 11px; color: var(--muted); padding: 0 14px 8px; }

/* ── Main scroll area ───────────────────────────────── */
#main { flex: 1; overflow: auto; position: relative; }

/* ── Map grid ───────────────────────────────────────── */
.gridwrap { display: inline-block; min-width: 100%; padding-bottom: 30px; }
.gridrow { display: flex; align-items: stretch; }
.gridrow.head { position: sticky; top: 0; z-index: 20; }
.colhead {
  padding: 10px 8px 8px; text-align: center;
  background: var(--bg); border-bottom: 1px solid var(--line);
  font-size: 12px; font-weight: 600; letter-spacing: .4px; color: var(--text);
  flex-shrink: 0; position: relative;
}
.colhead .n { display: block; color: var(--muted); font-weight: 400; font-size: 10.5px; }
.colhead .swatch {
  display: inline-block; width: 8px; height: 8px; border-radius: 2px; margin-right: 6px;
}
.rowlabel {
  width: 150px; flex-shrink: 0; position: sticky; left: 0; z-index: 10;
  background: var(--bg); border-right: 1px solid var(--line);
  padding: 14px 10px; display: flex; flex-direction: column; justify-content: flex-start;
}
.gridrow.head .rowlabel { z-index: 25; border-bottom: 1px solid var(--line); }
.rowlabel .cname {
  font-size: 13px; font-weight: 700; text-transform: uppercase; letter-spacing: .8px;
  position: sticky; top: 52px;
}
.rowlabel .cmeta { font-size: 10.5px; color: var(--muted); margin-top: 3px; position: sticky; top: 72px; }
.band { border-bottom: 1px solid var(--line); }
.band:nth-child(even) .cell { background: rgba(255,255,255,.012); }

/* US country header strip + state sub-rows */
.cheader {
  border-top: 2px solid var(--accent);
  border-bottom: 1px solid var(--line);
  background: linear-gradient(to bottom, rgba(78,161,255,.10), rgba(78,161,255,.02));
  padding: 9px 0;
}
.chlabel {
  position: sticky; left: 0; display: inline-block; padding: 0 10px;
  font-size: 13px; font-weight: 800; letter-spacing: 1.2px; color: var(--text);
}
.chlabel .chmeta {
  font-weight: 400; letter-spacing: .2px; font-size: 10.5px;
  color: var(--muted); margin-left: 10px;
}
.band.sub { border-bottom: 1px dashed rgba(255,255,255,.07); }
.rowlabel.sub { padding-left: 24px; }
.rowlabel.sub .cname {
  font-size: 11px; font-weight: 600; letter-spacing: .5px;
  text-transform: none; color: #b9c0cc;
}
.band.noents .rowlabel { padding-top: 7px; padding-bottom: 7px; flex-direction: row; gap: 8px; align-items: baseline; }
.band.noents .cell { padding: 4px 8px; }
.band.noents .rowlabel .cname { color: var(--muted); font-weight: 400; }
.band.noents .rowlabel .cmeta { display: none; }
.cell { flex-shrink: 0; padding: 10px 8px; border-right: 1px solid rgba(255,255,255,.04); }
.cellgrid { display: grid; grid-auto-flow: row; gap: 7px; justify-content: center; align-content: start; }

/* Industry segment groups (collapsible, in-place) */
.segwrap { display: flex; flex-direction: column; gap: 4px; }
.seghead {
  display: flex; align-items: center; gap: 6px; width: 100%;
  background: rgba(45, 212, 191, .06); border: 1px solid rgba(45, 212, 191, .22);
  border-radius: 5px; padding: 5px 9px; color: var(--text); cursor: pointer;
  font-size: 11px; text-align: left;
}
.seghead:hover { background: rgba(45, 212, 191, .13); }
.seghead.open { background: rgba(45, 212, 191, .16); border-color: rgba(45, 212, 191, .45); }
.seghead .segarrow { color: #2dd4bf; font-size: 10px; width: 10px; }
.seghead .segname { flex: 1; font-weight: 600; letter-spacing: .2px; }
.seghead .segcount {
  background: rgba(255,255,255,.08); border-radius: 10px; padding: 0 7px;
  font-size: 10px; color: var(--muted);
}
.segbody { margin: 2px 0 4px; }
.segbody .cellgrid { padding-top: 3px; }

/* entity card */
.card { width: 76px; cursor: pointer; }
.card .thumb {
  width: 76px; height: 46px; background: var(--card); border-radius: 3px;
  display: flex; align-items: center; justify-content: center; overflow: hidden;
  border-top: 2px solid transparent;
}
.card .thumb img { max-width: 90%; max-height: 88%; object-fit: contain; }
.card .ph {
  font-size: 15px; font-weight: 700; color: #3c4048; letter-spacing: .5px;
}
.card .cap {
  font-size: 8.5px; line-height: 1.25; color: var(--muted); text-align: center;
  margin-top: 3px; overflow: hidden; display: -webkit-box;
  -webkit-line-clamp: 2; -webkit-box-orient: vertical; word-break: break-word;
}
.card:hover .thumb { outline: 2px solid var(--accent); }
.card:hover .cap { color: var(--text); }

.emptymsg { padding: 60px; color: var(--muted); font-size: 14px; text-align: center; width: 100%; }

/* ── Table view ─────────────────────────────────────── */
.tblwrap { padding: 0 0 40px; }
table.tbl { border-collapse: collapse; width: 100%; font-size: 12.5px; }
.tbl th {
  position: sticky; top: 0; background: var(--bg2); color: var(--muted);
  text-align: left; padding: 8px 10px; border-bottom: 1px solid var(--line);
  cursor: pointer; user-select: none; white-space: nowrap; z-index: 5;
}
.tbl th:hover { color: var(--text); }
.tbl th .arrow { font-size: 9px; margin-left: 3px; }
.tbl td {
  padding: 6px 10px; border-bottom: 1px solid rgba(255,255,255,.05);
  max-width: 340px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.tbl tr { cursor: pointer; }
.tbl tbody tr:hover { background: var(--bg3); }
.typedot { display: inline-block; width: 8px; height: 8px; border-radius: 2px; margin-right: 6px; }

/* ── Drawer ─────────────────────────────────────────── */
.drawer {
  position: fixed; top: 0; right: -480px; width: 460px; max-width: 96vw; height: 100vh;
  background: var(--bg2); border-left: 1px solid var(--line); z-index: 50;
  transition: right .18s ease; display: flex; flex-direction: column;
  box-shadow: -12px 0 40px rgba(0,0,0,.45);
}
.drawer.open { right: 0; }
.drawer .dhead {
  padding: 14px 16px; border-bottom: 1px solid var(--line);
  display: flex; align-items: center; gap: 10px;
}
.drawer .dhead h2 { font-size: 16px; flex: 1; }
.drawer .dbody { flex: 1; overflow-y: auto; padding: 16px; }
.drawer .dfoot {
  padding: 12px 16px; border-top: 1px solid var(--line);
  display: flex; gap: 8px; justify-content: flex-end;
}
.xbtn { background: none; border: 0; color: var(--muted); font-size: 20px; line-height: 1; }
.xbtn:hover { color: var(--text); }
.dimg {
  width: 100%; height: 110px; background: var(--card); border-radius: 6px;
  display: flex; align-items: center; justify-content: center; margin-bottom: 14px;
}
.dimg img { max-height: 92%; max-width: 92%; object-fit: contain; }
.kv { margin-bottom: 10px; }
.kv .k { font-size: 10.5px; text-transform: uppercase; letter-spacing: .7px; color: var(--muted); margin-bottom: 2px; }
.kv .v { font-size: 13px; white-space: pre-wrap; }
.pillrow { display: flex; flex-wrap: wrap; gap: 5px; }
.pill {
  background: var(--bg3); border: 1px solid var(--line); border-radius: 20px;
  padding: 2px 10px; font-size: 11.5px;
}
.pill.primary { border-color: var(--accent); }
.sect { font-size: 11px; text-transform: uppercase; letter-spacing: .8px; color: var(--muted); margin: 18px 0 8px; border-bottom: 1px solid var(--line); padding-bottom: 4px; }
.factrow { display: flex; align-items: baseline; gap: 8px; padding: 5px 0; border-bottom: 1px dashed rgba(255,255,255,.06); font-size: 12.5px; }
.factrow .fv { font-weight: 600; }
.factrow .fl { color: var(--muted); flex: 1; }
.factrow .fx { color: var(--danger); background: none; border: 0; font-size: 14px; visibility: hidden; }
.factrow:hover .fx { visibility: visible; }
.noterow { padding: 6px 0; border-bottom: 1px dashed rgba(255,255,255,.06); font-size: 12.5px; }
.noterow .nd { color: var(--muted); font-size: 10.5px; margin-top: 2px; }
/* bridge diligence block */
/* ── Bridge decision view ───────────────────────────── */
.bridgewrap { padding: 14px 16px 40px; max-width: 1080px; }
.wpanel { border: 1px solid var(--line); border-radius: 8px; margin-bottom: 12px; background: var(--bg2); }
.wphead { width: 100%; display: flex; justify-content: space-between; align-items: center; padding: 9px 13px; font-size: 12.5px; color: var(--text); background: none; border: 0; cursor: pointer; }
.wphead:hover { color: #fff; }
.wptog { color: var(--muted); font-size: 11.5px; }
.wpbody { display: none; padding: 4px 14px 12px; }
.wpbody.open { display: block; }
.wprow { display: grid; grid-template-columns: 190px 1fr; gap: 12px; align-items: center; padding: 4px 0; }
.wplbl { font-size: 12px; color: var(--muted); display: flex; justify-content: space-between; }
.wppct { color: var(--accent); font-weight: 600; }
.wprow input[type=range] { width: 100%; accent-color: var(--accent); }
.wpfoot { display: flex; gap: 12px; align-items: center; margin-top: 10px; flex-wrap: wrap; }
.wpnote { font-size: 11px; color: var(--muted); flex: 1; min-width: 200px; }
.bridgebar { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin-bottom: 8px; }
.bcount { font-size: 12.5px; color: var(--text); font-weight: 600; margin-right: 8px; }
.blbl { font-size: 10.5px; text-transform: uppercase; letter-spacing: .5px; color: var(--muted); margin: 0 2px 0 8px; }
.bchip { border: 1px solid var(--line); background: var(--bg3); color: var(--text); border-radius: 20px; padding: 3px 11px; font-size: 11.5px; white-space: nowrap; cursor: pointer; }
.bchip:hover { border-color: var(--muted); }
.bchip.on { background: var(--accent); border-color: var(--accent); color: #101216; font-weight: 600; }
.bchip.clr { border-color: var(--danger); color: var(--danger); }
.bridgetools { margin-bottom: 8px; display: flex; align-items: center; gap: 8px; }
.bspacer { flex: 1; }
.wppresets { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; padding: 6px 0 10px; border-bottom: 1px solid var(--line); margin-bottom: 8px; }
.wppl { font-size: 10.5px; text-transform: uppercase; letter-spacing: .5px; color: var(--muted); margin-right: 4px; }
.wppreset { border: 1px solid var(--line); background: var(--bg3); color: var(--text); border-radius: 20px; padding: 3px 11px; font-size: 11.5px; cursor: pointer; }
.wppreset:hover { border-color: var(--muted); }
.wppreset.on { background: var(--accent); border-color: var(--accent); color: #101216; font-weight: 600; }
.scrsave { display: flex; gap: 8px; }
.scrlist { display: flex; flex-direction: column; gap: 4px; }
.scritem { display: flex; align-items: center; gap: 10px; padding: 7px 9px; border: 1px solid var(--line); border-radius: 6px; }
.scrname { color: var(--accent); cursor: pointer; font-weight: 600; font-size: 13px; }
.scrname:hover { text-decoration: underline; }
.scrmeta { flex: 1; color: var(--muted); font-size: 11px; }
.scrx { background: none; border: 0; color: var(--muted); cursor: pointer; font-size: 14px; }
.scrx:hover { color: var(--danger); }
.bsort { font-size: 12px; }
.bridgelist { display: flex; flex-direction: column; gap: 6px; }
.brow { display: flex; align-items: center; gap: 13px; padding: 9px 12px; background: var(--bg2); border: 1px solid var(--line); border-radius: 8px; cursor: pointer; }
.brow:hover { border-color: var(--muted); background: var(--bg3); }
.bscore { flex: 0 0 auto; min-width: 40px; text-align: center; font-size: 19px; font-weight: 700; border: 1.5px solid; border-radius: 8px; padding: 5px 4px; position: relative; }
.bscore .rsdot { position: absolute; top: 4px; right: 4px; }
.bmid { flex: 1; min-width: 0; }
.bmeta { min-width: 0; }
.bname { font-size: 13.5px; color: var(--text); font-weight: 600; }
.bsub { font-size: 11.5px; color: var(--muted); margin-left: 8px; }
.bwhy { font-size: 12px; color: var(--muted); margin-top: 1px; }
.bmini { display: flex; gap: 2px; height: 4px; margin-top: 7px; max-width: 340px; }
.bmseg { border-radius: 2px; min-width: 3px; }
.bright { flex: 0 0 auto; display: flex; align-items: center; gap: 9px; }
.bconf { font-size: 10.5px; padding: 1px 7px; border-radius: 10px; border: 1px solid var(--line); color: var(--muted); }
.bconf.c-high { color: var(--ok); border-color: rgba(70,194,142,.4); }
.bconf.c-medium { color: #e8a13c; border-color: rgba(232,161,60,.4); }
.bconf.c-low { color: var(--muted); }
.bpen { font-size: 10.5px; color: var(--danger); border: 1px solid rgba(229,99,108,.4); border-radius: 10px; padding: 1px 7px; }
.bpipe { font-size: 11.5px; }
.bpipe.ro { color: var(--accent); } .bpipe.ro.none { color: var(--muted); }
.rspipe { display: flex; align-items: center; gap: 8px; }
.rspl { font-size: 11px; text-transform: uppercase; letter-spacing: .5px; color: var(--muted); }
/* Score toggle, contracts view, kebab remove */
.scoretog { border: 1px solid var(--line); background: var(--bg3); color: var(--muted); border-radius: 7px; padding: 5px 11px; font-size: 12px; cursor: pointer; white-space: nowrap; }
.scoretog.on { color: var(--text); border-color: var(--accent); }
.scoretog:hover { border-color: var(--muted); }
.contractswrap { padding: 14px 16px 40px; max-width: 1020px; }
.chead2 { display: flex; gap: 14px; align-items: center; margin-bottom: 4px; flex-wrap: wrap; }
.csearch { flex: 1; min-width: 240px; background: var(--bg2); border: 1px solid var(--line); color: var(--text); border-radius: 7px; padding: 7px 11px; font-size: 13px; }
.clist { display: flex; flex-direction: column; gap: 6px; }
.crow { display: flex; gap: 14px; align-items: flex-start; padding: 9px 12px; background: var(--bg2); border: 1px solid var(--line); border-radius: 8px; cursor: pointer; }
.crow:hover { border-color: var(--muted); background: var(--bg3); }
.cmid2 { flex: 1; min-width: 0; }
.cname2 { font-size: 13px; font-weight: 600; color: var(--text); }
.cpar { font-size: 11.5px; color: var(--muted); }
.cpar a { color: var(--accent); text-decoration: none; }
.cpar a:hover { text-decoration: underline; }
.cdesc { font-size: 11.5px; color: var(--muted); margin-top: 2px; }
.cright { flex: 0 0 auto; display: flex; flex-direction: column; align-items: flex-end; gap: 3px; }
.cceil { font-size: 14px; font-weight: 700; color: var(--ok); }
.caw { font-size: 10.5px; color: var(--muted); border: 1px solid var(--line); border-radius: 10px; padding: 1px 7px; }
.kbwrap { position: relative; display: inline-block; }
.kb { background: none; border: 0; color: var(--muted); cursor: pointer; font-size: 15px; padding: 0 5px; border-radius: 4px; }
.kb:hover { color: var(--text); background: var(--bg3); }
.kbmenu { display: none; position: absolute; right: 0; top: 20px; z-index: 40; background: var(--bg3); border: 1px solid var(--line); border-radius: 7px; box-shadow: 0 6px 18px rgba(0,0,0,.4); min-width: 110px; }
.kbwrap.open .kbmenu { display: block; }
.kbitem { display: block; width: 100%; text-align: left; background: none; border: 0; color: var(--text); padding: 7px 12px; font-size: 12px; cursor: pointer; }
.kbitem:hover { background: var(--bg2); }
.kbitem.danger { color: var(--danger); }

/* Bridge mode toggle, compare, kanban */
.bmode { display: inline-flex; border: 1px solid var(--line); border-radius: 7px; overflow: hidden; margin-right: 10px; }
.bmode button { background: var(--bg2); color: var(--muted); border: 0; padding: 5px 13px; font-size: 12px; cursor: pointer; }
.bmode button.on { background: var(--accent); color: #101216; font-weight: 600; }
.bcmp { background: var(--bg3); border: 1px solid var(--line); color: var(--muted); border-radius: 6px; width: 24px; height: 22px; cursor: pointer; font-size: 12px; }
.bcmp:hover { color: var(--text); border-color: var(--muted); }
.bcmp.on { background: var(--accent); color: #101216; border-color: var(--accent); }
#comparebar { position: fixed; right: 22px; bottom: 22px; z-index: 60; display: none; gap: 9px; align-items: center; background: var(--bg3); border: 1px solid var(--accent); border-radius: 10px; padding: 9px 12px; box-shadow: 0 6px 24px rgba(0,0,0,.4); }
#comparebar.show { display: flex; }
#comparebar .cbn { font-size: 12.5px; color: var(--text); }
.kanban { display: grid; grid-template-columns: repeat(5, 1fr); gap: 10px; align-items: start; }
.kcol { background: var(--bg2); border: 1px solid var(--line); border-radius: 8px; min-height: 60px; }
.kcol.untracked { opacity: .8; }
.khead { display: flex; justify-content: space-between; font-size: 11.5px; text-transform: uppercase; letter-spacing: .5px; color: var(--muted); padding: 9px 11px; border-bottom: 1px solid var(--line); }
.khead .kn { color: var(--text); }
.kbody { display: flex; flex-direction: column; gap: 6px; padding: 8px; }
.kcard { background: var(--bg3); border: 1px solid var(--line); border-radius: 6px; padding: 8px; cursor: pointer; }
.kcard:hover { border-color: var(--muted); }
.kctop { display: flex; align-items: center; gap: 8px; }
.kscore { font-size: 12.5px; font-weight: 700; border: 1px solid; border-radius: 5px; padding: 0 5px; }
.kname { font-size: 12px; color: var(--text); font-weight: 600; }
.kwhy { font-size: 10.5px; color: var(--muted); margin: 4px 0 6px; }
.kpipe { font-size: 11px; width: 100%; }
.modal.wide { max-width: 92vw; width: 1050px; }
.cmpwrap { overflow-x: auto; }
.cmp { border-collapse: collapse; width: 100%; font-size: 12px; }
.cmp th, .cmp td { border: 1px solid var(--line); padding: 7px 9px; vertical-align: top; text-align: left; }
.cmp th { background: var(--bg3); position: sticky; top: 0; }
.cmpk { color: var(--muted); font-size: 11px; white-space: nowrap; background: var(--bg2); }
.cmph { display: flex; justify-content: space-between; gap: 8px; align-items: center; }
.cmpname { color: var(--accent); cursor: pointer; font-weight: 600; }
.cmpname:hover { text-decoration: underline; }
.cmpx { background: none; border: 0; color: var(--muted); cursor: pointer; font-size: 15px; }
.cmpscore { font-size: 20px; font-weight: 700; }
.cmpbar { position: relative; height: 6px; background: var(--bg); border-radius: 3px; }
.cmpbf { height: 6px; border-radius: 3px; } .cmpbv { position: absolute; right: 2px; top: -7px; font-size: 10px; color: var(--muted); }
.cmpmut { color: var(--muted); }
.rscard { display: flex; flex-direction: column; gap: 12px; }
.rshead { display: flex; align-items: center; gap: 14px; }
.rsscore { font-size: 38px; font-weight: 600; line-height: 1; }
.rsscore .rsdenom { font-size: 13px; color: var(--muted); font-weight: 400; margin-left: 2px; }
.rsverdict { flex: 1; }
.rsband { font-size: 15px; font-weight: 600; }
.rsmeta { font-size: 11.5px; color: var(--muted); margin-top: 2px; display: flex; gap: 8px; align-items: center; }
.rsgreen { color: #46c28e; border: 1px solid rgba(70,194,142,.5); border-radius: 10px; padding: 0 7px; font-size: 10.5px; }
.rsbars { display: flex; flex-direction: column; gap: 7px; }
.rsbar { display: flex; flex-direction: column; gap: 3px; }
.rsbl { display: flex; justify-content: space-between; font-size: 12px; color: var(--muted); }
.rstrack { height: 5px; border-radius: 3px; background: var(--bg); overflow: hidden; }
.rsfill { height: 5px; border-radius: 3px; }
.rspen { font-size: 12px; color: var(--danger); background: rgba(229,99,108,.10); border-radius: 6px; padding: 6px 9px; display: flex; gap: 7px; align-items: center; }
.rspico { font-weight: 700; }
.rsq { margin-top: 2px; }
.rsqh { font-size: 11px; text-transform: uppercase; letter-spacing: .6px; color: var(--muted); margin-bottom: 6px; }
.rsqi { font-size: 12.5px; color: var(--text); border-left: 2px solid var(--line); padding: 2px 0 2px 10px; margin-bottom: 6px; }
.rsraw { margin-top: 4px; }
.rsraw summary { font-size: 11.5px; color: var(--muted); cursor: pointer; padding: 4px 0; }
.rsraw summary:hover { color: var(--text); }
.rsbadge { display: inline-flex; align-items: center; gap: 4px; font-size: 11.5px; font-weight: 600; border: 1px solid; border-radius: 10px; padding: 1px 8px; }
.rsdot { width: 5px; height: 5px; border-radius: 50%; background: #46c28e; display: inline-block; }
.cardrs { position: absolute; top: 3px; right: 3px; font-size: 10.5px; font-weight: 700; color: #14171b; border-radius: 9px; padding: 0 6px; line-height: 16px; box-shadow: 0 0 0 1.5px rgba(20,23,27,.55); z-index: 2; }
.card { position: relative; }
.dilblock { display: flex; flex-direction: column; gap: 1px; margin-top: 8px; }
.dilrow { display: flex; gap: 10px; padding: 4px 7px; font-size: 12px; border-radius: 4px; }
.dilrow .dk { color: var(--muted); min-width: 148px; }
.dilrow .dv { color: var(--text); flex: 1; }
.dilrow.t1 { background: rgba(70,194,142,.14); }
.dilrow.t1 .dv { color: #46c28e; font-weight: 600; }
.dilrow.warn { background: rgba(229,99,108,.10); }
.dilrow.warn .dv { color: #e5636c; }

.connrow { display: flex; align-items: baseline; gap: 7px; padding: 5px 0; border-bottom: 1px dashed rgba(255,255,255,.06); font-size: 12.5px; }
.connrow .cdir { color: var(--accent); font-weight: 700; }
.connrow .clink { font-weight: 600; }
.connrow .ctype { color: var(--muted); flex: 1; font-size: 11.5px; }

/* forms */
.frm label { display: block; font-size: 10.5px; text-transform: uppercase; letter-spacing: .7px; color: var(--muted); margin: 12px 0 4px; }
.frm input[type=text], .frm input[type=number], .frm input[type=url], .frm select, .frm textarea {
  width: 100%; background: var(--bg3); border: 1px solid var(--line); color: var(--text);
  border-radius: 6px; padding: 7px 9px; outline: none;
}
.frm input:focus, .frm select:focus, .frm textarea:focus { border-color: var(--accent); }
.frm textarea { min-height: 90px; resize: vertical; }
.frm .row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.frm .row3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 10px; }
.frm .req { color: var(--danger); }
.tagbox {
  display: flex; flex-wrap: wrap; gap: 5px; background: var(--bg3);
  border: 1px solid var(--line); border-radius: 6px; padding: 6px; cursor: text;
}
.tagbox:focus-within { border-color: var(--accent); }
.tagbox .pill { display: inline-flex; align-items: center; gap: 5px; }
.tagbox .pill b { cursor: pointer; font-weight: 400; color: var(--muted); }
.tagbox .pill b:hover { color: var(--danger); }
.tagbox input {
  flex: 1; min-width: 110px; background: none; border: 0; outline: none; color: var(--text); padding: 3px;
}
.formhint { font-size: 11px; color: var(--muted); margin-top: 4px; }

/* ── Modal ──────────────────────────────────────────── */
.overlay {
  position: fixed; inset: 0; background: rgba(0,0,0,.55); z-index: 60;
  display: none; align-items: center; justify-content: center;
}
.overlay.open { display: flex; }
.modal {
  background: var(--bg2); border: 1px solid var(--line); border-radius: 10px;
  width: 520px; max-width: 94vw; max-height: 84vh; display: flex; flex-direction: column;
  box-shadow: 0 20px 60px rgba(0,0,0,.6);
}
.modal .mhead { padding: 14px 18px; border-bottom: 1px solid var(--line); font-weight: 600; font-size: 14px; display: flex; }
.modal .mhead span { flex: 1; }
.modal .mbody { padding: 16px 18px; overflow-y: auto; font-size: 13px; }
.modal .mfoot { padding: 12px 18px; border-top: 1px solid var(--line); display: flex; gap: 8px; justify-content: flex-end; }
.warnitem { padding: 8px 10px; border: 1px solid var(--line); border-left: 3px solid #e8a13c; border-radius: 6px; margin-bottom: 8px; }
.warnitem.removed { border-left-color: var(--danger); }
.warnitem .wk { font-size: 10.5px; text-transform: uppercase; letter-spacing: .6px; color: var(--muted); }

/* ── Toast ──────────────────────────────────────────── */
#toast {
  position: fixed; bottom: 100px; left: 50%; transform: translateX(-50%) translateY(20px);
  background: #0d0f12; border: 1px solid var(--line); color: var(--text);
  padding: 10px 18px; border-radius: 8px; opacity: 0; pointer-events: none;
  transition: all .2s ease; z-index: 80; font-size: 13px; box-shadow: 0 8px 30px rgba(0,0,0,.5);
}
#toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
#toast.err { border-color: var(--danger); }

.loading { padding: 80px; text-align: center; color: var(--muted); font-size: 14px; }

/* ── score explainer modal ─────────────────────────── */
.bchip.info { border-color: var(--accent); color: var(--accent); }
.explainoverlay {
  position: fixed; inset: 0; background: rgba(0,0,0,.55); z-index: 90;
  display: flex; align-items: center; justify-content: center; padding: 24px;
}
.explainbox {
  position: relative; background: var(--bg2); border: 1px solid var(--line);
  border-radius: 10px; max-width: 640px; max-height: 84vh; overflow-y: auto;
  padding: 26px 30px; box-shadow: 0 16px 48px rgba(0,0,0,.6); line-height: 1.55;
}
.explainbox h2 { font-size: 17px; margin-bottom: 12px; }
.explainbox p { margin: 10px 0; color: var(--text); }
.explainbox ol { margin: 10px 0 10px 22px; }
.explainbox li { margin: 7px 0; }
.explainbox .explainfoot { color: var(--muted); font-size: 12px; border-top: 1px solid var(--line); padding-top: 10px; }
.explainclose {
  position: absolute; top: 10px; right: 12px; background: none; border: 0;
  color: var(--muted); font-size: 16px; cursor: pointer;
}
.explainclose:hover { color: var(--text); }
.explainbox h3 { font-size: 13.5px; margin: 18px 0 6px; color: var(--accent); letter-spacing: .2px; }
.explainbox .exdims > li { margin: 12px 0; }
.exwhy { margin: 7px 0 2px; }
.exwhy > summary {
  cursor: pointer; color: var(--accent); font-size: 12px; list-style: none;
  padding: 3px 0; user-select: none;
}
.exwhy > summary::before { content: "▸ "; }
.exwhy[open] > summary::before { content: "▾ "; }
.exwhy > summary:hover { text-decoration: underline; }
.exwhy p {
  font-size: 12.5px; color: #c2c8d2; margin: 7px 0;
  border-left: 2px solid var(--line); padding-left: 11px;
}
.extable { border-collapse: collapse; width: 100%; margin: 10px 0; font-size: 12.5px; }
.extable th, .extable td { border: 1px solid var(--line); padding: 5px 9px; text-align: left; }
.extable th { background: var(--bg3); color: var(--muted); font-weight: 600; }
.excalc {
  background: var(--bg3); border: 1px solid var(--line); border-radius: 6px;
  padding: 11px 13px; font: 11.5px/1.5 ui-monospace, "Cascadia Code", Consolas, monospace;
  overflow-x: auto; color: #c2c8d2; margin: 8px 0;
}
.exlimits { margin: 8px 0 8px 20px; font-size: 12.5px; }
.exlimits li { margin: 6px 0; }

/* themed tag-filter row beneath the topbar (2026-08-18) */
.filterbar {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
  padding: 7px 14px; background: var(--bg2);
  border-bottom: 1px solid var(--line); z-index: 29;
}
.msdd { position: relative; }
.msdd-btn {
  background: var(--bg3); color: var(--text); border: 1px solid var(--line);
  border-radius: 6px; padding: 6px 8px; outline: none; cursor: pointer;
  white-space: nowrap;
}
.msdd-btn::after { content: " ▾"; color: var(--muted); font-size: 10px; }
.msdd-btn.on { border-color: var(--accent); color: var(--accent); }
.msdd-btn.open { border-color: var(--muted); }
.msdd-pop {
  display: none; position: absolute; top: calc(100% + 4px); left: 0;
  min-width: 250px; max-height: 330px; overflow-y: auto; z-index: 60;
  background: var(--bg2); border: 1px solid var(--line); border-radius: 8px;
  padding: 6px; box-shadow: 0 8px 24px rgba(0,0,0,.45);
}
.msdd-pop.show { display: block; }
.msdd-opt {
  display: flex; align-items: center; gap: 8px; padding: 4px 6px;
  border-radius: 5px; cursor: pointer; font-size: 13px;
}
.msdd-opt:hover { background: var(--bg3); }
.msdd-opt span:first-of-type { flex: 1; }
.msdd-n { color: var(--muted); font-size: 11px; }
.msdd-clear {
  padding: 4px 6px; margin-bottom: 4px; border-bottom: 1px solid var(--line);
  color: var(--accent); font-size: 12px; cursor: pointer;
}

.topbar h1 .edition {
  color: var(--muted); font-weight: 400; font-size: 11px; margin-left: 8px;
  border: 1px solid var(--line); border-radius: 10px; padding: 1px 8px;
  vertical-align: middle; letter-spacing: .4px;
}

/* ── Intel view (region dossier / FDI leads / change feed) ── */
.intelwrap { padding: 14px 16px 40px; max-width: 1080px; }
.intelmode { margin-bottom: 12px; }
.intelpane { display: flex; flex-direction: column; gap: 4px; }
.ihead { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 8px; }
.isel { background: var(--bg3); color: var(--text); border: 1px solid var(--line); border-radius: 7px; padding: 6px 9px; font-size: 13px; max-width: 340px; }
.itiles { display: flex; gap: 8px; flex-wrap: wrap; margin: 4px 0 8px; }
.itile { background: var(--bg2); border: 1px solid var(--line); border-radius: 8px; padding: 8px 14px; display: flex; flex-direction: column; }
.itile b { font-size: 17px; }
.itile span { color: var(--muted); font-size: 10.5px; text-transform: uppercase; letter-spacing: .5px; }
.ipanel { margin-bottom: 6px; }
.irow { display: flex; align-items: center; gap: 9px; padding: 6px 10px; background: var(--bg2); border: 1px solid var(--line); border-radius: 7px; margin-bottom: 5px; cursor: pointer; font-size: 12.5px; }
.irow:hover { border-color: var(--muted); background: var(--bg3); }
.irow.dead { cursor: default; opacity: .75; }
.itype { flex: none; font-size: 10px; text-transform: uppercase; letter-spacing: .4px; color: var(--muted); border: 1px solid var(--line); border-radius: 4px; padding: 1px 6px; }
.iname { font-weight: 600; }
.icountry { color: var(--muted); font-weight: 400; }
.iextra { margin-left: auto; color: var(--muted); font-size: 11.5px; white-space: nowrap; }
.isegrow { display: flex; align-items: center; gap: 10px; padding: 3px 2px; font-size: 12.5px; }
.isegrow .iname { min-width: 230px; font-weight: 500; }
.isegbar { height: 9px; background: var(--accent); border-radius: 4px; opacity: .75; }
.irow.lead { gap: 12px; }
.irank { flex: none; width: 26px; text-align: right; color: var(--muted); font-size: 11.5px; }
.iscore { flex: none; width: 34px; text-align: center; font-weight: 700; font-size: 14px; background: var(--bg3); border: 1px solid var(--line); border-radius: 6px; padding: 3px 0; }
.ileadmid { flex: 1; min-width: 0; }
.isub { color: var(--muted); font-size: 11.5px; margin-top: 1px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ifit { flex: none; color: var(--ok); font-size: 11px; border: 1px solid rgba(70,194,142,.4); border-radius: 10px; padding: 1px 8px; }
.iconf { flex: none; font-size: 10.5px; color: var(--muted); border: 1px solid var(--line); border-radius: 10px; padding: 1px 7px; }
.iconf[data-c="High"] { color: var(--ok); border-color: rgba(70,194,142,.4); }
.iconf[data-c="Low"] { color: var(--danger); border-color: rgba(229,99,108,.4); }

/* 2026-09 Tier-3 layers */
.ilanded { flex: none; font-size: 10.5px; color: #b07cf0; border: 1px solid rgba(176,124,240,.45); border-radius: 10px; padding: 1px 8px; }
.bcoinv { margin-left: 7px; font-size: 9.5px; color: var(--accent); border: 1px solid rgba(78,161,255,.45); border-radius: 8px; padding: 0 6px; vertical-align: 1px; }
.itype[data-t="solicitation"] { color: var(--ok); border-color: rgba(70,194,142,.4); }
.itype[data-t="budget-event"] { color: #e8a13c; border-color: rgba(232,161,60,.4); }
.ilq { flex: none; font-size: 10.5px; color: var(--muted); border: 1px solid var(--line); border-radius: 10px; padding: 1px 8px; }
.ilq[data-b="strong"] { color: var(--ok); border-color: rgba(70,194,142,.45); font-weight: 600; }
.ilq[data-b="above"] { color: var(--accent); border-color: rgba(78,161,255,.4); }
.wfsrc { color: var(--muted); font-size: 10.5px; padding: 5px 2px 1px; }
