/* ══════════════════════════════════════════════════════════════
   GRANT BUILDER DRAWER — visual sibling of program-builder-drawer
   ══════════════════════════════════════════════════════════════ */

.wk-gbd-overlay {
  position: fixed; inset: 0;
  z-index: 13000;
  display: none;
  align-items: center; justify-content: center;
  padding: 24px;
  font-family: Inter, system-ui, sans-serif;
}
.wk-gbd-overlay.is-open { display: flex; }
body.wk-gbd-locked { overflow: hidden; }

.wk-gbd-scrim {
  position: absolute; inset: 0;
  background: rgba(15, 23, 42, 0.45);
  backdrop-filter: blur(2px);
}

.wk-gbd-drawer {
  position: relative;
  width: 100%; max-width: 880px;
  max-height: min(94vh, 920px);
  background: #fff;
  border-radius: 16px;
  display: flex; flex-direction: column;
  box-shadow: 0 30px 80px -20px rgba(15, 23, 42, 0.45), 0 0 0 1px rgba(15, 23, 42, 0.06);
  animation: wkGbdPopIn 0.22s cubic-bezier(0.34, 1.2, 0.64, 1);
  overflow: hidden;
}
@keyframes wkGbdPopIn { from { transform: scale(0.96) translateY(8px); opacity: 0; } to { transform: scale(1) translateY(0); opacity: 1; } }

/* ── header ───────────────────────────────────────────── */
.wk-gbd-head {
  display: flex; align-items: flex-start; justify-content: space-between;
  padding: 22px 28px 16px; border-bottom: 1px solid #f1f5f9;
  background: linear-gradient(180deg, #ffffff 0%, #fafbfc 100%);
}
.wk-gbd-head-text { min-width: 0; }
.wk-gbd-eyebrow {
  text-transform: uppercase; letter-spacing: 0.1em;
  font-size: 11px; font-weight: 700; color: var(--c-blue, #004b7c);
}
.wk-gbd-title { margin: 6px 0 0; font-size: 22px; font-weight: 700; color: #0f172a; }
.wk-gbd-name-pill {
  display: inline-block; margin-top: 10px;
  padding: 6px 12px; border-radius: 999px;
  background: #f1f5f9; color: #64748b;
  font-size: 12.5px; font-weight: 600; font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  border: 1px dashed #cbd5e1;
}
.wk-gbd-name-pill.is-ready {
  background: #ecfdf5; color: #065f46; border: 1px solid #a7f3d0; border-style: solid;
}
.wk-gbd-close {
  width: 36px; height: 36px; border-radius: 10px;
  border: none; background: transparent;
  font-size: 24px; line-height: 1; cursor: pointer; color: #64748b;
  flex-shrink: 0;
}
.wk-gbd-close:hover { background: #f1f5f9; color: #0f172a; }

/* ── tabs (stepper) ─────────────────────────────────────── */
.wk-gbd-tabs {
  display: flex; align-items: center;
  padding: 14px 28px 12px;
  border-bottom: 1px solid #f1f5f9;
  background: #fff;
}
.wk-gbd-tab {
  flex: 1 1 0; min-width: 0;
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  padding: 8px 6px;
  background: transparent; border: none; cursor: pointer;
  font: inherit; font-size: 13px; font-weight: 600; color: #94a3b8;
  border-bottom: none;
  transition: color 0.15s;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.wk-gbd-tab:hover { color: #475569; }
.wk-gbd-tab > span:not(.wk-gbd-tab-marker) {
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.wk-gbd-tab-marker {
  display: inline-flex; align-items: center; justify-content: center;
  width: 24px; height: 24px; border-radius: 50%;
  background: #e2e8f0; color: #64748b;
  font-size: 11.5px; font-weight: 700;
  flex-shrink: 0;
  transition: background 0.15s, color 0.15s, box-shadow 0.15s;
}
.wk-gbd-tab.is-active { color: var(--c-blue, #004b7c); }
.wk-gbd-tab.is-active .wk-gbd-tab-marker {
  background: var(--c-blue, #004b7c); color: #fff;
  box-shadow: 0 0 0 4px rgba(0, 75, 124, 0.14);
}
.wk-gbd-tab.is-done { color: #16a34a; }
.wk-gbd-tab.is-done .wk-gbd-tab-marker { background: #16a34a; color: #fff; }

/* connector line between tabs */
.wk-gbd-tab-sep {
  flex: 0 1 36px;
  height: 2px;
  background: #e2e8f0;
  border-radius: 2px;
  margin: 0 4px;
  align-self: center;
  min-width: 12px;
}
.wk-gbd-tab-sep.is-done { background: #16a34a; }

/* ── body ──────────────────────────────────────────────── */
.wk-gbd-body {
  flex: 1; overflow-y: auto;
  padding: 24px 28px 32px;
}

.wk-gbd-field { margin-bottom: 20px; }
.wk-gbd-lbl {
  display: block; font-size: 11.5px; font-weight: 700;
  color: #475569; margin-bottom: 8px;
  text-transform: uppercase; letter-spacing: 0.06em;
}
.wk-gbd-lbl-inline {
  display: inline-flex; align-items: center; gap: 8px;
  font-size: 13px; color: #475569; cursor: pointer;
  margin-bottom: 8px;
}
.wk-gbd-lbl-inline input[type="checkbox"] { width: 16px; height: 16px; cursor: pointer; }

.wk-gbd-input {
  width: 100%; box-sizing: border-box;
  padding: 10px 12px;
  border: 1px solid #e2e8f0; border-radius: 9px;
  font: inherit; font-size: 13.5px; background: #fff; color: #0f172a;
  outline: none; transition: border-color 0.15s, box-shadow 0.15s;
}
.wk-gbd-input:focus {
  border-color: var(--c-blue, #004b7c);
  box-shadow: 0 0 0 3px rgba(0, 75, 124, 0.14);
}
.wk-gbd-textarea { resize: vertical; min-height: 90px; line-height: 1.5; }

.wk-gbd-input-prefix {
  position: relative; display: flex; align-items: center;
}
.wk-gbd-input-prefix .wk-gbd-prefix {
  position: absolute; left: 12px; color: #94a3b8; font-weight: 600;
  pointer-events: none; font-size: 13.5px;
}
.wk-gbd-input-prefix .wk-gbd-input { padding-left: 24px; }

.wk-gbd-grid-2 {
  display: grid; grid-template-columns: 1fr 1fr; gap: 14px;
}
.wk-gbd-hint {
  font-size: 11.5px; color: #94a3b8; margin-top: 6px;
}

/* ── chip pickers (grant types) ───────────────────────── */
.wk-gbd-chips {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px;
}
.wk-gbd-chip {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 10px 12px; border-radius: 10px;
  border: 1.5px solid #e2e8f0; background: #fff;
  cursor: pointer; transition: all 0.15s;
  font: inherit; font-size: 12.5px; font-weight: 600; color: #0f172a;
  text-align: left;
}
.wk-gbd-chip-dot { width: 10px; height: 10px; border-radius: 50%; flex-shrink: 0; }
.wk-gbd-chip:hover { border-color: #cbd5e1; transform: translateY(-1px); }
.wk-gbd-chip.is-active {
  border-color: var(--_c, #004b7c);
  background: color-mix(in srgb, var(--_c, #004b7c) 8%, #fff);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--_c, #004b7c) 14%, transparent);
}

/* ── status segmented row ─────────────────────────────── */
.wk-gbd-status-row {
  display: flex; flex-wrap: nowrap; gap: 4px;
  background: #f8fafc; border: 1px solid #e2e8f0; border-radius: 10px;
  padding: 4px;
  isolation: isolate;
}
.wk-gbd-status {
  flex: 1 1 0; min-width: 0;
  padding: 8px 6px; border-radius: 7px;
  border: none; background: transparent;
  font: inherit; font-size: 12.5px; font-weight: 600; color: #64748b;
  cursor: pointer; transition: all 0.15s;
  white-space: nowrap;
  text-align: center;
  overflow: hidden; text-overflow: ellipsis;
}
.wk-gbd-status:hover { background: #fff; color: #0f172a; }
.wk-gbd-status.is-active {
  background: #fff; color: var(--_c, #0f172a);
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.08);
}

/* ── link list (multi-select rows) ────────────────────── */
.wk-gbd-link-list {
  border: 1px solid #e2e8f0; border-radius: 10px;
  padding: 4px; max-height: 220px; overflow-y: auto;
  background: #fff;
}
.wk-gbd-link-row {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 10px; border-radius: 7px;
  font-size: 13px; color: #0f172a; cursor: pointer;
}
.wk-gbd-link-row:hover { background: #f8fafc; }
.wk-gbd-link-row input[type="checkbox"] { width: 16px; height: 16px; cursor: pointer; flex-shrink: 0; }
.wk-gbd-link-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.wk-gbd-link-meta {
  font-size: 11.5px; color: #94a3b8; font-weight: 500;
  flex-shrink: 0; padding-left: 8px;
}

.wk-gbd-empty {
  padding: 16px; text-align: center;
  background: #f8fafc; border-radius: 8px;
  font-size: 12.5px; color: #64748b;
  border: 1px dashed #e2e8f0;
}

/* ── override toggle ──────────────────────────────────── */
.wk-gbd-override .wk-gbd-input { margin-top: 4px; }

/* ── review tab ───────────────────────────────────────── */
.wk-gbd-rev-banner {
  padding: 18px 20px; border-radius: 14px; margin-bottom: 18px;
  background: linear-gradient(135deg,
    color-mix(in srgb, var(--_c, #004b7c) 10%, #fff) 0%,
    #fff 60%);
  border: 1px solid color-mix(in srgb, var(--_c, #004b7c) 25%, #e2e8f0);
}
.wk-gbd-rev-banner-eyebrow {
  font-size: 10.5px; font-weight: 700; text-transform: uppercase;
  letter-spacing: 0.1em; color: #475569;
}
.wk-gbd-rev-banner-title {
  font-size: 18px; font-weight: 700; color: #0f172a;
  margin-top: 4px; word-break: break-all;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
}
.wk-gbd-rev-pills { display: flex; gap: 6px; margin-top: 10px; flex-wrap: wrap; }
.wk-gbd-rev-pill {
  padding: 4px 10px; border-radius: 999px;
  background: color-mix(in srgb, var(--_c, #94a3b8) 14%, #fff);
  color: var(--_c, #475569);
  border: 1px solid color-mix(in srgb, var(--_c, #94a3b8) 30%, transparent);
  font-size: 11.5px; font-weight: 600;
}

.wk-gbd-rev-card {
  border: 1px solid #f1f5f9; border-radius: 10px;
  padding: 14px 16px; margin-bottom: 12px; background: #fff;
}
.wk-gbd-rev-card-title {
  font-size: 11px; font-weight: 700; color: #94a3b8;
  text-transform: uppercase; letter-spacing: 0.08em;
  margin-bottom: 10px;
}
.wk-gbd-rev-row {
  display: grid; grid-template-columns: 130px 1fr; gap: 12px;
  padding: 6px 0; border-bottom: 1px dashed #f1f5f9;
  font-size: 13px;
}
.wk-gbd-rev-row:last-child { border-bottom: none; }
.wk-gbd-rev-lbl { color: #64748b; font-weight: 600; font-size: 12px; }
.wk-gbd-rev-val { color: #0f172a; word-break: break-word; }
.wk-gbd-rev-empty { color: #cbd5e1; font-style: normal; }
.wk-gbd-rev-pre {
  margin: 0; padding: 8px 10px;
  background: #f8fafc; border-radius: 6px;
  white-space: pre-wrap; word-wrap: break-word;
  font: inherit; font-size: 12.5px; color: #334155;
}

/* ── footer ───────────────────────────────────────────── */
.wk-gbd-foot {
  display: flex; align-items: center; gap: 10px;
  padding: 14px 24px;
  border-top: 1px solid #f1f5f9;
  background: #fafbfc;
}
.wk-gbd-foot-spacer { flex: 1; }
.wk-gbd-btn {
  padding: 10px 18px; border-radius: 9px; border: none;
  font: inherit; font-weight: 600; font-size: 13px; cursor: pointer;
  transition: all 0.15s;
}
.wk-gbd-btn[disabled] { opacity: 0.5; cursor: not-allowed; filter: grayscale(0.3); }
.wk-gbd-btn--ghost { background: transparent; color: #475569; }
.wk-gbd-btn--ghost:hover:not([disabled]) { background: #f1f5f9; color: #0f172a; }
.wk-gbd-btn--primary {
  background: var(--c-blue, #004b7c); color: #fff;
  box-shadow: 0 1px 2px rgba(0, 75, 124, 0.25);
}
.wk-gbd-btn--primary:hover:not([disabled]) { background: var(--c-blue-d, #003a5e); box-shadow: 0 2px 8px rgba(0, 75, 124, 0.32); }
.wk-gbd-btn--save {
  background: linear-gradient(180deg, var(--c-blue, #004b7c) 0%, var(--c-blue-d, #003a5e) 100%);
  padding: 10px 22px;
}

/* ── + New Grant launch button (lives in grants list head) ─ */
.wk-gbd-launch-btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 8px 14px;
  background: var(--c-blue, #004b7c);
  color: #fff; border: none; border-radius: 8px;
  font: inherit; font-size: 12.5px; font-weight: 600;
  cursor: pointer; transition: all 0.15s;
  box-shadow: 0 1px 3px rgba(0, 75, 124, 0.3);
}
.wk-gbd-launch-btn:hover { background: var(--c-blue-d, #003a5e); box-shadow: 0 2px 10px rgba(0, 75, 124, 0.4); transform: translateY(-1px); }
.wk-gbd-launch-btn svg { width: 14px; height: 14px; }

/* ── custom client combobox ─────────────────────────────── */
.wk-gbd-combo { position: relative; }
.wk-gbd-combo-input { padding-right: 36px; }
.wk-gbd-combo-toggle {
  position: absolute; right: 4px; top: 50%; transform: translateY(-50%);
  width: 30px; height: 30px; border-radius: 6px;
  background: transparent; border: none; cursor: pointer;
  color: #64748b; display: flex; align-items: center; justify-content: center;
  transition: background 0.15s, transform 0.2s;
}
.wk-gbd-combo-toggle svg { width: 16px; height: 16px; }
.wk-gbd-combo-toggle:hover { background: #f1f5f9; color: #0f172a; }
.wk-gbd-combo.is-open .wk-gbd-combo-toggle { transform: translateY(-50%) rotate(180deg); }
.wk-gbd-combo-panel {
  position: absolute; left: 0; right: 0; top: calc(100% + 4px);
  background: #fff;
  border: 1px solid #e2e8f0; border-radius: 10px;
  box-shadow: 0 12px 32px -8px rgba(15, 23, 42, 0.18), 0 0 0 1px rgba(15, 23, 42, 0.04);
  max-height: 240px; overflow-y: auto;
  padding: 4px;
  z-index: 20;
  animation: wkGbdComboIn 0.12s ease-out;
}
@keyframes wkGbdComboIn { from { opacity: 0; transform: translateY(-4px); } to { opacity: 1; transform: translateY(0); } }
.wk-gbd-combo-item, .wk-gbd-combo-create {
  display: flex; align-items: center; gap: 8px;
  width: 100%; padding: 9px 12px; border-radius: 7px;
  background: transparent; border: none; cursor: pointer;
  font: inherit; font-size: 13px; color: #0f172a;
  text-align: left;
}
.wk-gbd-combo-item:hover, .wk-gbd-combo-item.is-hover, .wk-gbd-combo-item.is-active {
  background: #f1f5f9;
}
.wk-gbd-combo-item.is-active { color: var(--c-blue, #004b7c); font-weight: 600; }
.wk-gbd-combo-item mark { background: rgba(0, 75, 124, 0.16); color: var(--c-blue-d, #003a5e); padding: 0; border-radius: 2px; }
.wk-gbd-combo-create {
  border-top: 1px solid #f1f5f9; margin-top: 4px;
  color: var(--c-blue, #004b7c); font-weight: 600; font-size: 12.5px;
}
.wk-gbd-combo-create:hover { background: rgba(0, 75, 124, 0.06); }
.wk-gbd-combo-create svg { width: 14px; height: 14px; flex-shrink: 0; }
.wk-gbd-combo-create strong { font-weight: 700; color: #0f172a; }
/* Pinned-to-top variant */
.wk-gbd-combo-create--top {
  margin-top: 0; border-top: none;
  border-bottom: 1px solid #f1f5f9;
  background: rgba(0, 75, 124, 0.04);
}
.wk-gbd-combo-empty {
  padding: 14px; text-align: center;
  font-size: 12.5px; color: #94a3b8;
}

/* ── custom date picker ─────────────────────────────────── */
.wk-gbd-date { position: relative; }
.wk-gbd-date-btn {
  display: flex; align-items: center; gap: 10px;
  width: 100%; padding: 10px 12px;
  border: 1px solid #e2e8f0; border-radius: 9px;
  background: #fff; color: #0f172a;
  font: inherit; font-size: 13.5px; cursor: pointer;
  text-align: left;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.wk-gbd-date-btn:hover { border-color: #cbd5e1; }
.wk-gbd-date-btn:focus { outline: none; border-color: var(--c-blue, #004b7c); box-shadow: 0 0 0 3px rgba(0, 75, 124, 0.14); }
.wk-gbd-date-btn svg { width: 16px; height: 16px; color: #64748b; flex-shrink: 0; }
.wk-gbd-date-label { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 500; }
.wk-gbd-date-pop {
  position: absolute; left: 0; top: calc(100% + 6px);
  width: 280px;
  background: #fff;
  border: 1px solid #e2e8f0; border-radius: 12px;
  box-shadow: 0 16px 40px -12px rgba(15, 23, 42, 0.22), 0 0 0 1px rgba(15, 23, 42, 0.04);
  padding: 10px;
  z-index: 30;
  animation: wkGbdComboIn 0.12s ease-out;
}
.wk-gbd-cal-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 4px 4px 8px;
}
.wk-gbd-cal-month { font-size: 13.5px; font-weight: 700; color: #0f172a; }
.wk-gbd-cal-nav {
  width: 28px; height: 28px; border-radius: 7px;
  border: none; background: transparent; cursor: pointer;
  font-size: 18px; line-height: 1; color: #64748b;
  display: flex; align-items: center; justify-content: center;
}
.wk-gbd-cal-nav:hover { background: #f1f5f9; color: #0f172a; }
.wk-gbd-cal-dow {
  display: grid; grid-template-columns: repeat(7, 1fr);
  font-size: 11px; font-weight: 700; color: #94a3b8;
  text-align: center; padding: 4px 0; text-transform: uppercase;
  letter-spacing: 0.04em;
}
.wk-gbd-cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 2px; }
.wk-gbd-cal-day {
  height: 32px; border: none; background: transparent;
  font: inherit; font-size: 12.5px; color: #0f172a;
  border-radius: 7px; cursor: pointer;
  transition: background 0.12s;
}
.wk-gbd-cal-day:hover { background: #f1f5f9; }
.wk-gbd-cal-day.is-other { color: #cbd5e1; }
.wk-gbd-cal-day.is-today { font-weight: 700; color: var(--c-blue, #004b7c); }
.wk-gbd-cal-day.is-today::after {
  content: ''; display: block; width: 4px; height: 4px; border-radius: 50%;
  background: var(--c-blue, #004b7c); margin: 1px auto 0;
}
.wk-gbd-cal-day.is-selected {
  background: var(--c-blue, #004b7c) !important;
  color: #fff !important;
  font-weight: 700;
}
.wk-gbd-cal-day.is-selected::after { background: #fff; }
.wk-gbd-cal-foot {
  border-top: 1px solid #f1f5f9; margin-top: 6px; padding-top: 6px;
  display: flex; justify-content: flex-end;
}
.wk-gbd-cal-quick {
  padding: 5px 10px; border-radius: 6px; border: none;
  background: transparent; cursor: pointer;
  font: inherit; font-size: 12px; font-weight: 600; color: var(--c-blue, #004b7c);
}
.wk-gbd-cal-quick:hover { background: rgba(0, 75, 124, 0.08); }

/* ══════════════════════════════════════════════════════════
   v5 additions — CRM-backed pickers, picked tiles, tag pills,
   restyled status pills, rich combo items with logos
   ══════════════════════════════════════════════════════════ */

/* ── "(optional)" label flag ──────────────────────────── */
.wk-gbd-lbl-opt {
  text-transform: none; letter-spacing: 0;
  font-size: 11px; font-weight: 500; color: #94a3b8;
  margin-left: 4px;
}

/* ── circular logo / avatar bubble (used everywhere) ──── */
.wk-gbd-clogo {
  flex-shrink: 0;
  border-radius: 50%;
  overflow: hidden;
  display: inline-flex; align-items: center; justify-content: center;
  background: #f1f5f9;
  color: #fff; font-weight: 700;
  border: 1px solid rgba(15, 23, 42, 0.06);
  box-sizing: border-box;
}
.wk-gbd-clogo img {
  width: 100%; height: 100%; object-fit: contain;
  background: #fff;
}
.wk-gbd-clogo--init { padding: 0; }

/* ── rich combo item (logo + name + subtitle) ─────────── */
.wk-gbd-combo-item--rich {
  gap: 10px;
  padding: 8px 10px;
}
.wk-gbd-combo-text {
  flex: 1; min-width: 0;
  display: flex; flex-direction: column; gap: 1px;
}
.wk-gbd-combo-main {
  font-size: 13px; font-weight: 600; color: #0f172a;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.wk-gbd-combo-sub {
  font-size: 11.5px; color: #64748b;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.wk-gbd-combo-flag {
  display: inline-block; margin-left: 6px;
  padding: 1px 6px; border-radius: 4px;
  background: rgba(0, 75, 124, 0.10); color: var(--c-blue, #004b7c);
  font-size: 10px; font-weight: 600; vertical-align: middle;
}

/* ── "picked" tile (locked-in beneficiary or primary contact) ── */
.wk-gbd-picked-tile {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 12px;
  border: 1.5px solid #e2e8f0; border-radius: 10px;
  background: linear-gradient(180deg, #ffffff 0%, #f8fafc 100%);
  cursor: pointer;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.wk-gbd-picked-tile:hover {
  border-color: var(--c-blue, #004b7c);
  box-shadow: 0 0 0 3px rgba(0, 75, 124, 0.10);
}
.wk-gbd-picked-text {
  flex: 1; min-width: 0;
  display: flex; flex-direction: column; gap: 2px;
}
.wk-gbd-picked-name {
  font-size: 14px; font-weight: 700; color: #0f172a;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.wk-gbd-picked-sub {
  font-size: 12px; color: #64748b;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.wk-gbd-picked-x {
  width: 28px; height: 28px; border-radius: 7px;
  border: none; background: transparent;
  font-size: 18px; line-height: 1; cursor: pointer; color: #94a3b8;
  flex-shrink: 0;
}
.wk-gbd-picked-x:hover { background: #f1f5f9; color: #ef4444; }

/* ── tag pills (supporting contacts) ──────────────────── */
.wk-gbd-tagbox {
  border: 1px solid #e2e8f0; border-radius: 10px;
  padding: 8px;
  background: #fff;
  display: flex; flex-direction: column; gap: 8px;
  transition: border-color 0.15s;
}
.wk-gbd-tagbox:focus-within { border-color: var(--c-blue, #004b7c); box-shadow: 0 0 0 3px rgba(0, 75, 124, 0.10); }
.wk-gbd-tags {
  display: flex; flex-wrap: wrap; gap: 6px;
}
.wk-gbd-tags:empty { display: none; }
.wk-gbd-tag {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 3px 4px 3px 4px;
  background: #f1f5f9; border-radius: 999px;
  font-size: 12.5px; font-weight: 600; color: #0f172a;
}
.wk-gbd-tag-name { padding: 0 4px; }
.wk-gbd-tag-x {
  width: 18px; height: 18px; border-radius: 50%;
  border: none; background: transparent; cursor: pointer;
  font-size: 14px; line-height: 1; color: #64748b;
  display: inline-flex; align-items: center; justify-content: center;
}
.wk-gbd-tag-x:hover { background: rgba(15, 23, 42, 0.08); color: #ef4444; }
.wk-gbd-tag-warn {
  display: inline-block; margin-left: 6px;
  padding: 1px 6px; border-radius: 4px;
  background: rgba(245, 158, 11, 0.14); color: #b45309;
  font-size: 10.5px; font-weight: 600; vertical-align: middle;
}

/* ── inline combo (sits inside .wk-gbd-tagbox) ────────── */
.wk-gbd-combo--inline {
  position: relative;
}
.wk-gbd-combo-input--bare {
  border: none !important;
  padding: 4px 4px !important;
  background: transparent !important;
  font: inherit; font-size: 13px;
  width: 100%;
  outline: none;
}
.wk-gbd-combo-input--bare:focus {
  box-shadow: none !important;
}
.wk-gbd-combo--inline .wk-gbd-combo-panel {
  left: -8px; right: -8px; top: calc(100% + 6px);
}

/* ── restyled status pills (filled-when-active) ───────── */
.wk-gbd-status-row {
  background: #f8fafc;
}
.wk-gbd-status {
  position: relative;
  font-size: 12.5px;
  letter-spacing: 0.01em;
}
.wk-gbd-status.is-active {
  background: var(--_c, var(--c-blue, #004b7c));
  color: #fff;
  box-shadow: 0 1px 4px color-mix(in srgb, var(--_c, #004b7c) 35%, transparent);
}
.wk-gbd-status.is-active:hover { background: var(--_c, var(--c-blue, #004b7c)); color: #fff; }

/* ── section head with action button (Documents) ──────── */
.wk-gbd-section-head {
  display: flex; align-items: center; justify-content: space-between;
  gap: 10px; margin-bottom: 8px;
}
.wk-gbd-mini-btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 6px 10px; border-radius: 7px;
  border: 1px solid #cbd5e1; background: #fff;
  font: inherit; font-size: 12px; font-weight: 600; color: #0f172a;
  cursor: pointer; transition: all 0.15s;
}
.wk-gbd-mini-btn:hover {
  border-color: var(--c-blue, #004b7c);
  color: var(--c-blue, #004b7c);
  background: rgba(0, 75, 124, 0.04);
}
.wk-gbd-mini-btn svg { color: currentColor; }

/* ══════════════════════════════════════════════════════════
   SCOPE & PLAN — the five list editors

   A grant document is mostly tables, so this tab is a stack of cards, each
   card one row of one of those tables (line item, objective, milestone, open
   item, person). Every list shares this markup, so a sixth list needs no new
   CSS.
   ══════════════════════════════════════════════════════════ */
.wk-gbd-grid-3 {
  display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 14px;
}
/* Labelled divider that breaks Basics into "the award" and "the frame". */
.wk-gbd-section-rule {
  display: flex; align-items: center; gap: 10px;
  margin: 20px 0 14px;
  font-size: 11px; font-weight: 700; color: #94a3b8;
  text-transform: uppercase; letter-spacing: 0.08em;
}
.wk-gbd-section-rule::before,
.wk-gbd-section-rule::after {
  content: ''; flex: 1 1 auto; height: 1px; background: #eef2f7;
}
.wk-gbd-section-rule:empty { margin: 18px 0; }
.wk-gbd-section-rule > span { flex: 0 0 auto; }

.wk-gbd-scope-intro {
  padding: 11px 13px; margin-bottom: 18px;
  background: #f8fafc; border: 1px solid #eef2f7; border-radius: 10px;
  font-size: 12.5px; line-height: 1.55; color: #64748b;
}
.wk-gbd-scope-intro strong { color: #0f172a; font-weight: 700; }
.wk-gbd-scope-intro em { color: #475569; font-style: italic; }

.wk-gbd-lblock { margin-bottom: 4px; }
.wk-gbd-lstack { display: flex; flex-direction: column; gap: 10px; }

.wk-gbd-lempty {
  padding: 14px; border: 1px dashed #e2e8f0; border-radius: 10px;
  font-size: 12.5px; color: #94a3b8; background: #fcfdfe;
}

.wk-gbd-lrow {
  border: 1px solid #e8edf3; border-radius: 11px;
  background: #fff; overflow: hidden;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.wk-gbd-lrow:focus-within {
  border-color: var(--c-blue, #004b7c);
  box-shadow: 0 0 0 3px rgba(0, 75, 124, 0.09);
}
.wk-gbd-lrow-head {
  display: flex; align-items: center; gap: 9px;
  padding: 9px 11px;
  background: #f8fafc; border-bottom: 1px solid #eef2f7;
}
.wk-gbd-lrow-num {
  flex: 0 0 auto;
  width: 19px; height: 19px; border-radius: 6px;
  display: inline-flex; align-items: center; justify-content: center;
  background: #e2e8f0; color: #475569;
  font-size: 10.5px; font-weight: 700;
}
.wk-gbd-lrow-title {
  flex: 1 1 auto; min-width: 0;
  font-size: 12.5px; font-weight: 700; color: #0f172a;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.wk-gbd-lrow-title em { color: #cbd5e1; font-weight: 600; font-style: normal; }
.wk-gbd-lrow-rm {
  flex: 0 0 auto;
  width: 22px; height: 22px; border-radius: 6px;
  border: 1px solid transparent; background: transparent;
  color: #94a3b8; font-size: 17px; line-height: 1;
  cursor: pointer; transition: all 0.15s;
}
.wk-gbd-lrow-rm:hover {
  background: #fef2f2; border-color: #fecaca; color: #dc2626;
}

/* 12-column grid; each cell declares its own span from LIST_SPECS. */
.wk-gbd-lgrid {
  display: grid; grid-template-columns: repeat(12, 1fr);
  gap: 9px 10px; padding: 11px;
}
.wk-gbd-lcell { min-width: 0; }
.wk-gbd-lcell-lbl {
  display: block; margin-bottom: 4px;
  font-size: 10.5px; font-weight: 700; color: #94a3b8;
  text-transform: uppercase; letter-spacing: 0.05em;
}
.wk-gbd-lcell .wk-gbd-input { padding: 7px 9px; font-size: 12.5px; }
.wk-gbd-lrow-ta { resize: vertical; min-height: 46px; line-height: 1.45; }

.wk-gbd-ltotal {
  margin-top: 9px; padding: 8px 11px;
  background: #f8fafc; border: 1px solid #eef2f7; border-radius: 9px;
  font-size: 11.5px; font-weight: 600; color: #64748b;
  font-variant-numeric: tabular-nums;
}
/* The funder checks that the line items add up to the headline numbers, so a
   mismatch with Basics is called out rather than quietly saved. */
.wk-gbd-ltotal-warn {
  display: inline-block; margin-left: 8px;
  padding: 1px 7px; border-radius: 5px;
  background: #fffbeb; border: 1px solid #fde68a; color: #b45309;
  font-weight: 700;
}

.wk-gbd-ladd {
  margin-top: 10px; width: 100%;
  padding: 9px 12px; border-radius: 9px;
  border: 1px dashed #cbd5e1; background: #fff;
  font: inherit; font-size: 12.5px; font-weight: 700; color: #475569;
  cursor: pointer; transition: all 0.15s;
}
.wk-gbd-ladd:hover {
  border-color: var(--c-blue, #004b7c); border-style: solid;
  color: var(--c-blue, #004b7c); background: rgba(0, 75, 124, 0.04);
}

/* ── review: one card per non-empty list ──────────────── */
.wk-gbd-rev-count {
  display: inline-block; margin-left: 5px;
  padding: 1px 6px; border-radius: 5px;
  background: #eef2f7; color: #64748b;
  font-size: 10.5px; font-weight: 700; letter-spacing: 0;
}
.wk-gbd-rev-item {
  padding: 8px 0; border-bottom: 1px dashed #f1f5f9;
}
.wk-gbd-rev-item:last-child { border-bottom: none; }
.wk-gbd-rev-item-title {
  display: flex; align-items: baseline; gap: 8px;
  font-size: 13px; font-weight: 700; color: #0f172a;
}
.wk-gbd-rev-item-num {
  flex: 0 0 auto;
  min-width: 17px; height: 17px; border-radius: 5px;
  display: inline-flex; align-items: center; justify-content: center;
  background: #e2e8f0; color: #475569;
  font-size: 10px; font-weight: 700;
}
.wk-gbd-rev-chips {
  display: flex; flex-wrap: wrap; gap: 5px;
  margin: 6px 0 0 25px;
}
.wk-gbd-rev-chip {
  padding: 2px 8px; border-radius: 6px;
  background: #f8fafc; border: 1px solid #eef2f7;
  font-size: 11.5px; color: #475569; line-height: 1.5;
  max-width: 100%; word-break: break-word;
}
.wk-gbd-rev-chip b { color: #94a3b8; font-weight: 700; }

/* ── responsive ───────────────────────────────────────── */
@media (max-width: 880px) {
  .wk-gbd-overlay { padding: 0; }
  .wk-gbd-drawer { max-width: 100%; max-height: 100vh; height: 100%; border-radius: 0; }
  .wk-gbd-grid-2 { grid-template-columns: 1fr; }
  .wk-gbd-chips  { grid-template-columns: 1fr 1fr; }
  .wk-gbd-rev-row { grid-template-columns: 1fr; gap: 2px; }
}
@media (max-width: 880px) {
  .wk-gbd-grid-3 { grid-template-columns: 1fr; }
  /* Below the fold a 12-col grid is unreadable — every cell goes full width. */
  .wk-gbd-lgrid > .wk-gbd-lcell { grid-column: span 12 !important; }
  .wk-gbd-rev-chips { margin-left: 0; }
}
