/* ═══════════════════════════════════════════════════════════════════════
   Backlog Prioritization (Web Shop) — layout, tables, scoring, framework
   ═══════════════════════════════════════════════════════════════════════ */

/* ─── Light mode ───
   Applied as .bp-light on #bp-app (and on body-level bp elements like
   toasts/dialogs). Overrides the app's design tokens; everything below
   reads colors through var(), so the whole app follows. */
.bp-light {
  --bg:       #f6f8fa;
  --surface:  #ffffff;
  --surface2: #f2f4f7;
  --surface3: #e8ebf1;
  --border:   #d8dee6;
  --border2:  #bfc9d4;
  --text:     #1f2530;
  --text2:    #57606a;
  --text3:    #7d8794;
  --success:  #1a7f37;
  --warn:     #9a6700;
  --danger:   #cf222e;
  --dep-line: #8b95a3;    /* dependency brackets: grey on light */
}
.bp-light .bp-link { color: #0969da; }
.bp-light .bp-badge-blue { background: rgba(9, 105, 218, 0.12); color: #0969da; }
.bp-light .bp-badge-green { background: rgba(26, 127, 55, 0.12); }
.bp-light .bp-badge-amber { background: rgba(154, 103, 0, 0.12); }
.bp-light .bp-badge-red { background: rgba(207, 34, 46, 0.1); }
.bp-light .bp-matrix-basis { background: rgba(9, 105, 218, 0.06); }
.bp-light .bp-ctx { box-shadow: 0 8px 24px rgba(31, 37, 48, 0.18); }
.bp-light .bp-modal-overlay, .bp-modal-overlay.bp-light { background: rgba(31, 37, 48, 0.4); }

/* ─── App shell ─── */
#bp-app {
  position: fixed;
  inset: 0;
  display: flex;
  background: var(--bg);
  color: var(--text);
  z-index: 100;
}

.bp-sidebar {
  width: 230px;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  background: var(--surface);
  border-right: 1px solid var(--border);
}

.bp-workspace {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 16px 14px;
  border-bottom: 1px solid var(--border);
}

.bp-workspace-logo {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background: var(--accent);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
}

.bp-workspace-name { font-weight: 600; font-size: 14px; }
.bp-ws-select {
  appearance: none;
  -webkit-appearance: none;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--text);
  font-weight: 600;
  font-size: 14px;
  font-family: inherit;
  padding: 3px 22px 3px 8px;
  cursor: pointer;
  max-width: 150px;
  /* chevron so it clearly reads as a switcher */
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'%3E%3Cpath d='M1 1l4 4 4-4' fill='none' stroke='%238b949e' stroke-width='1.5'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 7px center;
}
.bp-ws-select:hover { border-color: var(--accent); }
.bp-ws-select:focus { outline: none; border-color: var(--accent); }
.bp-ws-select option { background: var(--surface); color: var(--text); }
/* Line the subtitle up with the select's text (8px padding + 1px border) */
.bp-ws-select + div { padding-left: 9px; margin-top: 2px; }

.bp-nav { flex: 1; padding: 10px 8px; display: flex; flex-direction: column; gap: 2px; }

.bp-nav-item {
  display: block;
  width: 100%;
  text-align: left;
  padding: 8px 12px;
  border: none;
  border-radius: var(--radius);
  background: transparent;
  color: var(--text2);
  font-size: 13px;
  cursor: pointer;
}
.bp-nav-item:hover { background: var(--surface2); color: var(--text); }
.bp-nav-active { background: var(--surface3); color: var(--text); font-weight: 600; }
/* Section headings group the pages; Priorities sits under Backlog */
.bp-nav-section {
  padding: 14px 12px 4px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.7px;
  text-transform: uppercase;
  color: var(--text3);
}
.bp-nav > .bp-nav-section:first-child { padding-top: 4px; }
.bp-nav-child { padding-left: 26px; font-size: 12.5px; }

.bp-sidebar-footer { padding: 12px 8px; border-top: 1px solid var(--border); }
.bp-user { padding: 4px 12px 10px; }
.bp-user-name { font-size: 13px; font-weight: 600; }

.bp-main {
  flex: 1;
  overflow-y: auto;
  padding: 24px 28px 60px;
}

.bp-loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  min-height: 60vh;
  color: var(--text2);
}

/* ─── Typography / helpers ─── */
.bp-main h1 { font-size: 20px; font-weight: 700; margin: 4px 0; }
.bp-main h2 { font-size: 14px; font-weight: 600; }
.bp-muted { color: var(--text2); }
.bp-small { font-size: 12px; }
.bp-strong { font-weight: 600; color: var(--text); }
.bp-num { text-align: right; font-variant-numeric: tabular-nums; }
.bp-link {
  background: none; border: none; padding: 0;
  color: #58a6ff; cursor: pointer; font-size: 13px; text-decoration: none;
}
.bp-link:hover { text-decoration: underline; }

.bp-page-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
}
.bp-header-meta { display: flex; align-items: center; gap: 8px; margin-top: 6px; flex-wrap: wrap; }
.bp-header-actions { display: flex; gap: 8px; flex-shrink: 0; }

/* ─── View-only accounts: hide write controls (clicks are also blocked in JS) ─── */
.bp-readonly [data-action="new-feature"],
.bp-readonly [data-action="toggle-edit-mode"],
.bp-readonly [data-action="edit-feature"],
.bp-readonly [data-action="archive-feature"],
.bp-readonly [data-action="delete-feature"],
.bp-readonly [data-action="bulk-delete"],
.bp-readonly [data-action="save-all-scores"],
.bp-readonly [data-action="edit-other-score"],
.bp-readonly [data-action="delete-other-score"],
.bp-readonly [data-action="create-draft"],
.bp-readonly [data-action="discard-draft"],
.bp-readonly [data-action="preview-publish"],
.bp-readonly [data-action="add-criterion"],
.bp-readonly [data-action="toggle-add-menu"],
.bp-readonly [data-action="roadmap-undo"],
.bp-readonly [data-action="roadmap-redo"],
.bp-readonly [data-action="new-roadmap-event"] { display: none !important; }
.bp-readonly .bp-score-btn { pointer-events: none; opacity: 0.55; }
.bp-readonly .bp-gantt-rsz-l, .bp-readonly .bp-gantt-rsz-r { display: none; }

/* ─── Presence avatars: who's viewing this page ─── */
.bp-presence { display: flex; align-items: center; margin-right: 4px; }
/* Sitting directly in a header, they'd be spread to the middle by
   space-between — pin them to the right, beside the header's button */
.bp-page-header > .bp-presence { margin-left: auto; }
.bp-presence-av {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.3px;
  border: 2px solid var(--surface);
  box-sizing: border-box;
  margin-left: -7px;
  cursor: default;
  user-select: none;
}
.bp-presence-av:first-child { margin-left: 0; }

/* ─── Buttons ─── */
.bp-btn {
  padding: 7px 14px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--surface2);
  color: var(--text);
  font-size: 13px;
  cursor: pointer;
  white-space: nowrap;
}
.bp-btn:hover { border-color: var(--border2); }
.bp-btn:disabled { opacity: 0.45; cursor: not-allowed; }
.bp-btn-primary { background: var(--accent2); border-color: var(--accent2); color: #fff; }
.bp-btn-primary:hover:not(:disabled) { background: var(--accent); border-color: var(--accent); }
.bp-btn-ghost { background: transparent; }
.bp-btn-danger-ghost { background: transparent; color: var(--danger); border-color: var(--border); }
.bp-btn-danger { background: var(--danger); border-color: var(--danger); color: #fff; }
.bp-btn-danger:hover { background: #ff6b64; border-color: #ff6b64; }
.bp-btn-sm { padding: 3px 8px; font-size: 12px; }
.bp-btn-icon { font-size: 21px; line-height: 1; padding: 3px 12px 5px; }
.bp-btn-block { display: block; width: 100%; margin-top: 14px; }
.bp-icon-btn {
  background: none; border: none; color: var(--text2);
  cursor: pointer; padding: 2px 6px; border-radius: 4px; font-size: 13px;
}
.bp-icon-btn:hover:not(:disabled) { background: var(--surface3); color: var(--text); }
.bp-icon-btn:disabled { opacity: 0.3; cursor: default; }

/* ─── Inputs ─── */
.bp-input, .bp-select {
  padding: 7px 10px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--surface2);
  color: var(--text);
  font-size: 13px;
  font-family: inherit;
}
.bp-input:focus, .bp-select:focus { outline: none; border-color: var(--accent); }
textarea.bp-input { resize: vertical; }

/* ─── Rich-text editor (feature description) ─── */
.bp-rt {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface2);
  overflow: hidden;
}
.bp-rt:focus-within { border-color: var(--accent); }
.bp-rt-toolbar {
  display: flex;
  align-items: center;
  gap: 2px;
  padding: 4px 6px;
  border-bottom: 1px solid var(--border);
  background: var(--surface3);
  flex-wrap: wrap;
}
.bp-rt-btn {
  border: none;
  background: transparent;
  color: var(--text2);
  font-family: inherit;
  font-size: 12px;
  line-height: 1;
  min-width: 24px;
  padding: 5px 6px;
  border-radius: 5px;
  cursor: pointer;
}
.bp-rt-btn:hover { background: var(--surface); color: var(--text); }
.bp-rt-sep { width: 1px; height: 16px; background: var(--border2); margin: 0 3px; }
.bp-rt-editor {
  min-height: 62px;
  max-height: 260px;
  overflow-y: auto;
  padding: 8px 10px;
  font-size: 13px;
  line-height: 1.5;
  color: var(--text);
  outline: none;
}
.bp-rt-editor:empty::before {
  content: attr(data-placeholder);
  color: var(--text3);
}
.bp-rt-editor a, .bp-rich a { color: var(--accent); text-decoration: underline; }
.bp-rt-editor ul, .bp-rt-editor ol, .bp-rich ul, .bp-rich ol { margin: 4px 0; padding-left: 22px; }
.bp-rt-editor p, .bp-rich p { margin: 0 0 6px; }
.bp-rt-editor p:last-child, .bp-rich p:last-child { margin-bottom: 0; }
/* Formatted descriptions on the feature page */
.bp-rich { line-height: 1.6; }
.bp-rich code {
  background: var(--surface3);
  padding: 1px 5px;
  border-radius: 4px;
  font-size: 12px;
}
/* Starts one row tall and grows with its content (height set in JS) */
textarea.bp-autogrow {
  resize: none;
  overflow-y: auto;      /* only scrolls once it reaches max-height */
  line-height: 1.45;
  box-sizing: border-box;
  max-height: 220px;
}

/* ─── KPI cards ─── */
.bp-kpi-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 12px;
  margin-bottom: 18px;
}
.bp-kpi {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 14px 16px;
}
.bp-kpi-value { font-size: 24px; font-weight: 700; }
.bp-kpi-label { font-size: 11px; color: var(--text2); text-transform: uppercase; letter-spacing: 0.4px; margin-top: 2px; }
.bp-kpi-green .bp-kpi-value { color: var(--success); }
.bp-kpi-red .bp-kpi-value { color: var(--danger); }

/* ─── Panels ─── */
.bp-panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 16px 18px;
  margin-bottom: 16px;
}
.bp-panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}
.bp-dash-grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  gap: 16px;
  align-items: start;
}
.bp-dash-grid .bp-panel { margin-bottom: 0; }
.bp-dash-grid .bp-panel:first-child { grid-row: span 2; }

/* ─── Tables ─── */
.bp-table-wrap { overflow-x: auto; position: relative; }
.bp-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.bp-table th {
  text-align: left;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.4px;
  color: var(--text2);
  font-weight: 600;
  padding: 8px 10px;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}
.bp-table th.bp-num { text-align: right; }
.bp-table td { padding: 9px 10px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.bp-table tbody tr:last-child td { border-bottom: none; }
.bp-sortable { cursor: pointer; user-select: none; }
.bp-info {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 14px; height: 14px;
  border-radius: 50%;
  border: 1px solid var(--border2);
  color: var(--text2);
  font-size: 9px;
  font-style: italic;
  font-family: Georgia, serif;
  cursor: help;
  vertical-align: middle;
  text-transform: none;
}
.bp-info:hover { border-color: var(--accent); color: var(--text); }
.bp-sortable:hover { color: var(--text); }
.bp-row-link { cursor: pointer; }
.bp-table tbody .bp-row-link:hover td { background: var(--surface2); }
.bp-row-inactive td { opacity: 0.5; }

/* Divider between descriptor columns and score columns */
.bp-table th.bp-col-divider,
.bp-table td.bp-col-divider { border-left: 2px solid var(--border2); }

/* Inline edit-mode dropdowns */
.bp-inline-cell { padding-top: 5px !important; padding-bottom: 5px !important; }
.bp-select-sm {
  padding: 4px 6px;
  font-size: 12px;
  max-width: 150px;
  width: 100%;
}

/* Row selection (bulk actions) */
.bp-check-cell { width: 30px; padding-right: 4px !important; }
.bp-check-cell input {
  width: 15px; height: 15px; accent-color: var(--accent);
  cursor: pointer; vertical-align: middle;
}
.bp-row-selected td { background: rgba(255, 0, 92, 0.06); }
.bp-table tbody .bp-row-selected.bp-row-link:hover td { background: rgba(255, 0, 92, 0.1); }

/* Row actions (Edit) — hover-revealed normally, always shown in edit mode */
.bp-row-actions { text-align: right; white-space: nowrap; }
.bp-row-actions .bp-btn { visibility: hidden; }
.bp-table tbody tr:hover .bp-row-actions .bp-btn,
.bp-table.bp-edit-mode .bp-row-actions .bp-btn { visibility: visible; }

/* Per-feature expansion (scores by user) */
.bp-expand-col { width: 30px; padding-right: 0 !important; }
.bp-expand-btn { transition: transform 0.15s; font-size: 12px; }
.bp-expand-btn.bp-expand-open { transform: rotate(90deg); }
.bp-row-expanded td { border-bottom: none; }
.bp-expand-row td {
  background: var(--surface2);
  padding: 10px 14px 12px 40px;
}
.bp-expand-row:hover td { background: var(--surface2); }
.bp-subtable { width: auto; min-width: 60%; border-collapse: collapse; font-size: 12px; }
.bp-subtable th {
  text-align: left; font-size: 10px; text-transform: uppercase; letter-spacing: 0.4px;
  color: var(--text3); font-weight: 600; padding: 4px 12px 4px 0; border-bottom: 1px solid var(--border);
}
.bp-subtable th.bp-num { text-align: right; }
.bp-subtable td { padding: 5px 12px 5px 0; border-bottom: 1px solid var(--border); }
.bp-subtable tbody tr:last-child td { border-bottom: none; }
.bp-subtable-final td { font-weight: 700; border-top: 1px solid var(--border2); }

/* All-scores toggle */
.bp-btn-toggle-on {
  background: var(--surface3);
  border-color: var(--accent);
  color: var(--text);
}

.bp-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 14px;
}
.bp-search { min-width: 220px; flex: 1; max-width: 340px; }
/* Controls pinned to the page's right edge, in line with the table */
.bp-toolbar-right { display: flex; align-items: center; gap: 8px; margin-left: auto; }

/* ─── Backlog sub-views: Ranked / Filtered ─── */
.bp-subviews {
  display: inline-flex;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 2px;
  gap: 2px;
}
.bp-subview {
  border: none;
  background: transparent;
  color: var(--text2);
  font-size: 13px;
  font-family: inherit;
  padding: 5px 14px;
  border-radius: 6px;
  cursor: pointer;
}
.bp-subview:hover { color: var(--text); }
.bp-subview-on { background: var(--surface); color: var(--text); font-weight: 600; }

/* ─── Ranked backlog: drag grips and divider rows ─── */
.bp-rank-col { width: 26px; padding-left: 8px !important; padding-right: 0 !important; }
.bp-rank-grip {
  display: inline-block;
  color: var(--text3);
  cursor: grab;
  font-size: 13px;
  line-height: 1;
  padding: 2px 3px;
  touch-action: none;
  user-select: none;
}
.bp-rank-grip:active { cursor: grabbing; }
/* The whole row is a drag handle in the ranked view */
.bp-ranked tbody tr { user-select: none; }
.bp-ranked tbody tr[data-rank-id] { cursor: grab; touch-action: none; }
.bp-ranked tbody tr[data-rank-id]:active { cursor: grabbing; }
.bp-ranked tbody tr[data-rank-id] button,
.bp-ranked tbody tr[data-rank-id] input,
.bp-ranked tbody tr[data-rank-id] select { cursor: pointer; }
.bp-divider-td { padding: 0 !important; }
.bp-divider-cell {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  height: 30px;
  padding: 0 12px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.6px;
  text-transform: uppercase;
  color: var(--text);
}
.bp-divider-name { cursor: pointer; }
.bp-divider-name:hover { text-decoration: underline; }
.bp-divider-del { opacity: 0; }
.bp-divider-row:hover .bp-divider-del { opacity: 0.7; }
.bp-rank-drop-line { left: 0; right: 0; }
.bp-tags-cell .bp-badge { margin-right: 3px; }

.bp-pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  margin-top: 14px;
}

/* ─── Badges ─── */
.bp-badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 600;
  white-space: nowrap;
}
.bp-badge-green { background: rgba(63, 185, 80, 0.15); color: var(--success); }
.bp-badge-amber { background: rgba(210, 153, 34, 0.15); color: var(--warn); }
.bp-badge-red   { background: rgba(248, 81, 73, 0.15); color: var(--danger); }
.bp-badge-blue  { background: rgba(88, 166, 255, 0.15); color: #58a6ff; }
.bp-badge-gray  { background: var(--surface3); color: var(--text2); }

/* ─── Empty states ─── */
.bp-empty { color: var(--text2); font-size: 13px; padding: 8px 0; }
.bp-empty-state {
  text-align: center;
  padding: 60px 20px;
  color: var(--text2);
}
.bp-empty-state p { margin-bottom: 16px; }
.bp-empty-state code {
  background: var(--surface2); padding: 2px 6px; border-radius: 4px; font-size: 12px;
}

/* ─── Dashboard extras ─── */
.bp-weights { display: flex; flex-direction: column; gap: 8px; }
.bp-weight-row {
  display: grid;
  grid-template-columns: 1fr auto auto;
  align-items: center;
  gap: 10px;
  font-size: 13px;
}
.bp-weight-bar {
  width: 90px; height: 6px; border-radius: 3px; background: var(--surface3); overflow: hidden;
}
.bp-weight-fill { height: 100%; background: var(--accent); border-radius: 3px; }

.bp-attention-group { margin-bottom: 14px; }
.bp-attention-title {
  font-size: 11px; text-transform: uppercase; letter-spacing: 0.4px;
  color: var(--text2); font-weight: 600; margin-bottom: 6px;
}
.bp-attention-item {
  display: flex; justify-content: space-between; gap: 10px; width: 100%;
  background: none; border: none; color: var(--text); font-size: 13px;
  padding: 5px 6px; border-radius: 6px; cursor: pointer; text-align: left;
}
.bp-attention-item:hover { background: var(--surface2); }

/* ─── Feature detail ─── */
.bp-detail-grid {
  display: grid;
  grid-template-columns: 1fr 300px;
  gap: 16px;
  align-items: start;
}
.bp-detail-side { position: sticky; top: 0; }
.bp-field-block { margin-bottom: 14px; }
.bp-field-label {
  font-size: 11px; text-transform: uppercase; letter-spacing: 0.4px;
  color: var(--text2); font-weight: 600; margin-bottom: 4px;
}
.bp-field-value { font-size: 13px; white-space: pre-wrap; }

.bp-priority-panel { text-align: left; }
.bp-priority-big { text-align: center; padding: 6px 0 14px; border-bottom: 1px solid var(--border); margin-bottom: 12px; }
.bp-priority-value { font-size: 40px; font-weight: 700; line-height: 1.1; }
.bp-priority-row {
  display: flex; justify-content: space-between; gap: 10px;
  padding: 8px 0; border-bottom: 1px solid var(--border);
}
.bp-priority-row:last-of-type { border-bottom: none; }

.bp-mode-select { display: flex; align-items: center; gap: 8px; }

/* ─── Scoring breakdown (detail page) ─── */
.bp-crit-breakdown { padding: 12px 0; border-bottom: 1px solid var(--border); }
.bp-crit-breakdown:last-child { border-bottom: none; }
.bp-crit-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.bp-crit-score { display: flex; align-items: center; gap: 10px; }
.bp-score { font-weight: 600; cursor: default; }
.bp-score-big { font-size: 18px; font-weight: 700; }

.bp-scorer-list { margin-top: 8px; display: flex; flex-direction: column; gap: 4px; }
.bp-scorer-row {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  font-size: 12px; padding: 4px 8px; background: var(--surface2); border-radius: 6px;
}
.bp-scorer-name { font-weight: 600; }
.bp-scorer-score { font-weight: 700; font-variant-numeric: tabular-nums; }
.bp-rationale summary { list-style: none; cursor: pointer; }
.bp-rationale summary::-webkit-details-marker { display: none; }
.bp-rationale-text {
  margin-top: 4px; padding: 6px 8px; background: var(--surface3);
  border-radius: 6px; font-size: 12px; color: var(--text2); max-width: 480px;
}

/* ─── Scoring breakdown: score matrix ─── */
.bp-matrix { width: 100%; border-collapse: collapse; font-size: 13px; }
.bp-matrix th {
  text-align: left; font-size: 11px; text-transform: uppercase; letter-spacing: 0.4px;
  color: var(--text2); font-weight: 600; padding: 8px 10px;
  border-bottom: 1px solid var(--border); white-space: nowrap; vertical-align: middle;
}
.bp-matrix th.bp-num { text-align: right; }
.bp-matrix th .bp-provided-avatar { margin-right: 6px; }
.bp-matrix-scorer { text-transform: none; letter-spacing: 0; color: var(--text); }
.bp-matrix td { padding: 9px 10px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.bp-matrix td .bp-muted.bp-small { display: block; }
.bp-matrix tfoot td {
  border-top: 2px solid var(--border2); border-bottom: none;
  font-weight: 600; color: var(--text2);
}
.bp-matrix-final { background: rgba(255, 0, 92, 0.05); }
.bp-matrix td.bp-matrix-final { font-size: 14px; }
.bp-matrix-basis { background: rgba(88, 166, 255, 0.06); }
.bp-matrix th .bp-badge { display: block; margin-top: 4px; }
.bp-matrix-raw { display: block; font-size: 11px; color: var(--text3); }
.bp-matrix-editable { cursor: pointer; position: relative; }
.bp-matrix-editable:hover { background: var(--surface3); }
.bp-matrix-editable:hover::after {
  content: '✎';
  position: absolute;
  top: 4px; right: 4px;
  font-size: 10px;
  color: var(--text2);
}

/* ─── Scoring breakdown: value composition ─── */
.bp-composition { margin-top: 16px; border-top: 1px solid var(--border); padding-top: 12px; }
.bp-comp-row {
  display: grid;
  grid-template-columns: 150px 1fr 170px;
  align-items: center;
  gap: 12px;
  padding: 4px 0;
  font-size: 13px;
}
.bp-comp-name { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bp-comp-bar { height: 8px; border-radius: 4px; background: var(--surface3); overflow: hidden; }
.bp-comp-fill { height: 100%; background: var(--accent); border-radius: 4px; }
.bp-comp-math { text-align: right; color: var(--text2); font-variant-numeric: tabular-nums; }
.bp-comp-math strong { color: var(--text); }
.bp-comp-total {
  display: flex; justify-content: flex-end; gap: 10px; align-items: baseline;
  margin-top: 8px; padding-top: 8px; border-top: 1px solid var(--border); font-size: 14px;
}

/* ─── Scoring breakdown: rationale ─── */
.bp-rationales { margin-top: 16px; border-top: 1px solid var(--border); padding-top: 12px; }
.bp-rationale-group { margin-bottom: 10px; }
.bp-rationale-crit { font-size: 12px; font-weight: 600; margin-bottom: 4px; }
.bp-rationale-row {
  display: flex; gap: 8px; align-items: flex-start;
  font-size: 13px; color: var(--text2); padding: 3px 0 3px 8px;
}
.bp-rationale-row .bp-provided-avatar { margin-top: 1px; }
.bp-rationale-row strong { color: var(--text); }

/* ─── Scoring experience ─── */
.bp-scoring-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 300px;
  gap: 16px;
  align-items: start;
}
.bp-score-cards { display: flex; flex-direction: column; gap: 14px; }
.bp-score-card { margin-bottom: 0; scroll-margin-top: 12px; }
.bp-score-card-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; }
.bp-score-card-result { display: flex; flex-direction: column; align-items: flex-end; gap: 2px; flex-shrink: 0; }
.bp-question { font-size: 14px; font-weight: 600; margin: 10px 0 2px; }
.bp-crit-desc { margin-bottom: 4px; }
.bp-score-input-row { display: flex; align-items: center; gap: 14px; margin: 12px 0 8px; flex-wrap: wrap; }
.bp-raw-input { width: 140px; font-size: 15px; }
.bp-threshold-result { font-size: 13px; }

/* Manual score options — guidance built into the buttons */
.bp-score-options {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 8px;
  margin: 12px 0 8px;
}
.bp-score-btn {
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--surface2);
  color: var(--text);
  cursor: pointer;
}
.bp-score-btn:hover { border-color: var(--border2); background: var(--surface3); }
/* Selected state must beat the :hover rule's specificity — stays pink while hovered */
.bp-score-btn.bp-score-btn-active,
.bp-score-btn.bp-score-btn-active:hover {
  background: var(--accent2);
  border-color: var(--accent2);
  color: #fff;
}
.bp-score-opt {
  display: flex; flex-direction: column; align-items: center; gap: 4px;
  padding: 10px 6px; text-align: center; min-height: 74px;
}
.bp-opt-num { font-size: 18px; font-weight: 700; line-height: 1; }
.bp-opt-label { font-size: 11px; line-height: 1.3; color: var(--text2); }
.bp-score-btn-active .bp-opt-label { color: rgba(255, 255, 255, 0.85); }

/* Numeric range reference chips */
.bp-range-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 8px; }
.bp-guidance-row.bp-range-chip {
  display: inline-flex; gap: 6px; align-items: baseline;
  font-size: 12px; color: var(--text2);
  padding: 4px 10px; border-radius: 20px;
  border: 1px solid var(--border); background: var(--surface2);
}
.bp-range-chip.bp-guidance-active { background: var(--accent2); border-color: var(--accent2); color: #fff; }
.bp-range-chip.bp-guidance-active .bp-guidance-score { color: #fff; }
.bp-guidance-score { font-weight: 700; flex-shrink: 0; }

.bp-rationale-input { width: 100%; margin: 6px 0 10px; }
.bp-score-card-footer { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }

/* Scores provided (per criterion) */
.bp-provided { margin-top: 14px; border-top: 1px solid var(--border); padding-top: 10px; }
.bp-provided-head { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; margin-bottom: 8px; flex-wrap: wrap; }
.bp-provided-title {
  font-size: 11px; text-transform: uppercase; letter-spacing: 0.4px;
  color: var(--text2); font-weight: 600;
}
.bp-provided-final { font-size: 13px; }
.bp-provided-row {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  padding: 6px 8px; border-radius: 6px; font-size: 12px;
}
.bp-provided-row:nth-child(odd) { background: var(--surface2); }
.bp-provided-me { outline: 1px solid var(--border2); }
.bp-provided-avatar {
  width: 22px; height: 22px; border-radius: 50%; flex-shrink: 0;
  background: var(--surface3); color: var(--text2);
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 10px; font-weight: 700;
}
.bp-provided-name { font-weight: 600; }
.bp-provided-score { font-weight: 700; font-size: 14px; font-variant-numeric: tabular-nums; }
.bp-provided-rationale {
  flex-basis: 100%; color: var(--text2);
  padding-left: 32px; font-size: 12px;
}
.bp-provided-actions { margin-left: auto; display: inline-flex; gap: 2px; }
.bp-provided-actions .bp-icon-btn { border: 1px solid var(--border); }

/* Scoreboard (sticky right panel) */
.bp-scoring-side { position: sticky; top: 0; }
.bp-scoreboard { margin-bottom: 0; }
.bp-scoreboard-progress { margin-bottom: 12px; }
.bp-progress-row { display: flex; align-items: center; gap: 10px; margin-top: 6px; }
.bp-progress-bar { flex: 1; height: 6px; border-radius: 3px; background: var(--surface3); overflow: hidden; }
.bp-progress-fill { height: 100%; background: var(--success); border-radius: 3px; transition: width 0.3s; }
.bp-scoreboard-table { width: 100%; border-collapse: collapse; font-size: 12px; margin-bottom: 12px; }
.bp-scoreboard-table th {
  text-align: left; font-size: 10px; text-transform: uppercase; letter-spacing: 0.4px;
  color: var(--text3); font-weight: 600; padding: 4px 6px; border-bottom: 1px solid var(--border);
}
.bp-scoreboard-table th.bp-num { text-align: right; }
.bp-scoreboard-table td { padding: 6px; border-bottom: 1px solid var(--border); }
.bp-scoreboard-table tbody tr:last-child td { border-bottom: none; }
.bp-scoreboard-table tbody tr:hover td { background: var(--surface2); }
.bp-scoreboard-result { border-top: 1px solid var(--border); padding-top: 10px; }
.bp-scoreboard-result .bp-priority-row { border-bottom: none; padding: 4px 0 8px; }
.bp-scoreboard-priority { font-size: 18px; }
.bp-pending { color: var(--warn); }
.bp-scoreboard-meta { display: flex; align-items: center; gap: 8px; margin-top: 8px; flex-wrap: wrap; }

/* ─── Framework ─── */
.bp-principle {
  border-left: 3px solid var(--accent);
  background: var(--surface);
  border-radius: 0 var(--radius) var(--radius) 0;
  padding: 12px 16px;
  font-size: 13px;
  color: var(--text2);
  font-style: italic;
  margin-bottom: 14px;
}
.bp-draft-banner {
  background: rgba(210, 153, 34, 0.1);
  border: 1px solid rgba(210, 153, 34, 0.4);
  color: var(--warn);
  border-radius: var(--radius);
  padding: 10px 14px;
  font-size: 13px;
  margin-bottom: 14px;
}
.bp-validation { margin-bottom: 14px; display: flex; flex-direction: column; gap: 4px; }
.bp-validation-row { font-size: 13px; padding: 6px 10px; border-radius: 6px; }
.bp-validation-error { background: rgba(248, 81, 73, 0.1); color: var(--danger); }
.bp-validation-warn { background: rgba(210, 153, 34, 0.1); color: var(--warn); }

.bp-publish-compare {
  display: grid; grid-template-columns: 1fr 1fr; gap: 20px;
}
.bp-publish-compare .bp-weight-row { grid-template-columns: 1fr auto; padding: 3px 0; }

/* ─── Activity ─── */
.bp-activity-list { display: flex; flex-direction: column; }
.bp-activity-row {
  display: flex; justify-content: space-between; align-items: baseline; gap: 14px;
  padding: 8px 6px; border-bottom: 1px solid var(--border); font-size: 13px;
}
.bp-activity-row:last-child { border-bottom: none; }
.bp-activity-row.bp-row-link:hover { background: var(--surface2); }

/* ─── Modal ─── */
.bp-modal-overlay {
  position: fixed; inset: 0; z-index: 200;
  background: rgba(0, 0, 0, 0.6);
  display: flex; align-items: flex-start; justify-content: center;
  padding: 5vh 16px;
  overflow-y: auto;
}
.bp-modal {
  background: var(--surface);
  color: var(--text);   /* resolve against the overlay's theme, not body */
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px 22px;
  width: 100%;
  max-width: 640px;
  max-height: 88vh;
  overflow-y: auto;
}
.bp-modal-header {
  display: flex; justify-content: space-between; align-items: center; margin-bottom: 16px;
}
.bp-modal-header h2 { font-size: 16px; }
.bp-modal-footer {
  display: flex; justify-content: flex-end; gap: 8px; margin-top: 18px;
}

.bp-form-grid {
  display: grid; grid-template-columns: 1fr 1fr; gap: 12px 16px;
}
.bp-form-field { display: flex; flex-direction: column; gap: 4px; font-size: 12px; color: var(--text2); min-width: 0; }
/* Equal columns: every control fills its cell */
.bp-form-field .bp-input,
.bp-form-field .bp-select { width: 100%; box-sizing: border-box; }
.bp-modal-md { max-width: 580px; }
/* Direct child only: this styles the field's label. Matching nested spans
   would also hit spans a contenteditable creates, and a bold-by-default
   descendant makes the browser's bold command toggle the wrong way. */
.bp-form-field > span { font-weight: 600; }
.bp-form-wide { grid-column: span 2; }
.bp-form-check {
  display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--text);
}
.bp-guidance-edit-row {
  display: grid;
  grid-template-columns: 70px 1fr 1fr 1fr 30px;
  gap: 8px;
  margin-bottom: 6px;
  align-items: center;
}

/* ─── Context menu (right-click on a feature) ─── */
.bp-ctx {
  position: fixed;
  z-index: 400;
  min-width: 180px;
  background: var(--surface2);
  border: 1px solid var(--border2);
  border-radius: var(--radius);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5);
  padding: 4px;
}
.bp-ctx-title {
  padding: 6px 10px;
  font-size: 11px;
  color: var(--text3);
  border-bottom: 1px solid var(--border);
  margin-bottom: 4px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 240px;
}
.bp-ctx-item {
  display: block;
  width: 100%;
  text-align: left;
  padding: 7px 10px;
  border: none;
  border-radius: 6px;
  background: transparent;
  color: var(--text);
  font-size: 13px;
  cursor: pointer;
}
.bp-ctx-item:hover { background: var(--surface3); }
.bp-ctx-danger { color: var(--danger); }
.bp-ctx-danger:hover { background: rgba(248, 81, 73, 0.12); }
.bp-ctx-sub { position: relative; }
.bp-ctx-parent {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.bp-ctx-arrow { color: var(--text3); font-size: 14px; line-height: 1; }
.bp-ctx-flyout {
  display: none;
  position: absolute;
  left: calc(100% + 2px);
  top: -5px;
  min-width: 180px;
  background: var(--surface2);
  border: 1px solid var(--border2);
  border-radius: var(--radius);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5);
  padding: 4px;
  z-index: 401;
}
.bp-light .bp-ctx-flyout { box-shadow: 0 8px 24px rgba(31, 37, 48, 0.18); }
.bp-ctx-sub:hover .bp-ctx-flyout,
.bp-ctx-sub:focus-within .bp-ctx-flyout { display: block; }
.bp-ctx-flyleft .bp-ctx-flyout { left: auto; right: calc(100% + 2px); }
/* The dependency picker can be long: cap it and scroll */
/* contain: hitting either end must not chain the scroll to the gantt */
.bp-ctx-flyout-list {
  max-height: 340px;
  overflow-y: auto;
  overscroll-behavior: contain;
  min-width: 220px;
}
.bp-ctx-section {
  padding: 6px 10px 4px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.4px;
  text-transform: uppercase;
  color: var(--text3);
}
.bp-ctx-disabled {
  padding: 7px 10px;
  font-size: 13px;
  color: var(--text3);
  cursor: default;
}
.bp-ctx-sep { height: 1px; background: var(--border); margin: 4px 0; }

/* ─── Confirmation dialog ─── */
.bp-confirm-overlay { align-items: center; z-index: 500; }
.bp-confirm { max-width: 440px; }
.bp-confirm .bp-modal-header h2 { font-size: 19px; font-weight: 700; }
.bp-confirm-message { font-size: 14px; color: var(--text); line-height: 1.6; }
.bp-confirm-message strong { color: var(--text); }
/* From/To dates share a column so they start at the same x */
.bp-date-change {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 4px 14px;
  margin-top: 14px;
  text-align: left;
}
.bp-confirm-list { margin: 0 0 10px; padding-left: 18px; color: var(--text); }
.bp-confirm-list li { margin: 2px 0; }

/* ─── Priority Pyramid ─── */
.bp-pyr-toggle { display: flex; gap: 8px; flex-shrink: 0; }
.bp-pyramid {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 22px;
  padding: 30px 0 40px;
  max-width: 1100px;
  margin: 0 auto;
}
.bp-pyr-row { display: flex; justify-content: center; gap: 22px; width: 100%; }
.bp-pyr-row-1 .bp-pyr-flip { width: 34%; min-width: 300px; height: 160px; }
.bp-pyr-row-2 .bp-pyr-flip { width: 32%; min-width: 270px; height: 145px; }
.bp-pyr-row-3 .bp-pyr-flip { width: 31%; min-width: 240px; height: 135px; }

/* 3D flip card: outcome on the front, KPI on the back */
.bp-pyr-flip { perspective: 1100px; cursor: pointer; }
.bp-pyr-flip-inner {
  position: relative;
  width: 100%; height: 100%;
  transform-style: preserve-3d;
  transition: transform 0.55s cubic-bezier(0.4, 0, 0.2, 1);
}
.bp-pyr-flip.bp-flipped .bp-pyr-flip-inner { transform: rotateY(180deg); }
.bp-pyr-flip:hover .bp-pyr-flip-inner { transform: rotateY(8deg); }
.bp-pyr-flip.bp-flipped:hover .bp-pyr-flip-inner { transform: rotateY(172deg); }

.bp-pyr-face {
  position: absolute; inset: 0;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  border-radius: 14px;
  padding: 20px 22px 26px;
  text-align: center;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 6px;
}
.bp-pyr-back { transform: rotateY(180deg); }

.bp-pyr-label { font-size: 12px; font-weight: 700; letter-spacing: 0.2px; }
.bp-pyr-title { font-size: 18px; font-weight: 700; line-height: 1.3; }
.bp-pyr-formula { font-size: 13px; color: var(--text2); }
.bp-pyr-hint {
  position: absolute; bottom: 8px; right: 12px;
  font-size: 10px; color: var(--text3); opacity: 0;
  transition: opacity 0.15s;
}
.bp-pyr-flip:hover .bp-pyr-hint { opacity: 1; }

/* Primary goal — filled light blue, dark text (as in the deck) */
.bp-pyr-primary .bp-pyr-face { background: #7edcf7; color: #0d1f28; }
.bp-pyr-primary .bp-pyr-label { color: #0d1f28; }
.bp-pyr-primary .bp-pyr-formula { color: #0d1f28; opacity: 0.75; }
.bp-pyr-primary .bp-pyr-hint { color: #0d1f28; opacity: 0; }
.bp-pyr-primary:hover .bp-pyr-hint { opacity: 0.6; }

/* Pillars & foundations — dark cards with a cyan top edge and cyan label */
.bp-pyr-pillar .bp-pyr-face, .bp-pyr-foundation .bp-pyr-face {
  background: var(--surface);
  border: 1px solid #2e9cc4;
  border-top: 4px solid #45b8e0;
  color: var(--text);
}
.bp-pyr-pillar .bp-pyr-label, .bp-pyr-foundation .bp-pyr-label { color: #45b8e0; }

@media (max-width: 900px) {
  .bp-pyr-row { flex-direction: column; align-items: center; }
  .bp-pyr-row .bp-pyr-flip { width: 100%; max-width: 460px; }
}

/* ─── Roadmap Gantt ─── */
.bp-gantt-panel { padding: 0; overflow: hidden; }
/* The gantt fills the viewport below the page header and scrolls
   internally — the page itself stays put and date headers stay locked */
.bp-gantt { display: flex; --gfs: 1; height: calc(100vh - 190px); min-height: 320px; }
.bp-gantt-side { display: flex; flex-direction: column; }
.bp-gantt-side-head { flex-shrink: 0; }
.bp-gantt-side-rows { flex: 1; overflow: hidden; }
/* Residual clamp compensation — transform keeps scroll geometry untouched */
.bp-gantt-side-inner { transform: translateY(var(--side-shift, 0px)); position: relative; }
.bp-gantt-scroll { overflow: auto; overscroll-behavior: none; }
.bp-gantt-side-rows { overscroll-behavior: none; }
.bp-main { overscroll-behavior: none; }
.bp-main-flush { padding-bottom: 12px; }
.bp-main-flush .bp-gantt-panel { margin-bottom: 0; }
.bp-gantt-headwrap {
  position: sticky;
  top: 0;
  z-index: 6;
  background: var(--surface);
}
/* Needs to beat .bp-view-settings' 250px width, which is defined later */
.bp-view-settings.bp-add-menu { width: 128px; padding: 6px; gap: 2px; }

/* Backlog Filter / View popovers (reuse the settings-popover shell) */
/* Anchored to the right edge (their buttons sit at the page's right) */
.bp-view-settings.bp-filter-menu { width: 330px; }
.bp-view-settings.bp-cols-menu { width: 190px; gap: 4px; }
.bp-pop-row {
  display: grid;
  grid-template-columns: 74px 48px 1fr;
  align-items: center;
  gap: 8px;
}
.bp-pop-row > span { font-size: 12px; color: var(--text2); white-space: nowrap; }
.bp-pop-row .bp-select { width: 100%; min-width: 0; }
/* include / exclude switch for each filter */
.bp-filter-mode {
  font-family: inherit;
  font-size: 11px;
  padding: 5px 0;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--surface2);
  color: var(--text2);
  cursor: pointer;
  text-align: center;
}
.bp-filter-mode:hover { border-color: var(--border2); color: var(--text); }
.bp-filter-not {
  background: color-mix(in srgb, var(--danger) 16%, transparent);
  border-color: color-mix(in srgb, var(--danger) 45%, transparent);
  color: var(--danger);
  font-weight: 600;
}
.bp-filter-mode-off { opacity: 0.45; }
.bp-pop-title {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.4px;
  text-transform: uppercase;
  color: var(--text3);
}
/* Icon-only toolbar buttons, with a count badge when something is applied */
.bp-btn-icon-label {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 6px 9px;
}
.bp-btn-icon-label svg { display: block; }
.bp-btn-count {
  font-size: 11px;
  font-weight: 700;
  line-height: 1;
  min-width: 14px;
  text-align: center;
}
/* Text-size scaling — higher specificity so these beat the base rules below */
.bp-gantt .bp-gantt-name { font-size: calc(13px * var(--gfs)); }
.bp-gantt .bp-gantt-cell { font-size: calc(11px * var(--gfs)); }
.bp-gantt .bp-gantt-dow { font-size: calc(10px * var(--gfs)); }
.bp-gantt .bp-gantt-bar { font-size: calc(11px * var(--gfs)); }
.bp-gantt .bp-gantt-ms-label, .bp-gantt .bp-gantt-beside { font-size: calc(11px * var(--gfs)); }
.bp-gantt .bp-gantt-group { font-size: calc(13px * var(--gfs)); }
/* Row heights scale with the text size too */
.bp-gantt .bp-gantt-name,
.bp-gantt .bp-gantt-track,
.bp-gantt .bp-gantt-group { height: calc(44px * var(--gfs)); }
.bp-gantt .bp-gantt-bar { height: calc(26px * var(--gfs)); }

/* View Settings popover */
.bp-vs-wrap { position: relative; display: inline-block; }
.bp-view-settings {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  z-index: 60;
  width: 250px;
  background: var(--surface);
  border: 1px solid var(--border2);
  border-radius: var(--radius);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  text-align: left;
}
.bp-vs-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  font-size: 13px;
}
.bp-vs-toggle {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  cursor: pointer;
}
.bp-vs-toggle input { accent-color: var(--accent); width: 15px; height: 15px; }
.bp-vs-stepper { display: inline-flex; align-items: center; gap: 6px; }
.bp-vs-val { min-width: 42px; text-align: center; font-variant-numeric: tabular-nums; font-size: 12px; }
.bp-gantt-side {
  flex-shrink: 0;
  width: 240px;
  border-right: 1px solid var(--border);
  position: relative;
  user-select: none;        /* rows drag to reorder — no text selection */
  -webkit-user-select: none;
}
.bp-gantt-side-rsz {
  position: absolute;
  top: 0; bottom: 0; right: -4px;
  width: 8px;
  cursor: col-resize;
  touch-action: none;
  z-index: 2;
}
.bp-gantt-side-rsz:hover { background: rgba(255, 0, 92, 0.25); }
.bp-gantt-side-head {
  height: 58px;
  display: flex;
  align-items: flex-end;
  padding: 8px 14px;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.4px;
  color: var(--text2);
  font-weight: 600;
  border-bottom: 1px solid var(--border);
  box-sizing: border-box;
}
.bp-gantt-name {
  height: 44px;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 14px;
  border-bottom: 1px solid var(--border);
  font-size: 13px;
  cursor: pointer;
  box-sizing: border-box;
}
.bp-gantt-name { cursor: grab; touch-action: none; }
.bp-gantt-name:hover { background: var(--surface2); }
.bp-gantt-name:active { cursor: grabbing; }
.bp-in-group { padding-left: 32px; }

/* ─── Dependency brackets (Event column) ─── */
/* Rows shift right to make room for one gutter per bracket lane */
.bp-gantt-name { padding-left: calc(14px + var(--dep-lanes, 0) * 16px); }
.bp-in-group { padding-left: calc(32px + var(--dep-lanes, 0) * 16px); }
.bp-gantt-group:not(.bp-gantt-divider) { padding-left: calc(6px + var(--dep-lanes, 0) * 16px); }
.bp-dep-layer {
  position: absolute;
  top: 0; left: 0;
  width: 100%;
  pointer-events: none;
  z-index: 2;
}
.bp-dep-bracket {
  position: absolute;
  /* Innermost lane ends 6px before the names; each lane out steps 16px left */
  left: calc(var(--dep-indent, 14px) + var(--lane) * 16px - 2px);
  top: calc((var(--i) + 0.5) * 44px * var(--gfs));
  height: calc((var(--j) - var(--i)) * 44px * var(--gfs));
  width: 12px;
  box-sizing: border-box;
  border: 2px solid var(--dep-line, #ffffff);
  border-right: none;
  border-radius: 4px 0 0 4px;
  opacity: 0.8;
  pointer-events: auto;
}
/* Interior members get an arm the same length as the bracket's corners */
.bp-dep-tick {
  position: absolute;
  left: 0;
  top: calc(var(--k) * 44px * var(--gfs) - 1px);
  width: 12px;
  height: 2px;
  background: var(--dep-line, #ffffff);
}
.bp-row-dragging { opacity: 0.4; }
.bp-gantt-drop-line {
  position: absolute;
  left: 0; right: 0;
  height: 2px;
  background: var(--accent);
  z-index: 5;
  pointer-events: none;
}

/* Group rows (TeamGantt-style) */
.bp-gantt-group {
  cursor: grab;
  touch-action: none;
  height: 44px;
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 0 8px 0 6px;
  border-bottom: 1px solid var(--border);
  background: var(--surface2);
  font-weight: 700;
  font-size: 13px;
  box-sizing: border-box;
}
.bp-group-name { flex: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bp-group-count { color: var(--text3); font-size: 11px; font-weight: 600; }
.bp-group-del { visibility: hidden; }
.bp-gantt-group:hover .bp-group-del { visibility: visible; }
.bp-gantt-track-group { background: var(--surface2); }

/* Divider rows: a solid band across the whole row, purely visual.
   Band color is set inline (darker grey by default, user-tintable). */
.bp-gantt-divider,
.bp-gantt-track-divider {
  background: color-mix(in srgb, #64748b 42%, var(--surface2));
  border-bottom: 1px solid var(--border);
}
.bp-gantt-divider {
  padding-left: 14px;
  font-size: calc(12px * var(--gfs));
  text-transform: uppercase;
  letter-spacing: 1.2px;
  color: var(--text2);
}
.bp-gantt-divider .bp-group-name { color: var(--text2); }
.bp-gantt-groupbar {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  height: 8px;
  border-radius: 4px;
  background: var(--text3);
  opacity: 0.55;
}
.bp-gantt-name-text { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bp-gantt-dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }

.bp-gantt-scroll { overflow: auto; flex: 1; }
.bp-gantt-timeline { position: relative; }
.bp-gantt-head-row {
  display: flex;
  height: 29px;
  border-bottom: 1px solid var(--border);
  box-sizing: border-box;
}
.bp-gantt-head-tall { height: 58px; }
.bp-gantt-cell {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  color: var(--text);
  border-right: 1px solid var(--border);
  box-sizing: border-box;
  overflow: hidden;
  white-space: nowrap;
}
.bp-gantt-month { font-weight: 600; color: var(--text); }
.bp-gantt .bp-gantt-dow { color: var(--text); opacity: 0.75; }
.bp-gantt-weekend { background: var(--surface2); }
/* Full-height weekend shading (day view) — painted before the tracks so
   it sits behind every bar and milestone */
.bp-gantt-wknd {
  position: absolute;
  bottom: 0;
  background: var(--surface2);
  opacity: 0.6;
  pointer-events: none;
}
.bp-gantt-dow { font-size: 10px; color: var(--text3); }
/* Daily view has three header rows (month / weekday / day) */
.bp-gantt-3head .bp-gantt-side-head { height: 87px; }

.bp-gantt-track {
  position: relative;
  height: 44px;
  border-bottom: 1px solid var(--border);
  box-sizing: border-box;
}
.bp-gantt-bar {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  height: 26px;
  border-radius: 6px;
  border: 2px solid transparent;   /* border color set inline (darker shade) */
  cursor: pointer;
  display: flex;
  align-items: center;
  padding: 0 8px;
  box-sizing: border-box;
  color: #0d1f28;
  font-size: 11px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
}
.bp-gantt-bar:hover { filter: brightness(1.06); }
/* Progress fill: base color over the light interior, TeamGantt-style */
.bp-gantt-fill {
  position: absolute;
  top: 0; left: 0; bottom: 0;
  border-radius: 3px 0 0 3px;
  pointer-events: none;
}
/* In-bar labels: dark text; the progress fill is softened (55% tint) so
   the text reads over both interior and fill in any theme */
.bp-gantt-bar-label {
  position: relative;
  z-index: 1;
  color: #0d1f28;
  /* The font's ascent outweighs its descent, so a geometrically centered
     line box reads as sitting high — nudge the glyphs down to optical center */
  transform: translateY(0.09em);
}
.bp-gantt-beside {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  font-size: 11px;
  font-weight: 400;
  font-style: italic;
  color: var(--text);
  white-space: nowrap;
  pointer-events: none;
  z-index: 1;
}
.bp-gantt-bar, .bp-gantt-milestone { touch-action: none; user-select: none; }
.bp-gantt-bar { cursor: grab; }
.bp-gantt-bar:active { cursor: grabbing; }
.bp-gantt-bar-label { pointer-events: none; }

/* Resize handles on event bars */
.bp-gantt-rsz {
  position: absolute;
  top: 0; bottom: 0;
  width: 8px;
  cursor: ew-resize;
}
.bp-gantt-rsz-l { left: 0; border-radius: 6px 0 0 6px; }
.bp-gantt-rsz-r { right: 0; border-radius: 0 6px 6px 0; }
.bp-gantt-bar:hover .bp-gantt-rsz { background: rgba(255, 255, 255, 0.25); }

/* Click-and-hold highlight: the held milestone's day column and its row */
.bp-gantt-hold-col {
  position: absolute;
  bottom: 0;
  background: var(--accent);
  opacity: 0.18;
  pointer-events: none;
}
.bp-gantt-hold-row {
  background: color-mix(in srgb, var(--accent) 16%, transparent);
}

/* Milestones: yellow diamond on a single day, vertically centered */
.bp-gantt-milestone {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: grab;
}
.bp-gantt-milestone:active { cursor: grabbing; }
.bp-gantt-diamond {
  /* 16 + 2px borders = a 20px box, so half of it is the whole number the
     renderer offsets by — an odd box would sit half a pixel off centre */
  width: 16px; height: 16px;
  transform: rotate(45deg);
  border-radius: 3px;
  border: 2px solid transparent;   /* darker yellow set inline */
  box-sizing: content-box;
  flex-shrink: 0;
}
.bp-gantt-milestone:hover .bp-gantt-diamond { filter: brightness(1.2); }
.bp-gantt-ms-label { font-size: 11px; color: var(--text); font-weight: 400; font-style: italic; white-space: nowrap; }
.bp-gantt-dot-ms { border-radius: 2px; transform: rotate(45deg); }

.bp-hidden { display: none !important; }

/* Color swatches in the roadmap modal */
.bp-swatches { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 4px; }
.bp-swatch {
  width: 26px; height: 26px;
  border-radius: 6px;
  border: 2px solid var(--border);
  cursor: pointer;
  padding: 0;
}
.bp-swatch:hover { border-color: var(--text2); }
.bp-swatch-on { border-color: var(--text); box-shadow: 0 0 0 2px var(--accent); }
.bp-swatch-auto {
  background: var(--surface2);
  color: var(--text2);
  font-size: 11px;
  font-weight: 700;
}
input[type="range"].bp-input { padding: 0; height: 26px; accent-color: var(--accent); }
.bp-gantt-today {
  position: absolute;
  bottom: 0;                 /* top set inline: starts below the header rows */
  transform: translateX(-50%);   /* left is the column centre, not the edge */
  width: 2px;
  background: var(--accent);
  opacity: 0.3;
  pointer-events: none;
}

/* ─── Toast ─── */
.bp-toast-update {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px 10px 18px;
}
.bp-toast-x {
  background: transparent;
  border: none;
  color: var(--text3);
  font-size: 13px;
  cursor: pointer;
  padding: 4px;
  line-height: 1;
}
.bp-toast-x:hover { color: var(--text); }

.bp-toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%) translateY(12px);
  background: var(--surface3);
  border: 1px solid var(--border2);
  color: var(--text);
  padding: 10px 18px;
  border-radius: var(--radius);
  font-size: 13px;
  opacity: 0;
  transition: opacity 0.25s, transform 0.25s;
  z-index: 500;
  pointer-events: none;
}
.bp-toast-show { opacity: 1; transform: translateX(-50%) translateY(0); }
/* The update toast has buttons — it must accept clicks */
.bp-toast-update { pointer-events: auto; }

/* ─── Responsive ─── */
@media (max-width: 1100px) {
  .bp-dash-grid { grid-template-columns: 1fr; }
  .bp-detail-grid { grid-template-columns: 1fr; }
  .bp-detail-side { position: static; }
  .bp-scoring-layout { grid-template-columns: 1fr; }
  .bp-scoring-side { position: static; order: -1; }
  .bp-score-options { grid-template-columns: repeat(auto-fit, minmax(110px, 1fr)); }
}
@media (max-width: 760px) {
  #bp-app { flex-direction: column; }
  .bp-sidebar {
    width: 100%; flex-direction: row; align-items: center;
    overflow-x: auto; border-right: none; border-bottom: 1px solid var(--border);
  }
  .bp-workspace { border-bottom: none; padding: 10px 12px; }
  .bp-nav { flex-direction: row; padding: 6px; }
  .bp-nav-item { white-space: nowrap; }
  .bp-sidebar-footer { border-top: none; display: flex; align-items: center; }
  .bp-user { display: none; }
  .bp-main { padding: 16px 14px 60px; }
  .bp-form-grid { grid-template-columns: 1fr; }
  .bp-form-wide { grid-column: span 1; }
  .bp-publish-compare { grid-template-columns: 1fr; }
}
