:root {
  --bg: #f0f2f5;
  --card: #ffffff;
  --ink: #0f172a;
  --muted: #64748b;
  --line: #e6e9ee;
  --brand: #b8232a;
  --brand-ink: #1f2a44;
  --open: #b7791f;
  --pending: #2563eb;
  --filled: #15803d;
  --req: #94a3b8;
  --radius: 16px;
  --shadow: 0 1px 2px rgba(15,23,42,.04), 0 4px 16px rgba(15,23,42,.06);
  --shadow-sm: 0 1px 2px rgba(15,23,42,.06);
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font: 15px/1.5 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, "Apple Color Emoji", sans-serif;
  color: var(--ink);
  background: var(--bg);
  overflow-x: hidden;
}
html { overflow-x: hidden; max-width: 100%; }
*, *::before, *::after { box-sizing: border-box; }

/* ---------- Top bar ---------- */
.top {
  position: sticky; top: 0; z-index: 30;
  display: flex; justify-content: space-between; align-items: center; gap: 16px;
  flex-wrap: wrap;
  padding: 14px 22px;
  background: rgba(255,255,255,.85);
  backdrop-filter: saturate(180%) blur(12px);
  -webkit-backdrop-filter: saturate(180%) blur(12px);
  border-bottom: 1px solid var(--line);
}
.top h1 { margin: 0; font-size: 20px; font-weight: 800; letter-spacing: -.3px; color: var(--brand-ink); }
.top h1 .year { font-weight: 700; color: var(--brand); }
.sub { margin: 2px 0 0; color: var(--muted); font-size: 12.5px; }
.yearpick { text-align: right; }
.yearpick > label { display: block; font-size: 11px; color: var(--muted); font-weight: 600; text-transform: uppercase; letter-spacing: .4px; }
.yearrow { display: flex; gap: 8px; margin-top: 4px; }
#yearSel { padding: 8px 12px; border: 1px solid var(--line); border-radius: 999px; font-size: 14px; font-weight: 600; color: var(--ink); background: #fff; outline: none; cursor: pointer; }
#yearSel:focus { border-color: var(--brand); box-shadow: 0 0 0 3px rgba(184,35,42,.12); }
#addYearBtn { white-space: nowrap; }
.who { text-align: right; }
.who label { display: block; font-size: 11px; color: var(--muted); font-weight: 600; text-transform: uppercase; letter-spacing: .4px; }
.who input {
  display: block; margin-top: 4px; padding: 8px 12px;
  border: 1px solid var(--line); border-radius: 999px; min-width: 190px;
  font-size: 14px; background: #fff; outline: none;
}
.who input:focus { border-color: var(--brand); box-shadow: 0 0 0 3px rgba(184,35,42,.12); }
.who .hint { font-size: 10.5px; color: var(--muted); }

/* ---------- Centered content column ---------- */
.summary, .tabs, .controls, .list, .foot { max-width: 1140px; margin-left: auto; margin-right: auto; }

/* ---------- Stat row (Host sites | Members) ---------- */
.summary {
  display: flex; align-items: stretch;
  gap: 22px; padding: 18px 22px 6px;
}
/* Groups grow in proportion to how many cards they hold (set inline:
   Host sites flex:3, Members flex:5) so every stat card is the same width. */
.sumgroup { flex: 1; min-width: 0; }
.sumgroup + .sumgroup { border-left: 1px solid var(--line); padding-left: 22px; }
.sumlabel { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .5px; color: var(--muted); margin: 0 0 8px 2px; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.archlink { border: 0; background: none; padding: 0; cursor: pointer; font: inherit; font-size: 11px; font-weight: 700; letter-spacing: .3px; color: var(--muted); text-transform: none; text-decoration: underline; text-underline-offset: 2px; }
.archlink:hover { color: var(--brand); }
/* All cards in a group sit on ONE line (they shrink to fit, never wrap). */
.sumcards { display: flex; gap: 10px; }
.sumcards .stat { flex: 1 1 0; min-width: 0; }
.stat[data-k="archs"] .n { color: var(--muted); }
.stat[data-k="exit"] .n { color: var(--muted); }
.stat[data-k="place"] .n { color: #be123c; }
/* Cards whose number is work still to be done get a subtle amber edge. */
.stat.todo { border-color: #fcd34d; background: #fffdf5; }
.stat.todo:hover { border-color: var(--open); }
.stat {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 12px 12px; box-shadow: var(--shadow-sm);
  cursor: pointer; transition: border-color .15s ease, box-shadow .15s ease, transform .1s ease;
}
.stat:hover { border-color: var(--brand); box-shadow: 0 4px 14px rgba(184,35,42,.14); transform: translateY(-1px); }
.stat .n { font-size: 24px; font-weight: 800; line-height: 1; letter-spacing: -.5px; }
.stat .l { font-size: 10.5px; line-height: 1.3; color: var(--muted); margin-top: 6px; font-weight: 600; text-transform: uppercase; letter-spacing: .3px; overflow-wrap: break-word; }
.stat[data-k="filled"] .n { color: var(--filled); }
.stat[data-k="open"] .n { color: var(--open); }
.stat[data-k="pending"] .n { color: var(--pending); }
.stat[data-k="needs"] .n { color: #be123c; }
.stat[data-k="sites"] .n { color: var(--brand); }
.stat[data-k="members"] .n { color: var(--filled); }

/* ---------- Open-positions map (collapsible, tucked at top) ---------- */
.mappanel { max-width: 1140px; margin: 10px auto 0; padding: 0 22px; }
.mappanel > summary {
  cursor: pointer; list-style: none; user-select: none;
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 13px; font-weight: 700; color: var(--brand);
  padding: 8px 14px; border: 1px solid var(--line); border-radius: 999px;
  background: var(--card); box-shadow: var(--shadow-sm);
}
.mappanel > summary::-webkit-details-marker { display: none; }
.mappanel > summary:hover { background: #f8fafc; }
.mappanel .maphint { font-weight: 500; color: var(--muted); font-size: 12px; }
.mappanel[open] > summary { margin-bottom: 12px; }
.map { height: 380px; width: 100%; border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow-sm); overflow: hidden; }
.leaflet-tooltip { white-space: normal; }
.maptip { font-size: 12px; line-height: 1.4; width: 200px; white-space: normal; word-break: normal; overflow-wrap: break-word; }
.maptip .maptipcity { font-weight: 700; margin-bottom: 3px; color: var(--brand); font-size: 12.5px; }
.maptip .maptiporg { margin: 3px 0; color: var(--ink); }
.maptip .maptiptypes { color: var(--muted); font-size: 11.5px; }

/* ---------- Tabs (segmented) ---------- */
.tabs { display: flex; gap: 8px; flex-wrap: wrap; padding: 14px 22px 0; }
.tab {
  border: 1px solid var(--line); background: var(--card); color: var(--muted);
  padding: 8px 16px; border-radius: 999px; cursor: pointer; font-size: 13px; font-weight: 600;
  transition: all .15s ease;
}
.tab:hover { background: #f8fafc; color: var(--ink); }
.tab.active { background: var(--brand); color: #fff; border-color: var(--brand); box-shadow: 0 2px 8px rgba(184,35,42,.25); }

/* ---------- Controls ---------- */
.controls { display: flex; gap: 10px; align-items: center; padding: 14px 22px; flex-wrap: wrap; }
.controls #search {
  flex: 1; min-width: 220px; padding: 11px 16px;
  border: 1px solid var(--line); border-radius: 999px; font-size: 14px; background: #fff; outline: none;
}
.controls #search:focus { border-color: var(--brand); box-shadow: 0 0 0 3px rgba(184,35,42,.12); }
.ghost {
  border: 1px solid var(--line); background: var(--card); padding: 10px 16px;
  border-radius: 999px; cursor: pointer; font-size: 13px; font-weight: 600; color: var(--ink);
}
.ghost:hover { background: #f8fafc; }
#addBtn { background: var(--brand); color: #fff; border-color: var(--brand); }
#addBtn:hover { background: var(--brand-ink); }
.mode { font-size: 12px; color: var(--muted); }
.sortwrap { display: inline-flex; align-items: center; gap: 7px; font-size: 12px; color: var(--muted); font-weight: 600; }
.sortsel {
  padding: 9px 14px; border: 1px solid var(--line); border-radius: 999px;
  font-size: 13px; font-weight: 600; background: #fff; color: var(--ink); cursor: pointer; outline: none;
}
.sortsel:focus { border-color: var(--brand); box-shadow: 0 0 0 3px rgba(184,35,42,.12); }

/* Board-approval button (one per host site, not per position) */
.boardbtn {
  flex: none; border: 1px solid var(--line); background: #fff; color: var(--brand-ink);
  font-size: 11.5px; font-weight: 700; padding: 6px 12px; border-radius: 999px;
  cursor: pointer; white-space: nowrap; transition: all .12s ease;
}
.boardbtn:hover { background: #f1f5f9; }
.boardbtn.on { background: #e3f6e9; border-color: #bbe7c8; color: var(--filled); }
.boardbtn:disabled { opacity: .55; cursor: default; }

/* Whole-host-site archive / restore (e.g. clearing a test submission) */
.orgbtn {
  flex: none; border: 1px solid var(--line); background: #fff; color: var(--muted);
  font-size: 11.5px; font-weight: 600; padding: 6px 11px; border-radius: 999px;
  cursor: pointer; white-space: nowrap; transition: all .12s ease;
}
/* Tiny icon-only archive button so the host-site name stays prominent */
.orgbtn.archive { flex: none; padding: 4px 6px; font-size: 13px; line-height: 1; border-color: transparent; background: none; opacity: .5; }
.orgbtn.archive:hover { background: #fffaf0; border-color: #f3d8a8; color: #92400e; opacity: 1; }
.orgbtn.restore { color: var(--brand); border-color: #c7d2fe; }
.orgbtn.restore:hover { background: #eef2ff; }
.card.card-archived { opacity: .7; }

/* ---------- Feed of org cards (flex-column masonry) ---------- */
/* JS distributes cards into these columns (shortest-column-first) so they pack
   tightly with no ragged whitespace, while each column is independent — a card
   changing height (or its absolute dropdown opening) never "drops" other cards. */
.list {
  padding: 6px 22px 56px;
  display: flex; align-items: flex-start; gap: 16px;
}
.col { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 16px; }
.loading { color: var(--muted); flex: 1 1 100%; padding: 40px 0; text-align: center; font-size: 15px; }

/* When sorted by city, stack city groups vertically with a clear header. */
.list.by-city { display: block; }
.citygroup {
  display: flex; align-items: baseline; gap: 10px;
  margin: 22px 0 12px; padding-bottom: 8px;
  border-bottom: 2px solid var(--line);
}
.citygroup:first-child { margin-top: 0; }
.citygroup-name { font-size: 16px; font-weight: 800; color: var(--ink); letter-spacing: -.01em; }
.citygroup-count { font-size: 12px; font-weight: 600; color: var(--muted); }
.citygroup-grid { display: flex; align-items: flex-start; gap: 16px; }

.card {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow); overflow: visible;
  width: 100%; margin: 0;
}

.card-head {
  display: flex; align-items: center; gap: 10px; padding: 14px 16px 12px; flex-wrap: wrap;
}
.avatar {
  flex: none; width: 40px; height: 40px; border-radius: 12px;
  display: grid; place-items: center; color: #fff; font-weight: 800; font-size: 14px;
  background: var(--c, var(--brand)); box-shadow: 0 2px 6px rgba(15,23,42,.18);
}
.card-id { min-width: 0; flex: 1; }
.card-id h3 { margin: 0; font-size: 15.5px; font-weight: 700; line-height: 1.25; overflow-wrap: break-word; word-break: normal; }
.todobadge { display: inline-block; font-weight: 700; font-size: 11px; color: #92400e; background: #fef3c7; border: 1px solid #fcd34d; border-radius: 999px; padding: 1px 8px; }
.card-meta { font-size: 12px; color: var(--muted); }
.mou-line { font-size: 11px; color: #1a7f37; font-weight: 600; margin-top: 2px; }
/* Top-right corner of the card: host-site city beside the filled/total ratio. */
.card-corner { flex: none; display: flex; align-items: center; gap: 10px; margin-left: auto; }
.cardcity { font-weight: 600; font-size: 12px; color: var(--muted); white-space: nowrap; }
.ratio {
  flex: none; font-size: 13px; font-weight: 800; color: var(--muted);
  background: #f1f5f9; padding: 4px 11px; border-radius: 999px;
}
.ratio.done { color: var(--filled); background: #e3f6e9; }

.progress { height: 4px; background: #eef2f7; }
.progress span { display: block; height: 100%; background: linear-gradient(90deg, var(--filled), #22c55e); transition: width .3s ease; }

/* ---------- Organization representative dropdown (above first position) ---------- */
.supbar { border-top: 1px solid var(--line); background: #f8fafc; }
.supsum {
  list-style: none; cursor: pointer; display: flex; align-items: center; gap: 8px;
  padding: 8px 16px; font-size: 12.5px;
}
.supsum::-webkit-details-marker { display: none; }
.supsum::after { content: "▾"; margin-left: auto; color: var(--muted); font-size: 11px; transition: transform .15s ease; }
.supbar[open] > .supsum::after { transform: rotate(180deg); }
.supsum:hover { background: #f1f5f9; }
.suphead { font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: .4px; color: var(--muted); flex: none; }
.supsumval { font-weight: 700; color: var(--ink); min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.supsumval.supempty { font-weight: 600; color: var(--brand); }
.supbody { padding: 0 16px 12px; }
.supline { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 16px; margin: 2px 0 8px; font-size: 13px; }
.supitem { color: var(--ink); }
.supitem a { color: var(--brand); text-decoration: none; }
.supitem a:hover { text-decoration: underline; }
.supeditwrap > summary {
  list-style: none; cursor: pointer; display: inline-block;
  border: 1px solid var(--line); background: #fff; color: var(--brand);
  font-size: 11.5px; font-weight: 700; padding: 4px 12px; border-radius: 999px;
}
.supeditwrap > summary::-webkit-details-marker { display: none; }
.supeditwrap > summary:hover { background: #eef2ff; }
.supform { margin-top: 10px; display: grid; gap: 8px; }
.suprow { display: flex; gap: 8px; }
.supform label { flex: 1; display: grid; gap: 3px; font-size: 10.5px; color: var(--muted); font-weight: 600; text-transform: uppercase; letter-spacing: .3px; }
.supform input {
  padding: 8px 11px; border: 1px solid var(--line); border-radius: 10px;
  font-size: 14px; color: var(--ink); background: #fff; outline: none; min-width: 0;
}
.supform input:focus { border-color: var(--brand); box-shadow: 0 0 0 3px rgba(184,35,42,.12); }
.supbtns { display: flex; gap: 8px; }

.slots { display: flex; flex-direction: column; }

/* ---------- Slot row ---------- */
.srow {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 11px 16px; border-top: 1px solid var(--line);
}
/* Positions NOT on the host site's original application (enrolled extras) — blue border. */
.srow.not-in-app { border: 2px solid var(--brand); border-radius: 8px; margin: 5px 8px; }
/* Clickable position-description link pulled from the enrollment form. */
.pdlink { display:inline-flex; align-items:center; margin-left:8px; font-size:10.5px; font-weight:800; letter-spacing:.05em; text-transform:uppercase; color:#b8232a; text-decoration:none; border:1px solid #f0c2c4; border-radius:999px; padding:2px 11px; background:#fdeff0; white-space:nowrap; vertical-align:middle; line-height:1.7; cursor:pointer; transition:background .12s, border-color .12s; }
.pdlink:hover { background:#f7d4d6; border-color:#e3a6a9; }
/* Hover quick-view of a position description (lazy-loaded; stays while hovering the panel). */
.qv { display:none; position:fixed; top:70px; right:20px; width:460px; height:620px; max-width:46vw; max-height:82vh; background:#fff; border:1px solid var(--line); border-radius:12px; box-shadow:0 18px 50px rgba(0,0,0,.32); z-index:60; overflow:hidden; }
.qv .qv-h { font-size:11px; font-weight:800; text-transform:uppercase; letter-spacing:.05em; color:var(--muted); padding:8px 12px; border-bottom:1px solid var(--line); }
.qv iframe { width:100%; height:calc(100% - 33px); border:0; display:block; }
@media (max-width:760px){ .qv { display:none !important; } }
.smain { min-width: 0; }
/* Slot type = secondary (smaller, muted). Member name = primary (below). */
.stype { display: flex; align-items: center; gap: 8px; font-weight: 500; font-size: 12px; color: var(--muted); }
.sname { margin-top: 4px; font-size: 16px; min-width: 0; }
.sname .mname { font-weight: 700; font-size: 16px; color: var(--ink); overflow-wrap: break-word; word-break: normal; }
/* Frozen (selection deadline passed, still unfilled) — greyed out, not actionable, no shimmer. */
.srow.frozen { opacity: .5; background: #f3f4f6; filter: grayscale(1); animation: none; }
.srow.frozen .pill, .srow.frozen .pill::after { animation: none; }
.srow.frozen .stools, .srow.frozen .sappr, .srow.frozen .placebar, .srow.frozen .addbar { pointer-events: none; }
.tag.frozen-tag { background: #e5e7eb; color: #4b5563; font-weight: 600; }
.sname .mopen { color: var(--muted); font-style: italic; }

/* status pill */
.pill { font-size: 10px; font-weight: 800; letter-spacing: .4px; text-transform: uppercase; padding: 3px 8px; border-radius: 999px; }
.pill.REQUESTED { background: #f1f5f9; color: var(--req); }
.pill.OPEN { background: #fdf2dc; color: var(--open); }
.pill.PENDING { background: #e6efff; color: var(--pending); }
.pill.FILLED { background: #e3f6e9; color: var(--filled); }
/* Member lifecycle stage pills: Pending (orange) -> Onboarding (blue) -> Active (green) */
.pill.stage-pending { background: #fdecd9; color: #b45309; }
.pill.stage-onboarding { background: #e6efff; color: #1d4ed8; }
.pill.stage-active { background: #e3f6e9; color: var(--filled); }

/* Stage advance / step-back: subtle chevron arrows in the row's top-right corner */
.stagenav { display: inline-flex; gap: 3px; align-items: center; }
.stagearrow { width: 22px; height: 22px; padding: 0; display: inline-flex; align-items: center; justify-content: center; border: 1px solid var(--line); border-radius: 6px; background: #fff; color: #9aa4b2; font-size: 15px; font-weight: 800; line-height: 1; cursor: pointer; }
.stagearrow:hover { color: var(--ink); background: #f1f5f9; border-color: #cbd5e1; }
.tag { display: inline-block; padding: 2px 7px; border-radius: 999px; font-size: 10px; font-weight: 700; }
.tag.warn { background: #fde8e8; color: #b42318; margin-left: 4px; }

/* ---------- Open positions: gentle shimmer to draw the eye ---------- */
/* Any unfilled position (awaiting host approval and/or a member) shimmers. */
.srow.s-OPEN, .srow.s-REQUESTED { background: linear-gradient(90deg, #fffdf7, #fff6e3, #fffdf7); }
.srow.s-OPEN .pill, .srow.s-REQUESTED .pill {
  position: relative; overflow: hidden;
  animation: pillGlow 1.8s ease-in-out infinite;
}
.srow.s-OPEN .pill::after, .srow.s-REQUESTED .pill::after {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(110deg, transparent 25%, rgba(255,255,255,.9) 50%, transparent 75%);
  transform: translateX(-130%);
  animation: pillShimmer 1.8s ease-in-out infinite;
}
.srow.s-OPEN .mopen, .srow.s-REQUESTED .mopen { color: var(--open); font-style: normal; font-weight: 600; }
@keyframes pillGlow {
  0%, 100% { box-shadow: 0 0 0 rgba(183,121,31,0); }
  50% { box-shadow: 0 0 10px rgba(183,121,31,.6); }
}
@keyframes pillShimmer {
  0% { transform: translateX(-130%); }
  60%, 100% { transform: translateX(130%); }
}
@media (prefers-reduced-motion: reduce) {
  .srow.s-OPEN .pill, .srow.s-REQUESTED .pill,
  .srow.s-OPEN .pill::after, .srow.s-REQUESTED .pill::after { animation: none; }
}

/* ---------- Exited members: kept on file but dimmed ---------- */
.srow.exited { opacity: .55; background: #f8fafc; animation: none; }
.srow.exited .pill, .srow.exited .pill::after { animation: none; }
.srow.exited .mname { text-decoration: line-through; color: var(--muted); }
.tag.exit { background: #e2e8f0; color: #475569; margin-left: 4px; }
.tag.arch { background: #fef3c7; color: #92400e; margin-left: 4px; }

/* Archived rows: kept on file, dimmed, recoverable */
.srow.archived { opacity: .6; background: #fffdf5; animation: none; }
.srow.archived .pill, .srow.archived .pill::after { animation: none; }

/* "Exited" action is a small labelled button, not an icon glyph */
.icon.exit { font-size: 11px; font-weight: 600; padding: 5px 9px; border: 1px solid var(--line); border-radius: 999px; }
.icon.exit:hover { background: #fde8e8; color: #b42318; border-color: #f0c7c2; }
.icon.restore { color: var(--brand); }
.icon.restore:hover { background: #eef2ff; color: var(--brand); }

/* ---------- Placement bar (unmatched enrollment) ---------- */
.srow.s-PLACE { background: #fff7f7; }
.placebar { margin-top: 8px; display: flex; flex-direction: column; gap: 5px; }
.placehint { font-size: 11.5px; color: #b42318; }
.placesel {
  padding: 8px 11px; border: 1px solid #f0c7c2; border-radius: 10px;
  font-size: 13px; background: #fff; color: var(--ink); outline: none; max-width: 320px;
}
.placesel:focus { border-color: var(--brand); box-shadow: 0 0 0 3px rgba(184,35,42,.12); }

/* ---------- Unrequested position: host site didn't ask for it ---------- */
.srow.s-EXTRA { background: #fffaf0; }
.addbar { margin-top: 8px; display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.addhint { font-size: 11.5px; color: #92400e; flex: 1; min-width: 180px; }
.btn.approveadd {
  border: 1px solid #f3d8a8; background: #fff7e6; color: #92400e;
  font-size: 12px; font-weight: 700; padding: 6px 12px; border-radius: 999px; cursor: pointer;
}
.btn.approveadd:hover { background: #fdebc8; }
.tag.added { background: #e3f6e9; color: var(--filled); margin-left: 4px; }
.tag.active { background: #e3f6e9; color: var(--filled); margin-left: 4px; }

/* "Active Site" chip shown in the card header once the board approves it.
   Blue "approved" palette — distinct from the green "Filled"/Active member. */
.sitebadge {
  display: inline-block; padding: 1px 8px; border-radius: 999px;
  font-size: 10.5px; font-weight: 800; letter-spacing: .3px; text-transform: uppercase;
  background: #e6efff; color: var(--brand); vertical-align: middle;
}
/* Shown while a host site still awaits board approval */
.pendbadge {
  display: inline-block; padding: 1px 8px; border-radius: 999px;
  font-size: 10.5px; font-weight: 800; letter-spacing: .3px; text-transform: uppercase;
  background: #fdf2dc; color: var(--open); vertical-align: middle;
}
.newbadge {
  display: inline-block; padding: 1px 8px; border-radius: 999px;
  font-size: 10.5px; font-weight: 800; letter-spacing: .3px; text-transform: uppercase;
  background: var(--brand); color: #fff; vertical-align: middle;
}

.sright { display: flex; align-items: center; gap: 6px; flex: none; }
.sappr { display: flex; gap: 6px; }
.mini {
  display: inline-flex; align-items: center; gap: 5px;
  font-size: 11px; font-weight: 600; color: var(--muted); cursor: pointer; user-select: none;
  border: 1px solid var(--line); border-radius: 999px; padding: 5px 9px; transition: all .12s ease;
}
.mini:hover { background: #f8fafc; }
.mini input { width: 14px; height: 14px; cursor: pointer; margin: 0; accent-color: var(--filled); }
.mini.on { color: var(--filled); border-color: #bbe7c8; background: #f0faf3; }
.mini input:disabled { cursor: not-allowed; }
.mini:has(input:disabled) { opacity: .5; cursor: not-allowed; }

/* ---------- Dropdown action menus (host site + per row) ---------- */
.menu { position: relative; flex: none; }
.menu > summary { list-style: none; cursor: pointer; display: inline-block; }
.menu > summary::-webkit-details-marker { display: none; }
.menubtn {
  border: 1px solid var(--line); background: #fff; color: var(--muted);
  font-size: 12px; font-weight: 700; padding: 5px 10px; border-radius: 999px;
  white-space: nowrap; transition: all .12s ease;
}
.menu[open] > .menubtn, .menubtn:hover { background: #f1f5f9; color: var(--ink); }
.menubtn.approved { color: var(--filled); border-color: #bbe7c8; background: #f0faf3; }
/* Absolute overlay (the grid feed doesn't clip it the way multicol did) so
   opening the menu never changes the card's height or moves it. */
.menupop {
  position: absolute; top: calc(100% + 6px); right: 0; z-index: 40;
  min-width: 170px;
  background: #fff; border: 1px solid var(--line); border-radius: 12px;
  box-shadow: 0 8px 22px rgba(15,23,42,.14); padding: 6px;
  display: flex; flex-direction: column; gap: 2px;
}
.menuitem {
  text-align: left; border: 0; background: none; cursor: pointer;
  font-size: 13px; color: var(--ink); padding: 8px 10px; border-radius: 8px; white-space: nowrap;
}
.menuitem:hover { background: #f1f5f9; }
.menuitem.danger { color: #b42318; }
.menuitem.danger:hover { background: #fde8e8; }
/* keep the menu trigger pinned right; the open panel floats beneath it */
.card-head .menu { margin-left: auto; }

.stools { display: flex; gap: 2px; }
.icon {
  border: 0; background: none; cursor: pointer; color: var(--muted);
  font-size: 14px; line-height: 1; padding: 6px 7px; border-radius: 8px;
}
.icon:hover { background: #eef2f6; color: var(--ink); }
.icon.danger:hover { background: #fde8e8; color: #b42318; }

/* ---------- Inline edit form ---------- */
.editform {
  border-top: 1px solid var(--line); padding: 14px 16px;
  display: grid; gap: 10px; background: #f8fafc;
}
.editform label { display: grid; gap: 4px; font-size: 11px; color: var(--muted); font-weight: 600; text-transform: uppercase; letter-spacing: .3px; }
.editform input, .editform select {
  padding: 9px 12px; border: 1px solid var(--line); border-radius: 10px; font-size: 14px; color: var(--ink); background: #fff; outline: none;
}
.editform input:focus, .editform select:focus { border-color: var(--brand); box-shadow: 0 0 0 3px rgba(184,35,42,.12); }
.editbtns { display: flex; gap: 8px; margin-top: 2px; }
.btn { border: 1px solid var(--line); background: var(--card); padding: 9px 18px; border-radius: 999px; cursor: pointer; font-size: 13px; font-weight: 600; }
.btn.save { background: var(--brand); color: #fff; border-color: var(--brand); }
.btn.save:hover { background: var(--brand-ink); }
.btn.cancel:hover { background: #f1f5f9; }

.foot { padding: 8px 22px 48px; color: var(--muted); font-size: 12.5px; text-align: center; display: flex; flex-direction: column; gap: 4px; align-items: center; }
.who { color: var(--muted); }
.linkbtn { background: none; border: 0; color: var(--brand); cursor: pointer; text-decoration: underline; font: inherit; padding: 0; }
.devicepanel { margin: 8px auto 0; max-width: 520px; width: 100%; text-align: left; background: var(--card); border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow-sm); padding: 10px 14px; }
.devicepanel .dphead { font-weight: 700; color: var(--ink); margin-bottom: 6px; }
.devicepanel ul { list-style: none; margin: 0; padding: 0; }
.devicepanel li { padding: 4px 0; border-top: 1px solid var(--line); }
.devicepanel li:first-child { border-top: 0; }
.devicepanel em { color: var(--brand); font-style: normal; font-weight: 600; }

/* ---------- Change log ---------- */
.changelog { list-style: none; margin: 0; padding: 0; width: 100%; max-width: 760px; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow-sm); overflow: hidden; }
.logitem { display: flex; gap: 12px; align-items: flex-start; padding: 13px 18px; border-bottom: 1px solid var(--line); }
.logitem:last-child { border-bottom: 0; }
.logdot { flex: none; width: 9px; height: 9px; border-radius: 999px; margin-top: 5px; background: var(--muted); }
.logdot.add { background: var(--filled); }
.logdot.del { background: #be123c; }
.logdot.chg { background: var(--brand); }
.logbody { min-width: 0; }
.logtext { font-size: 14px; color: var(--ink); line-height: 1.35; }
.logtext .logorg { color: var(--muted); font-weight: 500; }
.logmeta { font-size: 12px; color: var(--muted); margin-top: 2px; }

/* ---------- Responsive ---------- */

/* Tablet & down: the two stat groups stack and their cards flow into a grid so
   the 5 Member cards never get crushed into one tight row. The inline
   flex:3/flex:5 (set in JS for the desktop split) is overridden here. */
@media (max-width: 760px) {
  .summary { flex-direction: column; gap: 16px; padding-top: 14px; }
  .sumgroup { flex: 1 1 auto !important; min-width: 0; }
  .sumgroup + .sumgroup { border-left: 0; padding-left: 0; border-top: 1px solid var(--line); padding-top: 14px; }
  .sumcards { display: grid; grid-template-columns: repeat(auto-fit, minmax(96px, 1fr)); gap: 8px; }
  .stat .n { font-size: 22px; }
  .citygroup-grid { display: block; }
}

/* Phone */
@media (max-width: 560px) {
  .top { padding: 12px 16px; gap: 10px; }
  .top h1 { font-size: 18px; }
  .sub { font-size: 12px; }
  .yearpick { text-align: left; width: 100%; }
  .yearrow { width: 100%; }
  #yearSel { flex: 1; }
  .summary, .tabs, .controls, .list, .foot, .mappanel { padding-left: 16px; padding-right: 16px; }
  .tabs { gap: 6px; }
  .maphint { display: none; }
  .map { height: 300px; }
  .controls { gap: 8px; }
  .controls #search { min-width: 100%; flex-basis: 100%; }
  .sortwrap { flex: 1 1 100%; }
  .sortsel { flex: 1; }
  #addBtn, #refresh { flex: 1; }
  .mode { width: 100%; }
  /* Give the host-site name the full width; drop city / ratio / Manage to a
     second row instead of crushing the name into a narrow left column. */
  .card-head { padding: 12px 14px 10px; align-items: flex-start; }
  .card-id { flex: 1 1 65%; }
  .card-id h3 { white-space: normal; }
  .card-corner { margin-left: 0; }
  .boardbtn, .orgbtn.restore { flex: 1; text-align: center; }
  .srow { flex-direction: column; align-items: stretch; gap: 10px; padding: 11px 14px; }
  .sright { justify-content: space-between; }
  .sname .mname { max-width: 100%; }
  .citygroup { margin: 16px 0 10px; }
  .citygroup-name { font-size: 15px; }
  .suprow { flex-direction: column; }
}

/* Very small phones: two stat columns read better than three cramped ones. */
@media (max-width: 380px) {
  .sumcards { grid-template-columns: repeat(2, 1fr); }
}

/* ---------- Inquiries: nav badge + notification ticker (ticker.js) ---------- */
.navbadge { display: none; min-width: 17px; height: 17px; line-height: 17px; padding: 0 5px; border-radius: 999px; background: #dc2626; color: #fff; font-size: 10px; font-weight: 800; text-align: center; margin-left: 6px; vertical-align: middle; }
.inq-ticker { display: none; background: #fff7e6; border: 1px solid #f3d588; border-radius: 12px; overflow: hidden; white-space: nowrap; margin: 0 0 14px; }
.inq-ticker .tk-track { display: inline-block; padding: 8px 0; animation: tkscroll 36s linear infinite; }
.inq-ticker:hover .tk-track { animation-play-state: paused; }
.inq-ticker .tk-item { display: inline-block; color: #92400e; font-weight: 700; font-size: 13px; text-decoration: none; padding: 0 8px; }
.inq-ticker .tk-item:hover { text-decoration: underline; }
.inq-ticker .tk-item .tk-form { color: #b88a2e; font-weight: 600; }
.inq-ticker .tk-bell { color: #dc2626; }
.inq-ticker .tk-dot { color: #d9a441; padding: 0 4px; }
@keyframes tkscroll { 0% { transform: translateX(0); } 100% { transform: translateX(-50%); } }
@media (prefers-reduced-motion: reduce) { .inq-ticker .tk-track { animation: none; } }

/* Program-level tabs: Oklahoma Opportunities vs VISTA. Sit just above the tool nav. */
.progtabs { display: flex; gap: 6px; max-width: 1320px; margin: 12px auto 0; padding: 0 14px; flex-wrap: wrap; }
.progtab { display: inline-flex; align-items: center; text-decoration: none; font-weight: 800; font-size: 14.5px; color: #1f2a44; background: #fff; border: 1px solid #e1e6ef; border-radius: 12px 12px 0 0; padding: 11px 22px; box-shadow: 0 1px 4px rgba(20,20,40,.06); position: relative; top: 1px; }
.progtab:hover { color: #b8232a; border-color: #f0b8b8; }
.progtab.active { background: #b8232a; border-color: #b8232a; color: #fff; }
