/* Fingerpaint SOW Generator — styles */
:root {
  --chrome-h: 64px;
  --sidebar-w: 280px;
  --totals-h: 88px;
  /* Staff Plan (aggregated) column template — see .staff-plan-colhead */
  --plan-cols: 240px minmax(220px, 1fr) 80px 80px 80px 120px 32px;
}

* { box-sizing: border-box; }
html, body, #root { height: 100%; margin: 0; }
body {
  font-family: Arial, Helvetica, sans-serif;
  color: var(--fg);
  background: var(--bg);
}
button { font-family: inherit; }
select { font-family: inherit; }

/* ---------- App chrome ---------------------------------------------------- */
.app { display: grid; grid-template-rows: var(--chrome-h) 1fr; height: 100vh; }

.chrome {
  display: flex; align-items: stretch;
  background: var(--fpg-gray);
  color: #fff;
  z-index: 10;
}
/* The FPM logo SVG is white-text on transparent (only the swoosh is colored).
   The chrome bar inherits the dark fpg-gray so the white wordmark is visible. */
.chrome-logo {
  display: flex; align-items: center;
  padding: 0 22px;
  border-right: 1px solid rgba(255,255,255,0.12);
  min-width: var(--sidebar-w);
  background: var(--fpg-gray);
}
.chrome-logo img { height: 40px; width: auto; display: block; }

.chrome-sow {
  display: flex; align-items: center; gap: 14px;
  flex: 1;
  min-width: 0;
  padding: 0 24px;
  font-size: 14px;
}
.chrome-sow .sow-label {
  font-size: 10px; text-transform: uppercase; letter-spacing: 0.16em; font-weight: 700;
  color: rgba(255,255,255,0.55);
  flex-shrink: 0;
}
.chrome-sow .sow-divider { width: 1px; height: 22px; background: rgba(255,255,255,0.2); flex-shrink: 0; }
.chrome-sow .sow-title {
  font-family: Georgia, serif; font-size: 17px; color: #fff;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  min-width: 0;
}
.chrome-new-sow {
  flex-shrink: 0;
  font-family: inherit; font-size: 11px; font-weight: 700;
  letter-spacing: 0.08em; text-transform: uppercase;
  padding: 7px 14px; border-radius: 999px;
  border: 1px solid rgba(255,255,255,0.25);
  background: rgba(255,255,255,0.05); color: #fff;
  cursor: pointer; white-space: nowrap;
  transition: background-color 150ms ease-out, border-color 150ms ease-out;
}
.chrome-new-sow:hover { background: var(--fpg-orange); border-color: var(--fpg-orange); }

.chrome-sow .status-pill {
  flex-shrink: 0;
  font-size: 10px; padding: 4px 10px; border-radius: 999px;
  background: rgba(252, 133, 73, 0.2); color: var(--fpg-orange);
  font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase;
  white-space: nowrap;
}
.status-pill-wrap { position: relative; display: inline-flex; }
.status-pill-wrap .status-pill {
  border: 0; cursor: pointer; display: inline-flex; align-items: center; gap: 6px;
  font-family: inherit;
}
.status-pill.status-progress { background: rgba(252,133,73,0.2); color: var(--fpg-orange); }
.status-pill.status-review { background: rgba(182,133,30,0.25); color: #F6C26B; }
.status-pill.status-client { background: rgba(76,175,80,0.25); color: #8FD38F; }
.status-menu {
  position: absolute; top: 100%; left: 0; margin-top: 6px;
  background: #fff; color: var(--fg); border-radius: 8px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.25); z-index: 20;
  padding: 4px; min-width: 160px;
}
.status-menu button {
  display: block; width: 100%; text-align: left; padding: 8px 12px;
  border: 0; background: transparent; font-size: 12px; cursor: pointer;
  border-radius: 4px; font-family: inherit;
}
.status-menu button:hover, .status-menu button.active { background: var(--fpg-cotton); }

.chrome-bu {
  display: flex; align-items: center; gap: 8px;
  padding: 0 18px;
  border-left: 1px solid rgba(255,255,255,0.12);
  font-size: 13px;
}
.chrome-bu select {
  appearance: none;
  border: 0; background: transparent; color: #fff;
  font-size: 13px; font-weight: 700; cursor: pointer;
  padding-right: 14px;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6' fill='none' stroke='white' stroke-width='1.5'><polyline points='1,1 5,5 9,1'/></svg>");
  background-repeat: no-repeat; background-position: right 0 center;
}
.chrome-bu .tag { font-size: 10px; color: rgba(255,255,255,0.55); text-transform: uppercase; letter-spacing: 0.12em; }

.chrome-role {
  display: flex; align-items: center; gap: 10px;
  padding: 0 20px 0 18px;
  border-left: 1px solid rgba(255,255,255,0.12);
}
.chrome-role-label { font-size: 10px; text-transform: uppercase; letter-spacing: 0.12em; color: rgba(255,255,255,0.55); font-weight: 700; }
.chrome-role-select {
  appearance: none;
  background: rgba(255,255,255,0.12);
  border: 1px solid rgba(255,255,255,0.2);
  color: #fff; font-size: 12px; font-weight: 700;
  padding: 7px 28px 7px 12px;
  border-radius: 6px; cursor: pointer;
  text-transform: uppercase; letter-spacing: 0.06em;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6' fill='none' stroke='white' stroke-width='1.5'><polyline points='1,1 5,5 9,1'/></svg>");
  background-repeat: no-repeat; background-position: right 10px center;
}
.chrome-role-select:hover { background-color: rgba(255,255,255,0.2); }

/* ---------- Main layout ---------------------------------------------------- */
.main { display: grid; grid-template-columns: var(--sidebar-w) minmax(0, 1fr); min-height: 0; }

.sidebar {
  border-right: 1px solid var(--fpg-gray-100);
  background: var(--fpg-cotton);
  padding: 22px 14px;
  overflow-y: auto;
  display: flex; flex-direction: column; gap: 14px;
  min-width: 0;
}
.sidebar-header {
  padding: 4px 10px 18px;
  border-bottom: 1px solid var(--fpg-gray-100);
  margin-bottom: 4px;
}
.sidebar-header .sow-name {
  font-family: Georgia, serif; font-size: 22px; line-height: 1.18; margin: 6px 0 10px;
}
.sidebar-header .sow-meta { font-size: 12px; color: var(--fg-muted); line-height: 1.6; }
.sidebar-header .sow-meta strong { color: var(--fg); font-weight: 700; }

/* Sidebar sections */
.sidebar-section { padding: 14px 0 4px; border-top: 1px solid var(--fpg-gray-100); }
.sidebar-section:first-of-type { border-top: 0; padding-top: 6px; }
.sidebar-section-title {
  font-size: 10px; text-transform: uppercase; letter-spacing: 0.12em;
  font-weight: 700; color: var(--fg-muted);
  padding: 0 10px 8px;
}
.sidebar-section-body { display: flex; flex-direction: column; }

/* Sidebar totals block */
.sidebar-totals { padding: 14px 0 8px; margin-top: 10px; border-top: 1px solid var(--fpg-gray-100); }
.sidebar-totals-grid { padding: 0 10px; }
.st-row {
  display: flex; justify-content: space-between; align-items: baseline;
  padding: 5px 0; border-bottom: 1px dashed var(--fpg-gray-100);
  font-size: 12px;
}
.st-row:last-child { border-bottom: 0; }
.st-row .st-lbl { color: var(--fg-muted); font-weight: 500; }
.st-row .st-val { font-family: Georgia, serif; font-size: 15px; font-weight: 400; color: var(--fg); }
.st-row.primary .st-val { color: var(--fpg-orange-700); font-weight: 700; }
.st-row.primary { border-top: 1px solid var(--fpg-gray-200); padding-top: 8px; margin-top: 2px; }
.sidebar-totals-tags { padding: 10px 10px 0; display: flex; flex-direction: column; gap: 4px; font-size: 11px; }
.sidebar-totals-tags > div { display: flex; justify-content: space-between; }
/* Label stays on one line; long values (rate card names) wrap right-aligned. */
.sidebar-totals-tags .tg-l { color: var(--fg-muted); text-transform: uppercase; letter-spacing: 0.1em; font-size: 10px; font-weight: 700; white-space: nowrap; flex-shrink: 0; }
.sidebar-totals-tags .tg-v { font-weight: 700; text-align: right; }
/* Fee model / rate card rows are clickable — jump back to SOW Setup. */
.sidebar-totals-tags .tag-jump {
  display: flex; justify-content: space-between; align-items: baseline; gap: 10px;
  width: 100%; background: transparent; border: 0; padding: 3px 4px; margin: 0 -4px;
  border-radius: 4px; cursor: pointer; font: inherit; color: inherit; text-align: left;
}
.sidebar-totals-tags .tag-jump:hover { background: #FEF0E9; }
.sidebar-totals-tags .tag-jump:hover .tg-v { color: var(--fpg-orange-700); text-decoration: underline; }

/* Recent SOWs section — visually distinct card on the sidebar */
.sidebar-recents {
  margin: 14px 12px 8px;
  padding: 10px 0 6px;
  background: #fff;
  border: 1px solid var(--fpg-gray-100);
  border-radius: 8px;
  box-shadow: 0 1px 2px rgba(0,0,0,0.03);
}
.recents-head {
  width: 100%; display: flex; align-items: center; justify-content: space-between;
  padding: 4px 12px 8px; background: transparent; border: 0; cursor: pointer;
  color: var(--fg-muted); font-family: inherit;
}
.recents-head:hover .sidebar-section-title { color: var(--fg); }
.recents-head .sidebar-section-title { color: var(--fpg-orange-700) !important; }
.recents-list { display: flex; flex-direction: column; gap: 2px; padding: 0 6px; }
.recents-empty { padding: 8px 10px; font-size: 11px; color: var(--fg-muted); font-style: italic; }
.recent-item {
  display: flex; align-items: flex-start; gap: 6px;
  padding: 8px 10px; border-radius: 6px; cursor: pointer;
}
.recent-item:hover:not(.active) { background: #FEF0E9; }
.recent-item.active {
  background: var(--fpg-cotton);
  border-left: 3px solid var(--fpg-orange);
  padding-left: 7px;
  cursor: default;
}
.recent-meta { flex: 1; min-width: 0; }
.recent-name {
  font-size: 12px; font-weight: 700; color: var(--fg);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  display: flex; align-items: center; gap: 6px;
}
.recent-active-pill {
  font-size: 8.5px; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase;
  padding: 1px 6px; border-radius: 999px;
  background: var(--fpg-orange); color: #fff;
}
.recent-sub {
  font-size: 10.5px; color: var(--fg-muted); margin-top: 2px;
  display: flex; align-items: baseline; justify-content: space-between; gap: 6px;
  white-space: nowrap; overflow: hidden;
}
.recent-sub > span:first-child { overflow: hidden; text-overflow: ellipsis; }
.recent-updated { flex-shrink: 0; opacity: 0.7; }
.recent-modified {
  font-size: 10px; color: var(--fg-muted); opacity: 0.75; margin-top: 2px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.recent-del {
  border: 0; background: transparent; color: var(--fg-muted); cursor: pointer;
  padding: 0; border-radius: 50%; width: 18px; height: 18px;
  display: inline-flex; align-items: center; justify-content: center;
  opacity: 0; transition: opacity 120ms ease-out;
}
.recent-actions { display: inline-flex; align-items: center; gap: 2px; }
.recent-dup {
  border: 0; background: transparent; color: var(--fg-muted); cursor: pointer;
  padding: 0; border-radius: 50%; width: 18px; height: 18px;
  display: inline-flex; align-items: center; justify-content: center;
  opacity: 0; transition: opacity 120ms ease-out;
}
.recent-item:hover .recent-del,
.recent-item:hover .recent-dup { opacity: 1; }
.recent-del:hover { background: #FEE; color: #C44242; }
.recent-dup:hover { background: #FEF0E9; color: var(--fpg-orange-700); }

/* Template "Standard / Edited" badge on field labels */
.tpl-badge {
  display: inline-block; margin-left: 8px;
  font-size: 9px; font-weight: 700; letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 2px 6px; border-radius: 10px;
  background: var(--fpg-cotton); color: var(--fg-muted);
  border: 1px solid var(--fpg-gray-100);
}
.tpl-badge.edited {
  background: #FEF0E9; color: var(--fpg-orange-700); border-color: #FCC7A4;
}

.side-item {
  display: flex; align-items: center; gap: 10px;
  width: 100%; background: transparent; border: 0;
  padding: 9px 12px; border-radius: 6px; cursor: pointer;
  font-size: 13px; color: var(--fg); text-align: left;
  position: relative;
}
.side-item:hover { background: var(--fpg-cotton); }
.side-item.active { background: #FEF0E9; color: var(--fpg-orange-700); font-weight: 700; }
.side-item.active::before {
  content: ''; position: absolute; left: 0; top: 4px; bottom: 4px; width: 4px;
  background: var(--fpg-orange); border-radius: 2px;
}
.side-item .dot { width: 6px; height: 6px; border-radius: 50%; background: var(--fpg-gray-200); }
.side-item.active .dot { background: var(--fpg-orange); }

.role-note {
  padding: 12px 14px; border-radius: 8px; font-size: 12px; line-height: 1.5;
  margin-top: auto;
}
.role-note strong { display: block; font-size: 11px; text-transform: uppercase; letter-spacing: 0.08em; margin-bottom: 4px; }

/* ---------- Content ------------------------------------------------------- */
.content { overflow-y: auto; overflow-x: auto; min-width: 0; display: flex; flex-direction: column; }

/* Totals bar — sticky at top of content */
.totals-bar {
  position: sticky; top: 0; z-index: 8;
  display: flex; gap: 0;
  background: #fff;
  border-bottom: 1px solid var(--fpg-gray-100);
  padding: 18px 48px;
  align-items: center;
}
.totals-bar-cell {
  padding: 0 28px 0 0;
  border-right: 1px solid var(--fpg-gray-100);
  padding-left: 0;
}
.totals-bar-cell:first-child { padding-left: 0; }
.totals-bar-cell + .totals-bar-cell { padding-left: 28px; }
.totals-bar-cell .lbl { font-size: 10px; text-transform: uppercase; letter-spacing: 0.12em; color: var(--fg-muted); font-weight: 700; }
.totals-bar-cell .val { font-family: Georgia, serif; font-size: 24px; margin-top: 2px; line-height: 1.1; font-variant-numeric: tabular-nums; }
.totals-bar-cell .val .sub { font-size: 14px; color: var(--fg-muted); }
.totals-bar-cell.primary .val { color: var(--fpg-orange-700); }
.totals-bar-tag {
  margin-left: auto; font-size: 11px;
  text-align: right;
  line-height: 1.5;
  color: var(--fg);
}
.totals-bar-tag > div { font-weight: 700; letter-spacing: 0.04em; }
.totals-bar-tag .lbl-inline {
  font-size: 10px; color: var(--fg-muted); font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.12em;
  margin-right: 6px;
}

.content-inner { padding: 28px 48px 80px; flex: 1; }
.content-header { display: flex; align-items: flex-end; gap: 24px; margin-bottom: 24px; }
.content-header h1 {
  font-family: Georgia, serif; font-size: 30px; font-weight: 400; line-height: 1.15;
  margin: 0 0 6px;
}
.content-header .lede {
  color: var(--fg-muted); font-size: 13px;
  text-wrap: pretty; max-width: 78ch;
  margin: 0;
}
.content-header .actions { margin-left: auto; display: flex; gap: 8px; align-items: center; flex-shrink: 0; }

.eyebrow { font-size: 10px; text-transform: uppercase; letter-spacing: 0.14em; color: var(--fg-muted); font-weight: 700; }

/* Setup section headers */
.setup-section-head { margin-bottom: 4px; padding-bottom: 12px; border-bottom: 1px solid var(--fpg-gray-100); }
.setup-section-title {
  font-family: Georgia, serif; font-size: 18px; font-weight: 400;
  margin: 0 0 4px; color: var(--fg);
}
.setup-section-sub { margin: 0; font-size: 12px; color: var(--fg-muted); }

/* ---------- Buttons ------------------------------------------------------- */
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  font-family: Arial; font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.08em;
  padding: 10px 18px; border-radius: 999px; cursor: pointer; border: 1px solid transparent;
  transition: background-color 150ms ease-out, color 150ms ease-out, border-color 150ms ease-out;
}
.btn-primary { background: var(--fpg-orange); color: #fff; }
.btn-primary:hover { background: var(--fpg-orange-700); }
.btn-secondary { background: #fff; color: var(--fg); border-color: var(--fpg-gray); }
.btn-secondary:hover { background: var(--fpg-gray); color: #fff; }
.btn-ghost { background: transparent; color: var(--fg); }
.btn-ghost:hover { background: var(--fpg-gray-100); }
.btn-sm { padding: 6px 12px; font-size: 11px; }
.btn:disabled { opacity: 0.4; cursor: not-allowed; }

/* ---------- Cards --------------------------------------------------------- */
.card {
  background: #fff;
  border: 1px solid var(--fpg-gray-100);
  border-radius: 6px;
  padding: 24px;
}
.card-accent { border-top: 2px solid var(--fpg-orange); }

.pill { display: inline-flex; align-items: center; gap: 6px; font-size: 11px; padding: 3px 9px; border-radius: 999px; background: var(--fpg-cotton); color: var(--fg); font-weight: 700; letter-spacing: 0.04em; }
.pill-orange { background: #FEF0E9; color: #963E14; }
.pill-purple { background: #ECE3EE; color: #47254A; }
.pill-green { background: #E4F1E4; color: #2C5A2C; }
.pill-gray { background: var(--fpg-gray-100); color: var(--fg-muted); }

/* ---------- Inputs -------------------------------------------------------- */
.field-label { font-size: 11px; text-transform: uppercase; letter-spacing: 0.08em; color: var(--fg-muted); font-weight: 700; margin-bottom: 6px; display: block; }
.fp-input, .fp-select, .fp-textarea {
  width: 100%; font-family: Arial; font-size: 14px; color: var(--fg);
  border: 1px solid var(--fpg-gray-200); background: #fff;
  padding: 10px 12px; border-radius: 4px;
}
.fp-input:focus, .fp-select:focus, .fp-textarea:focus {
  outline: 0; border-color: var(--fpg-gray); box-shadow: 0 0 0 3px rgba(252, 133, 73, 0.15);
}
.fp-textarea { resize: vertical; min-height: 72px; font-family: Arial; }

/* Money input */
.money-input {
  display: inline-flex; align-items: center;
  border: 1px solid var(--fpg-gray-200); background: #fff;
  border-radius: 4px; overflow: hidden;
}
.money-input:focus-within { border-color: var(--fpg-gray); box-shadow: 0 0 0 3px rgba(252, 133, 73, 0.15); }
.money-input-prefix {
  padding: 0 8px 0 10px; color: var(--fg-muted); font-weight: 700; font-size: 14px;
  border-right: 1px solid var(--fpg-gray-100); background: var(--fpg-cotton);
  align-self: stretch; display: flex; align-items: center;
}
.money-input input {
  border: 0; outline: 0; padding: 10px 12px;
  font-family: Arial; font-size: 14px; color: var(--fg);
  background: transparent; text-align: right;
  font-variant-numeric: tabular-nums;
  width: 100%;
}
.money-input.sm input { padding: 6px 10px; font-size: 13px; }
.money-input.sm .money-input-prefix { padding: 0 6px 0 8px; font-size: 13px; }
.money-input.disabled { opacity: 0.55; }

/* Date input */
.fp-input[type=date] { font-family: Arial; }

/* ---------- Tables -------------------------------------------------------- */
.fp-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.fp-table th {
  text-align: left; padding: 10px 12px;
  font-size: 10px; text-transform: uppercase; letter-spacing: 0.08em; font-weight: 700; color: var(--fg-muted);
  border-bottom: 1px solid var(--fpg-gray-200); background: var(--fpg-cotton);
}
.fp-table td { padding: 12px; border-bottom: 1px solid var(--fpg-gray-100); vertical-align: top; }
.fp-table td.num, .fp-table th.num { text-align: right; font-variant-numeric: tabular-nums; }
.fp-table tr.total td { background: var(--fpg-gray); color: #fff; font-weight: 700; border-bottom: none; }

/* Sticky total row at the top */
.fp-table.sticky-total { border-collapse: separate; border-spacing: 0; }
.fp-table.sticky-total thead th { position: sticky; top: 0; z-index: 3; background: var(--fpg-cotton); }
.fp-table.sticky-total tr.total-top td {
  position: sticky; top: 36px; z-index: 2;
  background: var(--fpg-gray); color: #fff; font-weight: 700;
  padding: 14px 12px;
}

/* ---------- Wizard -------------------------------------------------------- */
.stepper { display: flex; gap: 0; margin-bottom: 24px; }
.stepper-step {
  flex: 1; display: flex; align-items: center; gap: 10px;
  padding: 14px 16px; border-bottom: 3px solid var(--fpg-gray-100); cursor: pointer;
  background: transparent; border-top: 0; border-left: 0; border-right: 0;
}
.stepper-step.active { border-bottom-color: var(--fpg-orange); }
.stepper-step.done { border-bottom-color: var(--fpg-gray); }
.stepper-step .num {
  width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center;
  background: var(--fpg-gray-100); color: var(--fg-muted); font-size: 11px; font-weight: 700;
}
.stepper-step.active .num { background: var(--fpg-orange); color: #fff; }
.stepper-step.done .num { background: var(--fpg-gray); color: #fff; }
.stepper-step .txt { font-size: 13px; font-weight: 700; color: var(--fg-muted); display: flex; flex-direction: column; align-items: flex-start; line-height: 1.35; }
.stepper-step .txt .step-title { font-size: 14px; font-weight: 700; }
.stepper-step .txt .step-sub { font-size: 11px; font-weight: 400; letter-spacing: 0; color: var(--fg-muted); }
.stepper-step.active .txt, .stepper-step.done .txt { color: var(--fg); }
.stepper-step.active .txt .step-sub, .stepper-step.done .txt .step-sub { color: var(--fg-muted); }

.guided-q.tight { margin-bottom: 8px; }
.guided-q.tight .guided-q-q { display: flex; align-items: center; gap: 8px; margin-bottom: 4px; }
.guided-q.tight .guided-select { margin-top: 0; }

/* CSS tooltip — works on hover/focus with no delay (native title= takes 1-2s). */
.tooltip-wrap {
  position: relative; flex-shrink: 0;
  display: inline-flex; align-items: center; justify-content: center;
  width: 18px; height: 18px; border-radius: 50%;
  background: var(--fpg-cotton); border: 1px solid var(--fpg-gray-100);
  color: var(--fg-muted); cursor: help; outline: 0;
  transition: color 120ms, border-color 120ms;
}
.tooltip-wrap:hover, .tooltip-wrap:focus { color: var(--fpg-orange-700); border-color: var(--fpg-orange); }
.tooltip-bubble {
  position: absolute; bottom: calc(100% + 8px); left: 50%; transform: translateX(-50%);
  background: var(--fpg-gray); color: #fff;
  padding: 10px 14px; border-radius: 6px;
  font-size: 12px; font-weight: 400; line-height: 1.45;
  white-space: normal; width: max-content; max-width: 320px;
  text-align: left;
  box-shadow: 0 8px 24px rgba(0,0,0,0.18);
  pointer-events: none;
  opacity: 0; visibility: hidden;
  transition: opacity 120ms, visibility 120ms;
  z-index: 50;
}
.tooltip-bubble::after {
  content: ''; position: absolute; top: 100%; left: 50%; transform: translateX(-50%);
  border: 6px solid transparent; border-top-color: var(--fpg-gray);
}
.tooltip-wrap:hover .tooltip-bubble,
.tooltip-wrap:focus .tooltip-bubble { opacity: 1; visibility: visible; }
.guided-select { margin-left: 32px; width: calc(100% - 32px); max-width: 480px; }

/* "Draft" pill on grid rows where required fields are missing — non-blocking. */
.draft-pill {
  display: inline-block;
  margin-left: 8px; padding: 1px 8px;
  background: #FFF4EB; color: #8A4A1E;
  border: 1px solid #F4B787; border-radius: 999px;
  font-size: 9px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase;
  vertical-align: middle;
}

/* Validation hint when no complexity factor is selected. */
.complexity-required-hint {
  margin-top: 12px; padding: 8px 10px;
  display: inline-flex; align-items: center; gap: 6px;
  background: #FFF4EB; color: #8A4A1E;
  border: 1px solid #F4B787; border-radius: 6px;
  font-size: 12px; font-weight: 500;
}

/* Step 3 variable-answer recap shown above the editable bullets, so reviewers
   can cross-check counts (e.g., "6 sizes" answer vs "4 sizes" bullet). */
.scope-vars-recap { background: var(--fpg-cotton); border-color: var(--fpg-orange-200); }
.vars-recap-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px 16px; }
.vars-recap-cell {
  display: flex; justify-content: space-between; align-items: baseline; gap: 12px;
  padding: 6px 10px; background: #fff; border: 1px solid var(--fpg-gray-100); border-radius: 4px;
}
.vars-recap-label { font-size: 12px; color: var(--fg-muted); min-width: 0; }
.vars-recap-value { font-size: 13px; font-weight: 700; color: var(--fpg-orange-700); flex-shrink: 0; }

/* "opt" badge next to optional variable labels (mirrors .req's *) */
.opt {
  display: inline-block;
  font-size: 9px; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase;
  padding: 1px 6px; border-radius: 999px;
  background: var(--fpg-cotton); color: var(--fg-muted);
  border: 1px solid var(--fpg-gray-100);
  margin-left: 2px;
  vertical-align: middle;
}
/* ---------- Guided tiering questions --------------------------------------- */
.guided-q { border: 1px solid var(--fpg-gray-100); border-radius: 6px; padding: 18px 22px; margin-bottom: 12px; background: #fff; }
.guided-q-q { font-family: Georgia, serif; font-size: 17px; font-weight: 400; margin-bottom: 12px; }
.guided-q-q .num { display: inline-block; width: 22px; height: 22px; border-radius: 50%; background: var(--fpg-gray-100); color: var(--fg-muted); font-family: Arial; font-size: 11px; font-weight: 700; text-align: center; line-height: 22px; margin-right: 10px; vertical-align: middle; }
.guided-q-q .num.done { background: var(--fpg-gray); color: #fff; }
/* Tiering tree: italic clarifier under a question + the Tier 1/2 · 3/4 palette tag. */
.guided-q-hint {
  font-size: 12.5px; font-style: italic; color: var(--fg-muted);
  margin: -6px 0 10px 32px; line-height: 1.45; max-width: 640px;
}
.guided-q.tight .guided-q-hint { margin: 0 0 8px 30px; }
/* ── Review lights on project lines (081326) ───────────────────────────── */
:root {
  --light-red: #C4453B;
  --light-yellow: #D9930B;
  --light-green: #3E8E5A;
}
.light-filter {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 12px;
}
.light-filter-label {
  font-family: Arial, sans-serif; font-size: 10px; font-weight: 700;
  letter-spacing: .08em; text-transform: uppercase; color: var(--fg-subtle, #8A8A8A);
}
.light-chip {
  display: inline-flex; align-items: center; gap: 6px;
  border: 1px solid var(--fpg-gray-200); background: #fff; border-radius: 999px;
  padding: 3px 10px; font-size: 12px; font-weight: 600; color: var(--fg-muted); cursor: pointer;
}
.light-chip:hover { border-color: var(--fpg-gray-300, #cfcfcf); }
.light-chip.on { border-color: currentColor; background: var(--fpg-cotton, #FAF8F5); }
.light-chip.light-red.on    { color: var(--light-red); }
.light-chip.light-yellow.on { color: var(--light-yellow); }
.light-chip.light-green.on  { color: var(--light-green); }
.light-chip.light-none.on   { color: var(--fg); }
.light-chip-n { font-variant-numeric: tabular-nums; opacity: .6; font-weight: 700; }
/* One flag glyph, tinted per status. Using a mask (not a background image) lets
   the same shape take any colour, so the chip and the row control stay in sync. */
:root {
  --flag-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M4 2h1.9v20H4z M6.7 3H19.4l-2.3 4.3 2.3 4.3H6.7z'/%3E%3C/svg%3E");
}
.light-dot {
  width: 11px; height: 11px; flex: 0 0 auto; background: var(--fpg-gray-300, #cfcfcf);
  -webkit-mask-image: var(--flag-mask); mask-image: var(--flag-mask);
  -webkit-mask-size: contain; mask-size: contain;
  -webkit-mask-repeat: no-repeat; mask-repeat: no-repeat;
  -webkit-mask-position: center; mask-position: center;
}
.light-chip.light-red    .light-dot { background: var(--light-red); }
.light-chip.light-yellow .light-dot { background: var(--light-yellow); }
.light-chip.light-green  .light-dot { background: var(--light-green); }
.light-chip.light-none   .light-dot { background: var(--fpg-gray-300, #cfcfcf); }
.light-clear {
  border: 0; background: transparent; color: var(--fpg-orange-700, #B4531F);
  font-size: 12px; font-weight: 700; cursor: pointer; padding: 3px 4px;
}

/* Per-row control: a flag that doubles as the picker. Text is hidden so the
   select reads as a flag; the accessible name comes from its title. It lives in
   its own grid column (see .pname) so the project name isn't indented past its
   own description line. */
.light-select {
  -webkit-appearance: none; appearance: none;
  width: 14px; height: 14px; padding: 0; border: 0; border-radius: 0;
  background-color: var(--fpg-gray-300, #cfcfcf);
  -webkit-mask-image: var(--flag-mask); mask-image: var(--flag-mask);
  -webkit-mask-size: contain; mask-size: contain;
  -webkit-mask-repeat: no-repeat; mask-repeat: no-repeat;
  -webkit-mask-position: center; mask-position: center;
  color: transparent; text-indent: -9999px;
  margin-top: 1px; cursor: pointer; flex: 0 0 auto;
}
.light-select:disabled { cursor: default; opacity: .5; }
.light-select.light-red    { background-color: var(--light-red); }
.light-select.light-yellow { background-color: var(--light-yellow); }
.light-select.light-green  { background-color: var(--light-green); }
.light-select:focus-visible { outline: 2px solid var(--fpg-orange); outline-offset: 2px; }
.light-select option { color: var(--fg); text-indent: 0; }

/* Flag in its own column so every text line — name, description, review row —
   shares one left edge instead of the name starting further right. */
.proj-row .pname { display: grid; grid-template-columns: 14px minmax(0, 1fr); gap: 8px; align-items: start; }
.proj-row .pname-text { min-width: 0; }

/* The review record under a project name: status · who · when · why. */
.review-line {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
  margin-top: 4px; font-weight: 400;
}
.review-badge {
  font-family: Arial, sans-serif; font-size: 10px; font-weight: 700;
  letter-spacing: .04em; text-transform: uppercase;
  padding: 1px 7px; border-radius: 10px; white-space: nowrap;
  border: 1px solid currentColor;
}
.review-line.light-red    .review-badge { color: var(--light-red); }
.review-line.light-yellow .review-badge { color: var(--light-yellow); }
.review-line.light-green  .review-badge { color: var(--light-green); }
.review-stamp { font-size: 11px; color: var(--fg-subtle, #8A8A8A); white-space: nowrap; }
.review-comment {
  flex: 1 1 180px; min-width: 120px; max-width: 420px;
  border: 0; border-bottom: 1px dashed var(--fpg-gray-200); background: transparent;
  font-family: inherit; font-size: 12px; color: var(--fg); padding: 1px 2px;
}
.review-comment::placeholder { color: var(--fg-subtle, #A5A5A5); font-style: italic; }
.review-comment:hover:not(:disabled) { border-bottom-color: var(--fpg-gray-300, #cfcfcf); }
.review-comment:focus { outline: 0; border-bottom-color: var(--fpg-orange); }
.review-comment:disabled { border-bottom-color: transparent; }

/* Tiering tree step label ("Step 01 · Define the palette"). */
.tier-step-label {
  font-family: Arial, sans-serif; font-size: 10px; font-weight: 700;
  letter-spacing: .08em; text-transform: uppercase;
  color: var(--fg-subtle, #8A8A8A); margin: 0 0 3px 30px;
}
/* Projects with no category picked yet — reads as a prompt, not a real category. */
.cat-name-unset { font-style: italic; color: var(--fpg-orange-700, #B4531F); }
.guided-a-row { display: flex; gap: 8px; flex-wrap: wrap; }
.guided-a { padding: 8px 14px; font-size: 12px; font-weight: 700; border: 1px solid var(--fpg-gray-200); border-radius: 999px; background: #fff; cursor: pointer; text-transform: uppercase; letter-spacing: 0.06em; }
.guided-a:hover { border-color: var(--fpg-gray); }
.guided-a.selected { background: var(--fpg-gray); color: #fff; border-color: var(--fpg-gray); }

.tier-result {
  margin-top: 16px; padding: 14px 18px;
  background: var(--fpg-cotton); border-radius: 8px;
  display: flex; align-items: center; gap: 16px;
}
.tier-result-label {
  font-family: Georgia, serif; font-size: 20px;
}
.tier-result-desc { color: var(--fg-muted); font-size: 12px; line-height: 1.5; flex: 1; }

/* ---------- Staffing (multi-role per dept) --------------------------------- */
.dept-group-header {
  margin: 24px 0 6px;
  padding: 8px 12px;
  font-size: 11px; font-weight: 700; letter-spacing: 0.12em; text-transform: uppercase;
  color: var(--fg-muted);
  background: var(--fpg-cotton);
  border-left: 3px solid var(--fpg-orange);
}
.dept-group-header-central { background: #F4EEFE; border-left-color: #6E3FBF; color: #47254A; }

.staff-totals-strip {
  display: inline-flex; align-items: center; gap: 10px;
  font-size: 12px; color: var(--fg-muted);
}
.staff-totals-strip strong { color: var(--fg); font-weight: 700; }
.staff-collapse-btn {
  background: var(--fpg-gray); color: #fff; border: 0;
  width: 22px; height: 22px; border-radius: 4px; cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center;
  margin-left: 10px;
}
.staff-collapse-btn:hover { background: var(--fpg-orange); }

/* All staffing rows share the same column template so hours/rate/extended
   line up across the dept header and each role line. */
.staff-dept {
  background: #fff; border: 1px solid var(--fpg-gray-100); border-radius: 8px;
  margin-bottom: 10px; overflow: hidden;
  /* Single shared template: title-select | name-input | hours | rate | extended | delete.
     The dept header reuses this template and spans the first two columns. */
  --staff-cols: 240px 1fr 76px 90px 110px 32px;
}
.staff-dept-head {
  display: grid;
  grid-template-columns: var(--staff-cols);
  align-items: center;
  gap: 12px;
  padding: 10px 18px;  /* tighter — was 12px */
  background: var(--fpg-cotton);
  border-bottom: 1px solid var(--fpg-gray-100);
  font-size: 13px;
  cursor: pointer;
  transition: background-color 120ms;
}
.staff-dept-head .dept-name-cell { grid-column: 1 / span 2; }
.staff-dept-head .num { text-align: right; }
.staff-dept-head .val { grid-column: span 2; text-align: right; }
.staff-dept-head:hover { background: #F4EBE0; }
.staff-dept.dept-group-central .staff-dept-head { background: #F4EEFE; }
.staff-dept.dept-group-central .staff-dept-head:hover { background: #ECE3EE; }
.staff-dept-head .dept-name-cell { display: flex; align-items: center; gap: 8px; min-width: 0; }
.staff-dept-head .dept-name { font-weight: 700; }
.staff-dept-head .meta { color: var(--fg-muted); font-size: 11px; margin-top: 2px; }
.staff-dept-head .num,
.staff-dept-head .val { text-align: right; font-variant-numeric: tabular-nums; font-weight: 700; }
/* Span "fee" across rate+extended columns so it sits over the per-role extended total. */
.staff-dept-head .val { grid-column: span 2; }
.staff-roles { padding: 4px 0 8px; }
.staff-role {
  display: grid;
  grid-template-columns: var(--staff-cols);
  gap: 12px; align-items: center;
  padding: 8px 18px;
}
/* Ensure hours/rate/extended/delete cells are right-edge-aligned. */
.staff-role .hour-input { width: 70px; justify-self: end; }
.staff-role .extended { text-align: right; }
.staff-role .delete-btn { justify-self: center; }
.staff-role .role-title-select select,
.staff-role .role-name-input input {
  width: 100%; border: 1px solid transparent; background: transparent;
  padding: 6px 8px; border-radius: 4px; font-family: inherit; font-size: 13px;
}
.staff-role .role-name-input input::placeholder { color: var(--fg-subtle); font-style: italic; }
.staff-role .role-name-input input:hover,
.staff-role .role-name-input input:focus,
.staff-role .role-title-select select:hover,
.staff-role .role-title-select select:focus { border-color: var(--fpg-gray-200); background: #fff; outline: 0; }
.staff-role .role-title-select select { appearance: none; cursor: pointer; padding-right: 18px; }
.staff-role .rate-cell { text-align: right; font-variant-numeric: tabular-nums; font-size: 12px; color: var(--fg-muted); }
.staff-role .rate-cell .muted { margin-left: 1px; }

/* Staff Plan (aggregated read-only view) — shares the dept card chrome but a
   different row layout: title (240px) | assignee (wider 1fr) | hrs | % | extended | empty.
   Wider assignee column so names don't wrap unnecessarily. */
.staff-dept-head.plan,
.staff-role.plan,
.staff-plan-colhead {
  display: grid;
  /* title · assignee · hours · % · rate (070226) · extended $ · icon.
     ONE template for the column labels, the dept header and the role rows —
     keeping them in separate declarations is how the header % ended up a
     column left of the role % once already. */
  grid-template-columns: var(--plan-cols);
  gap: 12px; align-items: center;
}
.staff-dept-head.plan {
  padding: 8px 18px;  /* tighter dept header — was 12px from default */
}
.staff-plan-colhead {
  /* Asymmetric on purpose: the dept cards carry a 3px group-accent border on
     the LEFT (.dept-group-core / -central) but only the base 1px on the right,
     so content sits 21px in from the left edge and 19px from the right. */
  padding: 0 19px 5px 21px;
  font-size: 10px; font-weight: 700; letter-spacing: 0.06em;
  text-transform: uppercase; color: var(--fg-subtle);
}
.staff-plan-colhead .num { text-align: right; }
.staff-role.plan {
  padding: 8px 18px;
  font-size: 13px;
  border-bottom: 1px solid var(--fpg-gray-100);
}
.staff-role.plan:last-child { border-bottom: 0; }
.staff-role.plan .role-title-cell {
  font-weight: 600; color: var(--fg);
  white-space: normal; word-break: break-word;
}
.staff-role.plan .role-assignee { padding: 0; }
.staff-role.plan .num,
.staff-role.plan .extended { text-align: right; font-variant-numeric: tabular-nums; }
.staff-role.plan .extended { font-weight: 700; }
/* Header layout matches the row layout: name spans both leftmost cells so the
   hrs / % / fee cells sit in the SAME columns as each role row beneath them.
   (Previously the header name took only col 1 and fee spanned 2 — pushing the
   header % one column left of the role %.) */
.staff-dept-head.plan .dept-name-cell { grid-column: 1 / span 2; }
.staff-dept-head.plan .val { grid-column: auto; }

/* Title caption under the level select in the per-project staffing editor */
.role-title-cap {
  margin-top: 4px; padding: 0 4px;
  font-size: 11px; color: var(--fg-muted); line-height: 1.25;
  font-weight: 500;
  white-space: normal; word-break: break-word;
}

/* Stacked title + level cell in the aggregated Staffing Plan view */
.role-title-level { display: flex; flex-direction: column; padding: 0 8px; min-width: 0; }
.role-title-level .role-title {
  font-size: 12px; font-weight: 700; color: var(--fg); line-height: 1.25;
  white-space: normal; word-break: break-word;
}
.role-title-level .role-level-sub {
  font-size: 10px; font-weight: 700; letter-spacing: 0.08em;
  color: var(--fg-muted); margin-top: 2px;
}
.staff-role .rate, .staff-role .extended { text-align: right; font-variant-numeric: tabular-nums; font-size: 13px; }
.staff-role .extended { font-weight: 700; }
.staff-role .hour-input { width: 70px; justify-self: end; }
.staff-role .delete-btn {
  background: transparent; border: 0; color: var(--fg-subtle); cursor: pointer;
  padding: 4px; border-radius: 4px;
}
.staff-role .delete-btn:hover { color: #C44242; background: #FEE; }

.staff-dept-actions {
  display: flex; gap: 8px; padding: 8px 18px 14px;
  border-top: 1px dashed var(--fpg-gray-100);
}
.staff-dept-actions button {
  background: transparent; border: 1px dashed var(--fpg-gray-200);
  color: var(--fg-muted); font-size: 11px; padding: 6px 12px; border-radius: 4px;
  cursor: pointer; font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em;
  display: inline-flex; align-items: center; gap: 6px;
}
.staff-dept-actions button:hover { border-color: var(--fpg-gray); color: var(--fg); background: #fff; }

.hour-input {
  width: 72px; font-size: 13px; padding: 6px 8px;
  border: 1px solid var(--fpg-gray-200); border-radius: 4px; text-align: right;
  font-variant-numeric: tabular-nums;
  background: #fff; color: var(--fg);
}
.hour-input:focus { outline: 0; border-color: var(--fpg-gray); }

/* ---------- Profitability meter -------------------------------------------- */
.profitability {
  padding: 20px;
  border: 1px solid var(--fpg-gray-100);
  background: var(--fpg-cotton);
  border-radius: 6px;
}
.profitability-bar {
  position: relative; height: 12px; background: #fff; border: 1px solid var(--fpg-gray-200); border-radius: 999px; overflow: hidden; margin: 16px 0 8px;
}
.profitability-fill { height: 100%; background: var(--fpg-orange); transition: width 300ms; }
.profitability-fill.warn { background: #E0A71A; }
.profitability-fill.bad { background: #C44242; }
.profitability-target { position: absolute; top: -4px; bottom: -4px; width: 2px; background: var(--fpg-gray); }
.profitability-nums { display: flex; justify-content: space-between; font-size: 12px; color: var(--fg-muted); }
.profitability-nums strong { color: var(--fg); font-size: 14px; }

/* ---------- Conversational view ------------------------------------------- */
.convo { max-width: 720px; margin: 0 auto; }
.convo-bubble {
  padding: 14px 18px; border-radius: 14px; max-width: 82%; margin-bottom: 12px;
  line-height: 1.55; font-size: 14px;
}
.convo-bubble.system { background: var(--fpg-cotton); color: var(--fg); }
.convo-bubble.user { background: var(--fpg-gray); color: #fff; margin-left: auto; border-bottom-right-radius: 4px; }
.convo-bubble.system { border-bottom-left-radius: 4px; }
.convo-bubble.system em { color: var(--fpg-orange-700); font-style: normal; font-weight: 700; }

/* ---------- Tweaks panel --------------------------------------------------- */
.tweaks-panel {
  position: fixed; right: 24px; bottom: 24px;
  width: 320px; max-height: 70vh; overflow-y: auto;
  background: #fff; border: 1px solid var(--fpg-gray); border-radius: 8px;
  box-shadow: var(--shadow-lg);
  padding: 16px 18px; font-size: 13px; z-index: 50;
}
.tweaks-panel h3 { font-family: Arial; font-size: 11px; font-weight: 700; letter-spacing: 0.12em; text-transform: uppercase; margin: 0 0 6px; color: var(--fg-muted); }
.tweaks-panel h2 { font-family: Georgia, serif; font-size: 18px; font-weight: 400; margin: 0 0 16px; }
.tweaks-group { margin-bottom: 18px; }
.tweaks-group-label { font-size: 11px; font-weight: 700; margin-bottom: 6px; }
.tweaks-options { display: flex; gap: 4px; border: 1px solid var(--fpg-gray-200); border-radius: 6px; padding: 3px; }
.tweaks-options button {
  flex: 1; font-size: 11px; padding: 6px 8px; border-radius: 4px;
  border: 0; background: transparent; cursor: pointer; font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.04em; color: var(--fg-muted);
}
.tweaks-options button.active { background: var(--fpg-gray); color: #fff; }

/* ---------- Projects grid (category grouped) ------------------------------- */
.projects-grid { width: 100%;
  /* T&M: idx · name · hours · fee · oop · total · profit · actions
     Actions widened to 132px so 4 buttons (~116px) never overflow left into
     the profitability column; profitability gets a touch more room (88px). */
  --grid-cols: 40px minmax(220px, 2fr) 84px 104px 100px 110px 88px 132px;
}
/* Fixed Fee drops the Hours column */
.projects-grid.ff { --grid-cols: 40px minmax(220px, 2fr) 104px 100px 110px 88px 132px; }
/* Projects & Pricing grid carries a Tier column (070226) — the Summary rollup
   shares the base class but not this modifier, so it keeps the original layout. */
.projects-grid.tiered { --grid-cols: 40px minmax(220px, 2fr) 48px 84px 104px 100px 110px 88px 132px; }
.projects-grid.ff.tiered { --grid-cols: 40px minmax(220px, 2fr) 48px 104px 100px 110px 88px 132px; }
.projects-grid-header {
  display: grid;
  grid-template-columns: var(--grid-cols);
  gap: 0; padding: 12px 18px;
  background: var(--fpg-gray); color: #fff;
  border-radius: 8px 8px 0 0;
  position: sticky; top: 0; z-index: 4;
  font-size: 10px; text-transform: uppercase; letter-spacing: 0.1em; font-weight: 700;
  align-items: center;
}
.projects-grid-header > .num { text-align: right; }
.projects-grid-header .row-actions-head { display: flex; justify-content: flex-end; }
.grid-collapse-btn {
  background: rgba(255,255,255,0.15); border: 0; color: #fff;
  width: 22px; height: 22px; border-radius: 4px; cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center;
}
.grid-collapse-btn:hover { background: rgba(255,255,255,0.28); }

.cat-group { margin-bottom: 2px; border-left: 1px solid var(--fpg-gray-100); border-right: 1px solid var(--fpg-gray-100); }
.cat-group:last-of-type { border-bottom: 1px solid var(--fpg-gray-100); }
.cat-header {
  display: grid;
  grid-template-columns: var(--grid-cols);
  gap: 0; padding: 16px 18px;
  background: #FAF5EF;
  border-top: 2px solid var(--fpg-gray);
  border-bottom: 1px solid var(--fpg-gray-200);
  align-items: center;
  cursor: pointer;
  transition: background-color 120ms;
}
.cat-header:hover { background: #F4EBE0; }
.cat-chev { color: var(--fg-muted); justify-self: center; }
.cat-name-cell { display: flex; align-items: baseline; gap: 10px; }
.cat-header .cat-name {
  font-family: Georgia, serif; font-size: 20px; font-weight: 400;
  color: var(--fg); letter-spacing: -0.01em;
}
.cat-header .cat-count {
  font-size: 11px; color: var(--fg-muted); text-transform: uppercase; letter-spacing: 0.1em;
}
.cat-header .num {
  text-align: right; color: var(--fg);
  font-family: Georgia, serif; font-size: 15px; font-weight: 400;
  font-variant-numeric: tabular-nums;
}

.cat-group.collapsed .cat-header { border-bottom-color: var(--fpg-gray-100); }

.proj-row {
  display: grid;
  grid-template-columns: var(--grid-cols);
  gap: 0; padding: 12px 18px;
  border-bottom: 1px solid var(--fpg-gray-100);
  align-items: center;
  font-size: 13px;
  cursor: pointer;
  transition: background-color 120ms;
}
.proj-row:hover { background: var(--fpg-cotton); }
.proj-row.active { background: #FEF0E9; border-left: 3px solid var(--fpg-orange); padding-left: 15px; }
.proj-row.active:hover { background: #FCE1D1; }
.proj-row.aor-auto { background: #F4EEFE; border-left: 3px solid #6E3FBF; padding-left: 15px; }
.proj-row.aor-auto:hover { background: #ECE3EE; }
.proj-row .idx { color: var(--fg-muted); font-size: 11px; font-variant-numeric: tabular-nums; }
.proj-row .pname strong { display: block; font-weight: 700; }
.proj-row .pname .pdesc { color: var(--fg-muted); font-size: 11px; line-height: 1.4; margin-top: 2px; overflow: hidden; text-overflow: ellipsis; display: -webkit-box; -webkit-line-clamp: 1; -webkit-box-orient: vertical; }
.proj-row .ptype { color: var(--fg-muted); font-size: 12px; }
.proj-row .tier-cell { font-size: 11px; }
.proj-row .num { text-align: right; font-variant-numeric: tabular-nums; }
.proj-row .num.primary { font-weight: 700; }
.proj-row .num.total { font-weight: 700; color: var(--fpg-orange-700); }

.row-actions { display: flex; gap: 4px; justify-content: flex-end; padding-left: 8px; }
.row-action {
  width: 26px; height: 26px; border-radius: 4px;
  background: transparent; border: 1px solid var(--fpg-gray-100);
  color: var(--fg-muted); cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center;
  transition: all 120ms;
}
.row-action:hover { background: #fff; color: var(--fg); border-color: var(--fpg-gray-200); }
.row-action.danger:hover { color: #B91C1C; border-color: #FCA5A5; background: #FEF2F2; }

.grand-total-row {
  display: grid;
  grid-template-columns: var(--grid-cols);
  gap: 0; padding: 14px 18px;
  background: var(--fpg-gray); color: #fff;
  border-radius: 0 0 8px 8px;
  font-size: 13px; font-weight: 700;
  align-items: center;
}
.grand-total-row .num { text-align: right; font-variant-numeric: tabular-nums; }
.grand-total-row .num.total { color: var(--fpg-orange-200, #FCC7A4); }
.grand-total-row .label {
  text-transform: uppercase; letter-spacing: 0.1em; font-size: 11px;
}

/* ---------- Project editor ---------------------------------------------- */
.project-editor-wrap {
  border-top: 1px solid var(--fpg-gray-100);
  margin-top: 12px; padding-top: 24px;
}
.project-editor-breadcrumb {
  display: flex; align-items: center; gap: 8px; margin-bottom: 12px;
  font-size: 12px;
}
.project-editor-breadcrumb a { color: var(--fpg-orange-700); cursor: pointer; }

/* ---------- Input details (Step 1) ----------------------------------- */
.input-details-grid {
  display: grid; grid-template-columns: 320px minmax(0, 1fr); gap: 16px;
  margin-bottom: 16px;
}
.input-details-right { display: flex; flex-direction: column; }
.type-search { position: relative; display: flex; align-items: center; gap: 8px; }
.type-search svg { position: absolute; left: 10px; opacity: 0.5; }
.type-search input { padding-left: 32px !important; }
.type-list { max-height: calc(100vh - 240px); min-height: 720px; overflow-y: auto; padding: 8px; border: 1px solid var(--fpg-gray-200); border-radius: 6px; background: #fff; }
.type-cat { margin-bottom: 12px; }
.type-cat-head {
  font-size: 10px; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase;
  color: var(--fpg-gray-500, #666); padding: 6px 4px 4px;
  border-bottom: 1px solid var(--fpg-gray-100);
}
.type-item {
  display: flex; justify-content: space-between; align-items: center; gap: 8px;
  width: 100%; padding: 8px 10px; border: 1px solid transparent;
  background: transparent; cursor: pointer; border-radius: 4px;
  text-align: left; font-size: 12.5px; line-height: 1.3;
  margin: 1px 0;
}
.type-item:hover:not(:disabled) { background: var(--fpg-cotton, #fff8f0); }
.type-item.active { background: var(--fpg-orange-100, #fde4cf); border-color: var(--fpg-orange-700); font-weight: 600; }
.type-item-meta { white-space: nowrap; font-size: 11px; }
.type-item-name { flex: 1; min-width: 0; }
.type-item-cat {
  flex-shrink: 0; padding: 2px 7px; border-radius: 999px;
  font-size: 9.5px; font-weight: 700; letter-spacing: 0.06em;
  background: var(--fpg-cotton); color: var(--fg-muted);
  border: 1px solid var(--fpg-gray-100);
}
.type-item-cat.tier-H { background: #FEF0E9; color: var(--fpg-orange-700); border-color: #FCC7A4; }
.type-item-cat.tier-M { background: #ECE3EE; color: #47254A; border-color: #D4BFD8; }
.type-item-cat.tier-L { background: #E4F1E4; color: #2C5A2C; border-color: #BFD8BF; }
.vars-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px 16px; }
.req { color: var(--fpg-orange-700); margin-left: 2px; }

.input-details-summary {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px;
  background: var(--fpg-cotton, #fff8f0);
  border: 1px solid var(--fpg-gray-100);
  border-radius: 8px; padding: 16px 20px;
}
.ids-cell { }
.ids-label { font-size: 10px; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase;
  color: var(--fpg-gray-500, #666); margin-bottom: 4px; }
.ids-val { font-family: Georgia, serif; font-size: 22px; line-height: 1.1; }

/* ---------- Helpers -------------------------------------------------------- */
.flex { display: flex; } .grow { flex: 1; } .between { justify-content: space-between; }
.gap-1 { gap: 4px; } .gap-2 { gap: 8px; } .gap-3 { gap: 12px; } .gap-4 { gap: 16px; } .gap-5 { gap: 24px; }
.mt-1 { margin-top: 4px; } .mt-2 { margin-top: 8px; } .mt-3 { margin-top: 12px; } .mt-4 { margin-top: 16px; } .mt-5 { margin-top: 24px; } .mt-6 { margin-top: 32px; }
.mb-2 { margin-bottom: 8px; } .mb-3 { margin-bottom: 12px; } .mb-4 { margin-bottom: 16px; } .mb-5 { margin-bottom: 24px; }
.w-full { width: 100%; }
.muted { color: var(--fg-muted); }
.small { font-size: 12px; }
.center { text-align: center; }
.nowrap { white-space: nowrap; }
.num-mono { font-variant-numeric: tabular-nums; }

/* ---------- Client PDF preview -------------------------------------------- */
.preview-toolbar {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 16px;
  background: var(--fpg-gray-800);
  color: #fff;
  border-radius: 6px;
  margin-bottom: 24px;
  position: sticky; top: 0;
  z-index: 5;
}
.preview-toolbar .muted { color: rgba(255,255,255,0.6); }
.preview-toolbar .btn-ghost { color: #fff; }
.preview-toolbar .btn-ghost:hover { background: rgba(255,255,255,0.1); }

.pdf-page {
  background: #fff;
  max-width: 820px;
  margin: 0 auto 40px;
  padding: 60px 70px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.08), 0 12px 40px rgba(0,0,0,0.12);
  border: 1px solid var(--fpg-gray-100);
  color: var(--fpg-gray);
  font-size: 12.5px;
  line-height: 1.55;
}

.pdf-cover {
  text-align: left;
  padding-bottom: 40px;
  border-bottom: 1px solid var(--fpg-gray-100);
  margin-bottom: 40px;
}
/* The FPM logo SVG is white text + a purple swoosh, so it needs a dark backdrop
   in the PDF cover (printed on white paper) to read. */
.pdf-logo-band {
  display: inline-block;
  background: var(--fpg-gray);
  padding: 14px 22px; border-radius: 4px;
  margin-bottom: 48px;
  -webkit-print-color-adjust: exact; print-color-adjust: exact;
}
.pdf-logo { height: 72px; width: auto; display: block; margin: 0; }
.pdf-eyebrow {
  font-size: 10px; letter-spacing: 0.2em; text-transform: uppercase;
  color: var(--fpg-orange-700); font-weight: 700; margin-bottom: 12px;
}
.pdf-title {
  font-family: Georgia, serif; font-weight: 400;
  font-size: 40px; line-height: 1.1; margin: 0 0 8px;
  color: var(--fpg-gray);
}
.pdf-subtitle { font-size: 16px; color: var(--fg-muted); margin-bottom: 36px; }
.pdf-meta {
  display: grid; grid-template-columns: 1fr 1fr; gap: 16px 40px;
  margin: 0 0 40px;
  padding: 0;
}
.pdf-meta > div { border-top: 1px solid var(--fpg-gray-100); padding-top: 10px; }
.pdf-meta dt {
  font-size: 10px; letter-spacing: 0.12em; text-transform: uppercase;
  color: var(--fg-muted); margin-bottom: 4px;
}
.pdf-meta dd { margin: 0; font-size: 13px; font-weight: 500; }

.pdf-total-box {
  background: var(--fpg-orange-50);
  border: 1px solid var(--fpg-orange-200);
  padding: 24px 28px;
  border-radius: 2px;
}
.pdf-total-grid {
  display: grid;
  grid-template-columns: 1fr 1fr 1.4fr;
  gap: 24px;
  align-items: baseline;
}
.pdf-total-col { display: flex; flex-direction: column; }
.pdf-total-col.primary { border-left: 1px solid var(--fpg-orange-200); padding-left: 24px; }
.pdf-total-label {
  font-size: 10px; letter-spacing: 0.16em; text-transform: uppercase;
  color: var(--fpg-orange-700); font-weight: 700;
  margin-bottom: 4px;
}
.pdf-total-sub {
  font-family: Georgia, serif;
  font-size: 22px; line-height: 1; color: var(--fpg-gray);
}
.pdf-total-amount {
  font-family: Georgia, serif;
  font-size: 36px; line-height: 1; color: var(--fpg-gray);
}

.pdf-section { margin-bottom: 44px; }
.pdf-h2 {
  font-family: Georgia, serif; font-weight: 400;
  font-size: 22px; margin: 0 0 16px;
  padding-bottom: 10px;
  border-bottom: 2px solid var(--fpg-gray);
  color: var(--fpg-gray);
}

.pdf-table { width: 100%; border-collapse: collapse; font-size: 12px; }
.pdf-table thead th {
  text-align: left; font-size: 10px; letter-spacing: 0.1em; text-transform: uppercase;
  color: var(--fg-muted); padding: 8px 10px;
  border-bottom: 1px solid var(--fpg-gray-200);
}
.pdf-table thead th.num { text-align: right; }
.pdf-table td { padding: 7px 10px; border-bottom: 1px solid var(--fpg-gray-100); }
.pdf-table td.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.pdf-table td.indent { padding-left: 28px; color: var(--fg-muted); font-size: 12px; }
.pdf-table tr.cat-row td {
  background: var(--fpg-cotton);
  font-weight: 700;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--fpg-orange-700);
  border-bottom: 1px solid var(--fpg-gray-200);
}
.pdf-table tr.grand td {
  border-top: 2px solid var(--fpg-gray);
  border-bottom: none;
  font-weight: 700;
  font-size: 13px;
  padding-top: 12px;
}

.pdf-cat-block { margin-bottom: 28px; }
.pdf-cat-header {
  font-size: 10px; letter-spacing: 0.18em; text-transform: uppercase;
  color: #fff; background: var(--fpg-gray);
  padding: 6px 12px; margin-bottom: 16px;
  font-weight: 700;
  display: inline-block;
}
.pdf-project {
  padding: 18px 0 22px;
  border-bottom: 1px solid var(--fpg-gray-100);
  margin-bottom: 4px;
  page-break-inside: avoid;
}
.pdf-project:last-child { border-bottom: none; }
.pdf-project-head {
  display: flex; justify-content: space-between; align-items: baseline;
  gap: 20px; margin-bottom: 14px;
}
.pdf-project-idx {
  font-size: 9px; letter-spacing: 0.16em; text-transform: uppercase;
  color: var(--fg-subtle); margin-bottom: 4px; font-weight: 700;
}
.pdf-project-title {
  font-family: Georgia, serif; font-weight: 400;
  font-size: 18px; margin: 0; color: var(--fpg-gray);
}
.pdf-project-sub { font-size: 11px; color: var(--fg-muted); margin-top: 2px; }
.pdf-project-price { text-align: right; flex-shrink: 0; }
.pdf-project-price .amount {
  font-family: Georgia, serif; font-size: 22px; color: var(--fpg-gray);
  font-variant-numeric: tabular-nums;
}
.pdf-project-price .sub { font-size: 10px; color: var(--fg-muted); margin-top: 2px; }

.pdf-body-block { margin-top: 10px; }
.pdf-body-label {
  font-size: 9px; letter-spacing: 0.16em; text-transform: uppercase;
  color: var(--fg-muted); font-weight: 700; margin-bottom: 4px;
}
.pdf-body-block p { margin: 0; font-size: 12px; line-height: 1.55; }
.pdf-body-block ul { margin: 0; padding-left: 18px; font-size: 12px; line-height: 1.55; }
.pdf-body-block li { margin-bottom: 2px; }

.pdf-terms p { font-size: 11.5px; line-height: 1.6; margin: 0 0 12px; }
.pdf-terms strong { color: var(--fpg-gray); }

.pdf-signatures { margin-top: 48px; }
.pdf-sig-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 48px; margin-top: 20px; }
.pdf-sig-label {
  font-size: 10px; letter-spacing: 0.14em; text-transform: uppercase;
  color: var(--fg-muted); margin-bottom: 36px; font-weight: 700;
}
.pdf-sig-line { border-top: 1px solid var(--fpg-gray); margin-bottom: 8px; }
.pdf-sig-name { font-size: 12px; font-weight: 600; }
.pdf-sig-date { font-size: 11px; color: var(--fg-muted); margin-top: 4px; }

.pdf-footer {
  margin-top: 48px;
  padding-top: 14px;
  border-top: 1px solid var(--fpg-gray-100);
  font-size: 10px;
  letter-spacing: 0.1em;
  color: var(--fg-subtle);
  text-align: center;
  text-transform: uppercase;
}


/* ===== Bullet list editor ===== */
.bullet-editor { border: 1px solid var(--fpg-gray-100); border-radius: 6px; background: #fff; padding: 4px 10px; }
.bullet-empty { padding: 8px 4px; }
.bullet-row { display: grid; grid-template-columns: 20px 1fr 24px; gap: 6px; align-items: start; padding: 6px 0; border-bottom: 1px dashed var(--fpg-gray-100); }
.bullet-row:last-of-type { border-bottom: 0; }
.bullet-dot { color: var(--fpg-orange); font-weight: 700; font-size: 14px; padding-top: 6px; text-align: center; }
.bullet-input { width: 100%; border: 0; background: transparent; font: inherit; padding: 5px 4px; resize: none; outline: 0; line-height: 1.45; color: var(--fg); overflow: hidden; }
.bullet-input:focus { background: var(--fpg-cotton); border-radius: 4px; }
.bullet-del { border: 0; background: transparent; color: var(--fg-muted); cursor: pointer; padding: 4px; border-radius: 4px; align-self: start; margin-top: 2px; }
.bullet-del:hover { color: #C44242; background: #FEE; }
.bullet-add { display: grid; grid-template-columns: 20px 1fr auto; gap: 6px; align-items: center; padding: 10px 0 6px; border-top: 1px solid var(--fpg-gray-100); margin-top: 4px; }
.bullet-add-input { width: 100%; border: 0; background: transparent; font: inherit; padding: 5px 4px; outline: 0; color: var(--fg); }
.bullet-add-input:focus { background: var(--fpg-cotton); border-radius: 4px; }
.bullet-add-btn { padding: 4px 12px; border: 1px solid var(--fpg-gray-200); border-radius: 999px; background: #fff; font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em; color: var(--fg); cursor: pointer; }
.bullet-add-btn:hover:not(:disabled) { background: var(--fpg-gray); color: #fff; border-color: var(--fpg-gray); }
.bullet-add-btn:disabled { opacity: 0.4; cursor: not-allowed; }

/* ===== Categories editor (Setup) ===== */
.cat-editor-list { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.cat-chip { display: inline-flex; align-items: center; gap: 6px; padding: 6px 8px 6px 12px; border: 1px solid var(--fpg-gray-200); border-radius: 999px; background: #fff; }
.cat-chip input { border: 0; background: transparent; font: inherit; font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em; color: var(--fg); width: auto; min-width: 60px; outline: 0; }
.cat-chip input:focus { color: var(--fpg-orange-700); }
.cat-chip .del { border: 0; background: transparent; color: var(--fg-muted); cursor: pointer; padding: 0; border-radius: 50%; width: 18px; height: 18px; display: inline-flex; align-items: center; justify-content: center; }
.cat-chip .del:hover { background: #FEE; color: #C44242; }
.cat-add { padding: 6px 12px; border: 1px dashed var(--fpg-gray-200); border-radius: 999px; background: transparent; font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em; color: var(--fg-muted); cursor: pointer; }
.cat-add:hover { border-color: var(--fpg-orange); color: var(--fpg-orange); background: var(--fpg-cotton); }
.cat-suggestions { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin-top: 6px; }
.cat-suggestions-label { font-size: 10px; font-weight: 700; letter-spacing: 0.12em; color: var(--fg-muted); margin-right: 6px; }
.cat-suggestion {
  padding: 4px 10px; border-radius: 999px; cursor: pointer;
  border: 1px solid var(--fpg-gray-100); background: var(--fpg-cotton);
  font-size: 11px; font-weight: 600; color: var(--fg);
  display: inline-flex; align-items: center; gap: 4px;
}
.cat-suggestion:hover { border-color: var(--fpg-orange); background: #FEF0E9; color: var(--fpg-orange-700); }

/* Brand chips below the Brand / Indication label */
.brand-chips { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.brand-chip {
  padding: 0; border-radius: 999px; font-family: inherit;
  border: 1px solid var(--fpg-gray-200); background: #fff;
  font-size: 12px; font-weight: 600; color: var(--fg);
  display: inline-flex; align-items: stretch;
  overflow: hidden;
  transition: background-color 120ms ease-out, color 120ms ease-out, border-color 120ms ease-out;
}
.brand-chip:hover { border-color: var(--fpg-orange); color: var(--fpg-orange-700); }
.brand-chip.selected { background: var(--fpg-orange); border-color: var(--fpg-orange); color: #fff; }
.brand-chip.selected:hover { background: var(--fpg-orange-700); }
.brand-chip.add { border-style: dashed; color: var(--fg-muted); padding: 7px 14px; cursor: pointer; align-items: center; gap: 4px; }
.brand-chip.add:hover { color: var(--fpg-orange); background: var(--fpg-cotton); border-color: var(--fpg-orange); }

/* Selectable chip — text button + optional X to clear */
.brand-chip-label {
  background: transparent; border: 0; cursor: pointer; color: inherit;
  font: inherit; padding: 7px 14px;
}
.brand-chip-label:disabled { cursor: not-allowed; opacity: 0.6; }
.brand-chip.selected .brand-chip-label { padding-right: 6px; }
.brand-chip-x {
  background: transparent; border: 0; cursor: pointer; color: inherit;
  padding: 0 10px 0 4px; display: inline-flex; align-items: center;
  opacity: 0.85;
}
.brand-chip-x:hover { opacity: 1; background: rgba(0,0,0,0.12); }

/* "Reset to <client>" link next to Rate card label */
.rate-card-reset {
  float: right; background: transparent; border: 0; cursor: pointer;
  font: inherit; font-size: 10px; font-weight: 600; letter-spacing: 0.04em;
  color: var(--fpg-orange-700); padding: 0;
  text-transform: none;
}
.rate-card-reset:hover { text-decoration: underline; }
.brand-empty { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.brand-add-row { display: flex; gap: 8px; align-items: center; margin-top: 4px; }
.brand-add-row .fp-input { flex: 1; }

/* ===== Differentiated staffing section header ===== */
.staff-section-header { display: flex; align-items: baseline; justify-content: space-between; padding: 14px 18px; margin: -24px -24px 18px; background: var(--fpg-cotton); border-radius: 8px 8px 0 0; border-bottom: 2px solid var(--fpg-orange); flex-wrap: wrap; gap: 8px; }
.staff-section-header h3 { font-family: Georgia, serif; font-size: 22px; font-weight: 400; margin: 0; color: var(--fg); text-transform: none; letter-spacing: 0; }
.staff-section-header .sub { font-size: 11px; color: var(--fg-muted); margin-top: 2px; letter-spacing: 0.02em; }
.staff-section-header .metrics { display: flex; gap: 16px; align-items: baseline; font-size: 13px; font-variant-numeric: tabular-nums; }
.staff-section-header .metric-val { font-weight: 700; color: var(--fg); }

/* Staffing-plan view: condensed dept rows */
.staff-dept.condensed .staff-dept-head { padding-top: 10px; padding-bottom: 10px; }
.staff-dept.condensed .staff-roles { padding-top: 0; }
.staff-dept.condensed .staff-role { padding-top: 5px; padding-bottom: 5px; }

/* Group badge for staffing (Core/Central differentiation) */
.dept-group-core { border-left: 3px solid var(--fpg-orange); }
.dept-group-central { border-left: 3px solid #6E3FBF; }
.dept-group-central .staff-dept-head { background: #f4eefe; }
/* NOTE: a stale .staff-role grid-template-columns override used to live here
   (200px 1fr 90px 120px 32px). It conflicted with the shared --staff-cols
   template defined above. Removed so the header/role rows align cleanly. */


/* ===== Print: only the PDF content =====
 *
 * Key insight: `@page { margin: <X> }` is ADDED on top of the browser's own
 * default print margins, so a 0.5in page margin compounded with Chrome's
 * default ~0.4in ended up looking double-margined.
 *
 * Fix: zero out @page margins entirely, then bake our margins INTO `.pdf-page`
 * as padding. That way we own all of the spacing and the browser's
 * "Margins: Default" setting in the print dialog no longer matters.
 */
@media print {
  @page { size: letter; margin: 0; }
  html, body { background: #fff !important; margin: 0 !important; padding: 0 !important; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  .chrome, .sidebar, .content-header, .preview-toolbar, .tweaks-panel, .status-bar, [data-noprint], .no-print { display: none !important; }
  .app { display: block !important; }
  .main { display: block !important; grid-template-columns: 1fr !important; }
  .content { display: block !important; padding: 0 !important; margin: 0 !important; overflow: visible !important; }
  .content-inner { padding: 0 !important; margin: 0 !important; max-width: none !important; }
  /* All of the page margin lives in .pdf-page padding so we don't double up
   * with browser defaults. Letter = 8.5 × 11 in. */
  .pdf-page {
    margin: 0 !important;
    box-shadow: none !important;
    border: 0 !important;
    padding: 0.6in 0.7in !important;
    max-width: none !important;
    width: 100% !important;
    background: #fff !important;
  }
  .pdf-section { break-inside: avoid; page-break-inside: avoid; margin-bottom: 28px !important; }
  .pdf-project { break-inside: avoid; page-break-inside: avoid; margin-bottom: 22px !important; }
  .pdf-cover { break-after: page; page-break-after: always; padding-bottom: 0 !important; border-bottom: 0 !important; margin-bottom: 0 !important; }
  .pdf-cat-block { break-inside: avoid-page; }
  .pdf-table thead { display: table-header-group; }
  .pdf-h2 { break-after: avoid; page-break-after: avoid; }
  a { color: inherit !important; text-decoration: none !important; }
}


/* ===== Suggested pricing banner ===== */
.suggestion-banner { display: flex; align-items: center; gap: 16px; padding: 12px 16px; margin-bottom: 16px; background: linear-gradient(180deg, #FFF4EB, #FFEEDF); border: 1px solid #F4B787; border-radius: 8px; border-left: 3px solid var(--fpg-orange); }
.suggestion-banner .sb-body { flex: 1; }
.suggestion-banner .sb-label { font-size: 10px; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase; color: var(--fpg-orange-700); margin-bottom: 4px; }
.suggestion-banner .sb-amounts { font-family: Georgia, serif; font-size: 16px; color: var(--fg); font-variant-numeric: tabular-nums; }
.suggestion-banner .sb-amounts strong { color: var(--fpg-orange-700); font-weight: 700; font-family: Georgia, serif; }


/* ---------- Section head for Review step --------------------------------- */
.section-head {
  display: flex; align-items: baseline; justify-content: space-between;
  padding: 0 4px 12px 4px; margin-bottom: 12px;
  border-bottom: 1px solid var(--fpg-gray-100);
}

/* ---------- Review round 060726 additions ---------------------------------- */

/* Clickable sidebar header fields (SOW name / client / dates) → SOW Setup */
.sidebar-jump {
  background: transparent; border: 0; padding: 1px 4px; margin: -1px -4px;
  border-radius: 4px; cursor: pointer; font: inherit; color: inherit; text-align: left;
  display: inline-block; max-width: 100%;
}
.sidebar-jump:hover { background: #FEF0E9; color: var(--fpg-orange-700); text-decoration: underline; }
button.sow-name { display: block; width: 100%; }

/* Stronger rollover on the 4 SOW Administration nav items */
.side-item { transition: background-color 120ms ease-out, color 120ms ease-out; }
.side-item:hover:not(.active) { background: #FEF0E9; color: var(--fpg-orange-700); }
.side-item:hover:not(.active) .dot { background: var(--fpg-orange); }

/* Pulse highlight when a sidebar link lands you on a Setup section */
@keyframes setup-jump-flash {
  0% { box-shadow: 0 0 0 3px rgba(244, 110, 33, 0.55); }
  100% { box-shadow: 0 0 0 3px rgba(244, 110, 33, 0); }
}
.setup-jump-flash { animation: setup-jump-flash 1.4s ease-out 1; }

/* Likely-misconfiguration warning (Fixed Fee + non-FF rate card) */
.setup-warning {
  display: flex; gap: 10px; align-items: flex-start;
  padding: 12px 14px; border-radius: 6px;
  background: #FEF0E9; border: 1px solid #FCC7A4; color: #8A3A12;
  font-size: 13px; line-height: 1.45;
}
.setup-warning svg { flex-shrink: 0; margin-top: 2px; }
.link-btn {
  background: none; border: 0; padding: 0; cursor: pointer;
  color: var(--fpg-orange-700); text-decoration: underline; font: inherit; font-weight: 600;
}

/* Brand-level team editor (Setup) */
/* Role field shortened, name field widened (per review): dept | role | name | del */
.team-row {
  display: grid; grid-template-columns: 220px 200px 1fr 32px;
  gap: 10px; align-items: center; margin-bottom: 8px;
}
.team-row .delete-btn {
  background: transparent; border: 0; color: var(--fg-muted); cursor: pointer;
  width: 26px; height: 26px; border-radius: 4px;
  display: inline-flex; align-items: center; justify-content: center;
}
.team-row .delete-btn:hover { background: #FEE; color: #C44242; }

/* Phase 2: unmatched-title review affordances in the team editor */
.team-row-review .fp-select { border-color: #E4A23B; }
.team-row-review-note {
  grid-column: 1 / -1; justify-self: start;
  display: inline-flex; align-items: center; gap: 5px;
  font-size: 11px; font-weight: 600; color: #9A5B00;
  background: #FDF3E2; border: 1px solid #F0D8AE; border-radius: 4px;
  padding: 2px 8px; margin: 2px 0 4px;
}
.team-review-banner {
  display: flex; align-items: flex-start; gap: 8px;
  font-size: 12.5px; line-height: 1.45; color: #7A4A00;
  background: #FDF3E2; border: 1px solid #F0D8AE; border-radius: 6px;
  padding: 8px 12px; margin-bottom: 12px;
}
.team-review-banner svg { flex: 0 0 auto; margin-top: 2px; }

/* Phase 3: non-destructive "team changed — recalculate?" prompt in staffing */
.staff-stale-banner {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
  font-size: 12.5px; line-height: 1.45; color: #2A3E63;
  background: #EEF3FC; border: 1px solid #C9D8F0; border-radius: 6px;
  padding: 8px 12px; margin: 10px 0;
}
.staff-stale-banner svg { flex: 0 0 auto; color: #3E63A8; }
.staff-stale-banner .grow { flex: 1 1 auto; }

/* Core / Central group collapse toggles in the staffing grid */
.dept-group-toggle {
  display: flex; align-items: center; gap: 8px; width: 100%;
  cursor: pointer; border: 0; font-family: inherit; text-align: left;
}
.dept-group-toggle:hover { filter: brightness(0.96); }

/* Per-project notes thread under a SOW grid row */
.proj-notes {
  grid-column: 1 / -1;
  background: #FFFDF6; border: 1px solid var(--fpg-gray-100); border-top: 0;
  padding: 12px 16px 14px; cursor: default;
}
.proj-notes-user { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
.proj-note { padding: 8px 0; border-bottom: 1px dashed var(--fpg-gray-100); }
.proj-note:last-of-type { border-bottom: 0; }
.proj-note-head { display: flex; align-items: baseline; gap: 8px; font-size: 12px; }
.proj-note-text { font-size: 13px; margin-top: 3px; line-height: 1.45; white-space: pre-wrap; }
.proj-note.resolved .proj-note-text { text-decoration: line-through; color: var(--fg-muted); }
.proj-note-reply { margin: 8px 0 0 18px; padding-left: 10px; border-left: 2px solid var(--fpg-gray-100); font-size: 12px; }
.proj-note-add { display: flex; gap: 8px; margin-top: 10px; }
.proj-note-add.reply { margin-left: 18px; }
.proj-note-add .fp-input { flex: 1; }
.note-action {
  background: none; border: 0; padding: 0; cursor: pointer;
  font-size: 11px; font-weight: 600; color: var(--fg-muted); font-family: inherit;
}
.note-action:hover { color: var(--fpg-orange-700); text-decoration: underline; }
.note-action.danger:hover { color: #C44242; }
.row-action.has-notes { color: var(--fpg-orange-700); position: relative; }
.note-count {
  font-size: 9px; font-weight: 700; line-height: 1;
  background: var(--fpg-orange); color: #fff;
  border-radius: 999px; padding: 2px 4px; margin-left: 2px;
}

/* Finance-review flag on the PDF preview Terms (screen only — hidden in print) */
.pdf-review-note {
  display: flex; align-items: flex-start; gap: 8px;
  margin: 0 0 14px; padding: 10px 12px; border-radius: 6px;
  background: #FFF7E8; border: 1px dashed #D9A93F; color: #7A5A12;
  font-size: 12.5px; line-height: 1.45;
}
.pdf-review-note svg { flex-shrink: 0; margin-top: 1px; }

/* ---------- Auth: boot + sign-in screens, chrome user chip ----------------- */
.boot-screen, .signin-screen {
  position: fixed; inset: 0; display: flex; align-items: center; justify-content: center;
  background: var(--fpg-cotton, #FBF7F2);
}
.boot-card { color: var(--fg-muted); font-size: 14px; }
.signin-card {
  background: #fff; border: 1px solid var(--fpg-gray-100); border-radius: 12px;
  padding: 40px 44px; max-width: 420px; width: 100%; text-align: center;
  box-shadow: 0 8px 28px rgba(0,0,0,0.08);
}
.signin-logo {
  background: var(--fpg-gray); border-radius: 8px; padding: 16px;
  display: inline-flex; margin-bottom: 22px;
}
.signin-logo img { height: 36px; width: auto; display: block; }
.signin-eyebrow {
  font-size: 10px; font-weight: 700; letter-spacing: 0.14em; color: var(--fpg-orange-700);
}
.signin-title { font-family: Georgia, serif; font-weight: 400; font-size: 24px; margin: 6px 0 4px; }
.signin-sub { color: var(--fg-muted); font-size: 13px; margin: 0 0 22px; }
.signin-btn { width: 100%; justify-content: center; }

.chrome-user { display: inline-flex; align-items: center; gap: 10px; margin-left: 16px; }
.chrome-user-name {
  color: rgba(255,255,255,0.85); font-size: 12px; font-weight: 600;
  max-width: 160px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.chrome-signout {
  background: rgba(255,255,255,0.12); color: #fff; border: 0;
  padding: 4px 10px; border-radius: 6px; font-size: 11px; font-weight: 600; cursor: pointer;
}
.chrome-signout:hover { background: rgba(255,255,255,0.22); }

/* ── Department allocation sliders (EXPERIMENTAL — staffing-dept-sliders) ──── */
.dept-alloc {
  border: 1px solid var(--fpg-gray-100); border-left: 3px solid var(--fpg-orange);
  border-radius: 8px; padding: 12px 14px; margin: 10px 0 16px; background: var(--fpg-cotton);
}
.dept-alloc-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; margin-bottom: 12px; }
.dept-alloc-title { font-weight: 700; font-size: 12px; text-transform: uppercase; letter-spacing: 0.08em; color: var(--fg); }
.dept-alloc-sub { display: block; font-size: 11px; color: var(--fg-muted); margin-top: 3px; max-width: 60ch; line-height: 1.4; }
.dept-alloc-pool { display: flex; align-items: baseline; gap: 6px; white-space: nowrap; flex-shrink: 0; }
.dept-alloc-pool-num { font-family: Georgia, serif; font-size: 20px; color: var(--fg); }
.dept-alloc-reset {
  margin-left: 8px; border: 1px solid var(--fpg-gray-200); background: #fff; border-radius: 6px;
  padding: 3px 10px; font-size: 11px; font-weight: 700; cursor: pointer; color: var(--fg);
}
.dept-alloc-reset:hover:not(:disabled) { border-color: var(--fpg-orange); color: var(--fpg-orange-700); }
.dept-alloc-rows { display: flex; flex-direction: column; gap: 8px; }
/* Wider value column: two-decimal hours plus the % and the std chip need room,
   and the whole cell is LEFT-aligned now so the numbers line up down the list. */
.dept-alloc-row { display: grid; grid-template-columns: 22px 150px 1fr 200px; align-items: center; gap: 12px; }
.dept-alloc-name { font-size: 12px; font-weight: 600; color: var(--fg); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dept-alloc-val { display: flex; align-items: center; justify-content: flex-start; flex-wrap: nowrap; gap: 6px; font-size: 13px; }
/* Phase 4: numeric field + standard-baseline marker/reference on each slider */
.dept-alloc-slider-wrap { position: relative; width: 100%; display: flex; align-items: center; }
.dept-alloc-baseline {
  position: absolute; top: 50%; width: 2px; height: 14px; border-radius: 1px;
  background: var(--fpg-purple, #47254A); opacity: 0.45;
  transform: translate(-1px, -50%); pointer-events: none;
}
/* Fits "000.00" without clipping; left-aligned to match the cell. */
.dept-alloc-num {
  width: 68px; min-width: 68px; text-align: left; font-variant-numeric: tabular-nums;
  font-size: 13px; font-weight: 700; color: var(--fg);
  border: 1px solid var(--fpg-gray-200); border-radius: 5px; padding: 2px 6px; background: #fff;
}
.dept-alloc-num:focus { outline: none; border-color: var(--fpg-orange); }
.dept-alloc-std {
  border: 1px dashed var(--fpg-gray-300, #cfcfcf); background: #fff; color: var(--fg-muted);
  border-radius: 5px; font-size: 10.5px; font-weight: 600; padding: 1px 5px; cursor: pointer; white-space: nowrap;
}
.dept-alloc-std:hover:not(:disabled) { border-color: var(--fpg-orange); color: var(--fpg-orange-700); }
.dept-alloc-std:disabled { opacity: 0.5; cursor: default; }
.dept-alloc-foot { display: flex; align-items: center; gap: 6px; margin-top: 14px; flex-wrap: wrap; }
.dept-alloc-step {
  border: 1px solid var(--fpg-gray-200); background: #fff; border-radius: 6px;
  padding: 3px 10px; font-size: 12px; font-weight: 700; cursor: pointer; color: var(--fg); min-width: 42px;
}
.dept-alloc-step:hover:not(:disabled) { border-color: var(--fpg-orange); color: var(--fpg-orange-700); }
.dept-alloc-step:disabled, .dept-alloc-reset:disabled, .dept-alloc-slider:disabled { opacity: 0.4; cursor: not-allowed; }
.dept-alloc-add { width: 84px; padding: 4px 8px; }

/* Range slider — brand-orange track fill + thumb */
.dept-alloc-slider {
  -webkit-appearance: none; appearance: none; width: 100%; height: 6px; border-radius: 999px;
  background: var(--fpg-gray-200); outline: none; cursor: pointer;
}
.dept-alloc-slider::-webkit-slider-thumb {
  -webkit-appearance: none; appearance: none; width: 18px; height: 18px; border-radius: 50%;
  background: var(--fpg-orange); border: 2px solid #fff; box-shadow: 0 1px 3px rgba(0,0,0,0.3); cursor: pointer;
}
.dept-alloc-slider::-moz-range-thumb {
  width: 18px; height: 18px; border-radius: 50%; background: var(--fpg-orange);
  border: 2px solid #fff; box-shadow: 0 1px 3px rgba(0,0,0,0.3); cursor: pointer;
}
.dept-alloc-row.dept-group-central .dept-alloc-slider::-webkit-slider-thumb { background: var(--fpg-purple, #47254A); }
.dept-alloc-row.dept-group-central .dept-alloc-slider::-moz-range-thumb { background: var(--fpg-purple, #47254A); }

/* Staff-plan restructure (staffing-dept-sliders): sliders primary + per-person detail */
.dept-alloc-primary { margin-top: 12px; }
.dept-alloc-item { border-bottom: 1px solid var(--fpg-gray-100); }
.dept-alloc-item:last-child { border-bottom: 0; }
.dept-alloc-row { padding: 4px 0; }
.dept-alloc-expand {
  border: 0; background: transparent; cursor: pointer; color: var(--fg-muted);
  display: flex; align-items: center; justify-content: center; padding: 2px; border-radius: 4px;
}
.dept-alloc-expand:hover { color: var(--fpg-orange-700); background: var(--fpg-gray-100); }
.dept-alloc-detail {
  margin: 4px 0 10px; padding: 8px 10px 10px 34px; background: var(--fpg-cotton); border-radius: 8px;
  /* The per-person rows reuse .staff-role, whose grid reads --staff-cols. That
     variable is defined on .staff-dept, which does NOT wrap these rows in the
     slider UI — so the grid collapsed to ONE column and every cell stacked
     (the stray centered "×" in Steph's 080626 recording). Re-declare it here,
     slightly narrower to allow for this panel's left indent. */
  --staff-cols: 220px 1fr 76px 84px 104px 32px;
}
.dept-alloc-detail .staff-roles { display: flex; flex-direction: column; gap: 6px; }
.dept-alloc-detail .staff-dept-actions { margin-top: 8px; display: flex; gap: 10px; }
.dept-alloc-detail .staff-dept-actions button {
  border: 1px solid var(--fpg-gray-200); background: #fff; border-radius: 6px; padding: 3px 10px;
  font-size: 11px; font-weight: 700; cursor: pointer; color: var(--fg); display: inline-flex; align-items: center; gap: 5px;
}
.dept-alloc-detail .staff-dept-actions button:hover:not(:disabled) { border-color: var(--fpg-orange); color: var(--fpg-orange-700); }
.dept-alloc-adddept { font-size: 12px; }

/* Profitability + margin-vs-standard strip */
.staff-profit-strip {
  display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap;
  margin: 8px 0 2px; padding: 8px 12px; background: var(--fpg-cotton); border-radius: 8px;
}
.staff-profit-strip .srs-label {
  font-size: 10px; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase; color: var(--fg-muted);
}
.staff-profit-strip strong { font-family: Georgia, serif; font-size: 18px; }
.staff-profit-strip .srs-delta { margin-left: auto; }

/* Per-project staffing blocks on the Staff Plan page (staffing-dept-sliders) */
.staffplan-adjust { margin-top: 8px; }
.staffplan-proj { border: 1px solid var(--fpg-gray-100); border-radius: 8px; margin-bottom: 8px; overflow: hidden; }
.staffplan-proj-head {
  width: 100%; display: flex; align-items: center; gap: 8px; padding: 10px 14px;
  background: var(--fpg-cotton); border: 0; cursor: pointer; text-align: left; color: var(--fg);
}
.staffplan-proj-head:hover { background: var(--fpg-gray-100); }
.staffplan-proj-name { font-weight: 700; font-size: 13px; }
.staffplan-proj-hrs { font-family: Georgia, serif; font-size: 14px; }
.staffplan-proj-head .grow { flex: 1; }
.staffplan-proj-body { padding: 10px 14px 4px; }
/* The reused StaffingSection is a full card; flatten it a touch inside the block */
.staffplan-proj-body .card { border: 0; padding: 0; margin: 0; box-shadow: none; }

/* ── Feedback (082026): header button + schema-driven form ───────────────── */
.chrome-feedback {
  display: inline-flex; align-items: center; gap: 6px;
  background: transparent; color: #fff; border: 1px solid rgba(255,255,255,0.35);
  border-radius: 999px; padding: 6px 14px; margin-right: 8px;
  font-family: Arial, sans-serif; font-size: 11px; font-weight: 700;
  letter-spacing: .06em; text-transform: uppercase; cursor: pointer; white-space: nowrap;
}
.chrome-feedback:hover { border-color: #fff; background: rgba(255,255,255,0.12); }

.fb-overlay {
  position: fixed; inset: 0; background: rgba(20,12,30,0.45); z-index: 95;
  display: flex; align-items: flex-start; justify-content: center; padding: 8vh 16px 16px;
}
.fb-modal {
  width: 560px; max-width: 94vw; max-height: 84vh; overflow-y: auto;
  background: #fff; border-radius: 10px; padding: 20px;
  box-shadow: 0 18px 60px rgba(0,0,0,0.35);
}
.fb-head { display: flex; align-items: flex-start; gap: 12px; margin-bottom: 14px; }
.fb-title { font-family: var(--font-display, Georgia), serif; font-size: 19px; }
.fb-sub { color: var(--fg-muted); font-size: 12px; margin-top: 2px; }
.fb-x {
  margin-left: auto; background: transparent; border: 0; cursor: pointer;
  font-size: 22px; line-height: 1; color: var(--fg-muted); padding: 0 4px;
}
.fb-x:hover { color: var(--fg); }
.fb-fields { display: flex; flex-direction: column; gap: 14px; }
.fb-field .fp-input, .fb-field .fp-select { width: 100%; }
.fb-desc { margin: -2px 0 4px; }
.fb-textarea { resize: vertical; min-height: 84px; font-family: inherit; }
.fb-checks { display: flex; flex-wrap: wrap; gap: 6px; }
.fb-check {
  display: inline-flex; align-items: center; gap: 6px; cursor: pointer;
  border: 1px solid var(--fpg-gray-200); border-radius: 999px; padding: 4px 10px;
  font-size: 12px; color: var(--fg);
}
.fb-check.on { border-color: var(--fpg-orange); color: var(--fpg-orange-700, #B4531F); background: var(--fpg-cotton, #FAF8F5); }
.fb-rating { display: flex; gap: 2px; }
.fb-star {
  background: transparent; border: 0; cursor: pointer; padding: 0 2px;
  font-size: 22px; line-height: 1; color: var(--fpg-gray-200);
}
.fb-star.on { color: #D9930B; }
.fb-note { font-size: 13px; padding: 10px 12px; border-radius: 6px; background: var(--fpg-cotton, #FAF8F5); color: var(--fg-muted); }
.fb-note-warn { background: #FDF3E2; border: 1px solid #F0D8AE; color: #7A4A00; }
.fb-note-good { background: #EAF4EC; border: 1px solid #C4E0CB; color: #2C5A2C; }
.fb-foot { display: flex; align-items: center; gap: 8px; margin-top: 18px; flex-wrap: wrap; }

/* "Built from scratch" pointer list on a blank project's first step. */
.custom-next { margin: 10px 0 12px; padding-left: 18px; color: var(--fg-muted); font-size: 12.5px; line-height: 1.6; }
.custom-next strong { color: var(--fg); }

/* Busy spinner for long-running actions (the Excel export takes tens of
   seconds — see SummaryView). Sized to sit inline with button text. */
.btn-spinner {
  display: inline-block; width: 13px; height: 13px; flex: 0 0 auto;
  border: 2px solid currentColor; border-right-color: transparent;
  border-radius: 50%; opacity: .85; vertical-align: -2px;
  animation: btn-spin 0.7s linear infinite;
}
@keyframes btn-spin { to { transform: rotate(360deg); } }
.btn:disabled { opacity: .65; cursor: progress; }
@media (prefers-reduced-motion: reduce) { .btn-spinner { animation-duration: 2.5s; } }
