/* ============================================================
   VanillaPM — Authenticated app layout
   ----------------------------------------------------------------
   Page-specific layout for Dashboard + Project Detail.
   Builds ONLY on tokens.css / components.css — no new colours,
   type, or spacing values introduced.
   ============================================================ */

/* ── Brand lockup in nav ─────────────────────────────────── */
.brand-lockup {
  display: inline-flex; align-items: center; gap: var(--space-2);
  font-family: var(--font-sans); font-weight: 600; font-size: 18px;
  letter-spacing: -0.02em; color: var(--color-text-heading);
}
.brand-lockup:hover { text-decoration: none; }
.brand-lockup .pm { color: var(--color-primary); }
.brand-lockup svg { color: var(--color-primary); }

/* ── Top nav extensions ──────────────────────────────────── */
.topnav { position: sticky; top: 0; z-index: var(--z-sticky); }
.topnav-org { border: 1px solid transparent; background: transparent; }
.topnav-org:focus-visible { outline: none; box-shadow: var(--shadow-focus); }
.topnav-org-name { font-weight: 600; color: var(--color-text-heading); white-space: nowrap; }
.topnav-org svg.chev { width: 14px; height: 14px; color: var(--color-text-muted); }

.avatar-btn {
  border: 0; background: transparent; padding: 2px; border-radius: var(--radius-full);
  display: inline-flex; align-items: center; gap: 6px;
}
.avatar-btn:focus-visible { outline: none; box-shadow: var(--shadow-focus); }
.avatar-btn .chev { width: 14px; height: 14px; color: var(--color-text-muted); }

/* ── Dropdown menu (org switcher + avatar) ───────────────── */
.menu-wrap { position: relative; }
.menu {
  position: absolute; top: calc(100% + 8px);
  min-width: 240px;
  background: var(--color-surface-card);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-lg);
  padding: var(--space-2);
  z-index: var(--z-dropdown);
  opacity: 0; transform: translateY(-4px); pointer-events: none;
  transition: opacity var(--motion-fast) var(--ease-out), transform var(--motion-fast) var(--ease-out);
}
.menu.menu-left  { left: 0; }
.menu.menu-right { right: 0; }
.menu.is-open { opacity: 1; transform: translateY(0); pointer-events: auto; }
.menu-label { font-size: var(--fs-label); font-weight: 600; color: var(--color-text-muted); text-transform: uppercase; letter-spacing: 0.04em; padding: var(--space-2) var(--space-3) var(--space-1); }
.menu-item {
  display: flex; align-items: center; gap: var(--space-3);
  width: 100%; text-align: left;
  padding: var(--space-2) var(--space-3);
  border: 0; background: transparent;
  border-radius: var(--radius-md);
  font-family: var(--font-body); font-size: var(--fs-body-sm);
  color: var(--color-text-body); min-height: 40px; cursor: pointer;
}
.menu-item:hover { background: var(--color-surface-raised); color: var(--color-text-heading); text-decoration: none; }
.menu-item.is-current { color: var(--color-text-heading); font-weight: 500; }
.menu-item .menu-check { margin-left: auto; color: var(--color-primary); width: 16px; height: 16px; }
.menu-item.is-danger { color: var(--color-error-text); }
.menu-item.is-danger:hover { background: var(--color-error-surface); }
.menu-sep { height: 1px; background: var(--color-border-subtle); margin: var(--space-2) 0; }
.menu-org-mark { width: 28px; height: 28px; border-radius: var(--radius-md); display: inline-flex; align-items: center; justify-content: center; background: var(--color-primary-subtle); color: var(--color-primary); font-weight: 700; font-size: 12px; flex-shrink: 0; }
.menu-user-head { display: flex; align-items: center; gap: var(--space-3); padding: var(--space-2) var(--space-3) var(--space-3); }
.menu-user-name { font-size: var(--fs-body-sm); font-weight: 600; color: var(--color-text-heading); }
.menu-user-email { font-size: var(--fs-caption); color: var(--color-text-muted); }

/* ── Page shell ──────────────────────────────────────────── */
.page { min-height: 100vh; display: flex; flex-direction: column; }
.page-body { flex: 1; }
.container { max-width: var(--container-page); margin: 0 auto; padding: var(--space-8) var(--space-4) var(--space-16); }
.container-wide { max-width: 1240px; margin: 0 auto; padding: var(--space-6) var(--space-4) var(--space-16); }
@media (min-width: 768px) {
  .container { padding-left: var(--space-6); padding-right: var(--space-6); }
  .container-wide { padding-left: var(--space-8); padding-right: var(--space-8); }
}

/* ── Dashboard ───────────────────────────────────────────── */
.dash-head { display: flex; align-items: flex-end; justify-content: space-between; gap: var(--space-4); flex-wrap: wrap; margin-bottom: var(--space-6); }
.dash-head-sub { margin: var(--space-1) 0 0; color: var(--color-text-muted); font-size: var(--fs-body-sm); }

.toolbar { display: flex; align-items: center; gap: var(--space-2); flex-wrap: wrap; margin-bottom: var(--space-5); }
.toolbar .search { position: relative; flex: 1; min-width: 200px; max-width: 340px; }
.toolbar .search svg { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); width: 16px; height: 16px; color: var(--color-text-muted); }
.toolbar .search .input { padding-left: 38px; }
.toolbar .spacer { flex: 1; }

.seg { display: inline-flex; background: var(--color-surface-raised); border: 1px solid var(--color-border); border-radius: var(--radius-lg); padding: 2px; }
.seg button { border: 0; background: transparent; padding: 6px var(--space-3); border-radius: var(--radius-md); font-size: var(--fs-body-sm); font-weight: 500; color: var(--color-text-muted); display: inline-flex; align-items: center; gap: 6px; min-height: 32px; }
.seg button svg { width: 16px; height: 16px; }
.seg button.is-active { background: var(--color-surface-card); color: var(--color-text-heading); box-shadow: var(--shadow-xs); }

.project-grid { display: grid; grid-template-columns: 1fr; gap: var(--space-4); }
@media (min-width: 640px)  { .project-grid { grid-template-columns: 1fr 1fr; } }
@media (min-width: 1024px) { .project-grid { grid-template-columns: 1fr 1fr 1fr; } }

.pcard { display: flex; flex-direction: column; gap: var(--space-3); padding: var(--space-5); }
.pcard-top { display: flex; align-items: flex-start; justify-content: space-between; gap: var(--space-3); }
.pcard-folder { width: 36px; height: 36px; border-radius: var(--radius-lg); background: var(--color-primary-subtle); color: var(--color-primary); display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0; }
.pcard-folder svg { width: 20px; height: 20px; }
.pcard-name { font-family: var(--font-sans); font-size: var(--fs-h3); font-weight: var(--fw-h3); color: var(--color-text-heading); letter-spacing: -0.01em; margin: 0; }
.pcard-objective { font-size: var(--fs-body-sm); color: var(--color-text-muted); margin: 2px 0 0; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.pcard-foot { margin-top: auto; padding-top: var(--space-3); border-top: 1px solid var(--color-border-subtle); display: flex; align-items: center; justify-content: space-between; gap: var(--space-3); }
.pcard-pm { display: inline-flex; align-items: center; gap: var(--space-2); font-size: var(--fs-body-sm); color: var(--color-text-body); }
.pcard-updated { font-size: var(--fs-caption); color: var(--color-text-muted); }
.pcard-progress-label { display: flex; align-items: center; justify-content: space-between; font-size: var(--fs-caption); color: var(--color-text-muted); margin-bottom: 6px; }

/* ── Project detail header ───────────────────────────────── */
.proj-header { margin-bottom: var(--space-5); }
.proj-title-row { display: flex; align-items: flex-start; gap: var(--space-3); flex-wrap: wrap; margin-top: var(--space-3); }
.proj-title { font-family: var(--font-sans); font-size: var(--fs-h1); font-weight: var(--fw-h1); color: var(--color-text-heading); letter-spacing: -0.02em; margin: 0; }
.proj-title-actions { margin-left: auto; display: flex; gap: var(--space-2); align-items: center; }
.proj-stats { display: flex; flex-wrap: wrap; gap: var(--space-6); margin-top: var(--space-4); }
.proj-stat { display: flex; flex-direction: column; gap: 2px; }
.proj-stat-label { font-size: var(--fs-label); font-weight: 500; color: var(--color-text-muted); text-transform: uppercase; letter-spacing: 0.03em; }
.proj-stat-value { font-size: var(--fs-body-lg); font-weight: 600; color: var(--color-text-heading); font-variant-numeric: tabular-nums; }
.proj-stat-value.sm { font-size: var(--fs-body); }

/* Meta card grid */
.meta-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: var(--space-4) var(--space-6); }
@media (min-width: 768px) { .meta-grid { grid-template-columns: repeat(4, 1fr); } }
.meta-field { display: flex; flex-direction: column; gap: 2px; }
.meta-label { font-size: var(--fs-label); font-weight: 500; color: var(--color-text-muted); text-transform: uppercase; letter-spacing: 0.03em; }
.meta-value { font-size: var(--fs-body); color: var(--color-text-heading); }

/* ── Tab content ─────────────────────────────────────────── */
.tab-content {
  background: var(--color-surface-card);
  border: 1px solid var(--color-border);
  border-top: 0;
  border-radius: 0 0 var(--radius-xl) var(--radius-xl);
}
.tabpanel { padding: var(--space-5) var(--space-4); }
@media (min-width: 768px) { .tabpanel { padding: var(--space-6); } }
.tabpanel[hidden] { display: none; }

/* ── Global app shell: outer org rail + page content ───────── */
.app-shell { display: flex; align-items: flex-start; }
.app-shell-main { flex: 1; min-width: 0; }
.app-shell > .org-rail { position: sticky; top: calc(56px + var(--space-4)); align-self: start; margin: var(--space-5) 0 var(--space-5) var(--space-5); }

/* ── Project detail layout: process sidebar ─────────────────── */
.project-layout { display: flex; align-items: flex-start; gap: var(--space-4); }

.org-rail {
  display: flex; flex-direction: column; align-items: center; gap: var(--space-2);
  flex-shrink: 0;
  padding: var(--space-3);
  background: var(--color-surface-card);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-xl);
}
.org-rail-item {
  width: 40px; height: 40px;
  display: inline-flex; align-items: center; justify-content: center;
  border: 0; background: transparent;
  border-radius: var(--radius-lg);
  color: var(--color-text-muted); cursor: pointer;
  transition: background var(--motion-fast), color var(--motion-fast);
}
.org-rail-item svg { width: 20px; height: 20px; }
.org-rail-item:hover { background: var(--color-surface-raised); color: var(--color-text-heading); text-decoration: none; }
.org-rail-item.is-active { background: var(--color-primary-subtle); color: var(--color-primary); }
.org-rail-item.is-disabled,
.org-rail-item.is-disabled:hover { color: var(--color-text-disabled); background: transparent; cursor: default; }

/* Project switcher (breadcrumb dropdown trigger) */
.proj-switch-btn {
  display: inline-flex; align-items: center; gap: var(--space-1);
  border: 0; background: transparent; cursor: pointer;
  padding: 2px var(--space-2);
  border-radius: var(--radius-md);
  font-family: var(--font-body); font-size: var(--fs-body-sm); font-weight: 600;
  color: var(--color-text-heading);
}
.proj-switch-btn:hover { background: var(--color-surface-raised); }
.proj-switch-btn .chev { width: 14px; height: 14px; color: var(--color-text-muted); }

/* ── Project process-group sidebar ───────────────────────── */
.project-shell {
  flex: 1; min-width: 0;
  display: grid;
  grid-template-columns: 264px minmax(0, 1fr);
  align-items: stretch;
  background: var(--color-surface-card);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-xl);
}
.proc-nav {
  align-self: start;                       /* don't stretch, so sticky can engage */
  position: sticky;
  top: calc(56px + var(--space-4));        /* pin below the 56px top nav */
  max-height: calc(100vh - 88px);
  overflow-y: auto;
  background: var(--color-surface-card);
  padding: var(--space-5) var(--space-4) var(--space-8);
}
/* divider lives on the (full-height) content column so it stays continuous when
   the sticky sidebar is shorter than the page */
.proc-content { border-left: 1px solid var(--color-border); }
.proc-nav-head { display: none; }
.proc-project {
  display: flex; flex-direction: column; align-items: flex-start; gap: var(--space-2);
  padding: 0 var(--space-2) var(--space-4);
  margin-bottom: var(--space-4);
  border-bottom: 1px solid var(--color-border-subtle);
}
.proc-project-head { display: flex; align-items: flex-start; justify-content: space-between; gap: var(--space-2); width: 100%; }
.proc-project-name {
  flex: 1; min-width: 0;
  font-family: var(--font-sans);
  font-size: var(--fs-h3); font-weight: 600; line-height: 1.3; letter-spacing: -0.01em;
  color: var(--color-text-heading);
}
.proc-group { margin-bottom: var(--space-5); }
.proc-group:last-child { margin-bottom: 0; }
.proc-group-title {
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.09em;
  color: var(--color-text-placeholder);
  margin: 0 0 var(--space-2);
  padding: 0 var(--space-2);
}
/* CR-037 P3 — progressive phase reveal: a locked group's items dim + go inert
   (reveal, never hard-hide); the lock banner stays interactive for "Open anyway". */
.proc-group.is-phase-locked .proc-item,
.proc-group.is-phase-locked .proc-parent { opacity: 0.4; pointer-events: none; }
.proc-phase-lock {
  display: flex; align-items: center; gap: var(--space-2); flex-wrap: wrap;
  margin: 0 0 var(--space-2); padding: 6px var(--space-2);
  border-radius: var(--radius-md); background: var(--color-surface-raised);
}
.proc-phase-lock svg { width: 13px; height: 13px; color: var(--color-text-muted); flex-shrink: 0; }
.proc-phase-lock-reason { font-size: 11px; color: var(--color-text-muted); }
.proc-phase-open {
  margin-left: auto; border: 0; background: transparent; cursor: pointer;
  font-size: 11px; font-weight: 600; color: var(--color-primary); padding: 2px 4px;
}
.proc-phase-open:hover { text-decoration: underline; }
.proc-item {
  display: flex; align-items: center; gap: var(--space-3);
  width: 100%; text-align: left;
  padding: 8px var(--space-2); min-height: 38px;
  margin-bottom: 1px;
  border: 0; background: transparent;
  border-radius: var(--radius-lg);
  font-family: var(--font-body); font-size: var(--fs-body-sm); font-weight: 500;
  color: var(--color-text-body); cursor: pointer;
  transition: background var(--motion-fast), color var(--motion-fast);
}
.proc-item svg { width: 18px; height: 18px; flex-shrink: 0; color: var(--color-text-muted); transition: color var(--motion-fast); }
.proc-item:hover { background: var(--color-surface-raised); color: var(--color-text-heading); }
.proc-item:hover svg { color: var(--color-text-heading); }
.proc-item.is-active { background: var(--color-primary-subtle); color: var(--color-primary); font-weight: 600; }
.proc-item.is-active svg { color: var(--color-primary); }
.proc-item.is-disabled,
.proc-item.is-disabled:hover {
  color: var(--color-text-disabled); font-weight: 500;
  background: transparent; cursor: default;
}
.proc-item.is-disabled svg { color: var(--color-text-disabled); }
/* CR-022 — guided process-state badge (right-aligned check / lock) */
.proc-state { margin-left: auto; display: inline-flex; align-items: center; flex-shrink: 0; }
.proc-state svg { width: 14px !important; height: 14px !important; }
.proc-state.is-done svg { color: var(--color-success-text) !important; }
.proc-state.is-locked svg { color: var(--color-text-muted) !important; }
.proc-state.is-upcoming svg { color: var(--color-info-text, var(--color-text-muted)) !important; opacity: .7; }
/* CR-022 Phase 3 — Guided-mode toggle + soft-lock feedback */
.proc-guided { display: flex; align-items: center; gap: var(--space-2); margin-top: var(--space-2); cursor: pointer; font-size: var(--fs-caption); color: var(--color-text-muted); user-select: none; }
.proc-guided input { cursor: pointer; }
.proc-guided svg { width: 14px; height: 14px; }
.proc-locknote { display: flex; align-items: center; gap: var(--space-2); margin: var(--space-3) var(--space-2) 0; padding: var(--space-2) var(--space-3); border-radius: var(--radius-md); background: var(--color-warning-surface, #fef3c7); color: var(--color-warning-text); font-size: var(--fs-caption); }
.proc-locknote svg { width: 14px; height: 14px; flex-shrink: 0; }
.proc-content { padding: var(--space-6); min-width: 0; }

/* Collapsible sidebar section group (CR-016) — Planning */
.proc-parent { position: relative; }
.proc-parent-row { padding: 0; gap: 0; }                         /* flex row of main + twirl */
.proc-parent-main {
  flex: 1 1 auto; min-width: 0;
  display: flex; align-items: center; gap: var(--space-3);
  padding: 8px var(--space-2); border: 0; background: transparent;
  font: inherit; color: inherit; text-align: left; cursor: pointer; border-radius: var(--radius-lg);
}
.proc-parent-main svg { width: 18px; height: 18px; flex-shrink: 0; color: var(--color-text-muted); transition: color var(--motion-fast); }
.proc-parent-row.is-active .proc-parent-main { color: var(--color-primary); font-weight: 600; }
.proc-parent-row.is-active .proc-parent-main svg { color: var(--color-primary); }
.proc-twirl {
  flex-shrink: 0; width: 26px; height: 26px; margin-right: 4px;
  display: inline-flex; align-items: center; justify-content: center;
  border: 0; background: transparent; border-radius: var(--radius-md);
  color: var(--color-text-muted); cursor: pointer;
}
.proc-twirl:hover { background: var(--color-surface-page); color: var(--color-text-heading); }
.proc-twirl svg { width: 14px; height: 14px; }
.proc-twirl-chev svg { transition: transform var(--motion-fast); }
.proc-twirl-chev.is-open svg { transform: rotate(90deg); }
.proc-children { margin: 1px 0 2px; padding-left: 18px; display: flex; flex-direction: column; }
.proc-subitem {
  display: flex; align-items: center; gap: var(--space-3);
  width: 100%; text-align: left; border: 0; background: transparent;
  padding: 6px var(--space-2); margin-bottom: 1px; border-radius: var(--radius-lg);
  font-family: var(--font-body); font-size: var(--fs-body-sm); color: var(--color-text-muted);
  cursor: pointer; transition: background var(--motion-fast), color var(--motion-fast);
}
.proc-subitem svg { width: 18px; height: 18px; flex-shrink: 0; color: var(--color-text-muted); transition: color var(--motion-fast); }
.proc-subitem:hover { background: var(--color-surface-raised); color: var(--color-text-heading); }
.proc-subitem:hover svg { color: var(--color-text-heading); }
.proc-subitem.is-active { background: var(--color-primary-subtle); color: var(--color-primary); font-weight: 600; }
.proc-subitem.is-active svg { color: var(--color-primary); }

/* Collapse toggle */
.proc-collapse {
  display: inline-flex; align-items: center; justify-content: center;
  width: 28px; height: 28px; margin: 0; flex-shrink: 0;
  border: 0; background: transparent; border-radius: var(--radius-md);
  color: var(--color-text-muted); cursor: pointer;
}
.proc-collapse:hover { background: var(--color-surface-raised); color: var(--color-text-heading); }
.proc-collapse svg { width: 16px; height: 16px; transition: transform var(--motion-fast); }

/* Collapsed (icon-only) — desktop only */
@media (min-width: 861px) {
  .project-shell.shell-collapsed { grid-template-columns: 60px minmax(0, 1fr); }
  .shell-collapsed .proc-project-name,
  .shell-collapsed .proc-project-status,
  .shell-collapsed .proc-group-title,
  .shell-collapsed .proc-label { display: none; }
  .shell-collapsed .proc-project { padding-left: 0; padding-right: 0; }
  .shell-collapsed .proc-project-head { justify-content: center; }
  .shell-collapsed .proc-nav { padding-left: var(--space-2); padding-right: var(--space-2); }
  .shell-collapsed .proc-item { justify-content: center; gap: 0; padding-left: 0; padding-right: 0; }
  /* Planning section group in icon mode (CR-016): center icons, show '>' affordance, icon-only children */
  .shell-collapsed .proc-parent-main { justify-content: center; padding-left: 0; padding-right: 0; }
  .shell-collapsed .proc-twirl-chev { position: absolute; right: 2px; top: 50%; transform: translateY(-50%); width: 16px; height: 16px; margin: 0; }
  .shell-collapsed .proc-children { padding-left: 0; }
  .shell-collapsed .proc-subitem { justify-content: center; gap: 0; padding-left: 0; padding-right: 0; }
}

/* Mobile drawer pieces — hidden on desktop */
.proc-nav-toggle { display: none; }
.proc-nav-backdrop { display: none; }

@media (max-width: 860px) {
  .app-shell { display: block; }
  .app-shell > .org-rail { position: static; margin: var(--space-4) var(--space-4) 0; }
  .project-layout { display: block; }
  .org-rail { flex-direction: row; justify-content: flex-start; margin-bottom: var(--space-4); }
  .proc-collapse { display: none; }
  .project-shell { display: block; border: 0; background: transparent; border-radius: 0; overflow: visible; }
  .proc-nav-toggle {
    display: inline-flex; align-items: center; gap: var(--space-2);
    margin-bottom: var(--space-4);
  }
  .proc-nav {
    position: fixed; inset: 0 auto 0 0; z-index: 60;
    width: 268px; max-width: 84vw; max-height: none; top: auto;
    overflow-y: auto;
    box-shadow: var(--shadow-lg);
  }
  /* Closed: fully out of layout — a fixed element translated off-screen can't be
     clipped by ancestor overflow and would leave the page horizontally scrollable,
     so display:none is the reliable way to remove its phantom width. It still
     slides in on open via the keyframe below (close is instant, which is fine). */
  .proc-nav:not(.is-open) { display: none; }
  .proc-nav.is-open { animation: proc-nav-in var(--motion-base) var(--ease-out); }
  @keyframes proc-nav-in { from { transform: translateX(-100%); } to { transform: translateX(0); } }
  .proc-nav-head {
    display: flex; align-items: center; justify-content: space-between;
    margin-bottom: var(--space-3);
  }
  .proc-nav-backdrop {
    display: block; position: fixed; inset: 0; z-index: 55;
    background: rgba(15, 23, 42, 0.45);
  }
  .proc-content {
    padding: var(--space-5);
    background: var(--color-surface-card);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-xl);
  }
}

.tab-head { display: flex; align-items: flex-start; justify-content: space-between; gap: var(--space-4); margin-bottom: var(--space-5); flex-wrap: wrap; }
.tab-head-title { font-family: var(--font-sans); font-size: var(--fs-h2); font-weight: var(--fw-h2); color: var(--color-text-heading); letter-spacing: -0.015em; margin: 0; }
.tab-head-sub { font-size: var(--fs-body-sm); color: var(--color-text-muted); margin: 2px 0 0; }
.tab-head-actions { display: flex; align-items: center; gap: var(--space-2); flex-shrink: 0; }
@media (max-width: 560px) {
  .tab-head-actions { width: 100%; }
  .tab-head-actions .btn { flex: 1; }
}

.summary-row { display: grid; grid-template-columns: repeat(2, 1fr); gap: var(--space-3); margin-bottom: var(--space-5); }
@media (min-width: 768px) { .summary-row { grid-template-columns: repeat(4, 1fr); } }
.summary-tile { border: 1px solid var(--color-border); border-radius: var(--radius-lg); padding: var(--space-4); background: var(--color-surface-card); }
.summary-tile-label { font-size: var(--fs-label); font-weight: 500; color: var(--color-text-muted); text-transform: uppercase; letter-spacing: 0.03em; }
.summary-tile-value { font-size: var(--fs-h3); font-weight: 600; color: var(--color-text-heading); font-variant-numeric: tabular-nums; margin-top: 4px; }
.summary-tile-value.pos { color: var(--color-success-text); }
.summary-tile-value.neg { color: var(--color-error-text); }

/* WBS tree */
.wbs { border: 1px solid var(--color-border); border-radius: var(--radius-xl); overflow: hidden; }
.wbs-row { display: flex; align-items: center; gap: var(--space-3); padding: var(--space-3) var(--space-4); border-bottom: 1px solid var(--color-border-subtle); }
.wbs-row:last-child { border-bottom: 0; }
.wbs-row:hover { background: var(--color-surface-raised); }
.wbs-code { font-family: var(--font-mono); font-size: var(--fs-code); color: var(--color-text-muted); min-width: 52px; flex-shrink: 0; }
.wbs-name { font-size: var(--fs-body); color: var(--color-text-heading); flex: 1; }
.wbs-row.lvl-0 .wbs-name { font-weight: 600; }
.wbs-row.lvl-1 { padding-left: var(--space-10); }
.wbs-row.lvl-2 { padding-left: calc(var(--space-10) + var(--space-8)); }
.wbs-row.lvl-3 { padding-left: calc(var(--space-10) + var(--space-16)); }
.wbs-row.lvl-0 { background: var(--color-surface-raised); }
.wbs-meta { display: inline-flex; align-items: center; gap: var(--space-3); flex-shrink: 0; }
.wbs-toggle { width: 20px; height: 20px; color: var(--color-text-muted); flex-shrink: 0; display: inline-flex; align-items: center; justify-content: center; background: transparent; border: 0; border-radius: var(--radius-sm); }
.wbs-toggle:hover { color: var(--color-text-heading); }
.wbs-toggle svg { width: 16px; height: 16px; }
.wbs-spacer { width: 20px; flex-shrink: 0; }

/* Gantt */
.gantt-wrap { border: 1px solid var(--color-border); border-radius: var(--radius-xl); overflow: hidden; background: var(--color-surface-card); }
.gantt-scroll { overflow-x: auto; }
.gantt { min-width: 760px; }
.gantt-head { display: grid; grid-template-columns: 240px 1fr; border-bottom: 1px solid var(--color-border); background: var(--color-surface-raised); }
.gantt-head-label { padding: var(--space-3) var(--space-4); font-size: var(--fs-label); font-weight: 500; color: var(--color-text-muted); text-transform: uppercase; letter-spacing: 0.04em; }
.gantt-months { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; }
.gantt-month { padding: var(--space-3) var(--space-2); font-size: var(--fs-label); font-weight: 500; color: var(--color-text-muted); text-align: center; border-left: 1px solid var(--color-border-subtle); }
.gantt-row { display: grid; grid-template-columns: 240px 1fr; border-bottom: 1px solid var(--color-border-subtle); }
.gantt-row:last-child { border-bottom: 0; }
.gantt-row:hover { background: var(--color-surface-raised); }
.gantt-row.is-group { background: var(--color-surface-raised); }
.gantt-label { padding: var(--space-3) var(--space-4); display: flex; align-items: center; gap: var(--space-2); font-size: var(--fs-body-sm); color: var(--color-text-heading); border-right: 1px solid var(--color-border-subtle); }
.gantt-label .wbs-code { min-width: auto; }
.gantt-row.is-group .gantt-label { font-weight: 600; }
.gantt-track { position: relative; padding: var(--space-3) var(--space-2); }
.gantt-grid { position: absolute; inset: 0; display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; }
.gantt-grid span { border-left: 1px solid var(--color-border-subtle); }
.gantt-bar { position: relative; height: 22px; border-radius: var(--radius-full); background: var(--color-primary); display: flex; align-items: center; padding: 0 var(--space-2); }
.gantt-bar.subtle { background: var(--color-primary-subtle); }
.gantt-bar.subtle .gantt-bar-fill { position: absolute; left: 0; top: 0; bottom: 0; background: var(--color-primary); border-radius: var(--radius-full); }
.gantt-bar-label { font-size: 11px; font-weight: 600; color: var(--color-text-inverse); white-space: nowrap; position: relative; z-index: 1; }
.gantt-bar.subtle .gantt-bar-label { color: var(--color-primary); }
.gantt-milestone { width: 16px; height: 16px; background: var(--color-primary); transform: rotate(45deg); border-radius: 2px; margin: 3px 0; }

/* ── Interactive Gantt (frappe-gantt SVG) — theme integration ──────────────
   The library ships light-mode-only colours; map its SVG classes to our tokens
   so the axis, grid and labels stay legible in both themes. Scoped to the chart. */
.gantt-scroll #gantt-chart { min-width: max-content; }
#gantt-chart .gantt .grid-header { fill: var(--color-surface-raised); stroke: var(--color-border); }
#gantt-chart .gantt .grid-row { fill: var(--color-surface-card); }
#gantt-chart .gantt .grid-row:nth-child(even) { fill: var(--color-surface-raised); }
#gantt-chart .gantt .row-line { stroke: var(--color-border-subtle); }
#gantt-chart .gantt .tick { stroke: var(--color-border-subtle); }
#gantt-chart .gantt .tick.thick { stroke: var(--color-border); }
#gantt-chart .gantt .today-highlight { fill: var(--color-primary); opacity: 0.10; }
#gantt-chart .gantt .lower-text, #gantt-chart .gantt .upper-text { fill: var(--color-text-muted); }
#gantt-chart .gantt .upper-text { font-weight: 600; }
#gantt-chart .gantt .arrow { stroke: var(--color-text-muted); }
/* bars: solid primary track, darker progress; labels white on the coloured bar
   (readable in both themes), out-of-bar (.big) labels sit on the card. */
#gantt-chart .gantt .bar { fill: var(--color-primary); stroke: none; }
#gantt-chart .gantt .bar-progress { fill: color-mix(in srgb, var(--color-primary) 55%, #000); }
#gantt-chart .gantt .bar-label { fill: #fff; font-weight: 600; }
#gantt-chart .gantt .bar-label.big { fill: var(--color-text-heading); }
/* critical path (custom_class on the bar-wrapper) reads red; float bars stay primary */
#gantt-chart .gantt .bar-wrapper.bar-critical .bar { fill: #ef4444; }
#gantt-chart .gantt .bar-wrapper.bar-critical .bar-progress { fill: color-mix(in srgb, #ef4444 60%, #000); }
#gantt-chart .gantt .bar-wrapper.bar-done .bar-progress { fill: color-mix(in srgb, var(--color-primary) 40%, #000); }

/* ── Monte Carlo completion band (CR-025 P1) ──────────────────────────────── */
.mc-band { position: relative; height: 46px; margin-top: var(--space-2); }
.mc-band-track { position: absolute; left: 0; right: 0; top: 24px; height: 10px; border-radius: var(--radius-full);
  background: linear-gradient(90deg, #22c55e 0%, #eab308 55%, #ef4444 100%); }
.mc-band-marker { position: absolute; top: 0; transform: translateX(-50%); display: flex; flex-direction: column; align-items: center; }
.mc-band-marker::after { content: ''; width: 2px; height: 18px; margin-top: 2px; background: var(--color-text-heading); border-radius: 1px; }
.mc-band-flag { font-size: 10px; font-weight: 700; letter-spacing: 0.03em; color: var(--color-text-heading); white-space: nowrap; }
.mc-band-marker.is-base .mc-band-flag { color: var(--color-text-muted); font-weight: 600; }
.mc-band-marker.is-base::after { background: var(--color-text-muted); }
.mc-tile { border-left: 3px solid var(--color-border); padding-left: var(--space-2); }
.mc-tile.is-p50 { border-left-color: #22c55e; }
.mc-tile.is-p80 { border-left-color: #eab308; }
.mc-tile.is-p90 { border-left-color: #ef4444; }

/* small inline meta in tables */
.cell-assignee { display: inline-flex; align-items: center; gap: var(--space-2); }
.cell-id { font-family: var(--font-mono); font-size: var(--fs-body-sm); color: var(--color-text-muted); }
.row-actions { display: inline-flex; gap: 2px; justify-content: flex-end; }
.icon-btn { width: 32px; height: 32px; display: inline-flex; align-items: center; justify-content: center; border: 0; background: transparent; color: var(--color-text-muted); border-radius: var(--radius-md); }
.icon-btn:hover { background: var(--color-surface-raised); color: var(--color-text-heading); }
.icon-btn.is-danger:hover { background: var(--color-error-surface); color: var(--color-error-text); }
.icon-btn:focus-visible { outline: none; box-shadow: var(--shadow-focus); }
.icon-btn svg { width: 16px; height: 16px; }

/* severity dot composite */
.sev { display: inline-flex; align-items: center; gap: var(--space-2); }
.sev-score { font-family: var(--font-mono); font-size: var(--fs-body-sm); color: var(--color-text-muted); }

/* ── Toast ───────────────────────────────────────────────── */
.toast-stack { position: fixed; top: var(--space-4); right: var(--space-4); z-index: var(--z-toast); display: flex; flex-direction: column; gap: var(--space-2); }
.toast {
  display: flex; align-items: flex-start; gap: var(--space-3);
  background: var(--color-surface-card);
  border: 1px solid var(--color-border);
  border-left: 3px solid var(--color-success-text);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  padding: var(--space-3) var(--space-4);
  min-width: 280px; max-width: 360px;
  font-size: var(--fs-body-sm); color: var(--color-text-body);
  transform: translateX(120%); opacity: 0;
  transition: transform var(--motion-slow) var(--ease-out), opacity var(--motion-slow) var(--ease-out);
}
.toast.is-show { transform: translateX(0); opacity: 1; }
.toast svg { width: 18px; height: 18px; flex-shrink: 0; color: var(--color-success-text); margin-top: 1px; }
.toast .toast-title { font-weight: 600; color: var(--color-text-heading); }

/* Learning Centre — the boxed button carried over from the public nav (which lives in
   marketing-nav.css, not loaded in the app shell), rebuilt here on the shared tokens. */
.app-topnav .topnav-learn {
  display: inline-flex; align-items: center;
  padding: 6px 12px;
  border: 1px solid var(--color-border-strong);
  border-radius: var(--radius-md);
  font-size: var(--fs-body-sm); font-weight: 600;
  color: var(--color-text-heading); text-decoration: none; white-space: nowrap;
  transition: color var(--motion-fast), background var(--motion-fast), border-color var(--motion-fast);
}
.app-topnav .topnav-learn:hover { background: var(--color-surface-raised); border-color: var(--color-primary); }
.app-topnav .topnav-learn-short { display: none; }

/* ── Mobile nav adjustments ──────────────────────────────── */
/* Tablets & phones: the primary top bar packs a lot (brand · org · theme toggle ·
   New project · notifications · account). Below desktop it would overflow the
   viewport and make the WHOLE page scroll sideways, so condense it in two tiers. */
@media (max-width: 767px) {
  .app-topnav { padding-left: var(--space-3); padding-right: var(--space-3); }
  .app-topnav .topnav-left, .app-topnav .topnav-right { gap: var(--space-2); }
  /* "New project" collapses to its + icon (aria-label keeps it accessible). */
  .app-topnav .topnav-right .btn-primary .btn-label { display: none; }
  .app-topnav .topnav-right .btn-primary { padding-left: var(--space-2); padding-right: var(--space-2); }
  /* "Learning Centre" shortens to "Learn" so it doesn't widen the bar on phones. */
  .app-topnav .topnav-learn-full { display: none; }
  .app-topnav .topnav-learn-short { display: inline; }
  .app-topnav .topnav-learn { padding-left: var(--space-2); padding-right: var(--space-2); }
  /* Closed dropdowns are position:absolute with a min-width, so on a narrow
     viewport they'd extend the page and cause sideways scroll even while hidden.
     Take them out of layout when closed (they still open fine — anchored to their
     trigger, they fit within the viewport). */
  .menu:not(.is-open) { display: none; }
  /* Same for closed modals: their dialogs have a min-content width wider than a
     phone, so even hidden (opacity:0) they force the page to scroll sideways.
     Opening still works — .modal-backdrop.is-open keeps display:flex. */
  .modal-backdrop:not(.is-open) { display: none; }
}
@media (max-width: 560px) {
  /* Phones: drop the wordmark and the org name to their marks — the logo and the
     org avatar (+ chevron) stay tappable, but they stop eating horizontal space. */
  .app-topnav .brand-lockup > span { display: none; }
  .app-topnav .topnav-org-name { display: none; }
  .dash-head { align-items: stretch; }
  .dash-head .btn { width: 100%; }
}

/* ── Empty states ────────────────────────────────────────── */
/* .empty / .empty-icon / .empty-title / .empty-body come from components.css */
.empty .btn { margin-top: var(--space-2); }
.empty-icon.is-neutral { background: var(--color-surface-raised); color: var(--color-text-muted); }
.empty-actions { display: inline-flex; gap: var(--space-2); margin-top: var(--space-2); flex-wrap: wrap; justify-content: center; }

/* Empty board / gantt placeholders keep their container height */
.empty-in-board { min-height: 240px; display: flex; align-items: center; justify-content: center; }

/* ── Error pages ─────────────────────────────────────────── */
.minibar { display: flex; align-items: center; justify-content: center; height: 56px; border-bottom: 1px solid var(--color-border); background: var(--color-surface-card); }
.errorpage-icon {
  width: 72px; height: 72px; border-radius: var(--radius-2xl);
  display: inline-flex; align-items: center; justify-content: center;
  margin: 0 auto var(--space-5);
  background: var(--color-primary-subtle); color: var(--color-primary);
}
.errorpage-icon svg { width: 32px; height: 32px; }
.errorpage-icon.is-warning { background: var(--color-warning-surface); color: var(--color-warning-text); }
.errorpage-icon.is-error   { background: var(--color-error-surface);   color: var(--color-error-text); }
.errorpage-hint { font-size: var(--fs-body-sm); color: var(--color-text-muted); margin-top: var(--space-6); }
.errorpage-hint a { font-weight: 500; }

/* ── Showcase (empty-states documentation page) ──────────── */
.showcase { max-width: var(--container-page); margin: 0 auto; padding: var(--space-8) var(--space-4) var(--space-16); }
@media (min-width: 768px) { .showcase { padding-left: var(--space-6); padding-right: var(--space-6); } }
.showcase-head { margin-bottom: var(--space-8); max-width: 60ch; }
.showcase-section { margin-top: var(--space-10); }
.showcase-section-title { font-family: var(--font-sans); font-size: var(--fs-h2); font-weight: var(--fw-h2); color: var(--color-text-heading); letter-spacing: -0.015em; margin: 0 0 var(--space-1); }
.showcase-section-sub { font-size: var(--fs-body-sm); color: var(--color-text-muted); margin: 0 0 var(--space-5); }
.showcase-grid { display: grid; grid-template-columns: 1fr; gap: var(--space-5); }
@media (min-width: 760px) { .showcase-grid { grid-template-columns: 1fr 1fr; } }
.showcase-item-label { font-size: var(--fs-label); font-weight: 600; color: var(--color-text-muted); text-transform: uppercase; letter-spacing: 0.04em; margin: 0 0 var(--space-2); }
.showcase-frame { border: 1px solid var(--color-border); border-radius: var(--radius-xl); background: var(--color-surface-card); overflow: hidden; }
.showcase-frame .tab-head { padding: var(--space-5) var(--space-5) 0; margin-bottom: 0; }
.showcase-frame .empty { padding: var(--space-8) var(--space-6) var(--space-10); }

/* ════════════════════════════════════════════════════════════
   SPRINT 6 / 7 — new component patterns
   ════════════════════════════════════════════════════════════ */

/* ── Tab bar: group dividers + edge fade ─────────────────── */
.tabbar { position: relative; }
.tab-group-sep { flex-shrink: 0; align-self: center; width: 1px; height: 20px; background: var(--color-border); margin: 0 var(--space-1); }
.tabbar-wrap { position: relative; }
.tabbar-wrap::after { /* right edge fade hint */
  content: ""; position: absolute; top: 0; right: 0; bottom: 6px; width: 28px;
  background: linear-gradient(to right, transparent, var(--color-surface-raised));
  pointer-events: none; opacity: 0; transition: opacity var(--motion-fast);
}
.tabbar-wrap.can-scroll-right::after { opacity: 1; }

/* ── Sub-navigation pills (Planning, Charter nav) ────────── */
.subnav {
  display: flex; gap: var(--space-1); overflow-x: auto;
  padding-bottom: var(--space-3); margin-bottom: var(--space-4);
  border-bottom: 1px solid var(--color-border);
  scrollbar-width: thin;
}
.subnav::-webkit-scrollbar { height: 4px; }
.subnav::-webkit-scrollbar-thumb { background: var(--color-border); border-radius: 4px; }
.subpill {
  flex-shrink: 0;
  display: inline-flex; align-items: center; gap: var(--space-2);
  padding: 8px var(--space-3); min-height: 38px;
  border: 1px solid transparent; border-radius: var(--radius-full);
  background: transparent; color: var(--color-text-muted);
  font-family: var(--font-body); font-size: var(--fs-body-sm); font-weight: 500;
  white-space: nowrap; cursor: pointer;
  transition: background var(--motion-fast), color var(--motion-fast);
}
.subpill:hover { background: var(--color-surface-raised); color: var(--color-text-heading); }
.subpill.is-active { background: var(--color-primary-subtle); color: var(--color-primary); }
.subpill:focus-visible { outline: none; box-shadow: var(--shadow-focus); }
.subpanel[hidden] { display: none; }

/* Guideline TOC — a sticky "on this page" menu (CR-014), like the wiki page */
.guideline-layout { display: grid; grid-template-columns: 220px 1fr; gap: var(--space-5); align-items: start; }
.guideline-toc { position: sticky; top: 72px; padding: var(--space-3); }
.guideline-toc-title { font-size: var(--fs-caption); text-transform: uppercase; letter-spacing: 0.04em; color: var(--color-text-muted); margin-bottom: var(--space-2); }
.guideline-toc a { display: block; padding: 6px 10px; margin-bottom: 2px; border-radius: var(--radius-md); border-left: 2px solid transparent; color: var(--color-text-muted); text-decoration: none; font-size: var(--fs-body-sm); line-height: 1.35; cursor: pointer; }
.guideline-toc a:hover { background: var(--color-surface-raised); color: var(--color-text-heading); }
.guideline-toc a.is-active { background: var(--color-primary-subtle); color: var(--color-primary); font-weight: 600; border-left-color: var(--color-primary); }
.guideline-section { scroll-margin-top: 72px; }
@media (max-width: 860px) {
  .guideline-layout { grid-template-columns: 1fr; }
  .guideline-toc { position: static; margin-bottom: var(--space-3); }
}

/* ════════════ OVERVIEW REDESIGN (CR-015) — scoped to .ov-overview ════════════ */
.ov-overview { display: flex; flex-direction: column; gap: var(--space-5); }
.ov-head { display: flex; align-items: flex-start; justify-content: space-between; gap: var(--space-4); flex-wrap: wrap; }
.ov-head-titles { display: flex; flex-direction: column; gap: var(--space-2); min-width: 0; }
.ov-title-row { display: flex; align-items: center; gap: var(--space-3); flex-wrap: wrap; }
.ov-title-row h1 { margin: 0; }
.ov-head-actions { display: flex; align-items: center; gap: var(--space-2); flex-shrink: 0; }

/* Health hero */
.ov-hero { position: relative; overflow: hidden; display: grid; grid-template-columns: 1fr auto; gap: var(--space-6); align-items: center; padding: var(--space-5) var(--space-6); background: var(--color-surface-card); border: 1px solid var(--color-border); border-radius: var(--radius-xl); box-shadow: var(--shadow-xs); }
.ov-hero::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 4px; background: var(--ov-accent, var(--color-success-text)); }
.ov-hero-status { display: flex; flex-direction: column; gap: var(--space-2); min-width: 0; }
.ov-status-line { display: flex; align-items: center; gap: var(--space-2); flex-wrap: wrap; }
.ov-status-dot { width: 11px; height: 11px; border-radius: 50%; background: var(--ov-accent, var(--color-success-text)); box-shadow: 0 0 0 4px color-mix(in srgb, var(--ov-accent, var(--color-success-text)) 18%, transparent); flex-shrink: 0; }
.ov-status-label { font-family: var(--font-sans); font-size: 22px; font-weight: 600; letter-spacing: -0.01em; color: var(--color-text-heading); }
.ov-status-tag { font-family: var(--font-mono); font-size: 11px; font-weight: 600; letter-spacing: 0.04em; text-transform: uppercase; color: var(--ov-accent, var(--color-success-text)); background: color-mix(in srgb, var(--ov-accent, var(--color-success-text)) 12%, transparent); padding: 3px var(--space-2); border-radius: var(--radius-full); }
.ov-hero-summary { max-width: 56ch; color: var(--color-text-body); }
.ov-hero-facts { display: flex; gap: var(--space-6); padding-left: var(--space-6); border-left: 1px solid var(--color-border); }
.ov-fact { display: flex; flex-direction: column; gap: 3px; }
.ov-fact-val { font-family: var(--font-sans); font-weight: 600; color: var(--color-text-heading); white-space: nowrap; }

/* KPI row */
.ov-kpis { display: grid; grid-template-columns: repeat(4, 1fr); gap: var(--space-4); }
.ov-kpi { display: flex; flex-direction: column; gap: var(--space-2); padding: var(--space-4) var(--space-5); background: var(--color-surface-card); border: 1px solid var(--color-border); border-radius: var(--radius-lg); box-shadow: var(--shadow-xs); }
.ov-kpi-top { display: flex; align-items: center; justify-content: space-between; gap: var(--space-2); }
.ov-kpi-label { font-size: var(--fs-label); font-weight: 600; color: var(--color-text-muted); letter-spacing: 0.01em; }
.ov-kpi-icon { width: 30px; height: 30px; border-radius: var(--radius-md); display: inline-flex; align-items: center; justify-content: center; }
.ov-kpi-icon svg { width: 16px; height: 16px; }
.ov-kpi-value { font-family: var(--font-sans); font-size: 30px; font-weight: 700; letter-spacing: -0.02em; line-height: 1; color: var(--color-text-heading); }
.ov-kpi-note { display: flex; align-items: center; gap: 5px; font-size: var(--fs-body-sm); color: var(--color-text-muted); }
.ov-tint-green  { background: var(--color-success-surface); color: var(--color-success-text); }
.ov-tint-blue   { background: var(--color-info-surface);    color: var(--color-info-text); }
.ov-tint-indigo { background: var(--color-primary-subtle);  color: var(--color-primary); }
.ov-tint-amber  { background: var(--color-warning-surface); color: var(--color-warning-text); }
.ov-tint-red    { background: var(--color-error-surface);   color: var(--color-error-text); }
.ov-bar { height: 6px; border-radius: var(--radius-full); background: var(--color-surface-raised); overflow: hidden; }
.ov-bar > span { display: block; height: 100%; border-radius: var(--radius-full); }

/* 2-column body */
.ov-cols { display: grid; grid-template-columns: minmax(0, 1.65fr) minmax(0, 1fr); gap: var(--space-5); align-items: start; }
.ov-col { display: flex; flex-direction: column; gap: var(--space-5); min-width: 0; }
.ov-card-head { display: flex; align-items: flex-start; justify-content: space-between; gap: var(--space-3); margin-bottom: var(--space-4); }
.ov-card-head h2 { margin: 0; }

/* Lifecycle stepper */
.ov-life { display: grid; grid-template-columns: repeat(5, 1fr); gap: 0; }
.ov-step { position: relative; display: flex; flex-direction: column; align-items: center; text-align: center; gap: var(--space-2); padding: 0 var(--space-1); }
.ov-step::before, .ov-step::after { content: ""; position: absolute; top: 16px; height: 2px; background: var(--color-success-border); z-index: 0; }
.ov-step::before { left: 0; right: 50%; }
.ov-step::after  { left: 50%; right: 0; }
.ov-step.upcoming::before, .ov-step.upcoming::after { background: var(--color-border); }
.ov-step:first-child::before { display: none; }
.ov-step:last-child::after  { display: none; }
.ov-step-dot { position: relative; z-index: 1; width: 34px; height: 34px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; background: var(--color-success-surface); color: var(--color-success-text); border: 2px solid var(--color-success-text); }
.ov-step-dot svg { width: 17px; height: 17px; }
.ov-step.upcoming .ov-step-dot { background: var(--color-surface-raised); color: var(--color-text-muted); border-color: var(--color-border-strong); }
.ov-step.is-current .ov-step-dot { background: var(--color-primary); color: #fff; border-color: var(--color-primary); box-shadow: 0 0 0 4px var(--color-primary-subtle); }
.ov-step-name { font-size: var(--fs-body-sm); font-weight: 600; color: var(--color-text-heading); line-height: 1.25; }
.ov-step-sub { font-size: 11px; color: var(--color-text-muted); }

/* Timeline */
.ov-timeline { margin-top: var(--space-5); padding-top: var(--space-5); border-top: 1px solid var(--color-border); }
.ov-tl-track { position: relative; height: 8px; border-radius: var(--radius-full); background: var(--color-surface-raised); margin: var(--space-5) 0 var(--space-3); }
.ov-tl-fill  { position: absolute; left: 0; top: 0; bottom: 0; border-radius: var(--radius-full); background: color-mix(in srgb, var(--color-primary) 35%, var(--color-surface-raised)); }
.ov-tl-today { position: absolute; top: -5px; width: 2px; height: 18px; background: var(--color-primary); }
.ov-tl-today::after { content: "Today"; position: absolute; top: -18px; left: 50%; transform: translateX(-50%); font-size: 10px; font-weight: 600; color: var(--color-primary); white-space: nowrap; }
.ov-tl-milestone { position: absolute; top: -3px; width: 14px; height: 14px; border-radius: 50%; background: var(--color-surface-card); border: 2px solid var(--color-success-text); transform: translateX(-50%); }
.ov-tl-milestone.future { border-color: var(--color-border-strong); }
.ov-tl-ends { display: flex; justify-content: space-between; }
.ov-ms-list { display: flex; flex-wrap: wrap; gap: var(--space-2); margin-top: var(--space-4); }
.ov-ms { display: inline-flex; align-items: center; gap: 6px; font-size: var(--fs-body-sm); color: var(--color-text-body); background: var(--color-surface-raised); border: 1px solid var(--color-border); padding: 5px var(--space-3); border-radius: var(--radius-full); }
.ov-ms svg { width: 13px; height: 13px; flex-shrink: 0; }
.ov-ms.done svg { color: var(--color-success-text); }
.ov-ms.future svg { color: var(--color-text-muted); }
.ov-ms .ov-ms-date { color: var(--color-text-muted); }

/* Details meta grid */
.ov-meta { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: var(--space-5); }
.ov-meta-k { font-size: var(--fs-label); font-weight: 500; color: var(--color-text-muted); margin-bottom: 5px; }
.ov-meta-v { font-size: var(--fs-body); color: var(--color-text-heading); font-weight: 500; }
.ov-divider { margin-top: var(--space-5); padding-top: var(--space-5); border-top: 1px solid var(--color-border); }

/* At-a-glance signal list */
.ov-signals { display: flex; flex-direction: column; }
.ov-signal { display: flex; align-items: center; justify-content: space-between; gap: var(--space-3); padding: var(--space-3) 0; border-bottom: 1px solid var(--color-border-subtle, var(--color-border)); }
.ov-signal:last-child { border-bottom: 0; padding-bottom: 0; }
.ov-signal:first-child { padding-top: 0; }
.ov-signal-k { display: flex; align-items: center; gap: var(--space-2); font-size: var(--fs-body); color: var(--color-text-body); }
.ov-signal-k svg { width: 16px; height: 16px; color: var(--color-text-muted); }
.ov-signal-v { display: inline-flex; align-items: center; gap: 7px; font-family: var(--font-sans); font-weight: 600; color: var(--color-text-heading); }
.ov-pill { display: inline-flex; align-items: center; gap: 5px; font-size: 11px; font-weight: 600; padding: 2px 8px; border-radius: var(--radius-full); }
.ov-pill .dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; }

/* Governance by phase (CR-037 P2) — per-phase required-document progress */
.ov-phases { display: flex; flex-direction: column; gap: var(--space-4); }
.ov-phase { display: flex; flex-direction: column; gap: 6px; }
.ov-phase-head { display: flex; align-items: baseline; justify-content: space-between; gap: var(--space-3); }
.ov-phase-name { font-size: var(--fs-body); font-weight: 600; color: var(--color-text-heading); }
.ov-phase-count { font-size: var(--fs-caption); color: var(--color-text-muted); font-variant-numeric: tabular-nums; }
.ov-phase-sub { display: flex; align-items: center; gap: var(--space-2); min-height: 16px; }
.ov-phase-note { font-size: 11px; color: var(--color-text-muted); }

/* CR-038 — generalised stage worksheet (the widget canvas; CR-037 P4 → any phase) */
.stage-wrap { max-width: 920px; margin: 0 auto; padding: var(--space-6) var(--space-4); display: flex; flex-direction: column; gap: var(--space-6); }
.stage-head { text-align: left; }
.stage-lede { margin: var(--space-2) 0 0; color: var(--color-text-muted); font-size: var(--fs-body); max-width: 62ch; }
.stage-progress { padding: var(--space-4) var(--space-5); display: flex; flex-direction: column; gap: 8px; }
.stage-note { display: flex; align-items: center; gap: 6px; font-size: var(--fs-body-sm); margin: 2px 0 0; }
.stage-note svg { width: 14px; height: 14px; flex-shrink: 0; }
.stage-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(248px, 1fr)); gap: var(--space-4); }
.stage-card { display: flex; flex-direction: column; gap: var(--space-2); padding: var(--space-4); }
.stage-card-top { display: flex; align-items: center; justify-content: space-between; gap: var(--space-2); }
.stage-card-ic { display: inline-flex; }
.stage-card-ic svg { width: 22px; height: 22px; }
.stage-card-tag { font-family: var(--font-mono); font-size: 10px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.08em; color: var(--color-text-placeholder); }
.stage-card-title { font-size: var(--fs-body); font-weight: 600; color: var(--color-text-heading); margin: 0; }
.stage-card-blurb { font-size: var(--fs-body-sm); color: var(--color-text-muted); margin: 0; flex: 1; line-height: 1.45; }
.stage-card-foot { display: flex; align-items: center; justify-content: space-between; gap: var(--space-2); margin-top: var(--space-2); }
.stage-status { font-size: 11px; font-weight: 600; padding: 2px 8px; border-radius: var(--radius-full); background: var(--color-surface-raised); color: var(--color-text-muted); }
.stage-status.is-ok { background: var(--color-success-surface); color: var(--color-success-text); }
.stage-status.is-warn { background: var(--color-warning-surface); color: var(--color-warning-text); }
.stage-status.is-info { background: var(--color-primary-subtle); color: var(--color-primary); }
.stage-blocked { display: flex; align-items: center; gap: 6px; font-size: 11px; color: var(--color-warning-text); }
.stage-blocked svg { width: 13px; height: 13px; flex-shrink: 0; }
.stage-card-scratch { border-style: dashed; }
/* CR-038 — a process-group title that opens its stage canvas (the PO's sketch model) */
.proc-group-title-btn { display: block; width: 100%; text-align: left; border: 0; background: transparent; cursor: pointer; border-radius: var(--radius-sm); transition: color var(--motion-fast); }
.proc-group-title-btn:hover { color: var(--color-text-body); }
.proc-group-title-btn.is-active { color: var(--color-primary); }

/* Focus callout */
.ov-focus { display: flex; flex-direction: column; gap: var(--space-3); }
.ov-focus-item { display: flex; gap: var(--space-3); align-items: flex-start; }
.ov-focus-ic { width: 32px; height: 32px; border-radius: var(--radius-md); flex-shrink: 0; display: inline-flex; align-items: center; justify-content: center; }
.ov-focus-ic svg { width: 16px; height: 16px; }
.ov-focus-body { min-width: 0; }
.ov-focus-body .k { font-size: var(--fs-label); font-weight: 600; color: var(--color-text-muted); }
.ov-focus-body .v { font-size: var(--fs-body); font-weight: 600; color: var(--color-text-heading); }
.ov-focus-body .s { font-size: var(--fs-body-sm); color: var(--color-text-muted); }

/* Announcements */
.ov-ann { display: flex; flex-direction: column; gap: var(--space-3); }
.ov-ann-item { padding: var(--space-3); background: var(--color-surface-raised); border-radius: var(--radius-md); }
.ov-ann-item strong { color: var(--color-text-heading); }
.ov-ann-meta { font-size: var(--fs-caption); color: var(--color-text-muted); }

@media (max-width: 1100px) {
  .ov-cols { grid-template-columns: 1fr; }
  .ov-kpis { grid-template-columns: repeat(2, 1fr); }
  .ov-hero { grid-template-columns: 1fr; }
  .ov-hero-facts { padding-left: 0; border-left: 0; padding-top: var(--space-4); border-top: 1px solid var(--color-border); }
}
@media (max-width: 640px) {
  .ov-kpis { grid-template-columns: 1fr; }
  .ov-life { grid-template-columns: 1fr; gap: var(--space-3); }
  .ov-step::before, .ov-step::after { display: none; }
  .ov-step { flex-direction: row; text-align: left; }
}

/* ── RACI matrix grid ────────────────────────────────────── */
.matrix-wrap { border: 1px solid var(--color-border); border-radius: var(--radius-xl); overflow: hidden; background: var(--color-surface-card); }
.matrix-scroll { overflow-x: auto; }
.matrix { border-collapse: separate; border-spacing: 0; width: 100%; font-size: var(--fs-body-sm); }
.matrix th, .matrix td { padding: var(--space-2) var(--space-3); border-bottom: 1px solid var(--color-border-subtle); border-right: 1px solid var(--color-border-subtle); text-align: center; }
.matrix thead th {
  position: sticky; top: 0; z-index: 2;
  background: var(--color-surface-raised); color: var(--color-text-muted);
  font-size: var(--fs-label); font-weight: 600; white-space: nowrap;
}
.matrix .matrix-corner, .matrix th[scope="row"], .matrix td.matrix-rowhead {
  position: sticky; left: 0; z-index: 1;
  background: var(--color-surface-card);
  text-align: left; color: var(--color-text-heading); font-weight: 500;
  min-width: 180px; max-width: 220px;
  box-shadow: 1px 0 0 var(--color-border);
}
.matrix thead .matrix-corner { z-index: 3; background: var(--color-surface-raised); }
.matrix tbody tr:hover td { background: var(--color-surface-raised); }
.matrix tbody tr:hover td.matrix-rowhead { background: var(--color-surface-raised); }
/* RACI cycle chip */
.raci-chip {
  width: 34px; height: 34px; border-radius: var(--radius-md);
  border: 1px solid var(--color-border); background: var(--color-surface-card);
  font-family: var(--font-body); font-weight: 700; font-size: var(--fs-body-sm);
  color: var(--color-text-disabled);
  display: inline-flex; align-items: center; justify-content: center;
  cursor: pointer; transition: background var(--motion-fast), color var(--motion-fast), border-color var(--motion-fast);
}
.raci-chip:focus-visible { outline: none; box-shadow: var(--shadow-focus); }
.raci-chip[data-raci="R"] { background: var(--color-success-surface); color: var(--color-success-text); border-color: var(--color-success-border); }
.raci-chip[data-raci="A"] { background: var(--color-primary-subtle);  color: var(--color-primary);      border-color: #C7D2FE; }
.raci-chip[data-raci="C"] { background: var(--color-warning-surface); color: var(--color-warning-text); border-color: var(--color-warning-border); }
.raci-chip[data-raci="I"] { background: var(--color-surface-raised);  color: var(--color-text-body);    border-color: var(--color-border); }
.raci-legend { display: flex; flex-wrap: wrap; gap: var(--space-2) var(--space-4); margin-top: var(--space-3); font-size: var(--fs-caption); color: var(--color-text-muted); }
.raci-legend-item { display: inline-flex; align-items: center; gap: 6px; }
.raci-key { width: 18px; height: 18px; border-radius: var(--radius-sm); display: inline-flex; align-items: center; justify-content: center; font-weight: 700; font-size: 10px; }
.raci-key.r { background: var(--color-success-surface); color: var(--color-success-text); }
.raci-key.a { background: var(--color-primary-subtle); color: var(--color-primary); }
.raci-key.c { background: var(--color-warning-surface); color: var(--color-warning-text); }
.raci-key.i { background: var(--color-surface-raised); color: var(--color-text-body); border: 1px solid var(--color-border); }
/* RACI column header — a compact initials avatar (full name + role on hover) */
.raci-col-head { display: inline-grid; place-items: center; width: 34px; height: 34px; border-radius: 9999px; background: var(--color-primary-subtle); color: var(--color-primary); font-size: 12px; font-weight: 700; letter-spacing: 0.02em; cursor: default; }
th:has(> .raci-col-head) { vertical-align: middle; }
/* RACI matrix table: wide on desktop (task names on one line); on a phone the task
   column wraps and the chips shrink so five people fit without a sideways scroll. */
.raci-table { min-width: max-content; }
.raci-table thead th:first-child { min-width: 180px; }
.raci-table thead th:not(:first-child) { padding: var(--space-2) var(--space-3); }
@media (max-width: 600px) {
  .raci-table { min-width: 0; }
  .raci-table thead th:first-child, .raci-table tbody td:first-child {
    min-width: 0; width: 8.5rem; white-space: normal; line-height: 1.3;
    padding-left: var(--space-3); padding-right: var(--space-2);
  }
  .raci-table thead th:not(:first-child), .raci-table tbody td:not(:first-child) { padding: var(--space-2) 2px; }
  .raci-table .raci-chip, .raci-table .raci-col-head { width: 30px; height: 30px; }
}
/* WBS tree row: one line on desktop; on a phone the title keeps the first line and
   the status menu + actions wrap beneath it (otherwise the title shrinks to nothing). */
@media (max-width: 600px) {
  .wbs-row { flex-wrap: wrap; row-gap: 0 !important; }   /* beats the inline gap shorthand */
  .wbs-row::after { content: ""; flex-basis: 100%; order: 1; }   /* forced line break */
  .wbs-row .wbs-row-title { flex: 1 1 0; }
  .wbs-row .wbs-row-title > span { white-space: normal !important; }
  .wbs-row .wbs-row-status, .wbs-row .wbs-row-actions { order: 2; }
  .wbs-row .wbs-row-status { width: 8.5rem !important; margin: var(--space-1) 0 var(--space-1) 28px; }
  .wbs-row .wbs-row-actions { flex-wrap: wrap; flex-shrink: 1 !important; }
}
/* Workload heatmap — clickable week headers + cells (open the week breakdown) */
.wl-week-head { border: 0; background: transparent; color: var(--color-text-muted); font-size: var(--fs-caption); font-weight: 600; white-space: nowrap; padding: 6px 10px; border-radius: var(--radius-sm); cursor: pointer; transition: background var(--motion-fast), color var(--motion-fast); }
.wl-week-head:hover { background: var(--color-surface-raised); color: var(--color-text-heading); }
/* The status backgrounds are pale pastels in both themes, so the figure needs a
   fixed dark ink — inheriting the (light, in dark mode) table text made the
   numbers unreadable on the coloured cells. Scoped as `.table .wl-cell` (0,0,2,0)
   so it beats `.table tbody td` (0,0,1,2), which otherwise sets the text colour. */
.table .wl-cell { text-align: center; cursor: pointer; border-radius: 4px; font-variant-numeric: tabular-nums; min-width: 52px; padding: 8px 6px; font-size: var(--fs-caption); font-weight: 600; color: #0f172a; }
.table .wl-cell:hover { box-shadow: inset 0 0 0 2px var(--color-primary); }

/* ── Disclosure rows / cards ─────────────────────────────── */
.disc-toggle {
  display: inline-flex; align-items: center; gap: 6px;
  background: transparent; border: 0; cursor: pointer;
  color: var(--color-primary); font-size: var(--fs-body-sm); font-weight: 500;
  padding: 6px 8px; border-radius: var(--radius-md); min-height: 36px;
}
.disc-toggle:hover { background: var(--color-surface-raised); }
.disc-toggle:focus-visible { outline: none; box-shadow: var(--shadow-focus); }
.disc-toggle svg { width: 16px; height: 16px; transition: transform var(--motion-base) var(--ease-out); }
.disc-toggle[aria-expanded="true"] svg { transform: rotate(90deg); }
.disc-panel { background: var(--color-surface-raised); border-top: 1px solid var(--color-border-subtle); padding: var(--space-4); }
.disc-panel[hidden] { display: none; }
.disc-panel-title { font-size: var(--fs-label); font-weight: 600; color: var(--color-text-muted); text-transform: uppercase; letter-spacing: 0.04em; margin: 0 0 var(--space-2); }
tr.disc-detail-row > td { padding: 0; }

/* ── Inline-add row form ─────────────────────────────────── */
.inline-add {
  display: flex; flex-wrap: wrap; align-items: flex-end; gap: var(--space-2);
  padding: var(--space-3); margin-top: var(--space-2);
  background: var(--color-surface-raised); border: 1px dashed var(--color-border-strong);
  border-radius: var(--radius-lg);
}
.inline-add .field { flex: 1; min-width: 140px; gap: 2px; }
.inline-add .input, .inline-add .select { min-height: 38px; padding-top: 6px; padding-bottom: 6px; }
.inline-add-actions { display: flex; gap: var(--space-1); }
.inline-add[hidden] { display: none; }
@media (max-width: 560px) { .inline-add .field { flex-basis: 100%; } .inline-add-actions { width: 100%; } .inline-add-actions .btn { flex: 1; } }

/* ── In-modal sub-tabs ───────────────────────────────────── */
.modal-subtabs {
  display: inline-flex; gap: 2px; padding: 3px;
  background: var(--color-surface-raised); border-radius: var(--radius-lg);
  margin-bottom: var(--space-4);
}
.modal-subtab {
  border: 0; background: transparent; cursor: pointer;
  padding: 6px var(--space-3); min-height: 34px; border-radius: var(--radius-md);
  font-family: var(--font-body); font-size: var(--fs-body-sm); font-weight: 500;
  color: var(--color-text-muted); display: inline-flex; align-items: center; gap: 6px;
}
.modal-subtab.is-active { background: var(--color-surface-card); color: var(--color-text-heading); box-shadow: var(--shadow-xs); }
.modal-subtab:focus-visible { outline: none; box-shadow: var(--shadow-focus); }
.modal-subpanel[hidden] { display: none; }

/* Comment thread */
.comment-thread { display: flex; flex-direction: column; gap: var(--space-3); max-height: 320px; overflow-y: auto; padding-right: var(--space-1); }
.comment { display: flex; gap: var(--space-3); }
.comment-body-wrap { flex: 1; }
.comment-head { display: flex; align-items: center; gap: var(--space-2); margin-bottom: 2px; }
.comment-author { font-size: var(--fs-body-sm); font-weight: 600; color: var(--color-text-heading); }
.comment-time { font-size: var(--fs-caption); color: var(--color-text-muted); }
.comment-text { font-size: var(--fs-body-sm); color: var(--color-text-body); }
.comment-del { margin-left: auto; }
.comment.is-own .comment-bubble { background: var(--color-primary-subtle); }
.comment-bubble { background: var(--color-surface-raised); border-radius: var(--radius-lg); padding: var(--space-2) var(--space-3); }

/* Logged-vs-estimate bar */
.time-meter { display: flex; align-items: center; gap: var(--space-3); margin-bottom: var(--space-4); }
.time-meter .progress { flex: 1; }

/* ── Stepper (project wizard) ────────────────────────────── */
.stepper { display: flex; align-items: center; gap: var(--space-2); margin-bottom: var(--space-8); }
.step-node { display: flex; align-items: center; gap: var(--space-2); flex-shrink: 0; }
.step-dot {
  width: 32px; height: 32px; border-radius: var(--radius-full);
  display: inline-flex; align-items: center; justify-content: center;
  font-family: var(--font-body); font-weight: 600; font-size: var(--fs-body-sm);
  background: var(--color-surface-raised); color: var(--color-text-muted);
  border: 1px solid var(--color-border); flex-shrink: 0;
}
.step-node.is-active .step-dot { background: var(--color-primary); color: var(--color-text-inverse); border-color: var(--color-primary); }
.step-node.is-done .step-dot { background: var(--color-primary-subtle); color: var(--color-primary); border-color: var(--color-primary-subtle); }
.step-label { font-size: var(--fs-body-sm); font-weight: 500; color: var(--color-text-muted); white-space: nowrap; }
.step-node.is-active .step-label { color: var(--color-text-heading); }
.step-bar { flex: 1; height: 2px; background: var(--color-border); border-radius: 2px; min-width: 16px; }
.step-bar.is-done { background: var(--color-primary); }
.stepper-mobile { display: none; }
@media (max-width: 640px) {
  .stepper { display: none; }
  .stepper-mobile { display: block; margin-bottom: var(--space-6); }
  .stepper-mobile .progress { margin-top: var(--space-2); }
}

/* ── KPI cards (dashboard) ───────────────────────────────── */
.kpi-grid { display: grid; grid-template-columns: 1fr 1fr; gap: var(--space-3); margin-bottom: var(--space-6); }
@media (min-width: 768px) { .kpi-grid { grid-template-columns: repeat(4, 1fr); } }
.kpi-card { display: flex; align-items: center; gap: var(--space-3); padding: var(--space-4); }
.kpi-icon { width: 40px; height: 40px; border-radius: var(--radius-lg); background: var(--color-surface-raised); color: var(--color-text-muted); display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0; }
.kpi-icon svg { width: 20px; height: 20px; }
.kpi-icon.is-amber { background: var(--color-warning-surface); color: var(--color-warning-text); }
.kpi-icon.is-red { background: var(--color-error-surface); color: var(--color-error-text); }
.kpi-label { font-size: var(--fs-label); font-weight: 500; color: var(--color-text-muted); text-transform: uppercase; letter-spacing: 0.03em; }
.kpi-value { font-family: var(--font-sans); font-size: var(--fs-h2); font-weight: 600; color: var(--color-text-heading); line-height: 1.1; font-variant-numeric: tabular-nums; }
.kpi-value.is-amber { color: var(--color-warning-text); }
.kpi-value.is-red { color: var(--color-error-text); }
.kpi-sub { font-size: var(--fs-caption); color: var(--color-text-muted); }

/* ── Discipline badge / selector ─────────────────────────── */
.discipline-badge {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 3px var(--space-2); border-radius: var(--radius-md);
  background: var(--color-surface-raised); border: 1px solid var(--color-border);
  font-size: var(--fs-body-sm); font-weight: 500; color: var(--color-text-body);
}
.discipline-badge svg { width: 14px; height: 14px; color: var(--color-primary); }

/* ── PMBOK inline help ───────────────────────────────────── */
.help-dot {
  display: inline-flex; align-items: center; justify-content: center;
  width: 16px; height: 16px; color: var(--color-text-muted);
  vertical-align: middle; cursor: help;
}
.help-dot svg { width: 14px; height: 14px; }
.section-help { font-size: var(--fs-caption); color: var(--color-text-muted); margin: 2px 0 0; }

/* ── Power-interest matrix ───────────────────────────────── */
.pi-matrix { display: grid; grid-template-columns: 28px 1fr; grid-template-rows: 1fr 28px; gap: var(--space-2); max-width: 560px; }
.pi-yaxis { grid-column: 1; grid-row: 1; writing-mode: vertical-rl; transform: rotate(180deg); text-align: center; font-size: var(--fs-label); font-weight: 600; color: var(--color-text-muted); text-transform: uppercase; letter-spacing: 0.04em; }
.pi-plot {
  grid-column: 2; grid-row: 1; position: relative;
  aspect-ratio: 1 / 0.78; border: 1px solid var(--color-border); border-radius: var(--radius-lg);
  background:
    linear-gradient(var(--color-border-subtle), var(--color-border-subtle)) center / 100% 1px no-repeat,
    linear-gradient(var(--color-border-subtle), var(--color-border-subtle)) center / 1px 100% no-repeat;
  overflow: hidden;
}
.pi-quad { position: absolute; width: 50%; height: 50%; display: flex; padding: var(--space-2); }
.pi-quad span { font-size: var(--fs-caption); color: var(--color-text-muted); font-weight: 500; }
.pi-quad.tl { top: 0; left: 0; align-items: flex-start; justify-content: flex-start; background: rgba(79,70,229,0.03); }
.pi-quad.tr { top: 0; right: 0; align-items: flex-start; justify-content: flex-end; text-align: right; background: rgba(79,70,229,0.06); }
.pi-quad.bl { bottom: 0; left: 0; align-items: flex-end; justify-content: flex-start; }
.pi-quad.br { bottom: 0; right: 0; align-items: flex-end; justify-content: flex-end; text-align: right; background: rgba(79,70,229,0.03); }
.pi-dot { position: absolute; transform: translate(-50%, 50%); display: flex; flex-direction: column; align-items: center; gap: 2px; z-index: 2; }
.pi-dot .dot { width: 14px; height: 14px; border-radius: 50%; border: 2px solid var(--color-surface-card); box-shadow: var(--shadow-sm); }
.pi-dot .dot.eng-unaware    { background: var(--color-text-muted); }
.pi-dot .dot.eng-resistant  { background: var(--color-error-strong); }
.pi-dot .dot.eng-neutral    { background: var(--color-border-strong); }
.pi-dot .dot.eng-supportive { background: var(--color-success-text); }
.pi-dot .dot.eng-leading    { background: var(--color-warning-text); }
.pi-dot .pi-name { font-size: 10px; color: var(--color-text-body); white-space: nowrap; background: var(--color-surface-card); padding: 0 4px; border-radius: var(--radius-sm); }
.pi-xaxis { grid-column: 2; grid-row: 2; text-align: center; font-size: var(--fs-label); font-weight: 600; color: var(--color-text-muted); text-transform: uppercase; letter-spacing: 0.04em; }

/* ── Charter ─────────────────────────────────────────────── */
.charter-layout { display: grid; grid-template-columns: 220px 1fr; gap: var(--space-6); align-items: start; }
@media (max-width: 860px) { .charter-layout { grid-template-columns: 1fr; gap: var(--space-4); } }
.charter-nav { position: sticky; top: 72px; display: flex; flex-direction: column; gap: 2px; }
@media (max-width: 860px) {
  .charter-nav { position: static; flex-direction: row; overflow-x: auto; padding-bottom: var(--space-2); border-bottom: 1px solid var(--color-border); gap: var(--space-1); }
}
.charter-nav-link {
  display: flex; align-items: center; gap: var(--space-2);
  padding: 8px var(--space-3); border-radius: var(--radius-md); min-height: 38px;
  font-size: var(--fs-body-sm); color: var(--color-text-muted); text-decoration: none; white-space: nowrap;
}
.charter-nav-link:hover { background: var(--color-surface-raised); color: var(--color-text-heading); text-decoration: none; }
.charter-nav-link.is-active { background: var(--color-primary-subtle); color: var(--color-primary); font-weight: 500; }
.charter-sections { display: flex; flex-direction: column; gap: var(--space-4); }
.charter-section-card { scroll-margin-top: 72px; }
.charter-autogen { display: inline-flex; align-items: center; gap: 6px; font-size: var(--fs-caption); color: var(--color-primary); background: var(--color-primary-subtle); padding: 2px var(--space-2); border-radius: var(--radius-full); margin-top: var(--space-2); }
.charter-banner { display: flex; align-items: center; gap: var(--space-3); padding: var(--space-3) var(--space-4); border-radius: var(--radius-lg); border: 1px solid; margin-bottom: var(--space-5); font-size: var(--fs-body-sm); }
.charter-banner svg { width: 18px; height: 18px; flex-shrink: 0; }
.charter-banner .banner-actions { margin-left: auto; display: flex; gap: var(--space-2); flex-shrink: 0; }
.charter-banner.is-draft    { background: var(--color-surface-raised);  border-color: var(--color-border);          color: var(--color-text-body); }
.charter-banner.is-pending  { background: var(--color-warning-surface); border-color: var(--color-warning-border);  color: var(--color-warning-text); }
.charter-banner.is-approved { background: var(--color-success-surface); border-color: var(--color-success-border);  color: var(--color-success-text); }
.charter-banner.is-rejected { background: var(--color-error-surface);   border-color: var(--color-error-border);    color: var(--color-error-text); }
@media (max-width: 560px) { .charter-banner { flex-wrap: wrap; } .charter-banner .banner-actions { margin-left: 0; width: 100%; } .charter-banner .banner-actions .btn { flex: 1; } }
.charter-read h3 { font-family: var(--font-sans); font-size: var(--fs-h3); color: var(--color-text-heading); margin: var(--space-5) 0 var(--space-2); }
.charter-read p { color: var(--color-text-body); margin: 0 0 var(--space-3); white-space: pre-line; }

/* utility */
.muted { color: var(--color-text-muted); }
.nowrap { white-space: nowrap; }
.flex-between { display: flex; align-items: center; justify-content: space-between; gap: var(--space-3); }

/* ── Project creation wizard (T-146) ─────────────────────────────────── */
.wizard { max-width: 640px; margin: 0 auto; }
.wizard-step[hidden] { display: none; }
.disc-grid { display: grid; grid-template-columns: 1fr 1fr; gap: var(--space-2); }
@media (min-width: 560px) { .disc-grid { grid-template-columns: repeat(3, 1fr); } }
.disc-opt {
  display: flex; flex-direction: column; align-items: flex-start; gap: 6px;
  padding: var(--space-3); border: 1px solid var(--color-border); border-radius: var(--radius-lg);
  background: var(--color-surface-card); cursor: pointer; text-align: left; min-height: 72px;
  transition: border-color var(--motion-fast), background var(--motion-fast);
}
.disc-opt:hover { border-color: var(--color-border-strong); }
.disc-opt.is-sel { border-color: var(--color-primary); background: var(--color-primary-subtle); }
.disc-opt svg { width: 22px; height: 22px; color: var(--color-primary); }
.disc-opt .disc-name { font-size: var(--fs-body-sm); font-weight: 500; color: var(--color-text-heading); }
.wizard-foot { display: flex; justify-content: space-between; gap: var(--space-2); margin-top: var(--space-8); }
@media (max-width: 560px) {
  .wizard-foot { position: sticky; bottom: 0; background: var(--color-surface-page); padding: var(--space-3) 0; margin-top: var(--space-6); }
  .wizard-foot .btn { flex: 1; }
}
.toggle-card { display: flex; align-items: flex-start; gap: var(--space-3); padding: var(--space-4); border: 1px solid var(--color-border); border-radius: var(--radius-lg); }

/* Theme toggle (CR-034 Phase 1b) moved to components.css so it's available on
   every base — app, auth, public/marketing, and the design-system page. */

/* ── CR-011 Backlog & Sprints workspace ─────────────────────────────── */
.sprint-card { padding: var(--space-4); transition: box-shadow var(--motion-fast, 120ms) ease, border-color var(--motion-fast, 120ms) ease; }
.sprint-card.is-active-sprint { border-left: 3px solid var(--color-primary); }
.sprint-card.is-drop { outline: 2px dashed var(--color-primary); outline-offset: -2px; background: var(--color-primary-subtle); }
.task-chip { display: flex; align-items: center; gap: var(--space-2); padding: 6px var(--space-2); background: var(--color-surface-raised); border-radius: var(--radius-sm); cursor: grab; user-select: none; font-size: var(--fs-body-sm); }
.task-chip:hover { background: var(--color-border-subtle); }
.task-chip:active { cursor: grabbing; }
