/* ══════════════════════════════════════════════════════════════
   VALUE TRACKER — chip + popover styles
   ══════════════════════════════════════════════════════════════ */

/* ── inline chip on plan-grid rows ─────────────────────────── */
.wk-vt-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 9px;
  font-size: 11px;
  font-weight: 600;
  line-height: 1;
  border-radius: 999px;
  border: 1px solid transparent;
  cursor: pointer;
  white-space: nowrap;
  font-family: inherit;
  transition: all .12s ease;
  margin-left: auto;
}
.wk-vt-chip svg { flex: 0 0 auto; }
.wk-vt-chip--empty {
  color: #64748b;
  background: #f8fafc;
  border-color: #e2e8f0;
  border-style: dashed;
}
.wk-vt-chip--empty:hover {
  color: #0f766e;
  background: #ecfdf5;
  border-color: #99f6e4;
  border-style: solid;
}
.wk-vt-chip--filled {
  color: #065f46;
  background: linear-gradient(135deg, #d1fae5, #ecfdf5);
  border-color: #6ee7b7;
}
.wk-vt-chip--filled:hover {
  background: linear-gradient(135deg, #a7f3d0, #d1fae5);
  border-color: #34d399;
  transform: translateY(-1px);
  box-shadow: 0 2px 6px -2px rgba(16, 185, 129, .3);
}

/* ── popover ───────────────────────────────────────────────── */
.wk-vt-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, .35);
  backdrop-filter: blur(2px);
  /* Stacks above engagement-profile overlay (12000), other ep modals (65000),
     deliverable modal (65000), and mini-card overlay (70000). */
  z-index: 80000;
  animation: wkVtFadeIn .15s ease;
}
@keyframes wkVtFadeIn { from { opacity: 0 } to { opacity: 1 } }

.wk-vt-pop {
  position: fixed;
  z-index: 80001;
  width: 380px;
  max-width: calc(100vw - 16px);
  max-height: calc(100vh - 16px);
  overflow-y: auto;
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 14px;
  box-shadow: 0 20px 50px -10px rgba(15, 23, 42, .25), 0 8px 16px -4px rgba(15, 23, 42, .12);
  padding: 14px 16px 12px;
  font-family: inherit;
  animation: wkVtPopIn .15s cubic-bezier(.16,.84,.44,1);
}
@keyframes wkVtPopIn {
  from { opacity: 0; transform: translateY(4px) scale(.98); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.wk-vt-pop-head {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 2px;
}
.wk-vt-pop-title {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 13px;
  font-weight: 700;
  color: #0f172a;
  flex: 1;
}
.wk-vt-pop-title svg { color: #10b981; }
.wk-vt-pop-close {
  width: 24px;
  height: 24px;
  border: none;
  background: transparent;
  color: #94a3b8;
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
  border-radius: 6px;
  font-family: inherit;
}
.wk-vt-pop-close:hover { background: #f1f5f9; color: #0f172a; }

.wk-vt-pop-sub {
  font-size: 12px;
  color: #64748b;
  margin-bottom: 12px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* fields */
.wk-vt-grid {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 8px;
  margin-bottom: 10px;
}
.wk-vt-grid--2 { grid-template-columns: 1fr 1fr; }
.wk-vt-field { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.wk-vt-field--full { grid-column: 1 / -1; }
.wk-vt-lbl {
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .04em;
  color: #64748b;
}
.wk-vt-field input,
.wk-vt-field select,
.wk-vt-field textarea {
  width: 100%;
  padding: 7px 9px;
  font-size: 13px;
  font-family: inherit;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  background: #fff;
  color: #0f172a;
  outline: none;
  transition: border-color .12s, box-shadow .12s;
}
.wk-vt-field input:focus,
.wk-vt-field select:focus,
.wk-vt-field textarea:focus {
  border-color: #10b981;
  box-shadow: 0 0 0 3px rgba(16, 185, 129, .15);
}
.wk-vt-field textarea { resize: vertical; min-height: 50px; }

/* Simple question-style fields — used by the simplified 4-question popover */
.wk-vt-q-grid {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 12px;
}
.wk-vt-q-field {
  display: flex;
  flex-direction: column;
  gap: 5px;
}
.wk-vt-q-lbl {
  font-size: 12px;
  font-weight: 600;
  color: #0f172a;
}
.wk-vt-q-inline {
  display: flex;
  align-items: center;
  gap: 6px;
}
.wk-vt-q-num {
  width: 80px;
  padding: 8px 10px;
  font-size: 14px;
  font-family: inherit;
  font-weight: 600;
  color: #0f172a;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  background: #fff;
  outline: none;
  transition: border-color .12s, box-shadow .12s;
}
.wk-vt-q-num:focus {
  border-color: #10b981;
  box-shadow: 0 0 0 3px rgba(16,185,129,.15);
}
.wk-vt-q-per {
  font-size: 13px;
  color: #64748b;
  font-weight: 500;
}
.wk-vt-q-unit {
  flex: 1;
  padding: 8px 10px;
  font-size: 14px;
  font-family: inherit;
  font-weight: 600;
  color: #0f172a;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  background: #fff;
  outline: none;
  cursor: pointer;
}
.wk-vt-q-unit:focus {
  border-color: #10b981;
  box-shadow: 0 0 0 3px rgba(16,185,129,.15);
}
.wk-vt-q-with-unit {
  display: flex;
  align-items: stretch;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  background: #fff;
  overflow: hidden;
  transition: border-color .12s, box-shadow .12s;
}
.wk-vt-q-with-unit:focus-within {
  border-color: #10b981;
  box-shadow: 0 0 0 3px rgba(16,185,129,.15);
}
.wk-vt-q-with-unit input {
  flex: 1;
  padding: 8px 10px;
  font-size: 14px;
  font-family: inherit;
  font-weight: 600;
  color: #0f172a;
  border: none;
  background: transparent;
  outline: none;
}
.wk-vt-q-unit-label {
  display: flex;
  align-items: center;
  padding: 0 12px;
  font-size: 12px;
  font-weight: 600;
  color: #64748b;
  background: #f8fafc;
  border-left: 1px solid #e2e8f0;
}

/* "Saved each time × people" strip — live computed savings per occurrence */
.wk-vt-saved-strip {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 10px;
  background: #f8fafc;
  border: 1px dashed #cbd5e1;
  border-radius: 8px;
  margin-bottom: 10px;
  font-size: 12px;
}
.wk-vt-saved-strip-lbl {
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .05em;
  color: #64748b;
}
.wk-vt-saved-strip-val {
  font-size: 14px;
  font-weight: 700;
  color: #0f172a;
  margin-right: auto;
}
.wk-vt-saved-strip-x {
  color: #94a3b8;
  font-weight: 500;
}
.wk-vt-saved-strip-people {
  display: flex;
  align-items: center;
  gap: 6px;
}
.wk-vt-saved-strip-people input {
  width: 56px;
  padding: 4px 7px;
  font-size: 12px;
  font-family: inherit;
  font-weight: 600;
  color: #0f172a;
  text-align: center;
  border: 1px solid #e2e8f0;
  border-radius: 6px;
  background: #fff;
  outline: none;
}
.wk-vt-saved-strip-people input:focus {
  border-color: #10b981;
  box-shadow: 0 0 0 2px rgba(16, 185, 129, .15);
}

/* live preview block */
.wk-vt-preview {
  background: linear-gradient(135deg, #ecfdf5, #f0fdfa);
  border: 1px solid #99f6e4;
  border-radius: 10px;
  padding: 10px 12px;
  margin: 8px 0 10px;
}
.wk-vt-preview-row {
  display: flex;
  gap: 12px;
  margin-bottom: 4px;
}
.wk-vt-preview-cell { flex: 1; }
.wk-vt-preview-cell--money { text-align: right; }
.wk-vt-preview-val {
  font-size: 18px;
  font-weight: 800;
  color: #0f172a;
  line-height: 1.1;
  letter-spacing: -.01em;
}
.wk-vt-preview-cell--money .wk-vt-preview-val { color: #047857; }
.wk-vt-preview-lbl {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: .05em;
  color: #475569;
  font-weight: 600;
  margin-top: 2px;
}
.wk-vt-preview-meta {
  font-size: 11px;
  color: #64748b;
  border-top: 1px dashed rgba(15, 118, 110, .25);
  padding-top: 6px;
  margin-top: 4px;
}

/* advanced toggle */
.wk-vt-adv-toggle {
  display: flex;
  align-items: center;
  gap: 6px;
  width: 100%;
  padding: 6px 0;
  border: none;
  background: transparent;
  font-family: inherit;
  font-size: 12px;
  font-weight: 600;
  color: #475569;
  cursor: pointer;
  text-align: left;
}
.wk-vt-adv-toggle:hover { color: #0f172a; }
.wk-vt-adv {
  padding-top: 4px;
  border-top: 1px solid #f1f5f9;
}

/* footer */
.wk-vt-pop-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid #f1f5f9;
}
.wk-vt-foot-right { display: flex; gap: 6px; }
.wk-vt-btn {
  padding: 7px 14px;
  font-size: 12px;
  font-weight: 600;
  font-family: inherit;
  border: 1px solid transparent;
  border-radius: 8px;
  cursor: pointer;
  transition: all .12s ease;
}
.wk-vt-btn--ghost {
  background: transparent;
  color: #94a3b8;
  border: none;
}
.wk-vt-btn--ghost:hover { color: #ef4444; }
.wk-vt-btn--secondary {
  background: #fff;
  color: #475569;
  border-color: #e2e8f0;
}
.wk-vt-btn--secondary:hover { background: #f8fafc; color: #0f172a; }
.wk-vt-btn--primary {
  background: linear-gradient(135deg, #10b981, #059669);
  color: #fff;
}
.wk-vt-btn--primary:hover {
  background: linear-gradient(135deg, #059669, #047857);
  box-shadow: 0 2px 6px -1px rgba(16, 185, 129, .4);
}

/* ── Engagement profile Value Delivered card ──────────────── */
.ep-value-card {
  background: linear-gradient(135deg, #ecfdf5, #f0fdfa);
  border: 1px solid #99f6e4;
  border-radius: 14px;
  padding: 16px 18px;
  margin: 12px 0;
}
.ep-value-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
}
.ep-value-card-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  font-weight: 700;
  color: #064e3b;
  text-transform: uppercase;
  letter-spacing: .05em;
}
.ep-value-card-empty {
  font-size: 12px;
  color: #475569;
  padding: 6px 0;
}
.ep-value-card-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  margin-bottom: 12px;
}
.ep-value-card-stat {
  background: rgba(255,255,255,.7);
  border-radius: 10px;
  padding: 10px 12px;
}
.ep-value-card-stat-val {
  font-size: 22px;
  font-weight: 800;
  color: #047857;
  letter-spacing: -.01em;
  line-height: 1.1;
}
.ep-value-card-stat-lbl {
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .05em;
  color: #475569;
  margin-top: 3px;
}
.ep-value-card-top {
  border-top: 1px dashed rgba(6, 95, 70, .25);
  padding-top: 8px;
}
.ep-value-card-top-head {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .05em;
  color: #064e3b;
  margin-bottom: 6px;
}
.ep-value-card-top-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 4px 0;
  font-size: 12px;
  color: #0f172a;
  border-bottom: 1px dotted rgba(6, 95, 70, .15);
}
.ep-value-card-top-row:last-child { border-bottom: none; }
.ep-value-card-top-row-name {
  flex: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-right: 12px;
}
.ep-value-card-top-row-val {
  font-weight: 700;
  color: #047857;
  white-space: nowrap;
}

/* ── Deliverables section on engagement profile Overview ──── */
.ep-deliverables-section .ep-section-title {
  display: flex;
  align-items: center;
}
.ep-deliverables-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 22px;
  height: 22px;
  padding: 0 7px;
  margin-left: 8px;
  font-size: 11px;
  font-weight: 700;
  color: #047857;
  background: #d1fae5;
  border-radius: 999px;
}
.ep-deliverables-empty {
  font-size: 12px;
  color: #64748b;
  padding: 12px;
  background: #f8fafc;
  border: 1px dashed #cbd5e1;
  border-radius: 10px;
}
.ep-deliverables-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.ep-deliverable-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  transition: border-color .12s, box-shadow .12s;
}
.ep-deliverable-row:hover {
  border-color: #99f6e4;
  box-shadow: 0 2px 8px -2px rgba(15, 23, 42, .08);
}
.ep-deliverable-main {
  flex: 1;
  min-width: 0;
}
.ep-deliverable-name {
  font-size: 13px;
  font-weight: 600;
  color: #0f172a;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-bottom: 4px;
}
.ep-deliverable-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  font-size: 11px;
  color: #64748b;
}
.ep-deliverable-meta-item { color: #64748b; }
.ep-deliverable-pill {
  display: inline-block;
  padding: 2px 7px;
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .03em;
  border-radius: 999px;
  background: #f1f5f9;
  color: #475569;
}
.ep-deliverable-pill--done { background: #d1fae5; color: #047857; }
.ep-deliverable-pill--in_progress { background: #dbeafe; color: #1d4ed8; }
.ep-deliverable-pill--blocked { background: #fee2e2; color: #b91c1c; }
.ep-deliverable-pill--at_risk { background: #fef3c7; color: #b45309; }
/* Deliverable lifecycle stages (outcome states, distinct from task statuses) */
.ep-deliverable-pill--proposed { background: #eef2ff; color: #4338ca; }
.ep-deliverable-pill--delivered { background: #ccfbf1; color: #0f766e; }
.ep-deliverable-pill--accepted { background: #d1fae5; color: #047857; }

/* Clickable stage pill (edit mode) — same look, plus a hover affordance and
   a caret so it reads as editable-in-place. */
.ep-deliv-stage-pill {
  border: none;
  cursor: pointer;
  font-family: inherit;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  line-height: inherit;
}
.ep-deliv-stage-pill svg { opacity: .55; }
.ep-deliv-stage-pill:hover {
  box-shadow: 0 0 0 2px rgba(99, 102, 241, .3);
  filter: brightness(.97);
}

/* Work-stream tag on a deliverable row */
.ep-deliv-row-ws {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 8px;
  border-radius: 999px;
  background: #f5f3ff;
  color: #6d28d9;
  border: 1px solid #ddd6fe;
  font-size: 10.5px;
  font-weight: 600;
  max-width: 220px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.ep-deliv-row-ws svg { flex: 0 0 auto; opacity: .7; }

/* Inline stage picker menu (opened from a row's stage pill) */
.ep-deliv-stage-menu {
  position: fixed;
  z-index: 1000002;
  min-width: 168px;
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  box-shadow: 0 16px 40px rgba(15, 23, 42, .22);
  padding: 5px;
  display: flex;
  flex-direction: column;
  gap: 1px;
}
.ep-deliv-stage-menu-item {
  display: flex;
  align-items: center;
  gap: 8px;
  border: none;
  background: transparent;
  font: 600 12.5px/1.2 inherit;
  color: #334155;
  padding: 8px 10px;
  border-radius: 7px;
  cursor: pointer;
  text-align: left;
}
.ep-deliv-stage-menu-item:hover { background: #f1f5f9; }
.ep-deliv-stage-menu-item.is-current { background: #eef2ff; color: #3730a3; }
.ep-deliv-stage-menu-item svg { margin-left: auto; color: #4f46e5; }
.ep-deliv-stage-menu-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex: 0 0 auto;
}

.ep-deliverable-value {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}
.ep-deliverable-value-money {
  font-size: 14px;
  font-weight: 700;
  color: #047857;
  text-align: right;
  line-height: 1.1;
}
.ep-deliverable-value-money span {
  display: block;
  font-size: 9px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .05em;
  color: #64748b;
  margin-top: 2px;
}
.ep-deliverable-value-hrs {
  font-size: 11px;
  color: #475569;
  font-weight: 500;
}

/* ── Deliverables TAB (full panel) ─────────────────────────── */
.ep-deliv-panel {
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.ep-deliv-header {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 16px 18px;
  background: linear-gradient(135deg, #ecfdf5, #f0fdfa);
  border: 1px solid #99f6e4;
  border-radius: 14px;
  flex-wrap: wrap;
}
.ep-deliv-header-left {
  flex: 1;
  min-width: 200px;
}
.ep-deliv-h-title {
  font-size: 18px;
  font-weight: 800;
  color: #064e3b;
  letter-spacing: -.01em;
}
.ep-deliv-h-sub {
  font-size: 12px;
  color: #475569;
  margin-top: 3px;
}
.ep-deliv-header-stats {
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
}
.ep-deliv-stat {
  background: rgba(255,255,255,.7);
  border-radius: 10px;
  padding: 8px 14px;
  text-align: right;
  min-width: 70px;
}
.ep-deliv-stat-val {
  font-size: 18px;
  font-weight: 800;
  color: #0f172a;
  letter-spacing: -.01em;
  line-height: 1.1;
}
.ep-deliv-stat--money .ep-deliv-stat-val { color: #047857; }
.ep-deliv-stat--hrs .ep-deliv-stat-val { color: #0d9488; }
.ep-deliv-stat-lbl {
  font-size: 9px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .05em;
  color: #475569;
  margin-top: 2px;
}
.ep-deliv-header-actions {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
}
.ep-deliv-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  font-size: 12px;
  font-weight: 600;
  font-family: inherit;
  border: 1px solid transparent;
  border-radius: 8px;
  background: #fff;
  color: #0f172a;
  cursor: pointer;
  transition: all .12s ease;
  white-space: nowrap;
}
.ep-deliv-btn--ai {
  background: linear-gradient(135deg, #6366f1, #8b5cf6);
  color: #fff;
  border: none;
  box-shadow: 0 1px 3px rgba(99,102,241,.3);
}
.ep-deliv-btn--ai:hover {
  background: linear-gradient(135deg, #4f46e5, #7c3aed);
  box-shadow: 0 4px 12px -2px rgba(99,102,241,.45);
  transform: translateY(-1px);
}
.ep-deliv-btn--ai.is-loading {
  opacity: .7;
  cursor: wait;
}
.ep-deliv-btn--add {
  background: #0f766e;
  color: #fff;
  border: none;
}
.ep-deliv-btn--add:hover { background: #115e59; }
.ep-deliv-btn--select {
  background: #fff;
  color: #475569;
  border: 1px solid #e2e8f0;
}
.ep-deliv-btn--select:hover {
  color: #15803d;
  border-color: #86efac;
  background: #f0fdf4;
}
.ep-deliv-btn--primary {
  background: linear-gradient(135deg, #10b981, #059669);
  color: #fff;
  border: none;
}
.ep-deliv-btn--primary:hover { background: linear-gradient(135deg, #059669, #047857); }
.ep-deliv-btn--cancel {
  background: #fff;
  color: #475569;
  border: 1px solid #e2e8f0;
}
.ep-deliv-btn--cancel:hover { background: #f8fafc; }
.ep-deliv-btn--sm {
  padding: 5px 10px;
  font-size: 11px;
}

/* AI SUGGESTIONS */
.ep-deliv-ai-suggestions {
  background: #fafafa;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  padding: 12px 14px;
}
.ep-deliv-ai-loading {
  font-size: 13px;
  color: #475569;
  padding: 14px;
  text-align: center;
  background: #fff;
  border-radius: 8px;
}
.ep-deliv-ai-error {
  font-size: 13px;
  color: #b91c1c;
  padding: 12px;
  background: #fef2f2;
  border-radius: 8px;
}
.ep-deliv-ai-empty {
  font-size: 13px;
  color: #475569;
  padding: 12px;
  text-align: center;
}
.ep-deliv-ai-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
}
.ep-deliv-ai-title {
  font-size: 13px;
  font-weight: 700;
  color: #312e81;
}
.ep-deliv-ai-actions {
  display: flex;
  gap: 6px;
}
.ep-deliv-ai-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.ep-deliv-ai-item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 12px 14px;
  background: #fff;
  border: 1px solid #e0e7ff;
  border-radius: 10px;
  border-left: 3px solid #6366f1;
}
.ep-deliv-ai-item-main {
  flex: 1;
  min-width: 0;
}
.ep-deliv-ai-item-name {
  font-size: 13px;
  font-weight: 700;
  color: #0f172a;
  margin-bottom: 3px;
}
.ep-deliv-ai-item-desc {
  font-size: 12px;
  color: #475569;
  line-height: 1.4;
  margin-bottom: 5px;
}
.ep-deliv-ai-item-meta {
  font-size: 11px;
  color: #6366f1;
  font-weight: 600;
}
.ep-deliv-ai-item-actions {
  display: flex;
  flex-direction: column;
  gap: 4px;
  flex-shrink: 0;
}

/* QUICK-ADD INLINE */
.ep-deliv-quick-add {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 14px;
  background: #f8fafc;
  border: 1px solid #cbd5e1;
  border-radius: 10px;
  flex-wrap: wrap;
}
.ep-deliv-quick-add input,
.ep-deliv-quick-add select {
  padding: 7px 10px;
  font-size: 13px;
  font-family: inherit;
  border: 1px solid #e2e8f0;
  border-radius: 7px;
  background: #fff;
  outline: none;
}
.ep-deliv-quick-add input:focus,
.ep-deliv-quick-add select:focus {
  border-color: #10b981;
  box-shadow: 0 0 0 2px rgba(16,185,129,.15);
}
.ep-deliv-quick-add input[type="text"] {
  flex: 1;
  min-width: 220px;
}

/* EMPTY STATE */
.ep-deliv-empty {
  text-align: center;
  padding: 40px 20px;
  background: #fff;
  border: 1px dashed #cbd5e1;
  border-radius: 12px;
}
.ep-deliv-empty-icon {
  color: #cbd5e1;
  margin-bottom: 12px;
}
.ep-deliv-empty-title {
  font-size: 15px;
  font-weight: 700;
  color: #0f172a;
  margin-bottom: 6px;
}
.ep-deliv-empty-sub {
  font-size: 13px;
  color: #64748b;
  max-width: 480px;
  margin: 0 auto;
  line-height: 1.5;
}

/* DELIVERABLES LIST */
.ep-deliv-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.ep-deliv-row {
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  overflow: hidden;
  transition: border-color .12s, box-shadow .12s;
}
.ep-deliv-row:hover {
  border-color: #99f6e4;
  box-shadow: 0 2px 8px -2px rgba(15, 23, 42, .08);
}
/* Deliverables grouped by work stream — collapsed <details> sections. A long
   list is split into per-work-stream groups you expand one at a time. */
.ep-deliv-group {
  display: flex; flex-direction: column; gap: 6px;
  border: 1px solid #e2e8f0; border-radius: 12px;
  background: #f8fafc; padding: 4px;
}
.ep-deliv-group[open] { background: #fff; }
.ep-deliv-group-head {
  display: flex; align-items: center; gap: 9px;
  cursor: pointer; list-style: none; user-select: none;
  padding: 9px 12px; border-radius: 9px;
}
.ep-deliv-group-head::-webkit-details-marker { display: none; }
.ep-deliv-group-head::marker { content: ''; }
.ep-deliv-group-head:hover { background: #f1f5f9; }
.ep-deliv-group-chev { color: #94a3b8; flex: 0 0 auto; transition: transform .14s ease; }
.ep-deliv-group[open] > .ep-deliv-group-head .ep-deliv-group-chev { transform: rotate(90deg); }
.ep-deliv-group-name { font-weight: 700; font-size: 13.5px; color: #1e293b; flex: 1 1 auto; }
.ep-deliv-group-count {
  flex: 0 0 auto; font-size: 12px; font-weight: 600; color: #64748b;
  background: #eef2f7; border-radius: 999px; padding: 2px 10px;
}

/* ══ GROUP HEADER = THE HOUSE WORK-STREAM ROW ═══════════════════════════
   The header of a per-stream group is the SAME row the Work Streams tab
   draws in List view — status pill, meta chips, progress bar, faces and
   all. _panelDeliverables builds it with _epWsCardHtml (opts.fold) inside
   a `.ep-projects-grid.ep-ws-view--list` host, so every one of those rules
   lands untouched and the two tabs cannot drift apart.

   Everything below is SHELL work only: get the group's own padding,
   background, border and hover out of the card's way, because two nested
   bordered boxes with two hover states reads as a bug. No card styling is
   restated here — that lives with the card. */
.ep-deliv-group--ws {
  border: 0;
  background: transparent;
  padding: 0;
}
.ep-deliv-group--ws[open] { background: transparent; }
.ep-deliv-group--ws > .ep-deliv-group-head {
  position: relative;       /* the containing block for .ep-dgrp-tail */
  padding: 0;
  gap: 8px;
  border-radius: 14px;      /* matches .wk-goal-card, for the focus ring */
}
/* The card owns the hover feedback (accent border + lift). A second tint on
   the summary behind it just makes the corners look wrong. */
.ep-deliv-group--ws > .ep-deliv-group-head:hover { background: transparent; }
/* Fixed-width chevron gutter so every row's card starts on the same x and
   the titles line up straight down the list. */
.ep-deliv-group--ws > .ep-deliv-group-head > .ep-deliv-group-chev {
  width: 14px;
  margin-left: 2px;
}
.ep-dgrp-wshost {
  flex: 1 1 auto;
  min-width: 0;
  margin-bottom: 0;         /* .ep-projects-grid ships 18px; wrong inside a row */
}
/* ⚠️ The tail's space is RESERVED inside the card by a padding-right rule that
   has to out-specify `.ep-projects-grid.ep-ws-view--list .ep-project-card`'s
   padding shorthand — so it lives in engagement-profile.css next to the rule it
   beats, NOT here. Putting it here as `.ep-dgrp-wshost .ep-ws-foldcard` lost the
   cascade (equal weight, and that file loads later): the reserve silently did
   nothing and the count badge printed straight over "0/4 deliverables
   delivered". Nothing in this block reserves width. */
.ep-dgrp-tail {
  position: absolute;
  right: 16px;
  top: 50%;
  transform: translateY(-50%);
  display: flex; align-items: center; gap: 7px;
  /* Above the card (which sets z-index on hover) and out of the way of the
     summary's own click target — the tail's own button handles its click. */
  z-index: 61;
}
/* A fold header is not a link — kill the lift so a click that only opens the
   group doesn't animate like a navigation, and keep the tooltip escape hatch
   the grid version relies on (.ep-project-card is overflow:hidden at rest). */
.ep-dgrp-wshost .ep-ws-foldcard:hover { transform: none; }
/* Indent the deliverables so they read as children of the stream above them,
   lining up with the card's text rather than the chevron gutter. */
.ep-deliv-group--ws > .ep-deliv-row { margin-left: 24px; }
.ep-deliv-group--ws[open] { padding-bottom: 6px; }
/* "Open ›" — the only thing in the header that navigates. Deliberately quiet
   until you hover the row: the row's job here is to fold. */
.ep-dgrp-open {
  flex: 0 0 auto;
  display: inline-flex; align-items: center; justify-content: center;
  width: 24px; height: 24px; padding: 0;
  border: 1px solid #e2e8f0; background: #fff; color: #475569;
  border-radius: 999px;
  cursor: pointer;
  opacity: 0; transition: opacity .13s ease, color .13s, border-color .13s;
}
.ep-deliv-group-head:hover .ep-dgrp-open,
.ep-dgrp-open:focus-visible { opacity: 1; }
.ep-dgrp-open:hover { color: #0f172a; border-color: #94a3b8; }
/* Touch has no hover, so the button would never appear. */
@media (hover: none) {
  .ep-dgrp-open { opacity: 1; }
}
/* Narrow popup: the card row already re-stacks itself at 900px (its own media
   query), so here just let the header wrap instead of crushing the card. */
@media (max-width: 760px) {
  .ep-deliv-group--ws > .ep-deliv-row { margin-left: 0; }
  /* The card re-stacks onto two rows here (its own 900px query), so the tail
     goes back in flow at the top rather than floating over a taller box. The
     matching padding reset is in engagement-profile.css, with the reserve. */
  .ep-dgrp-tail { position: static; transform: none; }
  .ep-deliv-group--ws > .ep-deliv-group-head { flex-wrap: wrap; }
  .ep-dgrp-wshost { flex-basis: 100%; order: 3; }
}
.ep-deliv-row-main {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
}
.ep-deliv-row-toggle {
  width: 22px;
  height: 22px;
  border: none;
  background: transparent;
  color: #64748b;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 6px;
  flex-shrink: 0;
  transition: transform .15s ease;
}
.ep-deliv-row-toggle:hover { background: #f1f5f9; color: #0f172a; }
.ep-deliv-row-toggle.is-open { transform: rotate(90deg); }
.ep-deliv-row-body {
  flex: 1;
  min-width: 0;
}
.ep-deliv-row-name {
  font-size: 13px;
  font-weight: 600;
  color: #0f172a;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-bottom: 4px;
}
.ep-deliv-row-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  font-size: 11px;
  color: #64748b;
}
.ep-deliv-row-meta-item { color: #64748b; }
.ep-deliv-row-ai-tag {
  display: inline-block;
  padding: 1px 6px;
  font-size: 9px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .05em;
  background: linear-gradient(135deg, #6366f1, #8b5cf6);
  color: #fff;
  border-radius: 4px;
}
.ep-deliv-row-value {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}
.ep-deliv-row-money {
  font-size: 14px;
  font-weight: 700;
  color: #047857;
  text-align: right;
  line-height: 1.1;
}
.ep-deliv-row-money span {
  display: block;
  font-size: 9px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .05em;
  color: #64748b;
  margin-top: 2px;
}
.ep-deliv-row-hrs {
  font-size: 11px;
  color: #475569;
  font-weight: 500;
}

/* DETAIL EXPAND */
.ep-deliv-row-detail {
  border-top: 1px solid #f1f5f9;
  padding: 12px 14px 14px;
  background: #fafafa;
}
.ep-deliv-detail-grid {
  display: grid;
  grid-template-columns: 2fr 1.5fr 1fr;
  gap: 14px;
  margin-bottom: 10px;
}
.ep-deliv-detail-col { min-width: 0; }
.ep-deliv-detail-lbl {
  font-size: 9px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .05em;
  color: #64748b;
  margin-bottom: 4px;
}
.ep-deliv-detail-val {
  font-size: 12px;
  color: #0f172a;
  line-height: 1.4;
}
.ep-deliv-detail-val--big {
  font-size: 18px;
  font-weight: 800;
  color: #047857;
}
.ep-deliv-detail-val em {
  color: #94a3b8;
  font-style: italic;
}
.ep-deliv-detail-actions {
  display: flex;
  justify-content: flex-end;
  gap: 6px;
}

/* ── Deliverables tab: scorecards (filter chips) ────────────── */
.ep-deliv-scorecards {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 8px;
  margin: 0;
}
.ep-deliv-sc {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
  padding: 12px 14px;
  background: #fff;
  border: 1px solid #e2e8f0;
  border-left: 3px solid var(--_sc-color, #94a3b8);
  border-radius: 10px;
  cursor: pointer;
  font-family: inherit;
  text-align: left;
  transition: all .12s ease;
}
.ep-deliv-sc:hover {
  border-color: var(--_sc-color, #94a3b8);
  transform: translateY(-1px);
  box-shadow: 0 4px 10px -3px rgba(15,23,42,.1);
}
.ep-deliv-sc.is-active {
  background: color-mix(in srgb, var(--_sc-color) 8%, #fff);
  border-color: var(--_sc-color, #94a3b8);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--_sc-color) 18%, transparent);
}
.ep-deliv-sc.is-empty {
  opacity: .5;
}
.ep-deliv-sc.is-empty:hover {
  opacity: 1;
}
.ep-deliv-sc-val {
  font-size: 22px;
  font-weight: 800;
  color: var(--_sc-color, #0f172a);
  letter-spacing: -.01em;
  line-height: 1;
}
.ep-deliv-sc-lbl {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .05em;
  color: #64748b;
}
.ep-deliv-sc.is-active .ep-deliv-sc-lbl { color: #0f172a; }

/* Sort bar above the list */
.ep-deliv-sortbar {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 6px 0;
  flex-wrap: wrap;
}
.ep-deliv-sortbar-lbl {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .05em;
  color: #64748b;
  margin-right: 4px;
}
.ep-deliv-sortbtn {
  padding: 4px 10px;
  font-size: 11px;
  font-weight: 600;
  font-family: inherit;
  border: 1px solid #e2e8f0;
  background: #fff;
  color: #475569;
  border-radius: 6px;
  cursor: pointer;
  transition: all .12s ease;
}
.ep-deliv-sortbtn:hover {
  background: #f8fafc;
  color: #0f172a;
}
.ep-deliv-sortbtn.is-active {
  background: #0f172a;
  color: #fff;
  border-color: #0f172a;
}
.ep-deliv-sortbar-count {
  margin-left: auto;
  font-size: 11px;
  color: #94a3b8;
  font-weight: 500;
}
.ep-deliv-empty--filtered {
  padding: 28px 20px;
}
.ep-deliv-inline-link {
  border: none;
  background: none;
  padding: 0;
  font: inherit;
  font-weight: 700;
  color: #0f766e;
  cursor: pointer;
  text-decoration: underline;
}

/* ── Deliverables controls toolbar (search + sort + Select) ──────────── */
.ep-deliv-toolbar {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  padding: 6px 0 2px;
  margin-bottom: 6px;
}
.ep-deliv-search-wrap {
  position: relative;
  display: flex;
  align-items: center;
  flex: 1 1 220px;
  min-width: 180px;
}
.ep-deliv-search-ico {
  position: absolute;
  left: 11px;
  color: #94a3b8;
  pointer-events: none;
}
.ep-deliv-search {
  width: 100%;
  padding: 8px 30px 8px 34px;
  font: inherit;
  font-size: 13px;
  color: #0f172a;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  background: #fff;
  transition: border-color .12s, box-shadow .12s;
}
.ep-deliv-search::placeholder { color: #94a3b8; }
.ep-deliv-search:focus {
  outline: none;
  border-color: #5eead4;
  box-shadow: 0 0 0 3px rgba(45, 212, 191, .18);
}
.ep-deliv-search-clear {
  position: absolute;
  right: 8px;
  width: 18px;
  height: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: none;
  border-radius: 50%;
  background: #e2e8f0;
  color: #475569;
  font-size: 14px;
  line-height: 1;
  cursor: pointer;
}
.ep-deliv-search-clear:hover { background: #cbd5e1; color: #0f172a; }
.ep-deliv-sort {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  flex-wrap: wrap;
}
.ep-deliv-sort-lbl {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .05em;
  color: #94a3b8;
  margin-right: 2px;
}
.ep-deliv-toolbtn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 12px;
  font: inherit;
  font-size: 12px;
  font-weight: 700;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  background: #fff;
  color: #475569;
  cursor: pointer;
  transition: all .12s ease;
}
.ep-deliv-toolbtn--select:hover {
  color: #15803d;
  border-color: #86efac;
  background: #f0fdf4;
}
.ep-deliv-toolbar-count {
  font-size: 11px;
  color: #94a3b8;
  font-weight: 600;
  white-space: nowrap;
}

/* ── Linked-task open button in modal ──────────────────────── */
.ep-deliv-modal-task-open {
  width: 24px;
  height: 24px;
  border: none;
  background: transparent;
  color: #94a3b8;
  cursor: pointer;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  opacity: 0;
  transition: opacity .12s, background .12s, color .12s;
}
.ep-deliv-modal-task:hover .ep-deliv-modal-task-open { opacity: 1; }
.ep-deliv-modal-task-open:hover { background: rgba(15,23,42,.08); color: #0f172a; }

/* ── "Mark delivered" pill on rows where all linked tasks are done ── */
.ep-deliv-row-mark-done {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 9px;
  font-size: 10px;
  font-weight: 700;
  font-family: inherit;
  background: linear-gradient(135deg, #10b981, #059669);
  color: #fff;
  border: none;
  border-radius: 999px;
  cursor: pointer;
  transition: all .12s ease;
  box-shadow: 0 1px 3px rgba(16, 185, 129, .35);
}
.ep-deliv-row-mark-done:hover {
  background: linear-gradient(135deg, #059669, #047857);
  box-shadow: 0 3px 8px -1px rgba(16, 185, 129, .5);
  transform: translateY(-1px);
}

/* Programs list: "Saved / yr" stat on program cards */
.prog-card-stat--value .prog-card-stat-v {
  color: #047857;
  font-weight: 800;
}

/* Reports tab: Value Delivered section */
.ep-report-section--value h3 {
  display: flex;
  align-items: center;
  gap: 6px;
}
.ep-report-section--value h3::before {
  content: '';
  width: 8px;
  height: 8px;
  background: #10b981;
  border-radius: 999px;
  display: inline-block;
}

/* ── Plan-grid: "Feeds N deliverables" chip ────────────────── */
.wk-pg-meta-feeds {
  display: inline-flex !important;
  align-items: center;
  gap: 4px;
  background: #faf5ff !important;
  color: #7c3aed !important;
  font-weight: 600;
  border: 1px solid #e9d5ff !important;
}

/* ── Deliverable rows: clickable hover affordance ──────────── */
.ep-deliv-row { cursor: pointer; }
.ep-deliv-row:hover { transform: translateY(-1px); }
.ep-deliv-row-arrow {
  color: #cbd5e1;
  flex-shrink: 0;
  transition: color .12s, transform .12s;
}
.ep-deliv-row:hover .ep-deliv-row-arrow {
  color: #10b981;
  transform: translateX(2px);
}
.ep-deliv-row-linked {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  color: #0d9488;
  font-weight: 600;
}
.ep-deliv-row-chip-wrap {
  /* Stops chip click from bubbling into the row click. */
}

/* ── Deliverable Modal ─────────────────────────────────────── */
.ep-deliv-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, .55);
  backdrop-filter: blur(2px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  animation: epDelivFade .15s ease;
  /* Force above the engagement profile (12000), edit overlay (~70000),
     drawers (65000), Miles FAB stack, and tooltips. Pairs with the inline
     z-index in engagement-profile.js _showDeliverableModal. */
  z-index: 300000 !important;
}
@keyframes epDelivFade { from { opacity: 0 } to { opacity: 1 } }

.ep-deliv-modal {
  background: #fff;
  border-radius: 16px;
  box-shadow: 0 25px 60px -12px rgba(15, 23, 42, .4);
  width: 100%;
  max-width: 720px;
  max-height: calc(100vh - 40px);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  animation: epDelivPopIn .2s cubic-bezier(.16,.84,.44,1);
}
@keyframes epDelivPopIn {
  from { opacity: 0; transform: translateY(8px) scale(.97); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.ep-deliv-modal-head {
  display: flex;
  align-items: center;
  padding: 14px 18px;
  border-bottom: 1px solid #f1f5f9;
  background: linear-gradient(135deg, #ecfdf5, #f0fdfa);
}
.ep-deliv-modal-title {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 1;
  font-size: 14px;
  font-weight: 700;
  color: #064e3b;
}
.ep-deliv-modal-title svg { color: #10b981; }
.ep-deliv-modal-close {
  width: 28px;
  height: 28px;
  border: none;
  background: transparent;
  color: #64748b;
  cursor: pointer;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.ep-deliv-modal-close:hover { background: rgba(15,23,42,.06); color: #0f172a; }

/* Tabs strip — sits directly under the head so the body only shows one
   section at a time. Each tab can carry a small badge ("$X/yr", "3", or
   "optional"). */
/* ── Deliverable top: front cover + the facts strip ────────
   Sits between the header and the tabs, so it holds on every tab. The cover is
   the uploaded screenshot; the strip is the same set of figures the reports
   quote. Wraps on narrow widths rather than scrolling sideways. */
.ep-deliv-top {
  display: flex; align-items: stretch; gap: 14px;
  padding: 12px 14px; background: #fbfdff;
  border-bottom: 1px solid #e2e8f0; flex-shrink: 0;
  font-family: inherit;
}
.ep-deliv-top-cover { flex: 0 0 auto; }
.ep-deliv-cover { position: relative; width: 108px; }
.ep-deliv-cover-btn {
  display: block; width: 108px; height: 76px; padding: 0; cursor: zoom-in;
  border: 1px solid #cbd5e1; border-radius: 9px; overflow: hidden; background: #f1f5f9;
  box-shadow: 0 1px 3px rgba(15, 23, 42, .12);
  transition: transform .18s cubic-bezier(.22,1,.36,1), box-shadow .18s;
}
.ep-deliv-cover-btn:hover { transform: translateY(-1px); box-shadow: 0 6px 16px rgba(15, 23, 42, .18); }
.ep-deliv-cover-btn img { width: 100%; height: 100%; object-fit: cover; display: block; }
.ep-deliv-cover-acts { display: flex; gap: 6px; margin-top: 5px; }
.ep-deliv-cover-act {
  flex: 1; border: 1px solid #e2e8f0; background: #fff; cursor: pointer;
  border-radius: 6px; padding: 3px 0; font: inherit; font-size: 10.5px; font-weight: 700;
  color: #475569;
}
.ep-deliv-cover-act:hover { background: #f1f5f9; color: #0f172a; }
.ep-deliv-cover-act.is-rm:hover { background: #fef2f2; border-color: #fecaca; color: #b91c1c; }
.ep-deliv-cover-empty {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 5px;
  width: 108px; height: 76px; cursor: pointer;
  border: 1.5px dashed #cbd5e1; border-radius: 9px; background: #fff;
  font: inherit; font-size: 10.5px; font-weight: 700; color: #64748b; text-align: center;
  transition: border-color .15s, color .15s, background .15s;
}
.ep-deliv-cover-empty:hover { border-color: #6366f1; color: #4338ca; background: #f5f3ff; }
.ep-deliv-cover-empty svg { width: 19px; height: 19px; }
.ep-deliv-cover-empty.is-busy { cursor: default; border-style: solid; }
.ep-deliv-cover-spin {
  width: 15px; height: 15px; border-radius: 50%;
  border: 2px solid #e2e8f0; border-top-color: #6366f1;
  animation: epDelivCoverSpin .7s linear infinite;
}
@keyframes epDelivCoverSpin { to { transform: rotate(360deg); } }

.ep-deliv-top-stats {
  flex: 1; min-width: 0;
  display: flex; flex-wrap: wrap; align-content: center; gap: 10px 20px;
}
/* align-items + text-align are pinned rather than inherited: this strip is
   dropped inside popups whose own alignment differs, and a facts row that
   right-aligns half its labels reads as broken. */
.ep-deliv-stat {
  display: flex; flex-direction: column; align-items: flex-start;
  gap: 1px; min-width: 0; text-align: left;
}
.ep-deliv-stat-k {
  font-size: 9.5px; font-weight: 800; letter-spacing: .07em; text-transform: uppercase;
  color: #94a3b8; line-height: 1.4; white-space: nowrap;
}
.ep-deliv-stat-v {
  font-size: 12.5px; font-weight: 700; color: #0f172a; line-height: 1.5;
  display: flex; align-items: center; gap: 4px; min-width: 0;
}
/* The owner face/name arrives as the shared rail value span; strip the rail's
   own box so it sits on this row like every other stat. */
.ep-deliv-stat-v .gd-sb-field-value { padding: 0; background: none; border: 0; font: inherit; color: inherit; }
.ep-deliv-stat.is-late .ep-deliv-stat-v { color: #dc2626; }
.ep-deliv-stat-stage {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 1px 9px 1px 7px; border-radius: 999px;
  background: #eef2ff; color: #4338ca; font-size: 11.5px; font-weight: 800;
}
.ep-deliv-stat-stage::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.ep-deliv-stat-stage[data-stage="delivered"] { background: #ecfdf5; color: #047857; }
.ep-deliv-stat-stage[data-stage="accepted"]  { background: #f0fdf4; color: #15803d; }
.ep-deliv-stat-stage[data-stage="in_progress"] { background: #fffbeb; color: #b45309; }
@media (max-width: 620px) {
  .ep-deliv-top { flex-wrap: wrap; gap: 10px; }
  .ep-deliv-top-stats { gap: 8px 16px; }
}

.ep-deliv-modal-tabs {
  display: flex !important;
  gap: 4px;
  padding: 8px 14px 0;
  border-bottom: 1px solid #e2e8f0;
  background: #ffffff;
  flex-shrink: 0;
  font-family: inherit;
}
.ep-deliv-modal .ep-deliv-modal-tab {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 9px 14px;
  margin: 0 0 -1px 0;
  border: 1px solid transparent;
  border-bottom: none;
  background: transparent;
  color: #64748b;
  font-size: 13px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  border-radius: 9px 9px 0 0;
  transition: color .15s ease, background .15s ease, border-color .15s ease;
  line-height: 1.2;
  outline: none;
  white-space: nowrap;
}
.ep-deliv-modal .ep-deliv-modal-tab:focus-visible {
  box-shadow: 0 0 0 2px rgba(16,185,129,.35);
}
.ep-deliv-modal-tab:hover { color: #0f172a; background: #f8fafc; }
.ep-deliv-modal-tab.is-active {
  color: #047857;
  background: #ffffff;
  border-color: #e2e8f0;
  border-bottom-color: #ffffff;
}
.ep-deliv-modal-tab-badge {
  display: inline-flex;
  align-items: center;
  height: 18px;
  padding: 0 7px;
  border-radius: 10px;
  background: #10b981;
  color: #ffffff;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .01em;
}
.ep-deliv-modal-tab-badge--ghost {
  background: transparent;
  color: #94a3b8;
  border: 1px solid #e2e8f0;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: .06em;
  font-size: 10px;
}
.ep-deliv-modal-tab-help {
  font-size: 12.5px;
  color: #64748b;
  line-height: 1.5;
  margin-bottom: 14px;
  padding: 10px 12px;
  background: #f8fafc;
  border-radius: 8px;
  border-left: 3px solid #10b981;
}
.ep-deliv-modal-tab-help .ep-deliv-modal-section-summary {
  display: block;
  margin-top: 4px;
  font-weight: 600;
  color: #0f172a;
}
/* Sections start with the section-head removed since the tab IS the label
   now — but keep the rule scoped so the legacy unsectioned layout (if any
   caller still uses it) doesn't break. */
[data-deliv-pane] > .ep-deliv-modal-section-head { display: none; }

.ep-deliv-modal-ai {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 6px 12px;
  margin-right: 8px;
  font-size: 11px;
  font-weight: 700;
  font-family: inherit;
  background: linear-gradient(135deg, #6366f1, #8b5cf6);
  color: #fff;
  border: none;
  border-radius: 7px;
  cursor: pointer;
  transition: all .12s ease;
  box-shadow: 0 1px 3px rgba(99,102,241,.3);
}
.ep-deliv-modal-ai:hover {
  background: linear-gradient(135deg, #4f46e5, #7c3aed);
  box-shadow: 0 2px 8px -1px rgba(99,102,241,.5);
  transform: translateY(-1px);
}

/* AI Enhance banner inside modal */
.ep-deliv-enh-banner {
  margin: 0;
  padding: 12px 18px;
  border-bottom: 1px solid #f1f5f9;
  font-size: 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.ep-deliv-enh-banner--loading {
  background: linear-gradient(135deg, #eef2ff, #e0e7ff);
  color: #4338ca;
  flex-direction: row;
  align-items: center;
}
.ep-deliv-enh-banner--error {
  background: #fef2f2;
  color: #b91c1c;
  flex-direction: row;
  align-items: center;
  justify-content: space-between;
}
.ep-deliv-enh-banner--empty {
  background: #f0fdf4;
  color: #166534;
  flex-direction: row;
  align-items: center;
  gap: 8px;
}
.ep-deliv-enh-banner--ready {
  background: linear-gradient(135deg, #faf5ff, #f3e8ff);
  border-left: 3px solid #8b5cf6;
}
.ep-deliv-enh-banner button {
  margin-left: auto;
  padding: 4px 10px;
  font-size: 11px;
  font-weight: 600;
  font-family: inherit;
  border: 1px solid currentColor;
  background: transparent;
  color: inherit;
  border-radius: 6px;
  cursor: pointer;
  opacity: .7;
}
.ep-deliv-enh-banner button:hover { opacity: 1; }
.ep-deliv-enh-spin { animation: epDelivSpin 1.2s linear infinite; }
@keyframes epDelivSpin { to { transform: rotate(360deg); } }

.ep-deliv-enh-head {
  display: flex;
  align-items: center;
  gap: 7px;
  font-weight: 700;
  color: #4c1d95;
}
.ep-deliv-enh-dismiss {
  width: 22px;
  height: 22px;
  margin-left: auto;
  padding: 0;
  border: none !important;
  background: transparent;
  color: #64748b;
  font-size: 16px;
  line-height: 1;
  cursor: pointer;
  opacity: .5 !important;
  border-radius: 4px;
}
.ep-deliv-enh-dismiss:hover { opacity: 1 !important; background: rgba(15,23,42,.06); }
.ep-deliv-enh-pieces {
  display: flex;
  flex-direction: column;
  gap: 4px;
  color: #1e293b;
}
.ep-deliv-enh-piece strong { color: #4c1d95; }
.ep-deliv-enh-why {
  font-size: 11px;
  font-style: italic;
  color: #6b7280;
  padding-top: 2px;
  border-top: 1px dashed rgba(139, 92, 246, .25);
}
.ep-deliv-enh-actions {
  display: flex;
  justify-content: flex-end;
  gap: 6px;
  margin-top: 4px;
}
.ep-deliv-enh-actions button {
  margin-left: 0;
  border: 1px solid transparent;
  opacity: 1;
}

.ep-deliv-modal-body {
  flex: 1;
  overflow-y: auto;
  padding: 16px 18px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.ep-deliv-modal-section {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
/* The native `hidden` attribute is `display:none` by default, but the rule
   above sets `display:flex` which overrides it. Restore the expected
   hide behavior so inactive tab panes actually hide. */
.ep-deliv-modal-section[hidden],
[data-deliv-pane][hidden] {
  display: none !important;
}
.ep-deliv-modal-section--value {
  background: linear-gradient(135deg, #ecfdf5, #f0fdfa);
  border: 1px solid #99f6e4;
  border-radius: 12px;
  padding: 14px;
}
.ep-deliv-modal-section-head {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .05em;
  color: #475569;
}
.ep-deliv-modal-section-head svg { color: #10b981; }
.ep-deliv-modal-section-summary {
  margin-left: auto;
  font-size: 11px;
  font-weight: 600;
  color: #0f766e;
  text-transform: none;
  letter-spacing: 0;
}
.ep-deliv-modal-meta-empty {
  font-style: italic;
  color: #94a3b8;
}

.ep-deliv-modal-field {
  display: flex;
  flex-direction: column;
  gap: 4px;
  flex: 1;
  min-width: 0;
}
.ep-deliv-modal-lbl {
  font-size: 11px;
  font-weight: 600;
  color: #475569;
}
.ep-deliv-modal-field input,
.ep-deliv-modal-field select,
.ep-deliv-modal-field textarea {
  padding: 8px 10px;
  font-size: 13px;
  font-family: inherit;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  background: #fff;
  color: #0f172a;
  outline: none;
  transition: border-color .12s, box-shadow .12s;
}
.ep-deliv-modal-field input:focus,
.ep-deliv-modal-field select:focus,
.ep-deliv-modal-field textarea:focus {
  border-color: #10b981;
  box-shadow: 0 0 0 3px rgba(16,185,129,.15);
}
.ep-deliv-modal-field textarea { resize: vertical; }

.ep-deliv-modal-row {
  display: flex;
  gap: 10px;
}
.ep-deliv-modal-q-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}
/* Advanced (people/rate/other wins/notes) — collapsed by default so creating
   a deliverable stays a three-question task. Mirrors .wk-vt-adv in the popover. */
.ep-deliv-adv-toggle {
  display: flex;
  align-items: center;
  gap: 6px;
  width: 100%;
  margin-top: 12px;
  padding: 6px 0;
  border: none;
  background: transparent;
  font-family: inherit;
  font-size: 12px;
  font-weight: 600;
  color: #475569;
  cursor: pointer;
  text-align: left;
}
.ep-deliv-adv-toggle:hover { color: #0f172a; }
/* "Estimate from the work" — small inline AI button on the Time-saved tab */
.ep-deliv-vt-estimate {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  margin-left: 4px;
  padding: 3px 9px;
  border: 1px solid #c7d2fe;
  border-radius: 999px;
  background: #eef2ff;
  color: #4338ca;
  font-family: inherit;
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  vertical-align: middle;
  transition: background .12s, border-color .12s;
}
.ep-deliv-vt-estimate:hover { background: #e0e7ff; border-color: #a5b4fc; }
.ep-deliv-vt-estimate:disabled { opacity: .6; cursor: default; }

/* ── Draft-with-AI prompt box (overlays the deliverable modal) ── */
.ep-deliv-draft-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: rgba(15, 23, 42, .45);
  backdrop-filter: blur(2px);
  z-index: 5;
  border-radius: inherit;
}
.ep-deliv-draft-card {
  width: 100%;
  max-width: 460px;
  background: #fff;
  border-radius: 14px;
  box-shadow: 0 24px 60px rgba(15, 23, 42, .35);
  padding: 18px 18px 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.ep-deliv-draft-head {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  font-weight: 700;
  color: #4338ca;
}
.ep-deliv-draft-head span { flex: 1; }
.ep-deliv-draft-x {
  border: none;
  background: transparent;
  font-size: 20px;
  line-height: 1;
  color: #94a3b8;
  cursor: pointer;
  padding: 0 2px;
}
.ep-deliv-draft-x:hover { color: #0f172a; }
.ep-deliv-draft-sub {
  font-size: 12.5px;
  line-height: 1.5;
  color: #475569;
}
.ep-deliv-draft-input {
  width: 100%;
  box-sizing: border-box;
  resize: vertical;
  min-height: 92px;
  padding: 10px 12px;
  border: 1px solid #cbd5e1;
  border-radius: 10px;
  font-family: inherit;
  font-size: 13px;
  line-height: 1.5;
  color: #0f172a;
}
.ep-deliv-draft-input:focus {
  outline: none;
  border-color: #818cf8;
  box-shadow: 0 0 0 3px rgba(129, 140, 248, .25);
}
.ep-deliv-draft-err {
  font-size: 12px;
  color: #b91c1c;
  background: #fef2f2;
  border: 1px solid #fecaca;
  border-radius: 8px;
  padding: 6px 10px;
}
.ep-deliv-draft-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: 2px;
}
.ep-deliv-draft-status {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 11.5px;
  font-weight: 600;
  color: #4338ca;
}
.ep-deliv-draft-status--muted { color: #94a3b8; font-weight: 500; }
.ep-deliv-draft-foot-right { display: flex; gap: 8px; }
.ep-deliv-adv {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding-top: 10px;
  margin-bottom: 4px;
  border-top: 1px solid #f1f5f9;
}

/* ── Impact category picker (chips + revealed field blocks) ── */
.ep-deliv-cat-picker-lbl {
  font-size: 12px;
  font-weight: 700;
  color: #475569;
  margin-top: 4px;
}
.ep-deliv-cat-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.ep-deliv-cat-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 600;
  color: #475569;
  padding: 5px 11px;
  border-radius: 999px;
  border: 1px solid #e2e8f0;
  background: #fff;
  cursor: pointer;
  transition: border-color .12s, background .12s, color .12s;
}
.ep-deliv-cat-chip:hover { border-color: #cbd5e1; }
.ep-deliv-cat-chip .ep-deliv-cat-dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: #cbd5e1;
  transition: background .12s;
}
.ep-deliv-cat-chip.is-on {
  color: var(--cat, #0d9488);
  border-color: color-mix(in srgb, var(--cat, #0d9488) 35%, #fff);
  background: color-mix(in srgb, var(--cat, #0d9488) 8%, #fff);
}
.ep-deliv-cat-chip.is-on .ep-deliv-cat-dot { background: var(--cat, #0d9488); }
.ep-deliv-cat-block {
  border: 1px solid #eef2f7;
  border-left: 3px solid var(--cat, #0d9488);
  border-radius: 8px;
  padding: 10px 12px;
  background: #fbfdff;
}
.ep-deliv-cat-block-head {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .03em;
  color: var(--cat, #0d9488);
  margin-bottom: 8px;
}
.ep-deliv-cat-block-head span {
  font-weight: 500;
  text-transform: none;
  letter-spacing: 0;
  color: #94a3b8;
}
.ep-deliv-modal-lbl-suffix { color: #94a3b8; font-weight: 500; }

/* ── AI impact estimator buttons ── */
.ep-deliv-impact-ai {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin: 4px 0 12px;
}
.ep-deliv-impact-ai-btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 13px;
  font-weight: 700;
  color: #4f46e5;
  padding: 8px 14px;
  border-radius: 9px;
  border: 1px solid #c7d2fe;
  background: linear-gradient(180deg, #fff, #f5f3ff);
  cursor: pointer;
  transition: border-color .12s, background .12s, box-shadow .12s;
}
.ep-deliv-impact-ai-btn:hover:not(:disabled) {
  border-color: #a5b4fc;
  box-shadow: 0 2px 8px rgba(79,70,229,.12);
}
.ep-deliv-impact-ai-btn:disabled { opacity: .65; cursor: default; }
.ep-deliv-impact-ai-hint { font-size: 11.5px; color: #94a3b8; flex: 1 1 180px; min-width: 160px; }

.ep-deliv-cat-block-head { display: flex; align-items: center; gap: 8px; }
.ep-deliv-cat-block-title { flex: 1; }
.ep-deliv-cat-ai {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  flex: 0 0 auto;
  font-size: 11px;
  font-weight: 700;
  color: #4f46e5;
  padding: 3px 8px;
  border-radius: 7px;
  border: 1px solid #c7d2fe;
  background: #f5f3ff;
  cursor: pointer;
  transition: border-color .12s, background .12s;
}
.ep-deliv-cat-ai:hover:not(:disabled) { border-color: #a5b4fc; background: #ede9fe; }
.ep-deliv-cat-ai:disabled { opacity: .65; cursor: default; }
.ep-deliv-modal-inline {
  display: flex;
  align-items: center;
  gap: 6px;
}
.ep-deliv-modal-inline span {
  font-size: 12px;
  color: #64748b;
}
.ep-deliv-modal-num {
  width: 70px;
  flex-shrink: 0;
}
.ep-deliv-modal-with-unit {
  display: flex;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  overflow: hidden;
  background: #fff;
  transition: border-color .12s, box-shadow .12s;
}
.ep-deliv-modal-with-unit:focus-within {
  border-color: #10b981;
  box-shadow: 0 0 0 3px rgba(16,185,129,.15);
}
.ep-deliv-modal-with-unit input {
  flex: 1;
  border: none;
  border-radius: 0;
  padding: 8px 10px;
  font-size: 13px;
  outline: none;
  background: transparent;
}
.ep-deliv-modal-with-unit span {
  display: flex;
  align-items: center;
  padding: 0 12px;
  font-size: 12px;
  font-weight: 600;
  color: #64748b;
  background: #f8fafc;
  border-left: 1px solid #e2e8f0;
}

.ep-deliv-modal-preview {
  display: flex;
  gap: 12px;
  padding-top: 10px;
  margin-top: 4px;
  border-top: 1px dashed rgba(15, 118, 110, .3);
}
.ep-deliv-modal-preview-cell { flex: 1; }
.ep-deliv-modal-preview-cell--money { text-align: right; }
.ep-deliv-modal-preview-val {
  font-size: 22px;
  font-weight: 800;
  color: #0f172a;
  letter-spacing: -.01em;
  line-height: 1.1;
}
.ep-deliv-modal-preview-cell--money .ep-deliv-modal-preview-val { color: #047857; }
.ep-deliv-modal-preview-lbl {
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .05em;
  color: #475569;
  margin-top: 3px;
}

/* Linked-tasks list */
.ep-deliv-modal-search {
  width: 100%;
  padding: 8px 10px;
  font-size: 13px;
  font-family: inherit;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  background: #fff;
  outline: none;
}
.ep-deliv-modal-search:focus {
  border-color: #10b981;
  box-shadow: 0 0 0 3px rgba(16,185,129,.15);
}
.ep-deliv-modal-task-list {
  max-height: 260px;
  overflow-y: auto;
  border: 1px solid #f1f5f9;
  border-radius: 10px;
  background: #fafafa;
  padding: 4px;
}
.ep-deliv-modal-empty-list {
  padding: 16px;
  text-align: center;
  font-size: 12px;
  color: #94a3b8;
}
.ep-deliv-modal-task {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  padding: 8px 10px;
  border-radius: 8px;
  cursor: pointer;
  transition: background .12s;
}
.ep-deliv-modal-task:hover { background: #fff; }
.ep-deliv-modal-task.is-checked { background: #ecfdf5; }
.ep-deliv-modal-task input[type="checkbox"] {
  margin-top: 2px;
  accent-color: #10b981;
  cursor: pointer;
  flex-shrink: 0;
}
.ep-deliv-modal-task-body {
  flex: 1;
  min-width: 0;
}
.ep-deliv-modal-task-name {
  font-size: 13px;
  font-weight: 500;
  color: #0f172a;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.ep-deliv-modal-task-meta {
  font-size: 11px;
  color: #64748b;
  margin-top: 2px;
}

.ep-deliv-modal-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 18px;
  border-top: 1px solid #f1f5f9;
  background: #fafafa;
}
.ep-deliv-modal-foot-right {
  display: flex;
  gap: 8px;
}
.ep-deliv-btn--danger {
  background: #fff;
  color: #dc2626;
  border: 1px solid #fecaca;
}
.ep-deliv-btn--danger:hover { background: #fef2f2; border-color: #f87171; }

/* The deliverable ⋯ menu is the shared WkRecordMenu (wk-record-menu.js,
   which injects its own .wk-rmenu styles). This file used to hold a second
   copy of those rules for this one modal — one menu, one stylesheet. */

@media (max-width: 720px) {
  .ep-value-card-grid { grid-template-columns: repeat(2, 1fr); }
  .wk-vt-grid { grid-template-columns: 1fr 1fr; }
  .wk-vt-grid--2 { grid-template-columns: 1fr; }
  .ep-deliverable-row { flex-direction: column; align-items: stretch; }
  .ep-deliverable-value { justify-content: space-between; margin-top: 6px; }
  .ep-deliv-header { flex-direction: column; align-items: stretch; }
  .ep-deliv-row-main { flex-wrap: wrap; }
  .ep-deliv-row-value { width: 100%; justify-content: space-between; padding-left: 0; }
  .ep-deliv-modal-row { flex-direction: column; }
  .ep-deliv-modal-q-grid { grid-template-columns: 1fr; }
}
