/* APEX Companion — self-contained stylesheet, no CDN dependencies */

/* ------------------------------------------------------------------ */
/* Reset & base */
/* ------------------------------------------------------------------ */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

/* ------------------------------------------------------------------ */
/* Duetto brand design tokens                                         */
/* Midnight Green #061e21 · Teal #1c4747 · Lime #c4ff45              */
/* Soft Lime #eaffbe · Grey #dde1e2                                   */
/* ------------------------------------------------------------------ */
:root {
  /* Brand palette
   * NOTE: --dt-midnight is now provided by the DS tokens.css.
   * App-specific aliases below are NOT in the DS and remain here. */
  --dt-teal:           #1c4747;
  --dt-teal-mid:       #2a5f5f;
  --dt-lime:           #c4ff45;
  --dt-lime-soft:      #eaffbe;
  --dt-grey:           #dde1e2;

  /* Light mode surfaces */
  --color-bg:          #f5f7f5;
  --color-surface:     #ffffff;
  --color-border:      #dde1e2;
  --color-text:        #0d1f22;
  --color-text-muted:  #5a6e72;
  --color-primary:     #1c4747;
  --color-primary-dark:#0f3333;
  --color-link:        #1c4747;
  --color-accent:      #c4ff45;
  --color-accent-soft: #eaffbe;

  /* Header */
  --color-header-bg:   #061e21;
  --color-header-text: #eaffbe;
  --color-header-nav:  rgba(234,255,190,.6);
  --color-header-nav-hover: #c4ff45;

  /* Status colours — semantic, not brand */
  --color-discovery:   #6f42c1;
  --color-validated:   #1c4747;
  --color-delivery:    #c2410c;
  --color-deployed:    #065f46;
  --color-learning:    #0f766e;
  --color-success:     #065f46;
  --color-killed:      #991b1b;
  --color-unknown:     #5a6e72;

  /* Type colours */
  --color-initiative:  #1c4747;
  --color-prd:         #5b21b6;
  --color-experiment:  #c2410c;
  --color-proposal:    #065f46;
  --color-decision:    #991b1b;
  --color-team-charter:#5a6e72;

  /* --font-mono is provided by the DS tokens.css */
  --font-sans: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;

  --radius:   6px;
  --shadow:   0 1px 3px rgba(6,30,33,.07), 0 1px 2px rgba(6,30,33,.05);
  --shadow-md:0 4px 6px rgba(6,30,33,.08), 0 2px 4px rgba(6,30,33,.06);

  /* Aliases used by mobile nav and notes panel */
  --text-secondary: var(--color-text-muted);
  --bg-card:        var(--color-surface);
  --bg-hover:       rgba(6, 30, 33, 0.05);
  --border:         var(--color-border);
}

/* Dark mode */
[data-theme="dark"] {
  --color-bg:          #0a1a1d;
  --color-surface:     #0f2528;
  --color-border:      #1e3a3e;
  --color-text:        #e8f0f1;
  --color-text-muted:  #7fa8ad;
  --color-primary:     #c4ff45;
  --color-primary-dark:#a8e020;
  --color-link:        #c4ff45;
  --color-accent:      #c4ff45;
  --color-accent-soft: #1c4747;

  --color-header-bg:   #030f11;
  --color-header-text: #eaffbe;
  --color-header-nav:  rgba(234,255,190,.5);
  --color-header-nav-hover: #c4ff45;

  --shadow:   0 1px 3px rgba(0,0,0,.3), 0 1px 2px rgba(0,0,0,.2);
  --shadow-md:0 4px 6px rgba(0,0,0,.35), 0 2px 4px rgba(0,0,0,.25);

  /* Aliases used by mobile nav and notes panel */
  --text-secondary: var(--color-text-muted);
  --bg-card:        var(--color-surface);
  --bg-hover:       rgba(255, 255, 255, 0.05);
  --border:         var(--color-border);
}

html { font-size: 16px; scroll-behavior: smooth; }

body {
  font-family: var(--font-sans);
  background: var(--color-bg);
  color: var(--color-text);
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

a { color: var(--color-link); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ------------------------------------------------------------------ */
/* Layout */
/* ------------------------------------------------------------------ */
.nav-auth {
  display: flex;
  align-items: center;
}

.logo {
  display: flex;
  align-items: center;
  gap: .5rem;
  text-decoration: none;
}
.logo:hover { text-decoration: none; }
.logo:hover .logo-text { color: var(--color-accent); }

.logo-alicorn {
  height: 30px;
  width: auto;
  display: block;
  image-rendering: -webkit-optimize-contrast;
}

.logo-text {
  font-weight: 700;
  font-size: 1.1rem;
  color: var(--color-header-text);
  letter-spacing: -.3px;
  transition: color .15s;
}

/* ── Tools landing (/tools) ─────────────────────────────────────────────── */
.tools-landing-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 1rem;
  margin-top: 1rem;
}
.tool-card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  gap: .5rem;
  text-decoration: none;
  color: var(--color-text);
  box-shadow: var(--shadow);
  transition: border-color .15s, box-shadow .15s, transform .15s;
}
.tool-card:hover {
  border-color: var(--color-primary);
  box-shadow: var(--shadow-md);
  text-decoration: none;
  color: var(--color-text);
  transform: translateY(-1px);
}
.tool-card-icon { font-size: 2rem; line-height: 1; }
.tool-card-title { font-size: 1.05rem; font-weight: 700; margin: 0; }
.tool-card-desc { font-size: .85rem; color: var(--color-text-muted); margin: 0; flex-grow: 1; }
.tool-card-cta { font-size: .85rem; font-weight: 600; color: var(--color-primary); margin-top: .25rem; }

/* ── Pods page ────────────────────────────────────────────────────────────── */
.pods-header { margin-bottom: 2rem; }
.pods-title { font-size: 1.75rem; font-weight: 700; margin: 0 0 .35rem; }
.pods-subtitle { color: var(--color-text-muted); margin: 0; }

.pods-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1rem;
}

.pod-card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: 10px;
  padding: 1.25rem;
  text-decoration: none;
  color: var(--color-text);
  display: flex;
  flex-direction: column;
  gap: .75rem;
  transition: box-shadow .15s, border-color .15s;
}
.pod-card:hover {
  box-shadow: 0 4px 16px rgba(0,0,0,.1);
  border-color: var(--color-primary);
  text-decoration: none;
  color: var(--color-text);
}

.pod-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.pod-name { font-size: 1.05rem; font-weight: 700; }

.pod-health-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
}
.pod-health-dot.pod-health-active,
.pod-health-badge.pod-health-active { background: #22c55e; color: #fff; }
.pod-health-dot.pod-health-mixed,
.pod-health-badge.pod-health-mixed { background: #f59e0b; color: #fff; }
.pod-health-dot.pod-health-discovery,
.pod-health-badge.pod-health-discovery { background: #818cf8; color: #fff; }
.pod-health-dot.pod-health-unknown,
.pod-health-badge.pod-health-unknown { background: var(--color-border); }

.pod-health-badge { padding: .2rem .55rem; border-radius: 999px; font-size: .72rem; font-weight: 600; }

.pod-card-desc {
  font-size: .8rem;
  color: var(--color-text-muted);
  margin: 0 0 .6rem;
  line-height: 1.4;
}

.pod-card-members {
  display: flex;
  flex-wrap: wrap;
  gap: .3rem;
  margin-bottom: .65rem;
}
.pod-member-chip {
  font-size: .72rem;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: 20px;
  padding: .15rem .55rem;
  color: var(--color-text);
  white-space: nowrap;
}
.pod-member-more {
  color: var(--color-text-muted);
  border-style: dashed;
}

.pod-domains { display: flex; flex-wrap: wrap; gap: .35rem; }
.pod-domain-chip {
  font-size: .73rem;
  background: var(--color-bg);
  border: 1px solid var(--color-border);
  border-radius: 4px;
  padding: .15rem .45rem;
  color: var(--color-text-muted);
}

.pod-stats {
  display: flex;
  gap: 1rem;
  font-size: .82rem;
  color: var(--color-text-muted);
}
.pod-stats strong { color: var(--color-text); }

.pod-status-bar {
  display: flex;
  border-radius: 4px;
  overflow: hidden;
  height: 6px;
  gap: 2px;
}
.pod-status-seg {
  display: flex;
  align-items: center;
  font-size: 0;  /* hide text label in bar */
  border-radius: 2px;
  min-width: 8px;
}
.pod-status-seg.status-delivery { background: #22c55e; }
.pod-status-seg.status-validated { background: #3b82f6; }
.pod-status-seg.status-discovery { background: #818cf8; }
.pod-status-seg.status-deployed { background: #0ea5e9; }

/* Pod detail */
.pod-pipeline { display: flex; flex-direction: column; gap: 1.75rem; }
.pod-pipeline-group {}
.pod-pipeline-label { display: flex; align-items: center; gap: .6rem; margin-bottom: .75rem; }
.pod-pipeline-count { font-size: .85rem; color: var(--color-text-muted); }

.pod-initiative-list { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: .4rem; }
.pod-initiative-item {
  display: flex;
  align-items: center;
  gap: .75rem;
  font-size: .9rem;
  padding: .5rem .75rem;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: 6px;
}
.pod-initiative-item a { font-weight: 500; text-decoration: none; }
.pod-initiative-item a:hover { text-decoration: underline; }
.pod-init-domain {
  font-size: .75rem;
  color: var(--color-text-muted);
  margin-left: auto;
  flex-shrink: 0;
}


/* Branch banner */
.branch-banner {
  background: #fffbeb;
  border-bottom: 1px solid #fde68a;
  color: #92400e;
  font-size: .83rem;
  padding: .4rem 1.5rem;
  display: flex;
  align-items: center;
  gap: .5rem;
}
.branch-banner strong {
  font-family: var(--font-mono);
  font-size: .8rem;
}
.branch-banner-clear {
  margin-left: auto;
  font-size: .78rem;
  color: #92400e;
  opacity: .7;
}
.branch-banner-clear:hover { opacity: 1; text-decoration: none; }

.main-content {
  flex: 1;
  max-width: 1200px;
  width: 100%;
  margin: 0 auto;
  padding: 2rem 1.5rem;
}

/* ------------------------------------------------------------------ */
/* Page header */
/* ------------------------------------------------------------------ */
.page-header {
  display: flex;
  align-items: baseline;
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.page-header h1 { font-size: 1.6rem; font-weight: 700; }

.count-badge {
  background: var(--color-border);
  color: var(--color-text-muted);
  border-radius: 999px;
  padding: .15rem .65rem;
  font-size: .8rem;
  font-weight: 600;
}
.count-badge-muted {
  background: transparent;
  border: 1px solid var(--color-border);
}

/* ------------------------------------------------------------------ */
/* Badges */
/* ------------------------------------------------------------------ */
.badge {
  display: inline-block;
  border-radius: 4px;
  padding: .15rem .5rem;
  font-size: .72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .4px;
}

.type-initiative  { background:#d4eeee; color:#0f3333; }
.type-prd         { background:#ede9fe; color:#5b21b6; }
.type-experiment  { background:#ffedd5; color:#c2410c; }
.type-proposal    { background:#d1fae5; color:#065f46; }
.type-decision    { background:#fee2e2; color:#991b1b; }
.type-team-charter{ background:#e5e7eb; color:#374151; }
.type-unknown     { background:#e5e7eb; color:#374151; }

.status-discovery { background:#f3e8ff; color:#6d28d9; }
.status-validated { background:#d4eeee; color:#0f3333; }
.status-delivery  { background:#fff0d9; color:#9a3c0a; }
.status-deployed  { background:#eaffbe; color:#1c4747; }
.status-learning  { background:#ccfbf1; color:#0f766e; }
.status-success   { background:#eaffbe; color:#1c4747; }
.status-killed    { background:#fee2e2; color:#991b1b; }
.status-unknown   { background:#e5e7eb; color:#374151; }

/* Dark mode badge overrides */
[data-theme="dark"] .type-initiative  { background:#1c4747; color:#c4ff45; }
[data-theme="dark"] .type-prd         { background:#3b1e6b; color:#d8b4fe; }
[data-theme="dark"] .type-experiment  { background:#431407; color:#fdba74; }
[data-theme="dark"] .type-proposal    { background:#064e3b; color:#6ee7b7; }
[data-theme="dark"] .type-decision    { background:#450a0a; color:#fca5a5; }
[data-theme="dark"] .type-team-charter{ background:#1e2d2f; color:#9db8bc; }
[data-theme="dark"] .type-unknown     { background:#1e2d2f; color:#9db8bc; }
[data-theme="dark"] .status-discovery { background:#3b1e6b; color:#d8b4fe; }
[data-theme="dark"] .status-validated { background:#1c4747; color:#c4ff45; }
[data-theme="dark"] .status-delivery  { background:#431407; color:#fdba74; }
[data-theme="dark"] .status-deployed  { background:#064e3b; color:#6ee7b7; }
[data-theme="dark"] .status-learning  { background:#134e4a; color:#5eead4; }
[data-theme="dark"] .status-success   { background:#064e3b; color:#6ee7b7; }
[data-theme="dark"] .status-killed    { background:#450a0a; color:#fca5a5; }
[data-theme="dark"] .status-unknown   { background:#1e2d2f; color:#9db8bc; }

/* ------------------------------------------------------------------ */
/* Filter bar */
/* ------------------------------------------------------------------ */
.filter-bar {
  display: flex;
  flex-wrap: wrap;
  gap: .75rem;
  margin-bottom: 1.75rem;
  align-items: center;
}

.filter-bar select {
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  padding: .4rem .75rem;
  font-size: .875rem;
  background: var(--color-surface);
  color: var(--color-text);
  cursor: pointer;
}

/* ------------------------------------------------------------------ */
/* Buttons */
/* ------------------------------------------------------------------ */
.btn-primary, .btn-secondary {
  display: inline-block;
  border: none;
  border-radius: var(--radius);
  padding: .4rem 1rem;
  font-size: .875rem;
  font-weight: 600;
  cursor: pointer;
  transition: background .15s;
}

.btn-primary {
  background: var(--color-primary);
  color: #fff;
}
.btn-primary:hover { background: var(--color-primary-dark); text-decoration: none; }

.btn-secondary {
  background: var(--color-border);
  color: var(--color-text);
}
.btn-secondary:hover { background: #d0d6db; text-decoration: none; }

/* ------------------------------------------------------------------ */
/* Artifact grid (index page) */
/* ------------------------------------------------------------------ */
.artifact-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1rem;
}

.artifact-card {
  display: flex;
  flex-direction: column;
  gap: .5rem;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  padding: 1rem;
  box-shadow: var(--shadow);
  color: var(--color-text);
  transition: box-shadow .15s, border-color .15s;
}
.artifact-card:hover {
  box-shadow: var(--shadow-md);
  border-color: var(--color-primary);
  text-decoration: none;
}

.card-header { display: flex; gap: .4rem; flex-wrap: wrap; }

.card-title {
  font-size: 1rem;
  font-weight: 600;
  line-height: 1.3;
  flex: 1;
}

.card-meta {
  font-size: .8rem;
  color: var(--color-text-muted);
}
.meta-sep { margin: 0 .2rem; }

.card-tags { display: flex; flex-wrap: wrap; gap: .3rem; }

.card-footer {
  display: flex;
  justify-content: space-between;
  font-size: .75rem;
  color: var(--color-text-muted);
  margin-top: auto;
  padding-top: .5rem;
  border-top: 1px solid var(--color-border);
}

.tag {
  background: var(--color-bg);
  border: 1px solid var(--color-border);
  border-radius: 4px;
  padding: .1rem .4rem;
  font-size: .7rem;
  color: var(--color-text-muted);
}
.tag-more { font-style: italic; }

/* ------------------------------------------------------------------ */
/* Empty state */
/* ------------------------------------------------------------------ */
.empty-state {
  text-align: center;
  padding: 4rem 1rem;
  color: var(--color-text-muted);
}
.empty-state p { margin-bottom: 1rem; }

/* ------------------------------------------------------------------ */
/* Artifact detail page */
/* ------------------------------------------------------------------ */
.breadcrumb {
  font-size: .85rem;
  color: var(--color-text-muted);
  margin-bottom: 1.25rem;
  display: flex;
  flex-wrap: wrap;
  gap: .25rem;
  align-items: center;
}
.crumb-sep { opacity: .5; }
.crumb-current { color: var(--color-text); font-weight: 500; }
.breadcrumb a { color: var(--color-link); }
.breadcrumb a:hover { text-decoration: underline; }

.artifact-header {
  margin-bottom: 2rem;
}
.artifact-header h1 {
  font-size: 1.75rem;
  font-weight: 700;
  margin: .5rem 0;
  line-height: 1.25;
}

.artifact-badges { display: flex; gap: .4rem; flex-wrap: wrap; margin-bottom: .4rem; }

.artifact-meta-row {
  display: flex;
  flex-wrap: wrap;
  gap: .5rem;
  margin-bottom: .5rem;
}
.meta-chip {
  background: var(--color-bg);
  border: 1px solid var(--color-border);
  border-radius: 999px;
  padding: .15rem .6rem;
  font-size: .78rem;
  color: var(--color-text-muted);
}

.artifact-tags { display: flex; flex-wrap: wrap; gap: .3rem; }

.artifact-layout {
  display: grid;
  grid-template-columns: 1fr 320px;
  gap: 2rem;
  align-items: start;
}

@media (max-width: 900px) {
  .artifact-layout { grid-template-columns: 1fr; }
  .artifact-sidebar { order: -1; }
}

/* ------------------------------------------------------------------ */
/* Prose (markdown body) */
/* ------------------------------------------------------------------ */
.prose {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  padding: 1.75rem 2rem;
  box-shadow: var(--shadow);
  min-width: 0;
}

.prose h1, .prose h2, .prose h3, .prose h4 {
  margin-top: 1.5em;
  margin-bottom: .5em;
  font-weight: 700;
  line-height: 1.25;
}
.prose h1 { font-size: 1.5rem; }
.prose h2 { font-size: 1.25rem; border-bottom: 1px solid var(--color-border); padding-bottom: .3rem; }
.prose h3 { font-size: 1.05rem; }

.prose p { margin-bottom: 1em; }
.prose ul, .prose ol { margin: .5em 0 1em 1.5em; }
.prose li { margin-bottom: .25em; }

.prose table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 1em;
  font-size: .9rem;
}
.prose th, .prose td {
  border: 1px solid var(--color-border);
  padding: .5rem .75rem;
  text-align: left;
}
.prose th { background: var(--color-bg); font-weight: 600; }
.prose tr:nth-child(even) td { background: #fafbfc; }

.prose code {
  background: var(--color-bg);
  border: 1px solid var(--color-border);
  border-radius: 3px;
  padding: .1em .3em;
  font-family: var(--font-mono);
  font-size: .875em;
}
.prose pre {
  background: #1e1e2e;
  color: #cdd6f4;
  border-radius: var(--radius);
  padding: 1rem;
  overflow-x: auto;
  margin-bottom: 1em;
}
.prose pre code {
  background: none;
  border: none;
  padding: 0;
  color: inherit;
  font-size: .875rem;
}

.prose blockquote {
  border-left: 4px solid var(--color-primary);
  padding-left: 1rem;
  color: var(--color-text-muted);
  margin: 1em 0;
}

/* ------------------------------------------------------------------ */
/* Sidebar */
/* ------------------------------------------------------------------ */
.artifact-sidebar {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.summary-panel {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  padding: 1.25rem;
  box-shadow: var(--shadow);
}

.summary-title, .fm-title {
  font-size: .85rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .5px;
  color: var(--color-text-muted);
  margin-bottom: .75rem;
}

.summary-text {
  font-size: .9rem;
  line-height: 1.7;
  color: var(--color-text);
  white-space: pre-wrap;
}

.summary-error { font-size: .85rem; color: var(--color-text-muted); font-style: italic; }

/* Per-initiative weekly progress report rendered in sidebar */
.initiative-weekly-report { font-size: .875rem; line-height: 1.65; color: var(--color-text); }
.initiative-weekly-report h2 {
  font-size: .8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .4px;
  color: var(--color-text-muted);
  margin: 1rem 0 .35rem;
  padding-bottom: .25rem;
  border-bottom: 1px solid var(--color-border);
}
.initiative-weekly-report h2:first-child { margin-top: 0; }
.initiative-weekly-report h3 { font-size: .85rem; font-weight: 600; margin: .75rem 0 .25rem; }
.initiative-weekly-report p { margin: 0 0 .5rem; }
.initiative-weekly-report ul { margin: .25rem 0 .5rem 1.1rem; padding: 0; }
.initiative-weekly-report li { margin-bottom: .2rem; }
.initiative-weekly-report strong { color: var(--color-text); font-weight: 600; }

/* Spinner */
.spinner {
  display: flex;
  align-items: center;
  gap: .35rem;
  flex-wrap: wrap;
  padding: .5rem 0;
}
.spinner-dot {
  width: 7px; height: 7px;
  background: var(--color-primary);
  border-radius: 50%;
  animation: bounce 1.2s infinite ease-in-out;
  display: inline-block;
}
.spinner-dot:nth-child(2) { animation-delay: .2s; }
.spinner-dot:nth-child(3) { animation-delay: .4s; }
.spinner-label { font-size: .8rem; color: var(--color-text-muted); margin-left: .25rem; }

@keyframes bounce {
  0%, 80%, 100% { transform: scale(0.6); opacity: .5; }
  40%            { transform: scale(1);   opacity: 1;  }
}

/* ------------------------------------------------------------------ */
/* Activity Dashboard */
/* ------------------------------------------------------------------ */

.dash-header {
  margin-bottom: 1.5rem;
}
.dash-title {
  font-size: 1.6rem;
  font-weight: 700;
}

/* Dashboard tab bar (Org / Pod / Me) */
.dashboard-tabs {
  display: flex;
  gap: 0.25rem;
  margin-bottom: 1.5rem;
  border-bottom: 2px solid var(--color-border);
  padding-bottom: 0;
}
.dash-tab {
  padding: 0.5rem 1.25rem;
  border-radius: 6px 6px 0 0;
  text-decoration: none;
  color: var(--color-text-muted);
  font-weight: 500;
  font-size: 0.9rem;
  transition: color 0.15s;
  margin-bottom: -2px;
  border: 2px solid transparent;
}
.dash-tab:hover { color: var(--color-text); }
.dash-tab--active {
  color: var(--color-text);
  border-color: var(--color-border) var(--color-border) var(--color-surface);
  background: var(--color-surface);
}

/* Stat row */
.stat-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1rem;
  margin-bottom: 1.75rem;
}

@media (max-width: 700px) {
  .stat-row { grid-template-columns: repeat(2, 1fr); }
}

.stat-card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  padding: 1rem 1.25rem;
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  gap: .2rem;
}
.stat-card-link {
  color: var(--color-text);
  cursor: pointer;
  transition: border-color .15s, box-shadow .15s;
}
.stat-card-link:hover {
  border-color: var(--color-primary);
  box-shadow: var(--shadow-md);
  text-decoration: none;
}
.stat-card-warn   { border-color: #ffc107; background: #fffdf0; }
.stat-card-action { border-color: #f59e0b; background: #fffbeb; }
.stat-card-action .stat-value { color: #92400e; }
.stat-card-action .stat-label { color: #b45309; }

.stat-value {
  font-size: 2rem;
  font-weight: 800;
  line-height: 1;
  color: var(--color-text);
}
.stat-label {
  font-size: .78rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .4px;
  color: var(--color-text-muted);
}

/* Blocked / alert section */
.dash-section-alert {
  border: 1px solid #fca5a5;
  background: #fff5f5;
  border-radius: var(--radius);
  padding: 1rem 1.25rem;
  margin-bottom: 1.5rem;
}
.dash-title-alert { color: #991b1b !important; }

.alert-list { display: flex; flex-direction: column; gap: .75rem; }
.alert-item {
  border-left: 3px solid #dc3545;
  padding-left: .75rem;
}
.alert-artifact-link {
  font-weight: 600;
  font-size: .9rem;
  display: flex;
  align-items: center;
  gap: .4rem;
  margin-bottom: .3rem;
}
.alert-blockers {
  list-style: disc;
  padding-left: 1.1rem;
  font-size: .82rem;
  color: var(--color-text-muted);
}

/* Two-column dashboard layout */
.dash-layout {
  display: grid;
  grid-template-columns: 1fr 320px;
  gap: 2rem;
  align-items: start;
}

@media (max-width: 900px) {
  .dash-layout { grid-template-columns: 1fr; }
}

/* Section titles */
.dash-section {
  margin-bottom: 1.5rem;
}
.dash-section-title {
  font-size: .8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .6px;
  color: var(--color-text-muted);
  margin-bottom: .75rem;
  display: flex;
  align-items: center;
  gap: .5rem;
}

.section-count {
  background: var(--color-border);
  color: var(--color-text-muted);
  border-radius: 999px;
  padding: .05rem .5rem;
  font-size: .72rem;
  font-weight: 700;
}

/* PR list */
.pr-list { display: flex; flex-direction: column; gap: .5rem; }

.pr-item {
  display: flex;
  flex-direction: column;
  gap: .25rem;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  padding: .75rem 1rem;
  box-shadow: var(--shadow);
  color: var(--color-text);
  transition: border-color .15s;
}
.pr-item:hover { border-color: var(--color-primary); text-decoration: none; }

.pr-meta-row {
  display: flex;
  align-items: center;
  gap: .5rem;
  flex-wrap: wrap;
}
.pr-number {
  font-size: .78rem;
  font-weight: 700;
  color: var(--color-text-muted);
  flex-shrink: 0;
}
.pr-age {
  font-size: .75rem;
  color: var(--color-text-muted);
  margin-left: auto;
}

.pr-badge {
  border-radius: 999px;
  padding: .1rem .55rem;
  font-size: .7rem;
  font-weight: 700;
}
.pr-badge-review   { background: #dbeafe; color: #1e40af; }
.pr-badge-approved { background: #d1fae5; color: #065f46; }
.pr-badge-changes  { background: #fee2e2; color: #991b1b; }

.pr-title {
  font-size: .9rem;
  font-weight: 600;
  line-height: 1.3;
}
.pr-author {
  font-size: .75rem;
  color: var(--color-text-muted);
}

/* Branch cards */
.dash-section-branches { margin-bottom: 1.5rem; }

.branch-name-heading {
  font-family: var(--font-mono);
  font-weight: 600;
  color: var(--color-primary);
}
.branch-back-link { margin-left: auto; }

.branch-card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: .6rem;
}

.branch-card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-left: 3px solid var(--color-border);
  border-radius: var(--radius);
  padding: .75rem 1rem;
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  gap: .25rem;
  transition: border-color .15s;
  color: var(--color-text);
  text-decoration: none;
}
.branch-card:hover { border-color: var(--color-primary); text-decoration: none; }

/* Type-specific left-border accent */
.branch-type-initiative { background: #dbeafe; color: #1e40af; }
.branch-type-feat       { background: #d1fae5; color: #065f46; }
.branch-type-fix        { background: #fee2e2; color: #991b1b; }
.branch-type-chore      { background: #f3f4f6; color: #374151; }
.branch-type-docs       { background: #ede9fe; color: #5b21b6; }

.branch-card:has(.branch-type-initiative) { border-left-color: #3b82f6; }
.branch-card:has(.branch-type-feat)       { border-left-color: #10b981; }
.branch-card:has(.branch-type-fix)        { border-left-color: #ef4444; }
.branch-card:has(.branch-type-chore)      { border-left-color: #9ca3af; }

.branch-card-header {
  display: flex;
  align-items: center;
  gap: .5rem;
  flex-wrap: wrap;
  margin-bottom: .1rem;
}

.branch-type-chip {
  font-size: .65rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .3px;
  border-radius: 3px;
  padding: .1rem .4rem;
  flex-shrink: 0;
}

.branch-pr-badge {
  border-radius: 999px;
  padding: .1rem .55rem;
  font-size: .7rem;
  font-weight: 700;
  margin-left: auto;
  cursor: pointer;
  user-select: none;
}
.branch-pr-badge:hover { filter: brightness(.92); }
.branch-pr-review   { background: #dbeafe; color: #1e40af; }
.branch-pr-approved { background: #d1fae5; color: #065f46; }
.branch-pr-changes  { background: #fee2e2; color: #991b1b; }
.branch-pr-you      { background: #fef3c7; color: #92400e; font-weight: 800; }

/* Cards needing the current user's attention */
.branch-card-needs-you {
  border-left-color: #f59e0b !important;
  box-shadow: 0 0 0 2px rgba(245,158,11,.25), var(--shadow);
}
.branch-card-your-changes {
  border-left-color: #ef4444 !important;
  box-shadow: 0 0 0 2px rgba(239,68,68,.2), var(--shadow);
}

.branch-name {
  font-size: .85rem;
  font-weight: 600;
  font-family: var(--font-mono);
  color: var(--color-primary);
  word-break: break-all;
}

.branch-commit {
  font-size: .8rem;
  color: var(--color-text);
  line-height: 1.4;
  margin: 0;
}
.branch-meta {
  font-size: .72rem;
  color: var(--color-text-muted);
}

/* Pipeline row (horizontal, below branches) */
.pipeline-row {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 1rem;
  align-items: start;
}

/* Pipeline sections */
.pipeline-section {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  padding: 1rem 1.1rem;
  box-shadow: var(--shadow);
  margin-bottom: 1rem;
}

.pipeline-title { border-bottom: 2px solid transparent; padding-bottom: .4rem; margin-bottom: .6rem; }
.pipeline-delivery  { border-color: #fd7e14; }
.pipeline-validated { border-color: #0d6efd; }
.pipeline-discovery { border-color: #6f42c1; }
.pipeline-other     { border-color: var(--color-border); }

.pipeline-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: .3rem;
}
.pipeline-item {
  display: flex;
  flex-direction: column;
  gap: .05rem;
  padding: .3rem 0;
  border-bottom: 1px solid var(--color-bg);
}
.pipeline-item:last-child { border-bottom: none; }
.pipeline-item a {
  font-size: .85rem;
  font-weight: 500;
  line-height: 1.3;
}
.pipeline-domain {
  font-size: .72rem;
  color: var(--color-text-muted);
}

.empty-activity {
  color: var(--color-text-muted);
  font-size: .85rem;
  padding: .5rem 0;
}

.pipeline-browse-link {
  display: block;
  font-size: .75rem;
  color: var(--color-text-muted);
  margin-top: .4rem;
  text-align: right;
}
.pipeline-browse-link:hover { color: var(--color-primary); }

/* ------------------------------------------------------------------ */
/* Health Check / Blockers panel */
/* ------------------------------------------------------------------ */
.blockers-panel {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  padding: 1.25rem;
  box-shadow: var(--shadow);
}

.blockers-title {
  font-size: .85rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .5px;
  color: var(--color-text-muted);
  margin-bottom: .75rem;
}

.blocker-ok {
  font-size: .85rem;
  color: #065f46;
  background: #d1fae5;
  border-radius: var(--radius);
  padding: .4rem .75rem;
}

.blocker-chips {
  display: flex;
  gap: .5rem;
  flex-wrap: wrap;
  margin-bottom: .75rem;
}

.chip {
  border-radius: 999px;
  padding: .15rem .65rem;
  font-size: .75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .3px;
}
.chip-blocking { background: #fee2e2; color: #991b1b; }
.chip-warning  { background: #fff3cd; color: #856404; }

.blocker-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: .6rem;
}

.blocker-item {
  border-radius: var(--radius);
  padding: .6rem .75rem;
  border-left: 3px solid transparent;
}
.blocker-blocking { border-left-color: #dc3545; background: #fff5f5; }
.blocker-warning  { border-left-color: #ffc107; background: #fffdf0; }

.blocker-desc {
  font-size: .82rem;
  font-weight: 600;
  color: var(--color-text);
  margin-bottom: .25rem;
}

.blocker-fix {
  font-size: .78rem;
  color: var(--color-text-muted);
  line-height: 1.4;
}

/* Frontmatter panel */
.frontmatter-panel {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  padding: 1.25rem;
  box-shadow: var(--shadow);
}

/* ── Frontmatter fact table ──────────────────────────────────────── */
.fm-table { width: 100%; border-collapse: collapse; font-size: .82rem; }
.fm-table tr { border-bottom: 1px solid var(--color-border); }
.fm-table tr:last-child { border-bottom: none; }
.fm-key {
  padding: .35rem .5rem .35rem 0;
  color: var(--color-text-muted);
  font-weight: 600;
  white-space: nowrap;
  vertical-align: top;
  width: 40%;
  text-transform: none;
  letter-spacing: 0;
}
.fm-val {
  padding: .35rem 0;
  color: var(--color-text);
  vertical-align: top;
  word-break: break-word;
}
.fm-val a { color: var(--color-link); }
/* Linked metadata values */
.fm-link {
  color: var(--color-link);
  text-decoration: none;
  border-bottom: 1px dotted var(--color-link);
}
.fm-link:hover { border-bottom-style: solid; text-decoration: none; }
/* Cross-reference links (related_* fields) get a small arrow indicator */
.fm-ref::after { content: " ↗"; font-size: .7em; opacity: .6; }
/* Null / absent value */
.fm-null { color: var(--color-text-muted); }
/* Separator between list items */
.fm-sep { color: var(--color-text-muted); }
/* Raw complex values */
.fm-raw { font-family: var(--font-mono); font-size: .78rem; color: var(--color-text-muted); }

/* ------------------------------------------------------------------ */
/* Search page */
/* ------------------------------------------------------------------ */
.search-form { margin-bottom: 1.5rem; }

.search-row {
  display: flex;
  gap: .5rem;
}

.search-input {
  flex: 1;
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  padding: .5rem 1rem;
  font-size: 1rem;
  font-family: var(--font-sans);
}
.search-input:focus {
  outline: 2px solid var(--color-primary);
  outline-offset: -1px;
}

.results-summary { color: var(--color-text-muted); margin-bottom: 1rem; }

.artifact-list { display: flex; flex-direction: column; gap: .5rem; }

.list-item {
  display: flex;
  align-items: center;
  gap: 1rem;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  padding: .75rem 1rem;
  box-shadow: var(--shadow);
  color: var(--color-text);
  transition: border-color .15s;
}
.list-item:hover { border-color: var(--color-primary); text-decoration: none; }

.list-item-badges { display: flex; gap: .3rem; flex-shrink: 0; }

.list-item-body { flex: 1; min-width: 0; }
.list-title { font-size: .95rem; font-weight: 600; }
.list-meta { font-size: .78rem; color: var(--color-text-muted); }

.list-date { font-size: .75rem; color: var(--color-text-muted); flex-shrink: 0; }

.search-hint { color: var(--color-text-muted); padding: 2rem 0; }

/* ------------------------------------------------------------------ */
/* Allocation page                                                      */
/* ------------------------------------------------------------------ */
.alloc-note {
  font-size: .85rem;
  color: var(--color-text-muted);
  margin-bottom: 1.5rem;
  line-height: 1.5;
}

/* Two-column layout: teams left, product area table right */
.alloc-layout {
  display: grid;
  grid-template-columns: 1fr 1.5fr;
  gap: 2rem;
  align-items: start;
}
@media (max-width: 900px) {
  .alloc-layout { grid-template-columns: 1fr; }
}

.alloc-col-title {
  font-size: 1rem;
  font-weight: 700;
  margin-bottom: .75rem;
  color: var(--color-text);
}

/* Team cards */
.alloc-team-card {
  display: block;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  padding: .9rem 1rem;
  box-shadow: var(--shadow);
  margin-bottom: .6rem;
  color: var(--color-text);
  text-decoration: none;
  transition: border-color .15s;
}
.alloc-team-card:hover { border-color: var(--color-primary); text-decoration: none; }
.alloc-team-no-team { cursor: default; opacity: .75; }
.alloc-team-no-team:hover { border-color: var(--color-border); }

.alloc-team-name {
  font-size: .95rem;
  font-weight: 700;
  margin-bottom: .2rem;
}
.alloc-team-authors {
  font-size: .78rem;
  color: var(--color-text-muted);
  margin-bottom: .5rem;
}

/* Stacked bar */
.alloc-team-bar-wrap {
  display: flex;
  height: 8px;
  border-radius: 4px;
  overflow: hidden;
  gap: 1px;
  margin-bottom: .35rem;
}
.alloc-bar-seg {
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: .6rem;
  font-weight: 700;
  color: #fff;
  min-width: 18px;
  border-radius: 2px;
}
.alloc-bar-delivery  { background: #fd7e14; }
.alloc-bar-validated { background: #0d6efd; }
.alloc-bar-discovery { background: #6f42c1; }
.alloc-bar-other     { background: var(--color-border); color: var(--color-text-muted); }

.alloc-bar-legend {
  font-size: .7rem;
  color: var(--color-text-muted);
  display: flex;
  align-items: center;
  gap: .3rem;
  flex-wrap: wrap;
}
.legend-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  display: inline-block;
}
.legend-delivery  { background: #fd7e14; }
.legend-validated { background: #0d6efd; }
.legend-discovery { background: #6f42c1; }

.alloc-no-team-list {
  list-style: disc;
  padding-left: 1.2rem;
  font-size: .8rem;
  color: var(--color-text-muted);
  margin-top: .4rem;
}
.alloc-no-team-list a { color: inherit; }

/* Breadcrumb (drill-down view) */
.alloc-breadcrumb {
  font-size: .85rem;
  color: var(--color-text-muted);
  margin-bottom: 1rem;
  display: flex;
  align-items: center;
  gap: .4rem;
}
.alloc-breadcrumb a { color: var(--color-primary); }
.alloc-breadcrumb-sep { opacity: .4; }

/* Team header stats (drill-down) */
.alloc-team-header { margin-bottom: 1.25rem; }
.alloc-team-stats {
  display: flex;
  gap: .5rem;
  flex-wrap: wrap;
}
.alloc-stat {
  border-radius: 999px;
  padding: .2rem .75rem;
  font-size: .78rem;
  font-weight: 700;
}
.alloc-stat-delivery  { background: #fff3e0; color: #e65100; }
.alloc-stat-validated { background: #e3f2fd; color: #1565c0; }
.alloc-stat-discovery { background: #ede7f6; color: #4527a0; }
.alloc-stat-other     { background: var(--color-bg); color: var(--color-text-muted); }

/* Individual person section */
.alloc-individual { margin-bottom: 2rem; }
.alloc-individual-name {
  font-size: 1rem;
  font-weight: 700;
  margin-bottom: .6rem;
  padding-bottom: .35rem;
  border-bottom: 2px solid var(--color-border);
}
.alloc-individual-unnamed { color: var(--color-text-muted); }

/* Initiative cards in drill-down */
.alloc-initiative-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: .6rem;
}
.alloc-initiative-card {
  display: block;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  padding: .75rem .9rem;
  box-shadow: var(--shadow);
  color: var(--color-text);
  text-decoration: none;
  transition: border-color .15s;
}
.alloc-initiative-card:hover { border-color: var(--color-primary); text-decoration: none; }

.alloc-ini-top {
  display: flex;
  align-items: center;
  gap: .4rem;
  margin-bottom: .35rem;
  flex-wrap: wrap;
}
.alloc-ini-title {
  font-size: .88rem;
  font-weight: 600;
  line-height: 1.35;
  margin-bottom: .2rem;
}
.alloc-ini-meta {
  font-size: .75rem;
  color: var(--color-text-muted);
}

.alloc-loe-chip {
  background: #fef9c3;
  color: #713f12;
  border-radius: 3px;
  padding: .05rem .4rem;
  font-size: .7rem;
  font-weight: 700;
}

/* Product area table */
.alloc-area-note {
  font-size: .78rem;
  color: var(--color-text-muted);
  margin-bottom: .75rem;
}

.alloc-area-table {
  width: 100%;
  border-collapse: collapse;
  font-size: .82rem;
}
.alloc-area-table th {
  text-align: left;
  padding: .35rem .6rem;
  font-size: .72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .3px;
  color: var(--color-text-muted);
  border-bottom: 2px solid var(--color-border);
}
.alloc-th-num { text-align: center; }
.alloc-area-table td { padding: .4rem .6rem; border-bottom: 1px solid var(--color-bg); }
.alloc-area-row:hover td { background: #f8f9fa; }
.alloc-area-heavy td { background: #fffbeb; }
.alloc-area-heavy:hover td { background: #fef9c3; }

.alloc-area-name { white-space: nowrap; }
.alloc-area-domain { color: var(--color-text-muted); }
.alloc-area-sep { margin: 0 .25rem; color: var(--color-text-muted); }
.alloc-area-product { font-weight: 600; }

.alloc-num { text-align: center; font-variant-numeric: tabular-nums; }
.alloc-num-delivery  { color: #e65100; font-weight: 700; }
.alloc-num-validated { color: #1565c0; font-weight: 700; }
.alloc-num-discovery { color: #4527a0; font-weight: 700; }
.alloc-loe-score { font-weight: 700; color: var(--color-text); }
.alloc-loe-labels { color: var(--color-text-muted); font-size: .75rem; }

.empty-state-text {
  color: var(--color-text-muted);
  padding: 2rem 0;
}

/* ------------------------------------------------------------------ */
/* Attention page                                                       */
/* ------------------------------------------------------------------ */
.attention-list {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.attention-item {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-left: 4px solid var(--color-border);
  border-radius: var(--radius);
  padding: 1rem 1.25rem;
  box-shadow: var(--shadow);
}
.attention-item.has-blockers { border-left-color: #dc3545; }
[data-theme="dark"] .attention-item.has-blockers { border-left-color: #b91c1c; }

/* ── Workflow pipeline breadcrumb (work.html / my_work.html) ─────────── */
.workflow-pipeline {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin: 0.75rem 0 1rem 0;
  flex-wrap: wrap;
}
.pipeline-stage {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 4px 10px;
  border-radius: 12px;
  background: var(--color-bg);
  color: var(--color-text-muted);
  font-size: 0.85em;
  font-weight: 500;
}
.pipeline-stage .stage-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--color-text-muted);
}
.pipeline-stage--active {
  background: var(--color-accent-soft);
  color: var(--color-text);
}
.pipeline-stage--active .stage-dot { background: var(--color-accent); }
[data-theme="dark"] .pipeline-stage--active { color: var(--color-accent); }
.pipeline-arrow { color: var(--color-text-muted); font-size: 0.9em; }

/* ── Status badges (warning/info) ───────────────────────────────────── */
.count-badge-warning {
  background: #fef3c7;
  color: #92400e;
}
[data-theme="dark"] .count-badge-warning {
  background: #78350f;
  color: #fef3c7;
}
.badge-branch {
  background: #fef3c7;
  color: #92400e;
  padding: 2px 8px;
  border-radius: 3px;
  font-size: 0.8em;
}
[data-theme="dark"] .badge-branch {
  background: #78350f;
  color: #fef3c7;
}
.badge-resource {
  background: #e0e7ff;
  color: #3730a3;
  padding: 2px 8px;
  border-radius: 3px;
  font-size: 0.8em;
}
[data-theme="dark"] .badge-resource {
  background: #1e1b4b;
  color: #c7d2fe;
}
.pr-state-badge.pr-state-open-info {
  background: #dbeafe;
  color: #1e40af;
}
[data-theme="dark"] .pr-state-badge.pr-state-open-info {
  background: #1e3a5f;
  color: #93c5fd;
}
.chat-deeplink {
  margin-left: 0.4rem;
  font-size: 0.8em;
  padding: 2px 8px;
  border-radius: 3px;
  background: #f3e8ff;
  color: #6b21a8;
  text-decoration: none;
  white-space: nowrap;
}
[data-theme="dark"] .chat-deeplink {
  background: #3b0764;
  color: #e9d5ff;
}

/* Card-footer chat button — one per card, not per blocker item */
.attention-item-footer {
  display: flex;
  justify-content: flex-end;
  margin-top: 0.75rem;
  padding-top: 0.5rem;
  border-top: 1px solid var(--color-border, #e5e7eb);
}

.chat-deeplink--card {
  margin-left: 0;
  font-size: 0.85em;
  padding: 4px 12px;
}

[data-theme="dark"] .attention-item-footer {
  border-top-color: #374151;
}

.attention-owner {
  color: var(--color-text-muted);
  font-size: 0.85em;
  margin-left: 0.4rem;
}

.attention-item-header {
  display: flex;
  align-items: center;
  gap: .75rem;
  margin-bottom: .75rem;
  flex-wrap: wrap;
}

.attention-artifact-link {
  display: flex;
  align-items: center;
  gap: .5rem;
  color: var(--color-text);
  text-decoration: none;
  flex: 1;
  min-width: 0;
}
.attention-artifact-link:hover { text-decoration: underline; }

.attention-title {
  font-weight: 600;
  font-size: .95rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.attention-count {
  font-size: .75rem;
  font-weight: 700;
  background: #fee2e2;
  color: #991b1b;
  border-radius: 999px;
  padding: .1rem .6rem;
  flex-shrink: 0;
}

.attention-blockers {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: .4rem;
}

.attention-blocker-item {
  border-radius: 4px;
  padding: .45rem .75rem;
  border-left: 3px solid transparent;
  display: flex;
  flex-direction: column;
  gap: .15rem;
}
.attention-blocking { border-left-color: #dc3545; background: #fff5f5; }
.attention-warning  { border-left-color: #ffc107; background: #fffdf0; }

.attention-blocker-desc {
  font-size: .82rem;
  font-weight: 600;
}
.attention-blocker-fix {
  font-size: .78rem;
  color: var(--color-text-muted);
}

/* Empty state improvements */
.empty-state {
  text-align: center;
  padding: 3rem 1rem;
  color: var(--color-text-muted);
}
.empty-state-heading {
  font-size: 1rem;
  font-weight: 600;
  color: var(--color-text);
  margin-bottom: .5rem;
}
.empty-state-detail {
  font-size: .85rem;
  margin-bottom: 1.25rem;
}
.empty-state-sub {
  font-size: .875rem;
  color: var(--color-text-muted);
  max-width: 36rem;
  margin: .5rem auto 1rem;
  line-height: 1.5;
}

/* Branch empty-state: PR context card */
.branch-pr-context {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  gap: .4rem;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: .5rem;
  padding: .875rem 1.25rem;
  margin: .75rem auto 1rem;
  max-width: 40rem;
  text-align: center;
}
.branch-pr-label {
  font-size: .75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .04em;
  color: var(--color-text-muted);
}
.branch-pr-link {
  font-size: .95rem;
  font-weight: 600;
  color: var(--color-link);
  text-decoration: none;
}
.branch-pr-link:hover { text-decoration: underline; }
.branch-pr-link .pr-list-num { color: var(--color-text-muted); margin-right: .3em; }
.branch-pr-age {
  font-size: .8rem;
  color: var(--color-text-muted);
  margin-top: .15rem;
}
/* ------------------------------------------------------------------ */
/* Diff page                                                            */
/* ------------------------------------------------------------------ */
.diff-filename {
  font-family: var(--font-mono);
  font-size: 1.1rem;
  font-weight: 700;
  word-break: break-all;
}

.diff-meta {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1.25rem;
  font-size: .85rem;
}
.diff-path {
  font-family: var(--font-mono);
  font-size: .8rem;
  color: var(--color-text-muted);
  background: var(--color-bg);
  border: 1px solid var(--color-border);
  border-radius: 4px;
  padding: .15rem .5rem;
}
.diff-vs { color: var(--color-text-muted); }

.diff-wrap {
  overflow-x: auto;
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.diff-table {
  width: 100%;
  border-collapse: collapse;
  font-family: var(--font-mono);
  font-size: .8rem;
  line-height: 1.5;
}

.diff-gutter {
  width: 2rem;
  text-align: center;
  padding: 0 .4rem;
  user-select: none;
  font-weight: 700;
  vertical-align: top;
  border-right: 1px solid transparent;
}
.diff-code {
  padding: 0 .75rem;
  white-space: pre;
  vertical-align: top;
  width: 100%;
}
.diff-code span { display: block; }

.diff-added   { background: #f0fdf4; }
.diff-added .diff-gutter   { color: #16a34a; background: #dcfce7; border-right-color: #86efac; }
.diff-removed { background: #fff5f5; }
.diff-removed .diff-gutter { color: #dc2626; background: #fee2e2; border-right-color: #fca5a5; }
.diff-context .diff-gutter { color: var(--color-border); background: var(--color-bg); border-right-color: var(--color-border); }
.diff-context { background: var(--color-surface); color: var(--color-text-muted); }

.diff-hunk { background: #eff6ff; }
.diff-hunk .diff-gutter { background: #dbeafe; border-right-color: #93c5fd; }
.diff-hunk-text { color: #1d4ed8; font-weight: 600; padding: .2rem .75rem; }

/* Other changed files (branch view) */
.other-files-section {
  margin-top: 2rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--color-border);
}
.other-files-title {
  font-size: .9rem;
  font-weight: 700;
  color: var(--color-text-muted);
  text-transform: uppercase;
  letter-spacing: .4px;
  margin-bottom: .75rem;
  display: flex;
  align-items: center;
  gap: .5rem;
}
.other-files-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: .25rem;
}
.other-file-item {
  display: flex;
  align-items: center;
  gap: .5rem;
  padding: .3rem .5rem;
  border-radius: 4px;
}
.other-file-item:hover { background: var(--color-bg); }
.other-file-icon { font-size: .85rem; width: 1.25rem; text-align: center; flex-shrink: 0; }
.other-file-path {
  font-family: var(--font-mono);
  font-size: .8rem;
  color: var(--color-primary);
  word-break: break-all;
  text-decoration: none;
}
.other-file-path:hover { text-decoration: underline; }

.empty-state-detail code {
  font-family: var(--font-mono);
  background: var(--color-bg);
  padding: .1rem .3rem;
  border-radius: 3px;
  border: 1px solid var(--color-border);
}

/* ------------------------------------------------------------------ */
/* Auth — profile avatar & dropdown                                     */
/* ------------------------------------------------------------------ */

/* "Sign in" button */
.btn-signin {
  display: inline-flex;
  align-items: center;
  gap: .4rem;
  padding: .3rem .75rem;
  background: var(--dt-lime);
  color: var(--dt-midnight);
  border-radius: var(--radius);
  font-size: .85rem;
  font-weight: 600;
  text-decoration: none;
  transition: background .15s;
}
.btn-signin:hover { background: #d4ff5e; text-decoration: none; }
.btn-signin .github-icon { fill: currentColor; flex-shrink: 0; }

/* ------------------------------------------------------------------ */
/* Unified profile badge + dropdown                                     */
/* ------------------------------------------------------------------ */

/* Sign-in buttons (unauthenticated state) */
.btn-google-signin {
  display: inline-flex;
  align-items: center;
  gap: .4rem;
  padding: .3rem .75rem;
  background: #fff;
  color: #3c4043;
  border: 1px solid #dadce0;
  border-radius: var(--radius);
  font-size: .85rem;
  font-weight: 500;
  text-decoration: none;
  transition: background .15s, box-shadow .15s;
}
.btn-google-signin:hover { background: #f8f9fa; box-shadow: 0 1px 3px rgba(0,0,0,.12); text-decoration: none; }
[data-theme="dark"] .btn-google-signin { background: #1e3a3e; color: #e8f0f1; border-color: #2e5a5e; }
[data-theme="dark"] .btn-google-signin:hover { background: #26484d; }

.nav-auth { gap: .35rem; }

/* Profile trigger */
.profile-menu { position: relative; }
.profile-trigger {
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
  display: flex;
  align-items: center;
}

/* Avatar wrapper — needed for the access-level dot overlay */
.profile-avatar-wrap {
  position: relative;
  display: inline-flex;
}
.profile-avatar {
  border-radius: 50%;
  display: block;
  border: 2px solid rgba(196,255,69,.4);
  transition: border-color .15s;
}
.profile-avatar-initials {
  width: 32px; height: 32px;
  border-radius: 50%;
  background: #4285f4;
  color: #fff;
  font-size: .8rem;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.profile-trigger:hover .profile-avatar,
.profile-trigger:hover .profile-avatar-initials { border-color: var(--dt-lime); outline: 2px solid var(--dt-lime); }

/* Access-level dot — bottom-right corner of the avatar */
.profile-access-dot {
  position: absolute;
  bottom: 0; right: 0;
  width: 9px; height: 9px;
  border-radius: 50%;
  border: 2px solid var(--color-header-bg);
}
.profile-access-dot.access-full { background: var(--dt-lime); }
.profile-access-dot.access-view { background: #8a9ba0; }

/* Dropdown panel */
.profile-dropdown {
  display: none;
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  min-width: 230px;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-md);
  z-index: 200;
  overflow: hidden;
}
.profile-menu.open .profile-dropdown { display: block; }

/* Identity header */
.profile-info {
  display: flex;
  align-items: center;
  gap: .65rem;
  padding: .8rem 1rem;
  border-bottom: 1px solid var(--color-border);
}
.profile-avatar-lg {
  border-radius: 50%;
  flex-shrink: 0;
}
.profile-name { font-weight: 600; font-size: .9rem; line-height: 1.25; }
.profile-login { font-size: .78rem; color: var(--color-text-muted); margin-top: .1rem; }

/* Connected accounts panel */
.profile-connections {
  padding: .4rem 0;
  border-bottom: 1px solid var(--color-border);
}
.connections-label {
  padding: .3rem 1rem .15rem;
  font-size: .7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .05em;
  color: var(--color-text-muted);
}
.connection-row {
  display: flex;
  align-items: center;
  gap: .55rem;
  padding: .45rem 1rem;
  font-size: .84rem;
  color: var(--color-text);
  text-decoration: none;
}
a.connection-row { transition: background .1s; }
a.connection-row:hover { background: var(--color-bg); text-decoration: none; }
.connection-icon {
  width: 18px; height: 18px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  color: var(--color-text);
}
.connection-icon-dim { opacity: .35; }
.connection-name { flex: 1; font-weight: 500; }
.connection-name-dim { color: var(--color-text-muted); font-weight: 400; }

/* Access-level badges inside the dropdown */
.connection-badge {
  font-size: .7rem;
  font-weight: 600;
  padding: .15rem .45rem;
  border-radius: 999px;
  white-space: nowrap;
}
.badge-full {
  background: rgba(196,255,69,.2);
  color: #2a5c00;
}
[data-theme="dark"] .badge-full { background: rgba(196,255,69,.15); color: var(--dt-lime); }
.badge-view {
  background: rgba(138,155,160,.15);
  color: var(--color-text-muted);
}
.connection-cta {
  font-size: .75rem;
  color: var(--color-primary);
  white-space: nowrap;
}

/* Sign-out links at the bottom */
.profile-dropdown-item {
  display: block;
  padding: .55rem 1rem;
  font-size: .875rem;
  color: var(--color-text);
  text-decoration: none;
  transition: background .1s;
}
.profile-dropdown-item:hover { background: var(--color-bg); text-decoration: none; }
.profile-signout { border-top: 1px solid var(--color-border); margin-top: 0; }
.profile-signout + .profile-signout { border-top: none; margin-top: 0; }

/* My Stuff section — separator above + two-line link rows */
.profile-section {
  border-top: 1px solid var(--color-border);
  padding: .4rem 0;
}
.profile-dropdown-item-rich {
  display: flex;
  flex-direction: column;
  gap: .1rem;
  padding: .45rem 1rem;
}
.profile-item-label { font-size: .875rem; color: var(--color-text); font-weight: 500; }
.profile-item-hint { font-size: .72rem; color: var(--color-text-muted); }

/* ------------------------------------------------------------------ */
/* PR list page                                                         */
/* ------------------------------------------------------------------ */

.pr-auth-note { font-size: .85rem; color: var(--color-text-muted); }
.btn-signin-inline {
  font-size: .85rem;
  color: var(--color-primary);
  border: 1px solid var(--color-primary);
  border-radius: var(--radius);
  padding: .25rem .65rem;
  text-decoration: none;
}
.btn-signin-inline:hover { background: var(--color-primary); color: #fff; text-decoration: none; }

.pr-list { list-style: none; display: flex; flex-direction: column; gap: .5rem; }
.pr-list-item {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  padding: .85rem 1rem;
}
a.pr-list-item, .pr-list-item--link {
  display: block;
  color: inherit;
  text-decoration: none;
}
a.pr-list-item:hover, .pr-list-item--link:hover {
  text-decoration: none;
}
.pr-list-header { display: flex; align-items: baseline; gap: .6rem; flex-wrap: wrap; margin-bottom: .3rem; }
.pr-list-title { font-weight: 600; color: var(--color-text); text-decoration: none; }
.pr-list-title:hover { color: var(--color-primary); }
.pr-list-num { color: var(--color-text-muted); font-weight: 400; margin-right: .25rem; }
.pr-list-meta { font-size: .82rem; color: var(--color-text-muted); display: flex; align-items: center; gap: .3rem; }
.pr-list-avatar { border-radius: 50%; vertical-align: middle; }
.pr-ext-icon { font-size: .75rem; color: var(--color-text-muted); }

/* ------------------------------------------------------------------ */
/* PR detail page                                                       */
/* ------------------------------------------------------------------ */

.pr-detail { display: flex; flex-direction: column; gap: 1.5rem; }

/* ------------------------------------------------------------------ */
/* Metadata edit modal (used on /my-work cards)                          */
/* ------------------------------------------------------------------ */

.btn-edit-metadata {
  font-size: .75rem;
  padding: 2px 8px;
  border: 1px solid var(--color-border);
  background: transparent;
  color: var(--color-text-muted, #6b7280);
  border-radius: 4px;
  cursor: pointer;
}
.btn-edit-metadata:hover {
  background: var(--color-surface-alt, #f3f4f6);
  color: var(--color-text, inherit);
}

dialog.meta-modal {
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  padding: 0;
  max-width: 480px;
  width: 90vw;
  background: var(--color-surface);
  color: var(--color-text, inherit);
  box-shadow: 0 10px 40px rgba(0,0,0,.18);
}
dialog.meta-modal::backdrop {
  background: rgba(0, 0, 0, .35);
  backdrop-filter: blur(2px);
}
.meta-modal-form { display: flex; flex-direction: column; gap: .75rem; padding: 1.25rem 1.5rem; }
.meta-modal-title { margin: 0; font-size: 1.05rem; }
.meta-modal-subtitle { display: block; font-weight: normal; font-size: .85rem; color: var(--color-text-muted, #6b7280); margin-top: 2px; }
.meta-modal-hint { font-size: .85rem; color: var(--color-text-muted, #6b7280); margin: 0 0 .25rem 0; }
.meta-field { display: flex; flex-direction: column; gap: .25rem; font-size: .9rem; }
.meta-field span { font-weight: 600; }
.meta-field select, .meta-field input {
  padding: .4rem .55rem;
  border: 1px solid var(--color-border);
  border-radius: 4px;
  background: var(--color-bg, #fff);
  color: inherit;
  font-size: .9rem;
}
.meta-modal-actions { display: flex; gap: .5rem; justify-content: flex-end; margin-top: .5rem; }

/* ------------------------------------------------------------------ */
/* Canonical dialog + toast classes                                    */
/*                                                                    */
/* Goal: a single set of class names every page can compose without   */
/* reinventing modal chrome. Coexists with the older                  */
/* `.meta-modal-*` / `.diff-modal-*` / `.pb-dialog-*` / `#pb-toast`   */
/* classes — those are kept for backwards compatibility while         */
/* migrating templates over time. New dialogs SHOULD use these.       */
/*                                                                    */
/* Structure:                                                         */
/*   <dialog class="dialog-panel">                                    */
/*     <header class="dialog-header">…</header>                       */
/*     <div   class="dialog-body">…</div>                             */
/*     <footer class="dialog-footer">                                 */
/*       <button class="dialog-btn-secondary">…</button>              */
/*       <button class="dialog-btn-primary">…</button>                */
/*     </footer>                                                      */
/*   </dialog>                                                        */
/*                                                                    */
/* For non-<dialog> overlay UIs (e.g. existing legacy modals), wrap   */
/* the panel in a `.dialog-overlay` and toggle `.is-open`.            */
/* ------------------------------------------------------------------ */
.dialog-overlay {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 900;
  background: rgba(6, 30, 33, .45);
  backdrop-filter: blur(2px);
  align-items: center;
  justify-content: center;
}
.dialog-overlay.is-open { display: flex; }

.dialog-panel {
  background: var(--color-surface);
  color: var(--color-text, inherit);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  box-shadow: 0 10px 40px rgba(0, 0, 0, .18);
  max-width: 480px;
  width: 90vw;
  padding: 0;
}
/* Native <dialog> tags get the same backdrop treatment. */
dialog.dialog-panel::backdrop {
  background: rgba(6, 30, 33, .45);
  backdrop-filter: blur(2px);
}

.dialog-header {
  padding: 1rem 1.5rem .25rem 1.5rem;
}
.dialog-header h2,
.dialog-header h3 {
  margin: 0;
  font-size: 1.05rem;
  font-weight: 600;
}
.dialog-header .dialog-subtitle {
  display: block;
  margin-top: 2px;
  font-size: .85rem;
  font-weight: normal;
  color: var(--color-text-muted, #6b7280);
}

.dialog-body {
  display: flex;
  flex-direction: column;
  gap: .75rem;
  padding: .75rem 1.5rem 1rem 1.5rem;
}
.dialog-body p {
  font-size: .85rem;
  color: var(--color-text-muted, #6b7280);
  margin: 0;
}

.dialog-footer {
  display: flex;
  justify-content: flex-end;
  gap: .5rem;
  padding: .75rem 1.5rem 1.25rem 1.5rem;
  border-top: 1px solid transparent;
}

.dialog-btn-primary,
.dialog-btn-secondary {
  padding: .45rem 1rem;
  border-radius: 6px;
  font-size: .85rem;
  font-family: inherit;
  cursor: pointer;
  border: 1px solid var(--color-border);
}
.dialog-btn-primary {
  background: var(--color-primary, #1c4747);
  color: #fff;
  border-color: var(--color-primary, #1c4747);
}
.dialog-btn-primary:hover { background: var(--color-primary-dark, #0f3333); }
.dialog-btn-primary:disabled,
.dialog-btn-secondary:disabled { opacity: .5; cursor: not-allowed; }
.dialog-btn-secondary {
  background: var(--color-surface, #fff);
  color: var(--color-text, inherit);
}
.dialog-btn-secondary:hover { background: var(--color-bg, #f5f7f5); }

/* Canonical toast — fixed-position transient notification. The
   pre-existing `.toast` rule (further down in this file) already
   covers light styling; this block adds the standard variants and a
   fade animation so all callers get consistent UX. The `.toast-warning`
   variant is new. */
.toast-warning { background: #d97706; color: #fff; }
.toast.is-visible {
  opacity: 1;
  pointer-events: auto;
  transition: opacity .2s ease-out;
}
.toast.is-hidden {
  opacity: 0;
  pointer-events: none;
  transition: opacity .25s ease-in;
}

/* Flash banner for redirected action feedback (e.g. reviewer self-removal). */
.pr-flash { padding: .65rem 1rem; border-radius: var(--radius); border: 1px solid var(--color-border); font-size: .9rem; }
.pr-flash-ok { background: #ecfdf5; border-color: #a7f3d0; color: #065f46; }
.pr-flash-error { background: #fef2f2; border-color: #fecaca; color: #991b1b; }
@media (prefers-color-scheme: dark) {
  .pr-flash-ok { background: #064e3b; border-color: #047857; color: #d1fae5; }
  .pr-flash-error { background: #4c1d24; border-color: #b91c1c; color: #fee2e2; }
}

/* Header */
.pr-header { background: var(--color-surface); border: 1px solid var(--color-border); border-radius: var(--radius); padding: 1.25rem 1.5rem; }
.pr-header-top { display: flex; align-items: center; gap: .75rem; margin-bottom: .75rem; flex-wrap: wrap; }
.pr-back { font-size: .85rem; }
.pr-github-link { margin-left: auto; font-size: .82rem; color: var(--color-text-muted); text-decoration: none; }
.pr-github-link:hover { color: var(--color-primary); }
.pr-title { font-size: 1.35rem; font-weight: 700; line-height: 1.3; margin-bottom: .5rem; }
.pr-number { color: var(--color-text-muted); font-weight: 400; margin-right: .35rem; }
.pr-meta { font-size: .85rem; color: var(--color-text-muted); display: flex; align-items: center; gap: .4rem; flex-wrap: wrap; }
.pr-author-avatar { border-radius: 50%; }

/* State badges */
.pr-state-badge {
  display: inline-flex; align-items: center;
  padding: .2rem .55rem; border-radius: 999px;
  font-size: .75rem; font-weight: 600; line-height: 1;
}
.pr-state-open    { background: #d1fae5; color: #065f46; }
.pr-state-draft   { background: #f3f4f6; color: #374151; }
.pr-state-merged  { background: #ede9fe; color: #5b21b6; }
.pr-state-closed  { background: #fee2e2; color: #991b1b; }
.pr-state-approved   { background: #d1fae5; color: #065f46; }
.pr-state-changes    { background: #fff3cd; color: #92400e; }

/* PR urgency dot — subtle leading indicator on the PR list rows.
   Tier 1 = your PR is blocked (red), tier 2 = you're blocking someone
   (amber), tier 3 = parked draft (grey), tier 4 = no dot rendered. */
.pr-urgency-dot {
  font-size: .7rem;
  margin-right: .35rem;
  vertical-align: middle;
  line-height: 1;
}
.pr-urgency-1 { color: #dc2626; }
.pr-urgency-2 { color: #d97706; }
.pr-urgency-3 { color: #9ca3af; }

/* Pod-health 3-state aliases (APEX#89). Rendered as solid dots, not glyphs. */
.pr-urgency-dot--healthy,
.pr-urgency-dot--needs_attention,
.pr-urgency-dot--blocked {
  display: inline-block;
  width: .55rem;
  height: .55rem;
  border-radius: 50%;
  font-size: 0;
}
.pr-urgency-dot--healthy { background: #22c55e; }
.pr-urgency-dot--needs_attention { background: #f59e0b; }
.pr-urgency-dot--blocked { background: #ef4444; }
[data-theme="dark"] .pr-urgency-dot--healthy { background: #4ade80; }
[data-theme="dark"] .pr-urgency-dot--needs_attention { background: #fbbf24; }
[data-theme="dark"] .pr-urgency-dot--blocked { background: #f87171; }

.pod-inflight-count {
  margin-left: auto;
  font-size: .78rem;
  color: var(--color-text-muted);
  font-variant-numeric: tabular-nums;
}

.pod-health-panel {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  padding: 1rem 1.25rem;
  margin-bottom: 1.25rem;
}
.pod-health-heading {
  display: flex;
  align-items: center;
  gap: .5rem;
  font-size: 1rem;
  margin: 0 0 .75rem 0;
}
.pod-health-summary {
  margin-left: auto;
  font-size: .8rem;
  font-weight: 400;
  color: var(--color-text-muted);
}
.stage-bar {
  display: flex;
  width: 100%;
  height: 1.5rem;
  border-radius: 4px;
  overflow: hidden;
  margin-bottom: .75rem;
  background: var(--color-bg);
}
.stage-bar-segment {
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: .72rem;
  color: #fff;
  white-space: nowrap;
  overflow: hidden;
}
.stage-bar--delivery   { background: #22c55e; }
.stage-bar--validated  { background: #818cf8; }
.stage-bar--discovery  { background: #3b82f6; }
.stage-bar--draft      { background: #9ca3af; }
.stage-bar--shipped    { background: #6d28d9; }
.stage-bar--unknown    { background: var(--color-border); color: var(--color-text-muted); }
.stage-bar-label { padding: 0 .4rem; }
.pod-health-board-link { display: inline-block; }

/* Diff counts */
.pr-additions { color: var(--color-success); font-weight: 600; }
.pr-deletions { color: var(--color-killed);  font-weight: 600; }
.pr-counts { font-family: var(--font-mono); font-size: .82rem; }
.pr-branch { font-family: var(--font-mono); font-size: .8rem; background: var(--color-bg); border: 1px solid var(--color-border); border-radius: 3px; padding: .05rem .3rem; }

/* Body + sidebar grid */
.pr-body-grid { display: grid; grid-template-columns: 1fr 280px; gap: 1.25rem; align-items: start; }
@media (max-width: 800px) { .pr-body-grid { grid-template-columns: 1fr; } }

/* Shared card section */
.card-section { background: var(--color-surface); border: 1px solid var(--color-border); border-radius: var(--radius); padding: 1.1rem 1.25rem; }
.pr-main { display: flex; flex-direction: column; gap: 1.25rem; }
.section-heading { font-size: .9rem; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: var(--color-text-muted); margin-bottom: .75rem; display: flex; align-items: center; gap: .5rem; }

/* PR description markdown */
.pr-markdown h1,.pr-markdown h2,.pr-markdown h3 { margin: .75rem 0 .4rem; font-size: 1rem; }
.pr-markdown p { margin-bottom: .5rem; }
.pr-markdown code { font-family: var(--font-mono); font-size: .82rem; background: var(--color-bg); border: 1px solid var(--color-border); border-radius: 3px; padding: .05rem .3rem; }
.pr-markdown pre { background: var(--color-bg); border: 1px solid var(--color-border); border-radius: var(--radius); padding: .75rem 1rem; overflow-x: auto; margin-bottom: .5rem; }
.pr-markdown ul,.pr-markdown ol { padding-left: 1.25rem; margin-bottom: .5rem; }

/* Files list */
.pr-file-list { list-style: none; display: flex; flex-direction: column; gap: .3rem; }
.pr-file-item {
  display: flex; align-items: center; gap: .6rem;
  font-size: .85rem; font-family: var(--font-mono);
  padding: .3rem .4rem; border-radius: var(--radius);
  transition: background .1s;
}
.pr-file-has-diff {
  cursor: pointer;
}
.pr-file-has-diff:hover { background: var(--color-bg); }
.pr-file-has-diff:hover .pr-file-view-hint { opacity: 1; }
.pr-file-view-hint {
  font-size: .72rem; font-family: var(--font-sans);
  color: var(--color-text-muted); opacity: 0;
  transition: opacity .15s; flex-shrink: 0;
  font-weight: 500;
}
.pr-file-status {
  width: 20px; height: 20px; border-radius: 3px; display: inline-flex; align-items: center; justify-content: center;
  font-size: .7rem; font-weight: 700; flex-shrink: 0;
}
.pr-file-status-added    { background: #d1fae5; color: #065f46; }
.pr-file-status-modified { background: #fef3c7; color: #92400e; }
.pr-file-status-removed  { background: #fee2e2; color: #991b1b; }
.pr-file-status-renamed  { background: #ede9fe; color: #5b21b6; }
.pr-file-path { flex: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pr-file-stats { flex-shrink: 0; font-size: .78rem; display: flex; gap: .3rem; }

/* ------------------------------------------------------------------ */
/* PR list — filter tabs                                               */
/* ------------------------------------------------------------------ */
.pr-filter-tabs {
  display: flex; gap: .4rem; margin-bottom: 1rem;
  border-bottom: 1px solid var(--color-border);
  padding-bottom: .5rem;
}
.pr-filter-tab {
  background: none; border: none; cursor: pointer;
  display: inline-flex; align-items: center; gap: .35rem;
  padding: .3rem .6rem; border-radius: var(--radius);
  font-size: .875rem; color: var(--color-text-muted);
  font-weight: 500; transition: background .1s, color .1s;
}
.pr-filter-tab:hover { background: var(--color-bg); color: var(--color-text); }
.pr-filter-tab.active {
  background: var(--color-accent-soft);
  color: var(--color-primary);
}
[data-theme="dark"] .pr-filter-tab.active { background: rgba(196,255,69,.12); color: var(--dt-lime); }
.pr-filter-count {
  background: var(--color-border); color: var(--color-text-muted);
  font-size: .72rem; font-weight: 700;
  padding: .05rem .35rem; border-radius: 999px; min-width: 1.4em; text-align: center;
}
.pr-filter-tab.active .pr-filter-count { background: var(--color-primary); color: #fff; }
[data-theme="dark"] .pr-filter-tab.active .pr-filter-count { background: var(--dt-lime); color: var(--dt-midnight); }

/* ------------------------------------------------------------------ */
/* Diff modal                                                          */
/* ------------------------------------------------------------------ */
.diff-modal {
  display: none; position: fixed; inset: 0; z-index: 900;
  align-items: flex-end;
}
.diff-modal.open { display: flex; }

.diff-modal-backdrop {
  position: absolute; inset: 0;
  background: rgba(6,30,33,.6);
}
.diff-modal-panel {
  position: relative; z-index: 1;
  width: 100%; height: 85vh; max-height: 85vh;
  background: var(--color-surface);
  border-top: 1px solid var(--color-border);
  border-radius: var(--radius) var(--radius) 0 0;
  display: flex; flex-direction: column;
  box-shadow: 0 -4px 24px rgba(0,0,0,.15);
  min-height: 0;
}
.diff-modal-header {
  display: flex; align-items: center; gap: .75rem;
  padding: .75rem 1rem;
  border-bottom: 1px solid var(--color-border);
  flex-shrink: 0;
}
.diff-modal-filename {
  flex: 1; font-family: var(--font-mono); font-size: .875rem;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.diff-modal-stats { font-size: .8rem; flex-shrink: 0; display: flex; gap: .5rem; }
.diff-modal-close {
  background: none; border: none; cursor: pointer;
  font-size: 1.1rem; color: var(--color-text-muted); line-height: 1;
  padding: .1rem .3rem; border-radius: 4px; flex-shrink: 0;
}
.diff-modal-close:hover { background: var(--color-bg); color: var(--color-text); }
.diff-modal-body {
  overflow-y: auto; overflow-x: auto;
  flex: 1 1 auto;
  min-height: 0;
  max-height: 100%;
  padding: 0;
}

/* Diff/Before/After view toggle (APEX#550) */
.diff-view-toggle {
  display: inline-flex; gap: 0; margin: 0 .75rem;
  border: 1px solid var(--color-border); border-radius: var(--radius);
  overflow: hidden; flex-shrink: 0;
}
.diff-view-btn {
  padding: .25rem .65rem; font-size: .78rem; font-weight: 500;
  background: var(--color-surface); color: var(--color-text);
  border: none; cursor: pointer; line-height: 1.2;
  border-right: 1px solid var(--color-border);
}
.diff-view-btn:last-child { border-right: none; }
.diff-view-btn:hover { background: var(--color-bg); }
.diff-view-btn.is-active {
  background: var(--color-primary); color: #fff;
}
.diff-panel { width: 100%; }
.diff-panel[hidden] { display: none; }
.diff-loading {
  display: flex; align-items: center; justify-content: center;
  gap: .35rem; padding: 2rem;
}
.diff-placeholder {
  padding: 1.5rem; color: var(--color-text-muted);
  font-size: .9rem; font-style: italic; text-align: center;
}
.diff-placeholder-error { color: #991b1b; font-style: normal; }
.diff-empty { padding: 1rem; color: var(--color-text-muted); font-size: .9rem; }
.rendered-content {
  padding: 1rem 1.25rem;
  max-width: none;
  font-size: .95rem;
}
.rendered-source {
  margin: 0;
  font-family: var(--font-mono); font-size: .8rem;
  white-space: pre-wrap; word-break: break-word;
  background: var(--color-bg); padding: 1rem 1.25rem;
}

/* Diff table */
.diff-table { width: 100%; border-collapse: collapse; font-family: var(--font-mono); font-size: .8rem; }
.diff-table td { padding: .1rem .4rem; white-space: pre; }
.diff-ln {
  width: 3rem; min-width: 3rem; text-align: right;
  color: var(--color-text-muted); user-select: none;
  border-right: 1px solid var(--color-border);
  padding-right: .6rem; font-size: .72rem;
}
.diff-code { padding-left: .6rem; }
.diff-add  { background: #ecfdf5; }
.diff-add .diff-code { color: #065f46; }
.diff-del  { background: #fef2f2; }
.diff-del .diff-code { color: #991b1b; }
.diff-ctx  { background: var(--color-surface); }
.diff-hunk { background: #eff6ff; }
.diff-hunk td { color: #1e40af; font-style: italic; padding: .2rem .6rem; }
[data-theme="dark"] .diff-add  { background: #052e16; }
[data-theme="dark"] .diff-add .diff-code { color: #86efac; }
[data-theme="dark"] .diff-del  { background: #2d0a0a; }
[data-theme="dark"] .diff-del .diff-code { color: #fca5a5; }
[data-theme="dark"] .diff-hunk { background: #0c1a3d; }
[data-theme="dark"] .diff-hunk td { color: #93c5fd; }

/* Review form */
.review-textarea {
  width: 100%; box-sizing: border-box;
  border: 1px solid var(--color-border); border-radius: var(--radius);
  padding: .6rem .75rem; font-family: var(--font-sans); font-size: .875rem;
  resize: vertical; margin-bottom: .75rem;
  background: var(--color-bg);
}
.review-textarea:focus { outline: none; border-color: var(--color-primary); box-shadow: 0 0 0 3px rgba(13,110,253,.1); }
.review-actions { display: flex; flex-direction: column; gap: .5rem; }
.btn-review {
  width: 100%; padding: .5rem; border-radius: var(--radius);
  font-size: .85rem; font-weight: 600; cursor: pointer; border: none;
  transition: opacity .15s, filter .15s;
}
.btn-review:hover { filter: brightness(.9); }
.btn-comment         { background: #e5e7eb; color: var(--color-text); }
.btn-approve         { background: var(--color-success); color: #fff; }
.btn-request-changes { background: #f59e0b; color: #fff; }

.review-signin { }
.review-signin-msg { font-size: .875rem; color: var(--color-text-muted); line-height: 1.5; }
.review-signin-msg a { color: var(--color-primary); }

/* ------------------------------------------------------------------ */
/* Reviewers card (PR detail sidebar)                                   */
/* ------------------------------------------------------------------ */
.reviewer-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: .3rem;
  margin-bottom: .75rem;
}
.reviewer-item {
  display: flex;
  align-items: center;
  gap: .45rem;
  font-size: .875rem;
}
.reviewer-avatar { border-radius: 50%; flex-shrink: 0; }
.reviewer-login { flex: 1; font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.reviewer-remove {
  background: none;
  border: none;
  cursor: pointer;
  color: var(--color-text-muted);
  font-size: .75rem;
  line-height: 1;
  padding: .1rem .25rem;
  border-radius: 3px;
  flex-shrink: 0;
  transition: color .1s, background .1s;
}
.reviewer-remove:hover { color: #c0392b; background: rgba(192,57,43,.08); }

.reviewer-empty {
  font-size: .8rem;
  color: var(--color-text-muted);
  margin-bottom: .65rem;
}

/* Add-reviewer form */
.reviewer-add-form {
  display: flex;
  gap: .35rem;
  margin-top: .5rem;
}
.reviewer-input {
  flex: 1;
  min-width: 0;
  padding: .3rem .55rem;
  font-size: .85rem;
  font-family: var(--font-mono);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  background: var(--color-bg);
  color: var(--color-text);
  transition: border-color .15s;
}
.reviewer-input:focus {
  outline: none;
  border-color: var(--color-primary);
}
.btn-add-reviewer {
  padding: .3rem .65rem;
  font-size: .82rem;
  font-weight: 600;
  background: var(--color-primary);
  color: #fff;
  border: none;
  border-radius: var(--radius);
  cursor: pointer;
  white-space: nowrap;
  transition: background .15s;
}
.btn-add-reviewer:hover { background: var(--color-primary-dark); }

/* Timeline */
.pr-timeline { }
.timeline-list { list-style: none; display: flex; flex-direction: column; gap: 1rem; }
.timeline-item { display: flex; gap: .75rem; align-items: flex-start; }
.timeline-avatar { border-radius: 50%; flex-shrink: 0; margin-top: .1rem; }
.timeline-content { flex: 1; }
.timeline-meta { font-size: .85rem; margin-bottom: .35rem; display: flex; align-items: center; gap: .4rem; flex-wrap: wrap; }
.timeline-author { font-weight: 600; }
.timeline-date { color: var(--color-text-muted); font-size: .78rem; margin-left: auto; }
.timeline-body {
  font-size: .875rem;
  color: var(--color-text);
  background: var(--color-bg);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  padding: .6rem .75rem;
  overflow-x: auto;
  /* plain text comments still wrap, rendered HTML does not need pre-wrap */
  word-break: break-word;
}
/* When the body is rendered HTML (.pr-markdown), scale down headings a bit */
.timeline-body.pr-markdown h1,
.timeline-body.pr-markdown h2,
.timeline-body.pr-markdown h3 { font-size: .9rem; margin: .5rem 0 .25rem; }
.timeline-body.pr-markdown p { margin-bottom: .35rem; }
.timeline-body.pr-markdown a { color: var(--color-link); word-break: break-all; }

/* Review state verdicts */
.review-verdict { font-size: .8rem; padding: .15rem .45rem; border-radius: 999px; font-weight: 500; }
.review-approved   { background: #d1fae5; color: #065f46; }
.review-changes    { background: #fff3cd; color: #92400e; }
.review-dismissed  { background: #f3f4f6; color: var(--color-text-muted); }

/* Alert */
.alert { border-radius: var(--radius); padding: .75rem 1rem; margin-bottom: 1rem; font-size: .875rem; }
.alert-error { background: #fee2e2; border: 1px solid #fca5a5; color: #991b1b; }

/* ------------------------------------------------------------------ */
/* User allocation table                                                */
/* ------------------------------------------------------------------ */

.user-alloc-section {
  margin-top: 2.5rem;
}

.alloc-col-subtitle {
  font-size: .8rem;
  font-weight: 400;
  color: var(--color-text-muted);
  text-transform: none;
  letter-spacing: 0;
}

.user-alloc-table {
  width: 100%;
  border-collapse: collapse;
  font-size: .875rem;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  overflow: hidden;
}

.user-alloc-table thead th {
  background: var(--color-bg);
  border-bottom: 2px solid var(--color-border);
  padding: .55rem .75rem;
  text-align: left;
  font-size: .78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .04em;
  color: var(--color-text-muted);
  white-space: nowrap;
}

/* Column widths */
.ua-col-person     { width: 160px; }
.ua-col-initiative { }
.ua-col-status     { width: 100px; }
.ua-col-area       { width: 180px; }
.ua-col-pct        { width: 72px; text-align: right; }

/* Person name cell (rowspan) */
.ua-person-row { border-top: 2px solid var(--color-border); }
.ua-person-row td { padding: 0; }

.ua-person-name {
  padding: .65rem .75rem !important;
  vertical-align: top;
  background: var(--color-bg);
  border-right: 1px solid var(--color-border);
}

.ua-person-name-inner {
  display: flex;
  flex-direction: column;
  gap: .3rem;
}

.ua-person-label {
  font-weight: 700;
  color: var(--color-text);
  font-size: .875rem;
}

.ua-person-summary {
  display: flex;
  align-items: center;
  gap: .3rem;
  flex-wrap: wrap;
  font-size: .72rem;
  color: var(--color-text-muted);
}

/* Stage pip badges inside person summary */
.ua-pip {
  border-radius: 3px;
  padding: .05rem .3rem;
  font-size: .68rem;
  font-weight: 700;
}
.ua-pip-delivery  { background: #fed7aa; color: #9a3412; }
.ua-pip-validated { background: #dbeafe; color: #1e40af; }
.ua-pip-discovery { background: #ede9fe; color: #5b21b6; }

/* Initiative rows */
.ua-ini-row td {
  padding: .45rem .75rem;
  border-bottom: 1px solid var(--color-border);
  vertical-align: middle;
}

.ua-ini-row:last-of-type td { border-bottom: none; }

.ua-ini-inactive { opacity: .55; }

.ua-ini-title a {
  color: var(--color-text);
  text-decoration: none;
}
.ua-ini-title a:hover { color: var(--color-primary); text-decoration: underline; }

.ua-ini-area {
  font-size: .8rem;
  color: var(--color-text-muted);
}
.ua-sep { margin: 0 .2rem; color: var(--color-border); }

/* % time cells */
.ua-col-pct, .ua-ini-pct, .ua-total-pct { text-align: right; }

.ua-pct {
  display: inline-block;
  font-variant-numeric: tabular-nums;
  font-weight: 600;
  min-width: 38px;
  text-align: right;
}
.ua-pct-explicit { color: var(--color-primary); font-style: italic; }
.ua-pct-derived  { color: var(--color-text-muted); }
.ua-pct-none     { color: var(--color-border); font-weight: 400; }

/* Totals row */
.ua-total-row td {
  padding: .45rem .75rem;
  background: var(--color-bg);
  border-top: 1px solid var(--color-border);
  border-bottom: 2px solid var(--color-border);
}
.ua-total-label {
  font-weight: 600;
  font-size: .8rem;
  color: var(--color-text-muted);
  text-transform: uppercase;
  letter-spacing: .04em;
}
.ua-total-pct .ua-pct { font-size: .9rem; }

/* ------------------------------------------------------------------ */
/* PR detail — AI Summary card                                         */
/* ------------------------------------------------------------------ */
.pr-ai-summary {
  display: flex;
  align-items: flex-start;
  gap: .75rem;
  background: linear-gradient(135deg, color-mix(in srgb, var(--dt-lime) 8%, var(--color-surface)), var(--color-surface));
  border: 1px solid color-mix(in srgb, var(--dt-lime) 25%, var(--color-border));
  border-radius: var(--radius);
  padding: 1rem 1.25rem;
  margin-bottom: 1.5rem;
  min-height: 3.5rem;
}
.pr-ai-summary-icon {
  font-size: 1.2rem;
  line-height: 1.5;
  flex-shrink: 0;
  color: var(--dt-lime);
  opacity: .4;
  transition: opacity .3s;
}
.pr-ai-summary.loaded .pr-ai-summary-icon { opacity: 1; }
.pr-ai-summary-body { flex: 1; }
.pr-ai-label {
  display: block;
  font-size: .7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: color-mix(in srgb, var(--dt-lime) 60%, var(--color-text-muted));
  margin-bottom: .3rem;
}
.pr-ai-text {
  font-size: .9rem;
  line-height: 1.55;
  color: var(--color-text);
  margin: 0;
  opacity: .5;
  transition: opacity .4s;
}
.pr-ai-summary.loaded .pr-ai-text { opacity: 1; }

/* ------------------------------------------------------------------ */
/* PR detail — Media viewer                                            */
/* ------------------------------------------------------------------ */

/* Horizontal scrolling strip of thumbnails */
.media-strip {
  display: flex;
  gap: .75rem;
  overflow-x: auto;
  padding-bottom: .5rem;
  scrollbar-width: thin;
}
.media-strip::-webkit-scrollbar { height: 4px; }
.media-strip::-webkit-scrollbar-track { background: transparent; }
.media-strip::-webkit-scrollbar-thumb { background: var(--color-border); border-radius: 2px; }

.media-thumb-btn {
  all: unset;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: .35rem;
  background: var(--color-bg);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  padding: .5rem;
  transition: border-color .15s, box-shadow .15s;
  text-align: center;
  flex-shrink: 0;
  width: 140px;
}
.media-thumb-btn:hover { border-color: var(--color-primary); box-shadow: var(--shadow); }
.media-thumb-error { opacity: .5; cursor: default; }

.media-thumb {
  width: 120px;
  height: 90px;
  object-fit: contain;
  border-radius: 4px;
  background: #fff;
  display: block;
}
.media-thumb-name {
  font-size: .7rem;
  color: var(--color-text-muted);
  word-break: break-all;
  line-height: 1.3;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.media-thumb-status {
  font-size: .65rem;
  font-weight: 700;
  text-transform: uppercase;
  padding: .1rem .35rem;
  border-radius: 3px;
}
.media-status-added    { background: #d1fae5; color: #065f46; }
.media-status-modified { background: #fff3cd; color: #856404; }
.media-status-removed  { background: #fee2e2; color: #991b1b; }

/* Lightbox */
.lightbox {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(6,30,33,.92);
  z-index: 1000;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 1rem;
}
.lightbox.open { display: flex; }
.lightbox-inner {
  max-width: 90vw;
  max-height: 85vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: .5rem;
}
.lightbox-img {
  max-width: 100%;
  max-height: 80vh;
  object-fit: contain;
  border-radius: var(--radius);
  box-shadow: 0 8px 32px rgba(0,0,0,.5);
}
.lightbox-caption {
  font-size: .8rem;
  color: rgba(234,255,190,.7);
  text-align: center;
}
.lightbox-close {
  position: absolute;
  top: 1rem; right: 1.25rem;
  background: none; border: none;
  color: #eaffbe; font-size: 1.5rem;
  cursor: pointer; line-height: 1;
  opacity: .7; transition: opacity .15s;
}
.lightbox-close:hover { opacity: 1; }
.lightbox-prev, .lightbox-next {
  position: absolute;
  top: 50%; transform: translateY(-50%);
  background: rgba(255,255,255,.1);
  border: 1px solid rgba(255,255,255,.15);
  color: #eaffbe;
  font-size: 2rem; line-height: 1;
  padding: .4rem .7rem;
  border-radius: var(--radius);
  cursor: pointer;
  transition: background .15s;
}
.lightbox-prev:hover, .lightbox-next:hover { background: rgba(255,255,255,.2); }
.lightbox-prev { left: 1rem; }
.lightbox-next { right: 1rem; }

.lightbox-dots {
  display: flex; gap: .4rem; justify-content: center;
  position: absolute; bottom: 1rem; left: 50%; transform: translateX(-50%);
}
.lightbox-dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: rgba(234,255,190,.3); border: none; cursor: pointer;
  transition: background .15s; padding: 0;
}
.lightbox-dot.active { background: var(--dt-lime); }
.lightbox-dot:hover { background: rgba(234,255,190,.6); }

/* ------------------------------------------------------------------ */
/* PR detail — Quick action buttons                                    */
/* ------------------------------------------------------------------ */
/* Verdict badge shown when current user already approved / requested changes */
.my-review-badge {
  display: flex;
  align-items: center;
  gap: .4rem;
  padding: .4rem .75rem;
  border-radius: var(--radius);
  font-size: .82rem;
  font-weight: 600;
  margin-bottom: .65rem;
}
.my-review-approved {
  background: #d1fae5;
  color: #065f46;
  border: 1px solid #a7f3d0;
}
.my-review-changes {
  background: #fee2e2;
  color: #991b1b;
  border: 1px solid #fecaca;
}
[data-theme="dark"] .my-review-approved { background: #064e3b; color: #6ee7b7; border-color: #065f46; }
[data-theme="dark"] .my-review-changes  { background: #450a0a; color: #fca5a5; border-color: #7f1d1d; }

.quick-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: .5rem;
  margin-bottom: .75rem;
}
/* When only one action button remains, let it span full width */
.quick-actions-single {
  grid-template-columns: 1fr;
}
.qa-btn {
  display: block;
  width: 100%;
  border: none;
  border-radius: var(--radius);
  padding: .5rem .75rem;
  font-size: .85rem;
  font-weight: 600;
  cursor: pointer;
  transition: background .15s, transform .1s;
  line-height: 1.3;
}
.qa-btn:active { transform: scale(.97); }
.qa-approve {
  background: #d1fae5;
  color: #065f46;
}
.qa-approve:hover { background: #a7f3d0; }
.qa-request {
  background: #fee2e2;
  color: #991b1b;
}
.qa-request:hover { background: #fecaca; }
[data-theme="dark"] .qa-approve { background: #064e3b; color: #6ee7b7; }
[data-theme="dark"] .qa-approve:hover { background: #065f46; }
[data-theme="dark"] .qa-request { background: #450a0a; color: #fca5a5; }
[data-theme="dark"] .qa-request:hover { background: #7f1d1d; }

.qa-divider {
  font-size: .73rem;
  color: var(--color-text-muted);
  text-align: center;
  margin-bottom: .65rem;
  position: relative;
}
.qa-divider::before, .qa-divider::after {
  content: '';
  position: absolute;
  top: 50%;
  width: 25%;
  height: 1px;
  background: var(--color-border);
}
.qa-divider::before { left: 0; }
.qa-divider::after  { right: 0; }

/* ------------------------------------------------------------------ */
/* Allocation tab nav                                                  */
/* ------------------------------------------------------------------ */
.alloc-tabs {
  display: flex;
  gap: 0;
  border-bottom: 2px solid var(--color-border);
  margin-bottom: 1.75rem;
}
.alloc-tab {
  padding: .55rem 1.25rem;
  font-size: .9rem;
  font-weight: 500;
  color: var(--color-text-muted);
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  transition: color .15s, border-color .15s;
  text-decoration: none;
}
.alloc-tab:hover { color: var(--color-primary); text-decoration: none; }
.alloc-tab.active {
  color: var(--color-primary);
  border-bottom-color: var(--color-primary);
  font-weight: 600;
}

/* Missing LOE badge in People tab */
.ua-missing-loe {
  display: inline-block;
  margin-left: .35rem;
  padding: .1rem .45rem;
  border-radius: 999px;
  font-size: .7rem;
  font-weight: 600;
  background: #fff3cd;
  color: #856404;
  cursor: default;
}

/* ------------------------------------------------------------------ */
/* Theme toggle                                                        */
/* ------------------------------------------------------------------ */
.theme-toggle {
  display: flex;
  align-items: center;
  gap: 0;
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  overflow: hidden;
  margin-right: .5rem;
}
.theme-toggle button {
  background: transparent;
  border: none;
  padding: .3rem .55rem;
  font-size: .8rem;
  cursor: pointer;
  color: var(--color-text-muted);
  transition: background .15s, color .15s;
  line-height: 1;
}
.theme-toggle button:hover { background: var(--color-border); color: var(--color-text); }
.theme-toggle button.active { background: var(--color-primary); color: #fff; }

/* ------------------------------------------------------------------ */
/* Updates page                                                        */
/* ------------------------------------------------------------------ */
.updates-page { max-width: 820px; margin: 0 auto; }

.updates-header { margin-bottom: 1.75rem; }
.updates-title-row {
  display: flex;
  align-items: center;
  gap: .75rem;
  flex-wrap: wrap;
  margin-bottom: .4rem;
}
.updates-heading { font-size: 1.6rem; font-weight: 700; margin: 0; }
.updates-freshness { font-size: .8rem; color: var(--color-text-muted); flex: 1; }
.updates-ts { font-variant-numeric: tabular-nums; }
.updates-sub { font-size: .875rem; color: var(--color-text-muted); margin: 0; }

.btn-refresh-updates {
  display: inline-flex;
  align-items: center;
  gap: .3rem;
  padding: .3rem .75rem;
  font-size: .8rem;
  font-weight: 500;
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  background: var(--color-surface);
  color: var(--color-text);
  cursor: pointer;
  transition: background .15s, border-color .15s;
  white-space: nowrap;
}
.btn-refresh-updates:hover { background: var(--color-border); }
.btn-refresh-updates:disabled { opacity: .5; cursor: default; }

.updates-loading { padding: 3rem 0; text-align: center; }

/* ── Period sections ── */
.updates-period {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg, 10px);
  padding: 1.25rem 1.5rem 1rem;
  margin-bottom: 1.25rem;
}

.period-label-row {
  display: flex;
  align-items: center;
  gap: .75rem;
  margin-bottom: .85rem;
  flex-wrap: wrap;
}
.period-label { font-size: 1.1rem; font-weight: 600; margin: 0; }

/* count chips */
.period-chips { display: flex; gap: .4rem; flex-wrap: wrap; }
.pchip {
  font-size: .72rem;
  font-weight: 500;
  padding: .15rem .55rem;
  border-radius: 99px;
  line-height: 1.5;
}
.pchip-opened { background: #dbeafe; color: #1d4ed8; }
.pchip-merged { background: #ede9fe; color: #6d28d9; }
.pchip-changed { background: #dcfce7; color: #15803d; }
@media (prefers-color-scheme: dark) {
  .pchip-opened { background: #1e3a5f; color: #93c5fd; }
  .pchip-merged { background: #2e1b5e; color: #c4b5fd; }
  .pchip-changed { background: #14532d; color: #86efac; }
}

/* AI summary card */
.period-summary {
  display: flex;
  gap: .75rem;
  align-items: flex-start;
  background: var(--color-bg);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  padding: .85rem 1rem;
  margin-bottom: 1rem;
}
.period-summary-icon {
  font-size: 1.1rem;
  color: var(--color-primary);
  flex-shrink: 0;
  line-height: 1.6;
}
.period-summary-text {
  margin: 0;
  font-size: .925rem;
  line-height: 1.65;
  color: var(--color-text);
}

.period-quiet { font-size: .875rem; color: var(--color-text-muted); margin: .5rem 0 0; }

/* ── Activity groups (collapsible) ── */
.period-activity { display: flex; flex-direction: column; gap: .5rem; }

.activity-group {
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  overflow: hidden;
}
.activity-group-header {
  display: flex;
  align-items: center;
  gap: .5rem;
  padding: .5rem .85rem;
  font-size: .85rem;
  font-weight: 500;
  cursor: pointer;
  list-style: none;
  user-select: none;
  background: var(--color-surface);
  transition: background .12s;
}
.activity-group-header:hover { background: var(--color-border); }
.activity-group[open] > .activity-group-header { border-bottom: 1px solid var(--color-border); }

/* status dots */
.ag-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}
.ag-dot-opened { background: #3b82f6; }
.ag-dot-merged { background: #8b5cf6; }
.ag-dot-artifact { background: #22c55e; }

.ag-count {
  margin-left: auto;
  background: var(--color-border);
  color: var(--color-text-muted);
  font-size: .72rem;
  padding: .1rem .45rem;
  border-radius: 99px;
  font-weight: 600;
}

.activity-list {
  list-style: none;
  margin: 0;
  padding: 0;
  background: var(--color-bg);
}
.activity-item {
  display: flex;
  align-items: baseline;
  gap: .5rem;
  padding: .45rem .85rem;
  font-size: .83rem;
  border-bottom: 1px solid var(--color-border);
  flex-wrap: wrap;
}
.activity-item:last-child { border-bottom: none; }

.activity-pr-link {
  font-weight: 600;
  color: var(--color-primary);
  text-decoration: none;
  white-space: nowrap;
}
.activity-pr-link:hover { text-decoration: underline; }
.activity-pr-title { flex: 1; color: var(--color-text); min-width: 0; }
.activity-pr-author { color: var(--color-text-muted); white-space: nowrap; font-size: .8rem; }

/* review decision inline badge */
.activity-rd {
  font-size: .72rem;
  padding: .1rem .45rem;
  border-radius: 99px;
  font-weight: 500;
  white-space: nowrap;
}
.rd-approved { background: #dcfce7; color: #15803d; }
.rd-review-required { background: #fef9c3; color: #854d0e; }
.rd-changes-requested { background: #fee2e2; color: #b91c1c; }
@media (prefers-color-scheme: dark) {
  .rd-approved { background: #14532d; color: #86efac; }
  .rd-review-required { background: #422006; color: #fcd34d; }
  .rd-changes-requested { background: #450a0a; color: #fca5a5; }
}

/* file list variant */
.activity-list-files .activity-item { padding: .4rem .85rem; }
.activity-item-file { display: block; }
.activity-file-link {
  font-family: var(--font-mono, monospace);
  font-size: .78rem;
  color: var(--color-primary);
  text-decoration: none;
  word-break: break-all;
}
.activity-file-link:hover { text-decoration: underline; }

/* ── Duetto wordmark in header ───────────────────────────── */
.logo-duetto-wordmark {
  height: 18px;
  width: auto;
  display: block;
  flex-shrink: 0;
}
.logo-divider {
  display: block;
  width: 1px;
  height: 16px;
  background: rgba(255, 255, 255, 0.2);
  flex-shrink: 0;
}

/* ── Today digest ─────────────────────────────────────── */
.today-digest {
  margin: 1.25rem 0;
}
.today-digest-inner {
  background: linear-gradient(135deg, color-mix(in srgb, var(--dt-lime) 8%, var(--color-surface)), var(--color-surface));
  border: 1px solid color-mix(in srgb, var(--dt-lime) 30%, var(--color-border));
  border-radius: 12px;
  padding: 1rem 1.25rem;
  display: flex;
  gap: 1.25rem;
  align-items: flex-start;
}
.today-digest-label {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  flex-shrink: 0;
  min-width: 80px;
}
.today-badge {
  display: inline-block;
  background: var(--dt-lime);
  color: var(--dt-midnight);
  font-size: 0.7rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 0.2rem 0.5rem;
  border-radius: 4px;
  line-height: 1.4;
}
.today-stats {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}
.today-stats span {
  font-size: 0.75rem;
  color: var(--color-text-muted);
  white-space: nowrap;
}
.today-digest-text {
  font-size: 0.9rem;
  line-height: 1.65;
  color: var(--color-text);
  margin: 0;
  flex: 1;
}
[data-theme="dark"] .today-digest-inner {
  background: linear-gradient(135deg, color-mix(in srgb, var(--dt-lime) 6%, #0f1e20), #0f1e20);
  border-color: color-mix(in srgb, var(--dt-lime) 20%, var(--color-border));
}

/* ── Activity chart ───────────────────────────────────── */
.activity-chart-section {
  margin: 0 0 1.5rem;
}
.activity-chart-header {
  display: flex;
  align-items: baseline;
  gap: 0.75rem;
  margin-bottom: 0.75rem;
}
.activity-chart-sub {
  font-size: 0.8rem;
  color: var(--color-text-muted);
}
.activity-chart-wrap {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: 12px;
  padding: 1.25rem 1.25rem 1rem;
}

/* ── Initiatives page ─────────────────────────────────── */
.initiatives-page { max-width: 1400px; }

.initiatives-header { margin-bottom: 1.75rem; }
.initiatives-title-row {
  display: flex;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
  margin-bottom: 0.4rem;
}
.initiatives-heading { font-size: 1.6rem; font-weight: 700; margin: 0; }
.initiatives-notion-link {
  font-size: 0.8rem;
  color: var(--dt-teal-mid, #2a5f5f);
  text-decoration: none;
  border: 1px solid var(--color-border);
  border-radius: 6px;
  padding: 0.2rem 0.55rem;
  transition: background 0.15s;
}
.initiatives-notion-link:hover { background: var(--color-surface); }
[data-theme="dark"] .initiatives-notion-link { color: var(--dt-lime); }
.initiatives-freshness {
  font-size: 0.78rem;
  color: var(--color-text-muted);
  margin-left: auto;
}
.initiatives-ts { font-variant-numeric: tabular-nums; }
.initiatives-sub { font-size: 0.85rem; color: var(--color-text-muted); margin: 0; }
.initiatives-filter-banner {
  margin-top: .5rem;
  padding: .35rem .75rem;
  font-size: .85rem;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: 6px;
  display: inline-flex;
  gap: .75rem;
  align-items: center;
}
.initiatives-filter-clear {
  color: var(--color-text-muted);
  font-size: .8rem;
  text-decoration: none;
}
.initiatives-filter-clear:hover { color: var(--color-text); text-decoration: underline; }

/* AI summary card */
.initiatives-summary-card { margin-bottom: 1.75rem; }
.initiatives-summary-inner {
  background: linear-gradient(135deg, color-mix(in srgb, var(--dt-teal) 10%, var(--color-surface)), var(--color-surface));
  border: 1px solid color-mix(in srgb, var(--dt-teal) 35%, var(--color-border));
  border-radius: 12px;
  padding: 1.25rem 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}
[data-theme="dark"] .initiatives-summary-inner {
  background: linear-gradient(135deg, color-mix(in srgb, var(--dt-teal) 8%, #0d1e1e), #0d1e1e);
  border-color: color-mix(in srgb, var(--dt-teal) 25%, var(--color-border));
}
.initiatives-summary-label {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 0.75rem;
  flex-shrink: 0;
}
.initiatives-pipeline-badge {
  display: inline-block;
  background: var(--dt-teal);
  color: #fff;
  font-size: 0.7rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 0.2rem 0.5rem;
  border-radius: 4px;
  line-height: 1.4;
}
[data-theme="dark"] .initiatives-pipeline-badge {
  background: color-mix(in srgb, var(--dt-teal) 60%, #fff);
  color: #fff;
}
.initiatives-summary-count {
  font-size: 0.75rem;
  color: var(--color-text-muted);
  white-space: nowrap;
}
.initiatives-active-header {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.8rem;
  line-height: 1.6;
  color: var(--color-text);
}
.initiatives-active-header strong {
  white-space: nowrap;
}
.initiatives-active-count {
  white-space: nowrap;
  color: var(--color-text-muted);
}
.domain-chip {
  display: inline-block;
  font-size: 0.7rem;
  font-weight: 600;
  padding: 0.1rem 0.45rem;
  border: 1px solid color-mix(in srgb, var(--dt-teal) 50%, var(--color-border));
  border-radius: 9999px;
  color: var(--dt-teal);
  background: color-mix(in srgb, var(--dt-teal) 8%, transparent);
  white-space: nowrap;
}
[data-theme="dark"] .domain-chip {
  color: color-mix(in srgb, var(--dt-teal) 75%, #fff);
  border-color: color-mix(in srgb, var(--dt-teal) 30%, var(--color-border));
  background: color-mix(in srgb, var(--dt-teal) 10%, transparent);
}
.initiatives-summary-html {
  font-size: 0.9rem;
  line-height: 1.65;
  color: var(--color-text);
  margin: 0;
  flex: 1;
  overflow-x: auto;
}
.initiatives-summary-html h2 {
  font-size: 1.05rem;
  font-weight: 700;
  margin: 1rem 0 0.4rem 0;
  color: var(--color-text);
  border-bottom: 1px solid var(--color-border);
  padding-bottom: 0.25rem;
}
.initiatives-summary-html h2:first-child { margin-top: 0; }
.initiatives-summary-html h3 {
  font-size: 0.95rem;
  font-weight: 600;
  margin: 0.75rem 0 0.3rem 0;
  color: var(--color-text);
}
.initiatives-summary-html p {
  margin: 0.3rem 0 0.5rem 0;
}
.initiatives-summary-html ul,
.initiatives-summary-html ol {
  margin: 0.25rem 0 0.5rem 0;
  padding-left: 1.4rem;
}
.initiatives-summary-html li {
  margin-bottom: 0.2rem;
}
.initiatives-summary-html strong {
  font-weight: 700;
  color: var(--color-text);
}
.initiatives-summary-html table {
  width: 100%;
  border-collapse: collapse;
  margin: 0.5rem 0;
  font-size: 0.85rem;
}
.initiatives-summary-html th,
.initiatives-summary-html td {
  padding: 0.35rem 0.6rem;
  border: 1px solid var(--color-border);
  text-align: left;
}
.initiatives-summary-html th {
  background: color-mix(in srgb, var(--dt-teal) 8%, var(--color-surface));
  font-weight: 600;
}
.initiatives-summary-html code {
  background: color-mix(in srgb, var(--color-text) 8%, var(--color-surface));
  padding: 0.1rem 0.3rem;
  border-radius: 3px;
  font-size: 0.85em;
}

/* Pipeline grid */
.pipeline-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 1.25rem;
  align-items: start;
}

.pipeline-col {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: 12px;
  padding: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.pipeline-col-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.25rem;
}

.pipeline-col-title {
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 0.2rem 0.55rem;
  border-radius: 5px;
}

/* Status colour map */
.status-delivery  { background: color-mix(in srgb, var(--dt-teal) 15%, transparent); color: var(--dt-teal-mid, #2a5f5f); }
.status-validated { background: color-mix(in srgb, var(--dt-lime) 20%, transparent); color: #4a6e00; }
.status-discovery { background: #fef3c7; color: #92400e; }
.status-deployed  { background: #f3f4f6; color: #4b5563; }
.status-learning  { background: #ede9fe; color: #6d28d9; }
.status-success   { background: #d1fae5; color: #065f46; }
.status-killed    { background: #fee2e2; color: #991b1b; }
.status-unknown   { background: #f3f4f6; color: #6b7280; }

[data-theme="dark"] .status-delivery  { background: rgba(28,71,71,.35); color: #7ecfcf; }
[data-theme="dark"] .status-validated { background: rgba(196,255,69,.15); color: var(--dt-lime); }
[data-theme="dark"] .status-discovery { background: #451a00; color: #fcd34d; }
[data-theme="dark"] .status-deployed  { background: #1f2937; color: #9ca3af; }
[data-theme="dark"] .status-learning  { background: #2e1b5e; color: #c4b5fd; }
[data-theme="dark"] .status-success   { background: #14532d; color: #86efac; }
[data-theme="dark"] .status-killed    { background: #450a0a; color: #fca5a5; }
[data-theme="dark"] .status-unknown   { background: #1f2937; color: #9ca3af; }

.pipeline-col-count {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--color-text-muted);
  background: var(--color-border);
  border-radius: 99px;
  padding: 0.1rem 0.5rem;
  min-width: 1.5rem;
  text-align: center;
}

/* Initiative cards */
.initiative-card {
  background: var(--color-bg, #fff);
  border: 1px solid var(--color-border);
  border-radius: 8px;
  padding: 0.7rem 0.85rem;
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}
[data-theme="dark"] .initiative-card { background: color-mix(in srgb, var(--color-surface) 60%, transparent); }

.initiative-title-row { display: flex; align-items: flex-start; }

.initiative-title {
  font-size: 0.85rem;
  font-weight: 600;
  line-height: 1.4;
  color: var(--color-text);
  text-decoration: none;
}
.initiative-title:hover { text-decoration: underline; color: var(--dt-teal-mid, #2a5f5f); }
[data-theme="dark"] .initiative-title:hover { color: var(--dt-lime); }
.initiative-title-plain {
  font-size: 0.85rem;
  font-weight: 600;
  line-height: 1.4;
  color: var(--color-text);
}
.initiative-ext-icon { font-size: 0.7em; opacity: 0.6; margin-left: 0.15em; }

.initiative-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.3rem;
}

.initiative-tag {
  font-size: 0.7rem;
  font-weight: 500;
  padding: 0.15rem 0.45rem;
  border-radius: 4px;
  white-space: nowrap;
}
.initiative-tag-product { background: #dbeafe; color: #1e40af; }
.initiative-tag-domain  { background: #f3e8ff; color: #7e22ce; }
.initiative-tag-timebox { background: #fef3c7; color: #92400e; }
.initiative-tag-author  { background: #f0fdf4; color: #166534; }

[data-theme="dark"] .initiative-tag-product { background: #1e3a5f; color: #93c5fd; }
[data-theme="dark"] .initiative-tag-domain  { background: #2e1b5e; color: #d8b4fe; }
[data-theme="dark"] .initiative-tag-timebox { background: #451a00; color: #fde68a; }
[data-theme="dark"] .initiative-tag-author  { background: #14532d; color: #86efac; }

.initiative-description {
  font-size: 0.78rem;
  color: var(--color-text-muted);
  line-height: 1.5;
  margin: 0;
}

/* ------------------------------------------------------------------ */
/* Artifact creation flow (#86)                                         */
/* ------------------------------------------------------------------ */

/* CTA button in prs.html page header */
.btn-new-artifact {
  display: inline-flex;
  align-items: center;
  gap: .3rem;
  padding: .25rem .7rem;
  background: var(--dt-lime);
  color: var(--dt-midnight);
  border-radius: var(--radius);
  font-size: .8rem;
  font-weight: 700;
  text-decoration: none;
  transition: background .15s, opacity .15s;
  margin-left: auto;
}
.btn-new-artifact:hover { background: #d4ff5e; text-decoration: none; }

/* Two-column create layout */
.create-artifact-layout {
  display: grid;
  grid-template-columns: 2fr 3fr;
  gap: 1.5rem;
  align-items: start;
  margin-bottom: 5rem; /* room for sticky submit bar */
}
@media (max-width: 900px) {
  .create-artifact-layout { grid-template-columns: 1fr; }
}

/* Panel cards */
.create-artifact-meta,
.create-artifact-body {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  padding: 1.25rem 1.5rem;
  box-shadow: var(--shadow);
}

.create-panel-title {
  font-size: .8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .5px;
  color: var(--color-text-muted);
  margin-bottom: 1rem;
}

/* Form field groups */
.create-field {
  margin-bottom: 1rem;
}
.create-field label {
  display: block;
  font-size: .82rem;
  font-weight: 600;
  color: var(--color-text);
  margin-bottom: .3rem;
}
.create-field input,
.create-field select,
.create-field textarea {
  width: 100%;
  padding: .45rem .7rem;
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  background: var(--color-bg);
  color: var(--color-text);
  font-family: var(--font-sans);
  font-size: .9rem;
  transition: border-color .15s;
}
.create-field input:focus,
.create-field select:focus,
.create-field textarea:focus {
  outline: none;
  border-color: var(--dt-teal);
  box-shadow: 0 0 0 3px rgba(28,71,71,.12);
}

/* Type chip selector */
.type-chips {
  display: flex;
  flex-wrap: wrap;
  gap: .4rem;
  margin-bottom: 1rem;
}
.type-chip {
  padding: .28rem .7rem;
  border: 1.5px solid var(--color-border);
  border-radius: 999px;
  font-size: .78rem;
  font-weight: 600;
  cursor: pointer;
  background: var(--color-surface);
  color: var(--color-text-muted);
  transition: background .12s, border-color .12s, color .12s;
  user-select: none;
}
.type-chip:hover {
  border-color: var(--dt-teal);
  color: var(--dt-teal);
}
.type-chip.selected {
  background: var(--dt-lime);
  border-color: var(--dt-lime);
  color: var(--dt-midnight);
}
[data-theme="dark"] .type-chip.selected {
  color: var(--dt-midnight);
}

/* Expandable "More metadata" section */
.create-more-toggle {
  font-size: .8rem;
  color: var(--color-text-muted);
  cursor: pointer;
  padding: .3rem 0;
  display: flex;
  align-items: center;
  gap: .3rem;
  border: none;
  background: none;
  font-family: inherit;
  margin-bottom: .5rem;
}
.create-more-toggle:hover { color: var(--color-primary); }
.create-more-section { display: none; }
.create-more-section.open { display: block; }

/* Body textarea */
.create-field textarea.body-editor {
  font-family: var(--font-mono);
  font-size: .85rem;
  min-height: 400px;
  resize: vertical;
  line-height: 1.6;
}

/* Frontmatter live preview */
.fm-preview {
  background: #0f2528;
  color: #c4ff45;
  font-family: var(--font-mono);
  font-size: .75rem;
  border-radius: var(--radius);
  padding: .85rem 1rem;
  overflow-x: auto;
  white-space: pre;
  margin-top: .75rem;
  border: 1px solid #1e3a3e;
  line-height: 1.5;
  max-height: 260px;
  overflow-y: auto;
}
/* Keep dark even in light mode */
.fm-preview { color-scheme: dark; }

/* Sticky submit bar */
.create-submit-bar {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: var(--color-surface);
  border-top: 1px solid var(--color-border);
  padding: .75rem 1.5rem;
  display: flex;
  align-items: center;
  gap: 1rem;
  z-index: 100;
  box-shadow: 0 -2px 8px rgba(6,30,33,.08);
}

.btn-create-pr {
  display: inline-flex;
  align-items: center;
  gap: .4rem;
  padding: .5rem 1.25rem;
  background: var(--dt-lime);
  color: var(--dt-midnight);
  border: none;
  border-radius: var(--radius);
  font-size: .9rem;
  font-weight: 700;
  cursor: pointer;
  transition: background .15s, opacity .15s;
  font-family: inherit;
}
.btn-create-pr:hover { background: #d4ff5e; }
.btn-create-pr:disabled { opacity: .6; cursor: not-allowed; }

.create-submit-note {
  font-size: .8rem;
  color: var(--color-text-muted);
}

/* Error banner */
.create-error-banner {
  background: #fef2f2;
  border: 1px solid #fca5a5;
  color: #991b1b;
  border-radius: var(--radius);
  padding: .75rem 1rem;
  margin-bottom: 1rem;
  font-size: .88rem;
}
[data-theme="dark"] .create-error-banner {
  background: #450a0a;
  border-color: #7f1d1d;
  color: #fca5a5;
}

/* ── Content source tabs ─────────────────────────────────────────────── */
.content-source-tabs {
  display: flex;
  gap: .25rem;
  margin-bottom: 1rem;
  border-bottom: 1px solid var(--color-border);
  padding-bottom: .5rem;
}
.content-tab {
  background: none;
  border: 1px solid transparent;
  border-radius: var(--radius, .5rem) var(--radius, .5rem) 0 0;
  color: var(--color-text-muted, #94a3b8);
  cursor: pointer;
  font-size: .82rem;
  padding: .35rem .75rem;
  transition: background .15s, color .15s;
}
.content-tab:hover { background: var(--color-bg, rgba(255,255,255,.06)); color: var(--color-text); }
.content-tab.active {
  background: var(--dt-lime);
  color: var(--dt-midnight);
  border-color: var(--dt-lime);
  font-weight: 600;
}
[data-theme="dark"] .content-tab.active { color: var(--dt-midnight); }

/* ── Upload drop zones ───────────────────────────────────────────────── */
.upload-drop-zone {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: .5rem;
  border: 2px dashed var(--color-border);
  border-radius: var(--radius, .5rem);
  cursor: pointer;
  min-height: 140px;
  padding: 1.5rem;
  text-align: center;
  transition: border-color .2s, background .2s;
}
.upload-drop-zone:hover, .upload-drop-zone.drag-over {
  border-color: var(--dt-lime);
  background: rgba(196,255,69,.06);
}
.upload-drop-zone-sm { min-height: 80px; padding: 1rem; }
.upload-drop-icon { font-size: 2rem; line-height: 1; }
.upload-drop-zone-sm .upload-drop-icon { font-size: 1.4rem; }
.upload-drop-text { font-size: .85rem; color: var(--color-text-muted, #94a3b8); }
.upload-filename {
  margin-top: .5rem;
  font-size: .82rem;
  color: var(--dt-lime);
}

/* ── Google Doc import ───────────────────────────────────────────────── */
.btn-gdoc-import {
  background: var(--dt-teal);
  border: none;
  border-radius: var(--radius, .5rem);
  color: #fff;
  cursor: pointer;
  font-size: .85rem;
  padding: .45rem .9rem;
  white-space: nowrap;
}
.btn-gdoc-import:hover { opacity: .85; }
.btn-gdoc-import:disabled { opacity: .5; cursor: not-allowed; }
.gdoc-status { font-size: .82rem; margin-top: .4rem; min-height: 1.2em; }
.gdoc-status.error   { color: #ef4444; }
.gdoc-status.loading { color: var(--color-text-muted, #94a3b8); }
.gdoc-status.success { color: var(--dt-lime); }
.gdoc-note { color: var(--color-text-muted, #94a3b8); font-size: .78rem; margin: .4rem 0 0; }

/* ── Attachments list ───────────────────────────────────────────────── */
.attachments-field { margin-top: 1.25rem; }
.field-hint { color: var(--color-text-muted, #94a3b8); font-size: .78rem; font-weight: 400; }
.attachment-list { list-style: none; margin: .5rem 0 0; padding: 0; display: flex; flex-direction: column; gap: .3rem; }
.attachment-item { align-items: center; display: flex; gap: .5rem; font-size: .82rem; }
.att-icon { flex-shrink: 0; }
.att-name { color: var(--color-text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.att-size { color: var(--color-text-muted, #94a3b8); flex-shrink: 0; }

/* ── Chat page (full-height flex layout) ────────────────────────────
   Why: The /chat page should fill the entire viewport below the fixed
   topbar without any magic-number height calculations. We override
   the normal .site-body padding/footer for body.chat-page only, and
   build the chat panel as a pure flex column.
   What: body.chat-page collapses .site-body padding + main-content
   padding + footer so the chat layout owns 100vh - header. Inside,
   .assist-layout is a row flex; .assist-chat is a column flex with
   a scrolling messages area (min-height: 0) and a non-sticky input.
   Test: Open /chat at any viewport height; the input row should sit
   flush at the bottom and the messages area should scroll inside. */
body.chat-page .site-body { padding-top: var(--header-height); }
body.chat-page .site-body .main-content {
  padding: 0;
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 0;
  overflow: hidden;
}
body.chat-page .stats-strip { display: none; }
body.chat-page .branch-banner { flex-shrink: 0; }
body.chat-page .site-body { min-height: 0; height: 100vh; }

.chat-page-header {
  align-items: center;
  display: flex;
  flex-shrink: 0;
  gap: 1rem;
  padding: 1rem 1.5rem .75rem;
}
.chat-page-header h1 { font-size: 1.4rem; font-weight: 700; margin: 0; }

.assist-layout {
  display: flex;
  flex-direction: row;
  flex: 1;
  min-height: 0;
  gap: 1rem;
  padding: 0 1.5rem 1rem;
}
@media (max-width: 800px) {
  .assist-layout { flex-direction: column; gap: .75rem; padding: 0 1rem 1rem; }
  .assist-guide { flex: 0 0 auto; max-height: 30vh; }
}

/* Guide sidebar — fixed-width left panel */
.assist-guide {
  background: var(--color-surface, #fff);
  border: 1px solid var(--color-border, #e2e8f0);
  border-radius: var(--radius, .5rem);
  overflow-y: auto;
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  flex: 0 0 280px;
  gap: 1rem;
  min-height: 0;
}
.guide-section {}
.guide-title {
  color: var(--dt-lime, #c4ff45);
  font-size: .72rem;
  font-weight: 700;
  letter-spacing: .08em;
  margin-bottom: .4rem;
  text-transform: uppercase;
}
[data-theme="dark"] .guide-title { color: var(--dt-lime); }
.guide-list {
  color: var(--color-text, #0f172a);
  font-size: .8rem;
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: .2rem;
}
[data-theme="dark"] .guide-list { color: var(--color-text, #f1f5f9); }
.guide-tip {
  background: rgba(196,255,69,.1);
  border-left: 3px solid var(--dt-lime);
  border-radius: 0 var(--radius, .5rem) var(--radius, .5rem) 0;
  color: var(--color-text, #0f172a);
  font-size: .78rem;
  font-style: italic;
  padding: .5rem .75rem;
}

/* Workflow stages */
.workflow-steps {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: .25rem;
  font-size: .72rem;
}
.wf-step {
  border-radius: 999px;
  padding: .2rem .55rem;
  font-weight: 600;
}
.wf-arrow { color: var(--color-text-muted, #94a3b8); font-size: .7rem; }
.wf-discovery  { background: #dbeafe; color: #1d4ed8; }
.wf-planned    { background: #ede9fe; color: #5b21b6; }
.wf-delivery   { background: #fef9c3; color: #92400e; }
.wf-validated  { background: #dcfce7; color: #166534; }
.wf-deployed   { background: #f0fdf4; color: #15803d; border: 1px solid #bbf7d0; }
[data-theme="dark"] .wf-discovery  { background: #1e3a5f; color: #93c5fd; }
[data-theme="dark"] .wf-planned    { background: #2d1b4e; color: #c4b5fd; }
[data-theme="dark"] .wf-delivery   { background: #3b2f00; color: #fde68a; }
[data-theme="dark"] .wf-validated  { background: #052e16; color: #86efac; }
[data-theme="dark"] .wf-deployed   { background: #052e16; color: #4ade80; border-color: #166534; }

.btn-clear-chat {
  background: none;
  border: 1px solid var(--color-border, #e2e8f0);
  border-radius: var(--radius, .5rem);
  color: var(--color-text-muted, #94a3b8);
  cursor: pointer;
  font-size: .78rem;
  padding: .35rem .75rem;
  width: 100%;
}
.btn-clear-chat:hover { border-color: #ef4444; color: #ef4444; }

/* Chat panel — flex column, fills remaining row width */
.assist-chat {
  background: var(--color-surface, #fff);
  border: 1px solid var(--color-border, #e2e8f0);
  border-radius: var(--radius, .5rem);
  display: flex;
  flex: 1;
  flex-direction: column;
  min-height: 0;
  min-width: 0;
  overflow: hidden;
}
.chat-messages {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  gap: .75rem;
}
.chat-message { display: flex; }
.chat-message-user     { justify-content: flex-end; }
.chat-message-assistant{ justify-content: flex-start; }
.chat-bubble {
  border-radius: 1rem;
  font-size: .875rem;
  line-height: 1.55;
  max-width: 80%;
  padding: .65rem 1rem;
  word-break: break-word;
}
.chat-message-user .chat-bubble {
  background: var(--dt-teal, #1c4747);
  color: #f1f5f9;
  border-bottom-right-radius: .25rem;
}
.chat-message-assistant .chat-bubble {
  background: var(--color-bg, #f8fafc);
  border: 1px solid var(--color-border, #e2e8f0);
  color: var(--color-text, #0f172a);
  border-bottom-left-radius: .25rem;
}
[data-theme="dark"] .chat-message-assistant .chat-bubble {
  background: rgba(255,255,255,.05);
  border-color: rgba(255,255,255,.1);
  color: var(--color-text, #f1f5f9);
}
.chat-code {
  background: #0f172a;
  border-radius: .375rem;
  color: #e2e8f0;
  font-family: 'JetBrains Mono', 'Fira Code', monospace;
  font-size: .75rem;
  margin: .5rem 0;
  overflow-x: auto;
  padding: .75rem 1rem;
  white-space: pre;
}

/* Thinking animation */
.thinking-dots span {
  animation: blink 1.2s infinite;
  font-size: 1.5rem;
  line-height: 1;
}
.thinking-dots span:nth-child(2) { animation-delay: .2s; }
.thinking-dots span:nth-child(3) { animation-delay: .4s; }
@keyframes blink { 0%,80%,100%{opacity:0} 40%{opacity:1} }

/* Ready bar */
.assist-ready-bar {
  align-items: center;
  background: rgba(196,255,69,.12);
  border-top: 2px solid var(--dt-lime);
  display: flex;
  gap: .75rem;
  padding: .75rem 1.25rem;
}
.ready-icon { color: var(--dt-lime); font-size: 1.1rem; }
.ready-text { color: var(--color-text, #0f172a); flex: 1; font-size: .88rem; font-weight: 600; }
[data-theme="dark"] .ready-text { color: var(--color-text, #f1f5f9); }
.btn-create-from-assist {
  background: var(--dt-lime);
  border: none;
  border-radius: var(--radius, .5rem);
  color: var(--dt-midnight);
  cursor: pointer;
  font-size: .85rem;
  font-weight: 700;
  padding: .45rem 1rem;
}
.btn-create-from-assist:hover { opacity: .85; }
.btn-edit-first {
  background: none;
  border: 1px solid var(--color-border);
  border-radius: var(--radius, .5rem);
  color: var(--color-text-muted, #94a3b8);
  cursor: pointer;
  font-size: .82rem;
  padding: .4rem .85rem;
}

/* Input row — flex-shrink: 0 keeps it pinned at the bottom of the
   .assist-chat flex column without needing position: sticky or any
   magic-number height. The messages area above flexes to fill. */
.chat-input-row {
  background: var(--color-surface, #fff);
  border-top: 1px solid var(--color-border, #e2e8f0);
  display: flex;
  flex-shrink: 0;
  gap: .5rem;
  padding: .75rem 1rem;
}
[data-theme="dark"] .chat-input-row {
  background: var(--color-surface);
}
.chat-input {
  background: var(--color-surface, #fff);
  border: 1px solid var(--color-border, #e2e8f0);
  border-radius: var(--radius, .5rem);
  color: var(--color-text, #0f172a);
  flex: 1;
  font-family: inherit;
  font-size: .875rem;
  min-height: 2.5rem;
  padding: .55rem .85rem;
  resize: none;
  transition: border-color .15s;
}
.chat-input:focus { border-color: var(--dt-lime); outline: none; }
[data-theme="dark"] .chat-input {
  background: rgba(255,255,255,.05);
  color: var(--color-text, #f1f5f9);
}
.btn-send {
  align-self: flex-end;
  background: var(--dt-lime);
  border: none;
  border-radius: var(--radius, .5rem);
  color: var(--dt-midnight);
  cursor: pointer;
  font-weight: 700;
  padding: .5rem 1.1rem;
}
.btn-send:hover { opacity: .85; }
.btn-send:disabled { cursor: not-allowed; opacity: .5; }

/* PRs page — assistant link button */
.btn-assist-link {
  background: rgba(196,255,69,.15);
  border: 1px solid var(--dt-lime);
  border-radius: var(--radius, .5rem);
  color: var(--dt-lime);
  font-size: .8rem;
  font-weight: 600;
  padding: .3rem .75rem;
  text-decoration: none;
}
.btn-assist-link:hover { background: rgba(196,255,69,.3); }

/* ------------------------------------------------------------------ */
/* Initiative detail page                                              */
/* ------------------------------------------------------------------ */

/* Hero header */
.init-hero {
  margin-bottom: 1.75rem;
}
.init-hero-badges {
  display: flex;
  flex-wrap: wrap;
  gap: .4rem;
  margin-bottom: .5rem;
}
.init-hero-title {
  font-size: 1.9rem;
  font-weight: 700;
  line-height: 1.2;
  margin-bottom: .5rem;
}
.init-hero-chips {
  display: flex;
  flex-wrap: wrap;
  gap: .4rem;
}
.init-confidence-badge {
  text-transform: capitalize;
}
.init-conf-high   { background: #d1fae5; color: #065f46; }
.init-conf-medium { background: #fef9c3; color: #92400e; }
.init-conf-low    { background: #fee2e2; color: #991b1b; }
[data-theme="dark"] .init-conf-high   { background: #052e16; color: #6ee7b7; }
[data-theme="dark"] .init-conf-medium { background: #3b2f00; color: #fde68a; }
[data-theme="dark"] .init-conf-low    { background: #450a0a; color: #fca5a5; }

/* Hypothesis callout */
.init-hypothesis {
  background: var(--color-accent-soft);
  border-left: 4px solid var(--color-primary);
  border-radius: 0 var(--radius) var(--radius) 0;
  padding: 1rem 1.25rem;
  margin-bottom: 1.25rem;
}
[data-theme="dark"] .init-hypothesis {
  background: rgba(196,255,69,.08);
  border-color: var(--color-primary);
}
.init-hyp-label {
  font-size: .72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .5px;
  color: var(--color-primary);
  margin-bottom: .35rem;
}
.init-hyp-text {
  font-size: .95rem;
  line-height: 1.65;
  color: var(--color-text);
  margin-bottom: 0;
}
.init-hyp-metric {
  margin-top: .6rem;
  font-size: .85rem;
  color: var(--color-text-muted);
}
.init-hyp-metric-label {
  font-weight: 600;
  color: var(--color-text);
  margin-right: .3rem;
}

/* Main column */
.init-main {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  min-width: 0;
}

/* Section title */
.init-section-title {
  font-size: 1.05rem;
  font-weight: 700;
  margin-bottom: .75rem;
  padding-bottom: .3rem;
  border-bottom: 1px solid var(--color-border);
  display: flex;
  align-items: baseline;
  gap: .75rem;
}

/* Components table */
.init-components {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  padding: 1.25rem 1.5rem;
  box-shadow: var(--shadow);
}
.init-comp-table {
  width: 100%;
  border-collapse: collapse;
  font-size: .875rem;
}
.init-comp-table th {
  background: var(--color-bg);
  border-bottom: 1px solid var(--color-border);
  padding: .5rem .75rem;
  text-align: left;
  font-size: .78rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .3px;
  color: var(--color-text-muted);
}
.init-comp-table td {
  padding: .55rem .75rem;
  border-bottom: 1px solid var(--color-border);
  vertical-align: middle;
}
.init-comp-table tr:last-child td { border-bottom: none; }
.init-comp-name { font-weight: 500; }
.init-comp-doc-label {
  font-size: .72rem;
  color: var(--color-text-muted);
  font-style: italic;
}
.init-comp-dash { color: var(--color-text-muted); }
.init-comp-links {
  display: flex;
  gap: .5rem;
  flex-wrap: wrap;
}
.init-comp-link {
  font-size: .78rem;
  color: var(--color-primary);
  border: 1px solid var(--color-border);
  border-radius: 999px;
  padding: .1rem .5rem;
  white-space: nowrap;
}
.init-comp-link:hover { text-decoration: none; background: var(--color-bg); }
.init-comp-link-gh { color: var(--color-text-muted); }

/* Weekly activity */
.init-weekly {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  padding: 1.25rem 1.5rem;
  box-shadow: var(--shadow);
}
.init-week-range {
  font-size: .78rem;
  font-weight: 400;
  color: var(--color-text-muted);
}
.init-weekly-empty {
  color: var(--color-text-muted);
  font-size: .875rem;
  font-style: italic;
}
.init-weekly-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  margin-bottom: .75rem;
  font-size: .875rem;
}
.init-weekly-stat { color: var(--color-text-muted); }
.init-weekly-stat strong { color: var(--color-text); }
.init-contrib-chip {
  background: var(--color-bg);
  border: 1px solid var(--color-border);
  border-radius: 999px;
  padding: .05rem .45rem;
  font-size: .75rem;
}
.init-commit-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: .35rem;
}
.init-commit-item {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: .4rem;
  font-size: .85rem;
  padding: .3rem .4rem;
  border-radius: 4px;
}
.init-commit-item:hover { background: var(--color-bg); }
.init-commit-sha {
  font-family: var(--font-mono);
  font-size: .78rem;
  background: var(--color-bg);
  border: 1px solid var(--color-border);
  border-radius: 3px;
  padding: .05rem .3rem;
  color: var(--color-text-muted);
  white-space: nowrap;
}
.init-commit-date {
  color: var(--color-text-muted);
  font-size: .78rem;
  white-space: nowrap;
}
.init-commit-author {
  font-weight: 600;
  color: var(--color-primary);
  font-size: .8rem;
  white-space: nowrap;
}
.init-commit-msg {
  color: var(--color-text);
  flex: 1;
}

/* People panel */
.init-people-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: .45rem;
}
.init-person-row {
  display: flex;
  align-items: center;
  gap: .5rem;
  font-size: .875rem;
}
.init-person-name { font-weight: 600; color: var(--color-text); flex: 1; }
.init-person-role {
  font-size: .72rem;
  color: var(--color-text-muted);
  background: var(--color-bg);
  border: 1px solid var(--color-border);
  border-radius: 999px;
  padding: .1rem .4rem;
}
.init-person-loe {
  font-size: .72rem;
  font-weight: 600;
  background: var(--color-accent-soft);
  color: var(--color-primary);
  border-radius: 999px;
  padding: .1rem .4rem;
}

/* Quick links panel */
.init-links-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: .3rem;
}
.init-quick-link {
  display: flex;
  align-items: center;
  gap: .4rem;
  font-size: .875rem;
  color: var(--color-link);
  padding: .25rem .1rem;
  border-radius: 4px;
}
.init-quick-link:hover { text-decoration: none; background: var(--color-bg); padding-left: .3rem; }
.init-quick-link-icon { font-size: .9rem; width: 1.1rem; text-align: center; }

/* Pipeline initiatives page: clickable cards + github icon */
.initiative-card-gh-link {
  font-size: .78rem;
  color: var(--color-text-muted);
  opacity: .6;
  margin-left: auto;
  flex-shrink: 0;
  padding: .1rem .2rem;
}
.initiative-card-gh-link:hover { opacity: 1; text-decoration: none; }

/* Responsive */
@media (max-width: 900px) {
  .init-hero-title { font-size: 1.4rem; }
  .init-comp-table th:nth-child(3),
  .init-comp-table td:nth-child(3) { display: none; }
}

/* ── Domain-organized initiatives page ─────────────────────────── */
.init-domain-section {
  margin-bottom: 2.5rem;
  border: 1px solid var(--color-border);
  border-radius: 10px;
  overflow: hidden;
}
.init-domain-header {
  background: var(--color-bg);
  border-bottom: 1px solid var(--color-border);
  padding: .75rem 1.25rem;
  display: flex;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
}
.init-domain-title-row {
  display: flex;
  align-items: center;
  gap: .75rem;
  flex: 1;
  min-width: 0;
}
.init-domain-name {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--color-text);
  letter-spacing: -.01em;
}
a.init-domain-name:hover { color: var(--color-link); text-decoration: none; }
.init-domain-unassigned { color: var(--color-text-muted); }
.init-domain-browse-link {
  font-size: .8rem;
  color: var(--color-text-muted);
  white-space: nowrap;
}
.init-domain-browse-link:hover { color: var(--color-link); text-decoration: none; }
.init-domain-pills {
  display: flex;
  flex-wrap: wrap;
  gap: .35rem;
}
.init-domain-pill {
  font-size: .72rem;
  font-weight: 600;
  padding: .15rem .5rem;
  border-radius: 999px;
  white-space: nowrap;
  letter-spacing: .02em;
}

/* Initiative cards grid inside each domain */
.init-domain-cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 0;
}
.init-domain-card {
  padding: .85rem 1.1rem;
  border-right: 1px solid var(--color-border);
  border-bottom: 1px solid var(--color-border);
  transition: background .12s;
}
.init-domain-card:hover { background: var(--color-bg); }
.init-domain-card-title-row {
  display: flex;
  align-items: flex-start;
  gap: .5rem;
  margin-bottom: .35rem;
}
.init-domain-card-title {
  font-size: .88rem;
  font-weight: 600;
  color: var(--color-text);
  line-height: 1.35;
  flex: 1;
}
.init-domain-card-title:hover { color: var(--color-link); text-decoration: none; }
.init-domain-card-meta {
  display: flex;
  flex-wrap: wrap;
  gap: .3rem;
  font-size: .74rem;
  color: var(--color-text-muted);
  margin-bottom: .3rem;
}
.init-domain-card-author::before { content: "@"; }
.init-domain-card-timebox {
  background: var(--color-bg-elevated);
  border: 1px solid var(--color-border);
  border-radius: 4px;
  padding: 0 .35rem;
  font-size: .7rem;
}
.init-domain-card-product {
  color: var(--color-text-muted);
  font-style: italic;
}
.init-domain-card-desc {
  font-size: .78rem;
  color: var(--color-text-muted);
  line-height: 1.45;
  margin: 0;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* Domain weekly report accordion */
.init-domain-report {
  border-top: 1px solid var(--color-border);
  background: var(--color-bg);
}
.init-domain-report-toggle {
  display: flex;
  align-items: center;
  gap: .5rem;
  padding: .6rem 1.1rem;
  cursor: pointer;
  user-select: none;
  font-size: .82rem;
  color: var(--color-text-muted);
  transition: background .1s;
}
.init-domain-report-toggle:hover {
  background: var(--color-bg-elevated);
  color: var(--color-text);
}
.init-domain-report-icon { font-size: .9rem; }
.init-domain-report-label { font-weight: 600; letter-spacing: .01em; }
.init-domain-report-chevron { margin-left: auto; font-size: .8rem; }
.init-domain-report-body {
  padding: 1rem 1.25rem 1.25rem;
  border-top: 1px solid var(--color-border);
}
.init-domain-report-body .initiative-weekly-report h2,
.init-domain-report-body .initiative-weekly-report h3 {
  font-size: .95rem;
  margin: 1rem 0 .4rem;
}
.init-domain-report-body .initiative-weekly-report p,
.init-domain-report-body .initiative-weekly-report li {
  font-size: .85rem;
  line-height: 1.55;
}

@media (max-width: 700px) {
  .init-domain-cards { grid-template-columns: 1fr; }
  .init-domain-header { flex-direction: column; align-items: flex-start; gap: .5rem; }
}

/* ── Browse page: domain header ─────────────────────────────── */
.browse-domain-header {
  margin-bottom: .25rem;
}
.browse-domain-title-row {
  display: flex;
  align-items: center;
  gap: .75rem;
}
.browse-domain-h1 {
  font-size: 1.6rem;
  font-weight: 800;
  margin: 0;
  letter-spacing: -.02em;
}
.browse-domain-badge {
  font-size: .72rem;
  padding: .2rem .55rem;
  background: var(--color-bg-elevated);
  border: 1px solid var(--color-border);
  color: var(--color-text-muted);
  border-radius: 999px;
}
.browse-domain-sub {
  font-size: .85rem;
  color: var(--color-text-muted);
  margin: .35rem 0 0;
}

/* Domain weekly report card — full-width below domain header */
.browse-domain-report-card {
  margin: 1rem 0 1.5rem;
  border: 1px solid var(--color-border);
  border-radius: 10px;
  background: var(--color-bg);
  overflow: hidden;
}
.browse-domain-report-card .initiatives-summary-inner {
  padding: 1rem 1.25rem;
}
.browse-domain-report-card .initiatives-summary-label {
  display: flex;
  align-items: center;
  gap: .75rem;
  margin-bottom: .75rem;
}
.browse-domain-report-card .initiatives-summary-html h2,
.browse-domain-report-card .initiatives-summary-html h3 {
  font-size: .95rem;
  margin: 1rem 0 .35rem;
}
.browse-domain-report-card .initiatives-summary-html p,
.browse-domain-report-card .initiatives-summary-html li {
  font-size: .875rem;
  line-height: 1.6;
}

/* Stale initiative list in /updates */
.period-dot-stale { color: #f59e0b; }
.stale-initiative-list { margin-top: .5rem; }
.stale-initiative-item {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: .4rem;
}
.stale-initiative-title { font-weight: 600; }
.stale-initiative-domain, .stale-initiative-author {
  font-size: .78rem;
  color: var(--color-text-muted);
}
.stale-initiative-author::before { content: "@"; }
.stale-initiative-age {
  font-size: .75rem;
  color: #f59e0b;
  font-weight: 500;
  margin-left: auto;
}

/* ── Activity Report (transactional) ───────────────────────── */
.btn-activity-report {
  display: inline-flex;
  align-items: center;
  gap: .35rem;
  font-size: .75rem;
  font-weight: 600;
  padding: .3rem .7rem;
  border: 1px solid var(--dt-teal);
  border-radius: 999px;
  background: transparent;
  color: var(--dt-teal);
  cursor: pointer;
  transition: background .15s, color .15s;
  white-space: nowrap;
}
.btn-activity-report:hover {
  background: var(--dt-teal);
  color: var(--dt-lime);
}
.btn-activity-report:disabled {
  opacity: .5;
  cursor: wait;
}

.activity-report-section {
  margin: 1rem 0 1.25rem;
}
.activity-report-section .activity-report-content {
  margin-top: .5rem;
}

.activity-report-container {
  margin: .75rem 0 1rem;
  border: 1px solid var(--color-border);
  border-radius: 10px;
  background: var(--color-surface);
  overflow: hidden;
}
.activity-report-loading {
  padding: 1rem 1.25rem;
  font-size: .85rem;
  color: var(--color-text-muted);
}
.activity-report-content {
  padding: 0 1.25rem 1.25rem;
}
.activity-report-content h4 { margin: 0; }

/* Summary bar */
.report-summary-bar {
  display: flex;
  flex-wrap: wrap;
  gap: .5rem;
  padding: .75rem 0 .75rem;
}
.report-stat-chip {
  font-size: .78rem;
  font-weight: 600;
  padding: .25rem .6rem;
  background: var(--color-accent-soft);
  border: 1px solid var(--color-border);
  border-radius: 999px;
  color: var(--color-text);
}

/* Plan titles */
.report-plan-title {
  font-size: .9rem;
  font-weight: 700;
  margin: 1rem 0 .4rem;
}

/* Task table */
.report-task-table {
  width: 100%;
  font-size: .82rem;
  border-collapse: collapse;
  margin-bottom: .75rem;
}
.report-task-table th {
  text-align: left;
  font-weight: 600;
  font-size: .75rem;
  text-transform: uppercase;
  letter-spacing: .03em;
  color: var(--color-text-muted);
  border-bottom: 2px solid var(--color-border);
  padding: .35rem .5rem;
}
.report-task-table td {
  padding: .35rem .5rem;
  border-bottom: 1px solid var(--color-border);
}
.report-task-table tr:nth-child(even) td {
  background: var(--color-bg);
}
.report-task-table a {
  color: var(--color-link);
  text-decoration: none;
  font-weight: 500;
}
.report-task-table a:hover { text-decoration: underline; }

/* Status badges */
.badge-closed {
  display: inline-block;
  font-size: .72rem;
  font-weight: 600;
  padding: .15rem .45rem;
  border-radius: 999px;
  background: var(--color-status-success, #dcfce7);
  color: #166534;
}
.badge-open {
  display: inline-block;
  font-size: .72rem;
  font-weight: 600;
  padding: .15rem .45rem;
  border-radius: 999px;
  background: #dbeafe;
  color: #1e40af;
}
.badge-unknown {
  display: inline-block;
  font-size: .72rem;
  font-weight: 600;
  padding: .15rem .45rem;
  border-radius: 999px;
  background: var(--color-bg);
  color: var(--color-text-muted);
  border: 1px solid var(--color-border);
}

.report-no-refs {
  font-size: .82rem;
  color: var(--color-text-muted);
  margin: .25rem 0 .5rem;
}

/* Git commit groups */
.report-git-group {
  margin: .5rem 0;
  font-size: .82rem;
}
.report-git-group ul {
  list-style: none;
  padding-left: 1rem;
  margin: .25rem 0;
}
.report-git-group li {
  margin: .2rem 0;
  line-height: 1.5;
}
.report-git-group code {
  font-size: .75rem;
  background: var(--color-bg);
  padding: .1rem .3rem;
  border-radius: 3px;
  font-family: "SF Mono", Monaco, monospace;
}

/* Generated timestamp */
.report-generated {
  margin-top: .75rem;
  font-size: .72rem;
  color: var(--color-text-muted);
  text-align: right;
}

/* ── Tool: Portfolio Health ─────────────────────────────────────────────────── */

.tools-health-score {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 7rem;
  height: 7rem;
  border-radius: 50%;
  font-size: 2.4rem;
  font-weight: 800;
  line-height: 1;
  color: #fff;
  margin: 0 auto 1.25rem;
}
.tools-health-score.score-green  { background: #16a34a; }
.tools-health-score.score-yellow { background: #ca8a04; }
.tools-health-score.score-red    { background: #dc2626; }
.tools-health-score small {
  display: block;
  font-size: .65rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .06em;
  margin-top: .15rem;
  opacity: .85;
}

.tools-metric-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 22rem), 1fr));
  gap: 1.25rem;
  margin-top: 1.5rem;
}

.tools-metric-card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: 12px;
  padding: 1.1rem 1.25rem 1.25rem;
  overflow: hidden;
}

.tools-metric-card h3 {
  font-size: .8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .05em;
  color: var(--color-text-muted);
  margin: 0 0 .85rem;
}

.tools-progress-bar {
  display: flex;
  align-items: center;
  gap: .6rem;
  margin-bottom: .45rem;
  font-size: .82rem;
}
.tools-progress-bar-label {
  flex: 0 0 7rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  color: var(--color-text);
}
.tools-progress-bar-track {
  flex: 1;
  height: .5rem;
  background: var(--color-border);
  border-radius: 999px;
  overflow: hidden;
}
.tools-progress-bar-fill {
  height: 100%;
  background: var(--dt-teal, #0d9488);
  border-radius: 999px;
  transition: width .3s ease;
}
.tools-progress-bar-count {
  flex: 0 0 2.5rem;
  text-align: right;
  color: var(--color-text-muted);
  font-size: .78rem;
}

.tools-stale-table {
  width: 100%;
  font-size: .82rem;
  border-collapse: collapse;
}
.tools-stale-table th {
  text-align: left;
  font-size: .73rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .04em;
  color: var(--color-text-muted);
  border-bottom: 2px solid var(--color-border);
  padding: .3rem .45rem;
}
.tools-stale-table td {
  padding: .35rem .45rem;
  border-bottom: 1px solid var(--color-border);
  vertical-align: middle;
}
.tools-stale-table tr:last-child td { border-bottom: none; }
.tools-stale-table a {
  color: var(--color-link);
  text-decoration: none;
  font-weight: 500;
}
.tools-stale-table a:hover { text-decoration: underline; }
.tools-stale-table tr:hover td { background: var(--color-accent-soft); }

/* ── Tool: Relationship Graph ───────────────────────────────────────────────── */

.tools-graph-wrap {
  position: relative;
  width: 100%;
  height: 600px;
  min-height: 500px;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: 12px;
  overflow: hidden;
  margin-top: 1rem;
}

.graph-spinner {
  width: 20px;
  height: 20px;
  border: 2.5px solid var(--color-border);
  border-top-color: var(--color-primary, #0d9488);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  flex-shrink: 0;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.tools-graph-svg {
  width: 100%;
  height: 100%;
  display: block;
}

.tools-graph-controls {
  display: flex;
  flex-wrap: wrap;
  gap: .5rem;
  margin: .75rem 0;
  align-items: center;
}

.tools-graph-btn {
  font-size: .78rem;
  font-weight: 600;
  padding: .28rem .75rem;
  border-radius: 999px;
  border: 1.5px solid var(--color-border);
  background: var(--color-surface);
  color: var(--color-text);
  cursor: pointer;
  transition: background .15s, border-color .15s, color .15s;
}
.tools-graph-btn.active {
  border-color: var(--dt-teal, #0d9488);
  background: var(--dt-teal, #0d9488);
  color: #fff;
}
.tools-graph-btn:hover:not(.active) {
  border-color: var(--dt-teal, #0d9488);
  color: var(--dt-teal, #0d9488);
}

.tools-graph-sep {
  width: 1px;
  height: 1.5rem;
  background: var(--color-border);
  margin: 0 .15rem;
}

.tools-graph-tooltip {
  position: absolute;
  pointer-events: none;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: 8px;
  padding: .5rem .75rem;
  font-size: .8rem;
  max-width: 16rem;
  box-shadow: 0 4px 12px rgba(0,0,0,.15);
  z-index: 10;
  display: none;
}
.tools-graph-tooltip strong {
  display: block;
  font-size: .82rem;
  margin-bottom: .15rem;
}
.tools-graph-tooltip small {
  color: var(--color-text-muted);
  display: block;
}

/* ------------------------------------------------------------------ */
/* Artifact Title Row (with share button)                              */
/* ------------------------------------------------------------------ */
.artifact-title-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
}
.artifact-title-row h1 { flex: 1; }

/* ------------------------------------------------------------------ */
/* Share Menu                                                          */
/* ------------------------------------------------------------------ */
.share-menu { position: relative; flex-shrink: 0; }
.btn-share {
  background: var(--color-primary);
  color: #fff;
  border: none;
  padding: .45rem .9rem;
  border-radius: var(--radius);
  font-size: .82rem;
  cursor: pointer;
  font-weight: 500;
  white-space: nowrap;
}
.btn-share:hover { background: var(--color-primary-dark); }
.share-dropdown {
  position: absolute;
  right: 0;
  top: calc(100% + 4px);
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-md);
  z-index: 20;
  min-width: 10rem;
  overflow: hidden;
}
.share-dropdown button {
  display: block;
  width: 100%;
  text-align: left;
  padding: .55rem .85rem;
  border: none;
  background: none;
  cursor: pointer;
  font-size: .82rem;
  color: var(--color-text);
}
.share-dropdown button:hover {
  background: var(--color-accent-soft);
}

/* ------------------------------------------------------------------ */
/* Toast Notification                                                   */
/* ------------------------------------------------------------------ */
.toast {
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  padding: .7rem 1.2rem;
  border-radius: var(--radius);
  font-size: .85rem;
  font-weight: 500;
  z-index: 9999;
  box-shadow: var(--shadow-md);
  max-width: 24rem;
}
.toast-success { background: var(--color-deployed); color: #fff; }
.toast-error   { background: var(--color-killed);   color: #fff; }

/* ------------------------------------------------------------------ */
/* Notion Comments Panel (slide-out)                                   */
/* ------------------------------------------------------------------ */
.comments-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.35);
  z-index: 100;
}
.comments-panel {
  position: fixed;
  top: 0;
  right: 0;
  width: min(28rem, 90vw);
  height: 100vh;
  background: var(--color-surface);
  border-left: 1px solid var(--color-border);
  box-shadow: -4px 0 16px rgba(0,0,0,.1);
  z-index: 101;
  display: flex;
  flex-direction: column;
}
.comments-panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 1.25rem;
  border-bottom: 1px solid var(--color-border);
}
.comments-panel-header h3 { margin: 0; font-size: 1rem; }
.comments-close {
  background: none;
  border: none;
  font-size: 1.5rem;
  cursor: pointer;
  color: var(--color-text-muted);
  line-height: 1;
}
.comments-close:hover { color: var(--color-text); }
.comments-list {
  flex: 1;
  overflow-y: auto;
  padding: 1rem 1.25rem;
}
.comments-loading,
.comments-empty,
.comments-note {
  color: var(--color-text-muted);
  font-size: .85rem;
  font-style: italic;
}
.comment-item {
  padding: .75rem 0;
  border-bottom: 1px solid var(--color-border);
}
.comment-item:last-child { border-bottom: none; }
.comment-time {
  display: block;
  font-size: .72rem;
  color: var(--color-text-muted);
  margin-bottom: .25rem;
}
.comment-text {
  font-size: .85rem;
  line-height: 1.5;
  color: var(--color-text);
  white-space: pre-wrap;
}
.comments-form {
  padding: 1rem 1.25rem;
  border-top: 1px solid var(--color-border);
}
.comments-form textarea {
  width: 100%;
  padding: .5rem .65rem;
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  font-size: .85rem;
  font-family: var(--font-sans);
  resize: vertical;
  background: var(--color-bg);
  color: var(--color-text);
}
.comments-form textarea:focus {
  outline: none;
  border-color: var(--color-primary);
}
.btn-comment-submit {
  margin-top: .5rem;
  background: var(--color-primary);
  color: #fff;
  border: none;
  padding: .45rem .9rem;
  border-radius: var(--radius);
  font-size: .82rem;
  cursor: pointer;
  font-weight: 500;
}
.btn-comment-submit:hover { background: var(--color-primary-dark); }

/* ── Global stats strip (pod board + all pages) ───────────────────────────── */
.stats-strip {
  display: flex;
  gap: .6rem;
  padding: .5rem 1.2rem;
  flex-wrap: wrap;
  align-items: center;
  border-bottom: 1px solid var(--color-border);
  background: var(--color-bg);
  font-family: 'Inter', system-ui, sans-serif;
}
.stats-pill {
  display: inline-flex;
  align-items: baseline;
  gap: .35rem;
  padding: .25rem .65rem;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: 9999px;
  font-size: .82rem;
  /* `a.stats-pill` inherits the site-wide link colour/underline rules,
     so reset them to match the old `<span>`-based pill appearance.
     Hover is a subtle background bump (no underline) to signal the
     pill is clickable without adding chrome. */
  color: inherit;
  text-decoration: none;
  transition: background .12s ease, border-color .12s ease;
}
a.stats-pill:hover {
  background: var(--color-hover, var(--color-bg));
  border-color: var(--color-primary);
  text-decoration: none;
}
.stats-pill .stats-value {
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  color: var(--color-text);
}
.stats-pill .stats-label {
  color: var(--color-text-muted);
}

/* ──────────────────────────────────────────────────────────────────────────
 * Pod board editor (APEX#329) — layout + chips + drop zone visuals
 * Drag-drop JS lives in Wave D; this file only handles presentation.
 * ────────────────────────────────────────────────────────────────────────── */
.pod-board-page { display: flex; flex-direction: column; gap: 1rem; padding: 1rem 2rem; }
.pod-board-banner { padding: 0.75rem 1rem; margin: 1rem 2rem 0; border-radius: 6px; border: 1px solid; font-size: 0.9rem; }
.pod-board-banner-warning { background: #fef3c7; border-color: #fde68a; color: #92400e; }
.pod-board-banner-warning a { color: #92400e; text-decoration: underline; }
.pod-board-header { display: flex; justify-content: space-between; align-items: center; gap: 1rem; flex-wrap: wrap; }
.pod-board-header h1 { margin: 0; font-size: 1.4rem; }
.pod-board-controls { display: flex; gap: 0.5rem; align-items: center; }
.pod-board-controls button { padding: 0.4rem 0.75rem; border: 1px solid var(--color-border); background: var(--color-surface); border-radius: 6px; font-size: 0.85rem; cursor: pointer; }
.pod-board-controls button[disabled] { opacity: 0.5; cursor: not-allowed; }
.pod-board-view-link { font-size: 0.85rem; color: var(--color-link); text-decoration: none; }
.pod-board-view-link:hover { text-decoration: underline; }
.pod-board-layout { display: grid; grid-template-columns: 280px 1fr; gap: 1.5rem; }

.pod-board-roster { border: 1px solid var(--color-border); border-radius: 8px; padding: 1rem; background: var(--color-surface); align-self: flex-start; }
.pod-board-roster h2 { margin: 0 0 0.75rem 0; font-size: 0.95rem; text-transform: uppercase; letter-spacing: 0.05em; color: var(--color-text-muted); }
.pod-roster-header { display: flex; flex-direction: column; gap: 0.4rem; margin-bottom: 0.75rem; padding-bottom: 0.5rem; border-bottom: 1px solid var(--color-border); }
.pod-roster-header h2 { margin: 0; }
.pod-roster-counts { font-size: 0.8rem; color: var(--color-text-muted); }
.pod-roster-count-other { font-style: italic; }
.pod-roster-filter-toggle { display: inline-flex; align-items: center; gap: 0.4rem; font-size: 0.8rem; cursor: pointer; user-select: none; color: var(--color-text-muted); }
.pod-roster-filter-toggle input[type="checkbox"] { margin: 0; }
.pod-roster-list { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 0.5rem; }
.pod-roster-card { padding: 0.6rem; border: 1px solid var(--color-border); border-radius: 6px; background: var(--color-surface); }
.pod-roster-card[draggable="true"] { cursor: grab; }
.pod-roster-card[draggable="true"]:hover { border-color: var(--color-accent); }
.pod-roster-card.overallocated { border-left: 3px solid #dc2626; }
.pod-roster-card.hidden { display: none; }
.pod-roster-card.out-of-pod { opacity: 0.65; border-left: 3px solid var(--color-border); }
.pod-roster-card.out-of-pod:hover { opacity: 1; }
.roster-home-pod { font-size: 0.7rem; padding: 0.1rem 0.35rem; background: var(--color-bg); border-radius: 4px; color: var(--color-text-muted); }
.roster-name { font-weight: 600; font-size: 0.9rem; color: var(--color-text); }
.roster-meta { display: flex; gap: 0.5rem; align-items: center; margin-top: 0.25rem; font-size: 0.8rem; color: var(--color-text-muted); }
.roster-allocation { font-variant-numeric: tabular-nums; }

.pod-board-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(340px, 1fr)); gap: 1rem; }
.pod-init-card { border: 1px solid var(--color-border); border-radius: 8px; padding: 1rem; background: var(--color-surface); }
.pod-init-card.has-pending { border-left: 3px solid #f59e0b; }
.pod-init-card.is-placeholder { background: var(--color-accent-soft); border-style: dashed; }
.pod-init-header { display: flex; justify-content: space-between; align-items: flex-start; gap: 0.5rem; margin-bottom: 0.75rem; }
.pod-init-header h3 { margin: 0; font-size: 1rem; color: var(--color-text); }

.pod-init-resources { margin-bottom: 0.75rem; }
.pod-init-resources h4,
.pod-init-children h4 {
  margin: 0 0 0.4rem 0;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--color-text-muted);
}
.resource-chips { list-style: none; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: 0.3rem; }
.resource-chip { display: inline-flex; align-items: center; gap: 0.4rem; padding: 0.2rem 0.5rem; background: var(--color-bg); border: 1px solid var(--color-border); border-radius: 9999px; font-size: 0.8rem; }
.resource-chip .allocation-input { width: 3rem; padding: 0.1rem 0.2rem; font-size: 0.75rem; border: 1px solid var(--color-border); border-radius: 4px; }
.resource-chip .allocation-value { font-variant-numeric: tabular-nums; color: var(--color-text-muted); }
.resource-chip .resource-remove { background: none; border: none; cursor: pointer; font-size: 1rem; line-height: 1; padding: 0; color: var(--color-text-muted); }
.resource-drop-hint { font-size: 0.75rem; color: var(--color-text-muted); margin-top: 0.4rem; font-style: italic; }
.pod-init-resources[data-drop-zone="resources"].drag-over { background: var(--color-accent-soft); outline: 2px dashed var(--color-accent); }

.pod-init-children { border-top: 1px solid var(--color-border); padding-top: 0.75rem; }
.children-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 0.4rem; }
.children-filter { display: flex; gap: 0.25rem; }
.filter-chip { padding: 0.15rem 0.5rem; border: 1px solid var(--color-border); border-radius: 9999px; background: transparent; font-size: 0.7rem; cursor: pointer; color: var(--color-text-muted); }
.filter-chip.active { background: var(--color-primary); color: var(--color-header-text); border-color: var(--color-primary); }
.children-list { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 0.3rem; }
.child-item { display: flex; gap: 0.4rem; align-items: center; font-size: 0.85rem; }
.child-item.hidden { display: none; }

.badge.placeholder { background: #fef3c7; color: #92400e; }
.badge.type-proposal { background: #ddd6fe; color: #5b21b6; }
.badge.type-experiment { background: #fce7f3; color: #9d174d; }

.pod-board-link { display: inline-block; margin-top: 0.5rem; font-size: 0.85rem; color: var(--color-link); text-decoration: none; }
.pod-board-link:hover { text-decoration: underline; }

/* ---------- Pod Board (Wave D: drag-drop + dialogs) ---------- */
.pod-roster-card.dragging { opacity: 0.5; }
.pod-init-resources[data-drop-zone="resources"].drag-over {
  background: var(--color-accent-soft, #eaffbe);
  outline: 2px dashed var(--color-accent, #c4ff45);
}

dialog#pb-submit-dialog,
dialog#pb-new-dialog {
  border: 1px solid var(--color-border, #dde1e2);
  border-radius: 12px;
  padding: 1.5rem;
  max-width: 520px;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15);
  background: var(--color-surface, #ffffff);
  color: var(--color-text, #0d1f22);
}
dialog#pb-submit-dialog::backdrop,
dialog#pb-new-dialog::backdrop { background: rgba(0, 0, 0, 0.4); }
dialog#pb-submit-dialog h2,
dialog#pb-new-dialog h2 { margin: 0 0 0.75rem 0; font-size: 1.1rem; }
dialog#pb-new-dialog label {
  display: block;
  margin: 0.75rem 0 0.25rem 0;
  font-size: 0.85rem;
  font-weight: 600;
}
dialog#pb-new-dialog input[type="text"] {
  width: 100%;
  padding: 0.5rem;
  border: 1px solid var(--color-border, #dde1e2);
  border-radius: 6px;
  font-size: 0.9rem;
  box-sizing: border-box;
}
.pb-dialog-actions {
  display: flex;
  justify-content: flex-end;
  gap: 0.5rem;
  margin-top: 1rem;
}
.pb-dialog-actions button {
  padding: 0.5rem 1rem;
  border: 1px solid var(--color-border, #dde1e2);
  border-radius: 6px;
  background: var(--color-surface, #ffffff);
  color: var(--color-text, #0d1f22);
  cursor: pointer;
  font-size: 0.85rem;
}
.pb-dialog-actions button.primary {
  background: var(--color-primary, #1c4747);
  color: #ffffff;
  border-color: var(--color-primary, #1c4747);
}
.pb-dialog-actions button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}
.pb-dialog-hint {
  font-size: 0.85rem;
  color: var(--color-text-muted, #5a6e72);
  margin: 0.5rem 0 0 0;
}
.pb-dialog-error {
  color: #991b1b;
  font-size: 0.85rem;
  margin-top: 0.5rem;
  min-height: 1em;
}
.pb-change-list {
  list-style: none;
  padding: 0;
  margin: 0.5rem 0;
  max-height: 300px;
  overflow-y: auto;
  border: 1px solid var(--color-border, #dde1e2);
  border-radius: 6px;
}
.pb-change-list li {
  padding: 0.4rem 0.6rem;
  border-bottom: 1px solid var(--color-border, #dde1e2);
  font-size: 0.8rem;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}
.pb-change-list li:last-child { border-bottom: none; }

#pb-toast {
  position: fixed;
  top: 1rem;
  right: 1rem;
  padding: 0.75rem 1rem;
  background: #991b1b;
  color: #ffffff;
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  z-index: 9999;
  max-width: 400px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s;
  font-size: 0.85rem;
}
#pb-toast.visible { opacity: 1; pointer-events: auto; }

.child-item.hidden { display: none; }

.pod-board-selector { display: inline-flex; align-items: center; }
.pod-board-selector select {
  padding: 0.35rem 0.6rem;
  border: 1px solid var(--color-border);
  border-radius: 6px;
  background: var(--color-surface);
  font-size: 0.9rem;
  font-family: inherit;
  min-width: 160px;
  cursor: pointer;
}
.pod-board-selector select:hover { border-color: var(--color-link); }
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}

/* ---------- Pod Board (Phase 2 UX bundle: #338 / #340 / #345) ---------- */

/* #338, #340: structured dialog form fields shared by Submit + New
   Initiative dialogs. */
.pb-dialog-field {
  display: block;
  margin: 0.75rem 0 0.25rem 0;
  font-size: 0.85rem;
  font-weight: 600;
}
.pb-dialog-field > span {
  display: block;
  margin-bottom: 0.25rem;
}
.pb-dialog-field input[type="text"],
.pb-dialog-field select,
.pb-dialog-field textarea {
  width: 100%;
  padding: 0.5rem;
  border: 1px solid var(--color-border, #dde1e2);
  border-radius: 6px;
  font-size: 0.9rem;
  font-family: inherit;
  box-sizing: border-box;
}
.pb-dialog-field textarea {
  resize: vertical;
  min-height: 3rem;
}
.pb-required { color: #991b1b; font-weight: 600; }
.pb-optional {
  color: var(--color-text-muted, #5a6e72);
  font-weight: 400;
  font-size: 0.75rem;
}

/* #345a: just-changed pulse highlight on initiative cards. */
.pod-init-card.just-changed {
  animation: pb-pulse 1.5s ease-out;
}
@keyframes pb-pulse {
  0%   { box-shadow: 0 0 0 0 rgba(59, 130, 246, 0.5); }
  50%  { box-shadow: 0 0 0 8px rgba(59, 130, 246, 0.15); }
  100% { box-shadow: 0 0 0 0 rgba(59, 130, 246, 0); }
}

/* #345c: overallocation drilldown tooltip. */
.pod-roster-card { position: relative; }
.pod-roster-card .roster-allocations-popover {
  display: none;
  position: absolute;
  z-index: 10;
  background: var(--color-surface, #ffffff);
  border: 1px solid var(--color-border, #dde1e2);
  border-radius: 6px;
  padding: 0.6rem;
  font-size: 0.75rem;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  min-width: 220px;
  left: 100%;
  top: 0;
  margin-left: 0.5rem;
}
.pod-roster-card .roster-allocations-popover strong {
  display: block;
  margin-bottom: 0.3rem;
  color: var(--color-text, #0d1f22);
}
.pod-roster-card .roster-allocations-popover ul {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}
.pod-roster-card.overallocated:hover .roster-allocations-popover {
  display: block;
}

/* #345d: drag-to-reorder visual affordances on initiative cards. */
.pod-init-card[draggable="true"] { cursor: grab; }
.pod-init-card.dragging { opacity: 0.5; }
.pod-init-card.drop-target {
  outline: 2px dashed var(--color-accent, #c4ff45);
  outline-offset: 2px;
}

/* ── Mobile nav ── */
.hamburger-btn {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: .375rem;
  color: var(--text-secondary);
  border-radius: var(--radius);
  line-height: 0;
}
.hamburger-btn:hover { background: var(--bg-hover); }
.hamburger-btn .bar { display: block; width: 22px; height: 2px; background: currentColor; border-radius: 1px; transition: transform .2s, opacity .2s; }
.hamburger-btn .bar + .bar { margin-top: 5px; }

/* Animate to X when open */
.nav-open .hamburger-btn .bar:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-open .hamburger-btn .bar:nth-child(2) { opacity: 0; }
.nav-open .hamburger-btn .bar:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

@media (max-width: 768px) {
  .hamburger-btn { display: flex; flex-direction: column; justify-content: center; order: 3; }
}

/* ── Notion Sync Panel ── */
/* ── Notion link bar ─────────────────────────────────────────────── */
.notion-link-bar { margin-bottom: 1rem; }
.notion-link-btn {
  display: inline-flex;
  align-items: center;
  gap: .45rem;
  padding: .4rem .85rem;
  border-radius: var(--radius);
  border: 1px solid var(--color-border);
  background: var(--color-surface);
  color: var(--color-text);
  font-size: .85rem;
  font-weight: 500;
  text-decoration: none;
  transition: background .15s, border-color .15s;
}
.notion-link-btn:hover {
  background: var(--color-surface-raised);
  border-color: var(--color-text-muted);
}

/* Artifact link bar — GitHub + Notion links below artifact header */
.artifact-link-bar {
  display: flex;
  align-items: center;
  gap: .6rem;
  margin-bottom: 1rem;
  flex-wrap: wrap;
}
.artifact-gh-link {
  display: inline-flex;
  align-items: center;
  gap: .3rem;
  padding: .4rem .85rem;
  border-radius: var(--radius);
  border: 1px solid var(--color-border);
  background: var(--color-surface);
  color: var(--color-text-muted);
  font-size: .85rem;
  font-weight: 500;
  text-decoration: none;
  transition: background .15s, border-color .15s, color .15s;
}
.artifact-gh-link:hover {
  background: var(--color-surface-raised);
  border-color: var(--color-text-muted);
  color: var(--color-text);
}

/* Git notes panel — APEX#81 */
.notes-panel {
  margin: 1rem 0;
  border: 1px solid var(--color-border);
  border-radius: var(--radius, 6px);
  background: var(--color-surface);
  padding: .25rem .75rem;
}
.notes-panel > summary {
  cursor: pointer;
  font-weight: 600;
  padding: .5rem 0;
  list-style: none;
}
.notes-body {
  padding: .5rem 0;
}
.notes-loading,
.notes-empty,
.notes-error {
  margin: .25rem 0;
  color: var(--color-text-muted);
  font-size: .9rem;
}
.notes-error {
  color: #b91c1c;
}
.note-card {
  border-left: 3px solid #d1d5db;
  padding: .5rem .75rem;
  margin: .5rem 0;
  background: var(--color-surface);
  border-radius: 4px;
}
.note-card.note-type-review { border-left-color: #2563eb; }
.note-card.note-type-question { border-left-color: #d97706; }
.note-card.note-type-decision { border-left-color: #059669; }
.note-card.note-type-general { border-left-color: #6b7280; }
.note-meta {
  font-size: .8rem;
  color: var(--color-text-muted);
  margin-bottom: .25rem;
  display: flex;
  flex-wrap: wrap;
  gap: .5rem;
  align-items: center;
}
.note-type-badge {
  display: inline-block;
  padding: .1rem .5rem;
  border-radius: 999px;
  font-size: .7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .03em;
  color: #fff;
}
.note-type-badge.note-type-review { background: #2563eb; }
.note-type-badge.note-type-question { background: #d97706; }
.note-type-badge.note-type-decision { background: #059669; }
.note-type-badge.note-type-general { background: #6b7280; }
.note-sha {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: .75rem;
  background: #f3f4f6;
  padding: 0 .35rem;
  border-radius: 3px;
}
.note-text {
  white-space: pre-wrap;
  font-size: .92rem;
  color: var(--color-text);
}
.notes-add {
  margin-top: .75rem;
  display: flex;
  flex-direction: column;
  gap: .5rem;
}
.notes-add textarea {
  width: 100%;
  padding: .5rem;
  border: 1px solid var(--color-border);
  border-radius: 4px;
  font-family: inherit;
  font-size: .9rem;
  resize: vertical;
}
.notes-add button {
  align-self: flex-start;
}

/* ── Cmd+K command palette badge in nav ───────────────────────────── */
.cmdk-badge {
  align-items: center;
  background: rgba(255, 255, 255, .08);
  border: 1px solid rgba(255, 255, 255, .18);
  border-radius: 6px;
  color: var(--color-header-nav);
  cursor: pointer;
  display: inline-flex;
  font-family: inherit;
  font-size: .72rem;
  font-weight: 600;
  height: 26px;
  padding: 0 .5rem;
  transition: background .15s ease, color .15s ease;
}
.cmdk-badge:hover {
  background: rgba(255, 255, 255, .15);
  color: var(--color-header-nav-hover);
}
.cmdk-badge .cmdk-key { letter-spacing: .03em; }

/* ── Cmd+K command palette dialog ─────────────────────────────────── */
.cmdk-dialog {
  background: transparent;
  border: none;
  border-radius: 12px;
  margin: 0 auto;
  margin-top: 12vh;
  padding: 0;
  max-width: 600px;
  width: 92vw;
}
.cmdk-dialog::backdrop {
  background: rgba(6, 30, 33, .55);
  backdrop-filter: blur(2px);
}
.cmdk-inner {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: 12px;
  box-shadow: 0 20px 60px rgba(6, 30, 33, .35);
  display: flex;
  flex-direction: column;
  max-height: 70vh;
  overflow: hidden;
}
.cmdk-input {
  background: transparent;
  border: none;
  border-bottom: 1px solid var(--color-border);
  color: var(--color-text);
  font-family: inherit;
  font-size: 1rem;
  outline: none;
  padding: .9rem 1rem;
  width: 100%;
}
.cmdk-results {
  flex: 1;
  overflow-y: auto;
  padding: .35rem 0;
}
.cmdk-section {
  color: var(--color-text-muted);
  font-size: .68rem;
  font-weight: 600;
  letter-spacing: .08em;
  padding: .5rem 1rem .25rem;
  text-transform: uppercase;
}
.cmdk-row {
  align-items: center;
  cursor: pointer;
  display: flex;
  font-size: .9rem;
  gap: .65rem;
  padding: .5rem 1rem;
}
.cmdk-row.active {
  background: var(--color-bg);
}
.cmdk-icon {
  flex-shrink: 0;
  font-size: 1rem;
  width: 1.25rem;
  text-align: center;
}
.cmdk-label {
  color: var(--color-text);
  flex: 1;
}
.cmdk-meta {
  color: var(--color-text-muted);
  font-family: var(--font-mono, monospace);
  font-size: .72rem;
}
.cmdk-empty {
  color: var(--color-text-muted);
  font-style: italic;
  padding: 1rem;
  text-align: center;
}
.cmdk-footer {
  border-top: 1px solid var(--color-border);
  color: var(--color-text-muted);
  display: flex;
  font-size: .7rem;
  gap: 1rem;
  padding: .5rem 1rem;
}
.cmdk-footer kbd {
  background: var(--color-bg);
  border: 1px solid var(--color-border);
  border-radius: 3px;
  font-family: var(--font-mono, monospace);
  font-size: .68rem;
  margin-right: .25rem;
  padding: 1px 4px;
}
[data-theme="dark"] .cmdk-inner {
  box-shadow: 0 20px 60px rgba(0, 0, 0, .65);
}

/* Hide cmdk-badge on small screens */
@media (max-width: 880px) {
  .cmdk-badge { display: none; }
}

/* ── Chat widget intent chips ─────────────────────────────────────── */
.apex-widget-intents {
  display: flex;
  flex-wrap: nowrap;
  gap: .35rem;
  overflow-x: auto;
  padding: .4rem .75rem .15rem;
  scrollbar-width: none;
}
.apex-widget-intents::-webkit-scrollbar { display: none; }
.apex-intent-chip {
  background: var(--color-bg);
  border: 1px solid var(--color-border);
  border-radius: 999px;
  color: var(--color-text);
  cursor: pointer;
  flex-shrink: 0;
  font-family: inherit;
  font-size: .72rem;
  padding: .25rem .6rem;
  transition: background .15s ease, border-color .15s ease;
  white-space: nowrap;
}
.apex-intent-chip:hover {
  background: var(--color-hover, var(--color-surface));
  border-color: var(--color-primary);
}

/* ── Fixed header + fixed sidebar layout ────────────────────────────── */
:root {
  --header-height: 56px;
  --sidebar-width: 220px;
}

.site-layout {
  min-height: 100vh;
}

/* Top header — fixed full-width above everything */
.site-topbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: var(--header-height);
  background: var(--color-header-bg);
  color: var(--color-header-text);
  border-bottom: 1px solid rgba(255,255,255,.08);
  box-shadow: 0 1px 3px rgba(0,0,0,.06);
  display: flex;
  align-items: center;
  padding: 0 1rem;
  gap: .85rem;
  z-index: 100;
}
.topbar-brand {
  display: inline-flex;
  align-items: center;
  gap: .55rem;
  font-weight: 700;
  font-size: 1rem;
}
.topbar-brand-home {
  display: inline-flex;
  align-items: center;
  gap: inherit;
  color: var(--color-header-text);
  text-decoration: none;
}
.topbar-brand-home:hover { text-decoration: none; color: var(--color-accent); }
.topbar-brand-logo { height: 22px; width: auto; display: block; }
.topbar-brand-name { white-space: nowrap; }
.topbar-brand-version {
  font-size: .65rem;
  font-weight: 600;
  white-space: nowrap;
  /* Rendered as an <a> linking to /changelog — strip hyperlink chrome so
     it still reads as a plain version label, just clickable. Use a subtle
     pill with full-opacity header text so the version stays readable
     against the dark topbar (WCAG AA — #eaffbe on #061e21 ≈ 14:1). */
  color: var(--color-header-text);
  background: rgba(234,255,190,.12);
  padding: .12rem .4rem;
  border-radius: 999px;
  text-decoration: none;
  cursor: pointer;
}
.topbar-brand-version:hover {
  background: rgba(196,255,69,.2);
  color: var(--color-accent);
  text-decoration: none;
}

.topbar-context {
  flex: 1;
  font-size: .9rem;
  color: var(--color-header-nav);
  font-weight: 500;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.topbar-actions {
  display: flex;
  align-items: center;
  gap: .5rem;
}

/* Sidebar — fixed below header */
.site-sidebar {
  position: fixed;
  top: var(--header-height);
  left: 0;
  bottom: 0;
  width: var(--sidebar-width);
  background: var(--color-header-bg);
  color: var(--color-header-nav);
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  border-right: 1px solid rgba(255,255,255,.06);
  z-index: 90;
}

/* Site body — main content area, offset for header + sidebar */
.site-body {
  display: flex;
  flex-direction: column;
  min-width: 0;
  margin-left: var(--sidebar-width);
  padding-top: var(--header-height);
  min-height: 100vh;
}
.site-body .main-content { flex: 1; padding: 1.5rem 2rem; max-width: none; margin: 0; width: auto; }

/* Nav */
.sidebar-nav {
  flex: 1;
  padding: .5rem .35rem;
  overflow-y: auto;
}
.sidebar-nav .sb-link,
.sidebar-nav .sb-summary {
  display: flex;
  align-items: center;
  gap: .55rem;
  padding: .45rem .65rem;
  border-radius: 6px;
  color: var(--color-header-nav);
  font-size: .88rem;
  text-decoration: none;
  cursor: pointer;
  user-select: none;
  list-style: none;
}
.sidebar-nav .sb-link:hover,
.sidebar-nav .sb-summary:hover {
  background: rgba(255,255,255,.05);
  color: var(--color-header-nav-hover);
  text-decoration: none;
}
.sidebar-nav .sb-link[aria-current="page"] {
  background: rgba(196,255,69,.08);
  color: var(--color-accent);
  border-left: 2px solid var(--color-accent);
  padding-left: calc(.65rem - 2px);
}
.sidebar-nav .sb-icon { font-size: 1rem; flex-shrink: 0; width: 1.25rem; text-align: center; }
.sidebar-nav .sb-label { flex: 1; }
.sidebar-nav .sb-caret { font-size: .7rem; opacity: .55; transition: transform .15s; }
.sidebar-nav details[open] > .sb-summary .sb-caret { transform: rotate(90deg); }

.sidebar-nav details > .sb-summary::-webkit-details-marker { display: none; }
.sidebar-nav details > .sb-summary { list-style: none; }
.sidebar-nav details .sb-children {
  display: flex;
  flex-direction: column;
  margin: .15rem 0 .25rem 1.4rem;
  gap: 1px;
}
.sidebar-nav details .sb-children .sb-link {
  font-size: .82rem;
  padding: .35rem .55rem;
}
.sidebar-nav .sb-divider {
  border: none;
  border-top: 1px solid rgba(255,255,255,.06);
  margin: .5rem .35rem;
}
.sidebar-nav .sb-cta {
  display: flex;
  align-items: center;
  gap: .55rem;
  margin: .35rem .35rem;
  padding: .5rem .75rem;
  border-radius: 6px;
  border: 1px solid rgba(196,255,69,.35);
  color: var(--color-accent);
  font-weight: 600;
  font-size: .85rem;
  text-decoration: none;
}
.sidebar-nav .sb-cta:hover {
  background: var(--color-accent);
  color: var(--color-header-bg);
  text-decoration: none;
}

/* Sidebar footer */
.sidebar-footer {
  padding: .65rem .5rem;
  border-top: 1px solid rgba(255,255,255,.06);
  display: flex;
  flex-direction: column;
  gap: .5rem;
}
.sidebar-footer .theme-toggle { justify-content: center; }
.sidebar-footer .profile-menu { width: 100%; }
.sidebar-footer .profile-trigger {
  width: 100%;
  display: flex;
  align-items: center;
  gap: .55rem;
  padding: .35rem .5rem;
  border-radius: 6px;
  color: var(--color-header-nav);
}
.sidebar-footer .profile-trigger:hover { background: rgba(255,255,255,.05); }
.sidebar-footer .profile-trigger .sb-profile-name {
  font-size: .8rem;
  color: var(--color-header-text);
  flex: 1;
  text-align: left;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.sidebar-footer .profile-dropdown { bottom: calc(100% + 8px); top: auto; right: auto; left: 0; min-width: 230px; }
.sidebar-footer .btn-signin,
.sidebar-footer .btn-google-signin {
  width: 100%;
  justify-content: center;
}

/* Right-side container in topbar: theme toggle + auth */
.topbar-right {
  display: flex;
  align-items: center;
  gap: .6rem;
  margin-left: auto;
  flex-shrink: 0;
  white-space: nowrap;
  min-width: 0;
}

/* Theme toggle inside topbar — compact, header-coloured */
.topbar-theme-toggle {
  display: flex;
  align-items: center;
  gap: 2px;
  background: rgba(255,255,255,.06);
  border-radius: 6px;
  padding: 2px;
}
.topbar-theme-toggle button {
  background: transparent;
  border: none;
  border-radius: 4px;
  color: var(--color-header-nav);
  cursor: pointer;
  font-size: .75rem;
  height: 24px;
  line-height: 1;
  padding: 0 6px;
  transition: background .15s, color .15s;
}
.topbar-theme-toggle button:hover { background: rgba(255,255,255,.1); color: var(--color-header-text); }
.topbar-theme-toggle button.active { background: rgba(196,255,69,.2); color: var(--color-accent); }

/* Profile menu in topbar */
.topbar-profile-menu .profile-dropdown {
  top: calc(100% + 10px);
  right: 0;
  min-width: 220px;
}
/* Prevent topbar profile trigger from expanding and wrapping */
.topbar-profile-menu .profile-trigger {
  flex-shrink: 0;
}
/* Truncate long display names in the topbar */
.topbar-profile-menu .profile-display-name {
  display: inline-block;
  max-width: 120px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  vertical-align: middle;
}

/* Sign-in links in topbar (unauthenticated state) */
.topbar-signin-links {
  display: flex;
  align-items: center;
  gap: .4rem;
}
.topbar-signin-btn {
  display: inline-flex;
  align-items: center;
  gap: .35rem;
  background: rgba(255,255,255,.08);
  border: 1px solid rgba(255,255,255,.14);
  border-radius: 6px;
  color: var(--color-header-text);
  font-size: .78rem;
  font-weight: 500;
  padding: 4px 10px;
  text-decoration: none;
  transition: background .15s;
  white-space: nowrap;
}
.topbar-signin-btn:hover { background: rgba(255,255,255,.15); text-decoration: none; color: var(--color-header-text); }
.topbar-signin-btn .github-icon { fill: currentColor; }

/* Hide sign-in labels and profile display name on small screens to save space */
@media (max-width: 480px) {
  .topbar-signin-label { display: none; }
  .topbar-theme-toggle { display: none; }
  .topbar-profile-menu .profile-display-name { display: none; }
}

/* Cmd+K badge in topbar */
.site-topbar .cmdk-badge {
  background: rgba(255,255,255,.08);
  border-color: rgba(255,255,255,.12);
  color: var(--color-header-nav);
}
.site-topbar .cmdk-badge:hover {
  background: rgba(255,255,255,.14);
  color: var(--color-header-text);
}

/* Hamburger button in topbar (mobile only) */
.site-topbar .hamburger-btn {
  display: none;
  color: var(--color-header-text);
}
.site-topbar .hamburger-btn:hover { background: rgba(255,255,255,.08); }

/* Sidebar overlay for mobile */
.sidebar-overlay {
  display: none;
  position: fixed;
  top: var(--header-height);
  left: 0; right: 0; bottom: 0;
  background: rgba(0,0,0,.4);
  z-index: 85;
}

/* Mobile (≤768px): off-canvas sidebar */
@media (max-width: 768px) {
  .site-sidebar {
    transform: translateX(-100%);
    transition: transform .2s ease;
    width: 260px;
    z-index: 95;
  }
  .site-layout.sidebar-open .site-sidebar { transform: translateX(0); }
  .site-layout.sidebar-open .sidebar-overlay { display: block; }
  .site-body {
    margin-left: 0;
  }
  .site-body .main-content { padding: 1rem 1.25rem; }
  .site-topbar .hamburger-btn {
    display: flex;
    flex-direction: column;
    justify-content: center;
  }
  .topbar-brand-version { display: none; }
}

/* ── Me-tab Action Queue (Needs Your Input) ───────────────────────── */
.action-queue {
  margin-bottom: 2rem;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: 8px;
  padding: 1.25rem 1.5rem;
}
.action-queue--empty {
  background: transparent;
  border-style: dashed;
}
.action-queue-heading {
  font-size: 1rem;
  font-weight: 600;
  margin: 0 0 1rem 0;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.action-queue-clear {
  color: var(--color-text-muted);
  font-size: 0.9rem;
}
.action-queue-list {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}
.action-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.75rem 1rem;
  border-radius: 6px;
  background: var(--color-bg);
  border-left: 3px solid var(--color-border);
  gap: 1rem;
}
.action-item--review_requested { border-left-color: var(--color-accent); }
.action-item--changes_requested { border-left-color: #dc3545; }
.action-item--blocked { border-left-color: #f59e0b; }
.action-item-body { flex: 1; min-width: 0; }
.action-item-title {
  display: block;
  font-weight: 500;
  color: var(--color-text);
  text-decoration: none;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.action-item-title:hover { text-decoration: underline; }
.action-item-meta {
  font-size: 0.8rem;
  color: var(--color-text-muted);
}
.action-item-cta { flex-shrink: 0; }
[data-theme="dark"] .action-item--changes_requested { border-left-color: #f87171; }
[data-theme="dark"] .action-item--blocked { border-left-color: #fbbf24; }

/* ── Shared feed layout (What's New + Changelog) ──────────────────────
   Why:  /whats-new and /changelog present the same visual feed — avatar,
         meta row, optional chips, body. These .feed-* classes are the
         single source of truth shared by both pages via the feed_item
         macro in macros.html. */
.feed-page { max-width: 900px; }
.feed-header { margin-bottom: 1.5rem; }
.feed-header h1 { margin: 0 0 .25rem; font-size: 1.6rem; }
.feed-sub { color: var(--color-text-muted); font-size: .9rem; margin: 0; }
.feed-empty {
  padding: 2rem 1rem .5rem;
  text-align: center;
  color: var(--color-text-muted);
  margin: 1.5rem 0 0;
}
.feed-empty-sub {
  text-align: center;
  color: var(--color-text-muted);
  font-size: .85rem;
  margin: 0 0 1rem;
}
.feed-list { list-style: none; padding: 0; margin: 0; }
.feed-item {
  display: flex;
  gap: .75rem;
  align-items: flex-start;
  padding: .9rem 0;
  border-bottom: 1px solid var(--color-border);
}
.feed-item:last-child { border-bottom: none; }

.feed-avatar {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  font-weight: 700;
  font-size: .85rem;
}
/* Circle — author initials on What's New. Per-entry hue rotation keeps
   authors visually distinct without a hashing helper. */
.feed-avatar--circle {
  width: 2rem;
  height: 2rem;
  border-radius: 50%;
  background: hsl(var(--avatar-hue, 200) 60% 45%);
  color: #fff;
}
[data-theme="dark"] .feed-avatar--circle {
  background: hsl(var(--avatar-hue, 200) 55% 42%);
}
/* Pill — version tag on Changelog. Wider than tall. */
.feed-avatar--pill {
  height: 2rem;
  border-radius: 999px;
  padding: 0 .65rem;
  background: var(--color-primary);
  color: var(--color-header-text);
  font-size: .8rem;
  white-space: nowrap;
}
[data-theme="dark"] .feed-avatar--pill {
  background: var(--color-accent);
  color: #0a1a1d;
}

.feed-body { flex: 1; min-width: 0; }
.feed-meta {
  display: flex;
  gap: .6rem;
  align-items: baseline;
  font-size: .8rem;
  color: var(--color-text-muted);
  margin-bottom: .2rem;
}
.feed-meta-left { font-weight: 600; color: var(--color-text); }
.feed-meta-right {
  display: inline-flex;
  align-items: baseline;
  gap: .5rem;
  margin-left: auto;
}
.feed-meta-sep { color: var(--color-text-muted); opacity: .6; }
.feed-author { font-weight: 600; color: var(--color-text); }
.feed-sha {
  font-family: var(--font-mono, monospace);
  font-size: .7rem;
  color: var(--color-text-muted);
  text-decoration: none;
  padding: 1px 4px;
  border-radius: 3px;
}
.feed-sha:hover {
  color: var(--color-primary);
  background: var(--color-bg);
  text-decoration: none;
}
.feed-time {
  color: var(--color-text-muted);
  font-size: .78rem;
}
.muted { color: var(--color-text-muted); }
.feed-message {
  font-size: .82rem;
  color: var(--color-text-muted);
  margin-top: .35rem;
  word-break: break-word;
}
.feed-chips {
  list-style: none;
  padding: 0;
  margin: .15rem 0 0;
  display: flex;
  flex-wrap: wrap;
  gap: .35rem;
}
.feed-chip {
  display: inline-block;
  padding: .15rem .55rem;
  background: var(--color-bg);
  border: 1px solid var(--color-border);
  border-radius: 999px;
  font-size: .78rem;
  color: var(--color-text);
  text-decoration: none;
  max-width: 320px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.feed-chip:hover {
  border-color: var(--color-primary);
  text-decoration: none;
}
.feed-files {
  font-size: .75rem;
  margin-top: .3rem;
}
.feed-files code {
  font-size: .72rem;
  background: var(--color-bg);
  padding: 1px 4px;
  border-radius: 3px;
}

/* Meta-row pills/links shared by both feeds. */
.feed-date-pill {
  display: inline-flex;
  align-items: center;
  padding: .15rem .55rem;
  background: var(--color-bg);
  border: 1px solid var(--color-border);
  border-radius: 999px;
  font-size: .75rem;
  color: var(--color-text-muted);
}
.feed-latest-pill {
  display: inline-flex;
  align-items: center;
  padding: .15rem .55rem;
  background: var(--color-primary);
  color: var(--color-header-text);
  border-radius: 999px;
  font-size: .7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .4px;
}
[data-theme="dark"] .feed-latest-pill {
  background: var(--color-accent);
  color: #0a1a1d;
}
.feed-tag-link {
  font-size: .78rem;
  color: var(--color-text-muted);
  text-decoration: none;
}
.feed-tag-link:hover { color: var(--color-primary); text-decoration: underline; }

/* Colour-coded changelog section bullets, reused inside the feed body. */
.feed-section { margin-top: .7rem; }
.feed-section h3 {
  margin: 0 0 .3rem;
  font-size: .8rem;
  text-transform: uppercase;
  letter-spacing: .5px;
  color: var(--color-text-muted);
}
.feed-section ul {
  list-style: none;
  margin: 0;
  padding: 0;
}
.feed-section li {
  position: relative;
  padding-left: 1.1rem;
  font-size: .88rem;
  line-height: 1.55;
  margin-bottom: .15rem;
  color: var(--color-text);
}
.feed-section li::before {
  content: "";
  position: absolute;
  left: 0;
  top: .55em;
  width: 7px;
  height: 7px;
  border-radius: 50%;
}
.feed-section.sec-added   li::before { background: #22c55e; }
.feed-section.sec-fixed   li::before { background: #3b82f6; }
.feed-section.sec-changed li::before { background: #f59e0b; }
.feed-section.sec-other   li::before { background: var(--color-border); }

/* ── Sidebar "new activity" badge dot ─────────────────────────────── */
.sb-badge-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #f59e0b;
  margin-left: auto;
  flex-shrink: 0;
  box-shadow: 0 0 0 2px var(--color-surface, transparent);
}
[data-theme="dark"] .sb-badge-dot { background: #fbbf24; }

/* ── APEX News (AI daily briefing card) ───────────────── */
.apex-news {
  margin: 0 0 1.5rem;
}
.apex-news-card {
  background: linear-gradient(135deg,
    color-mix(in srgb, var(--dt-lime) 10%, var(--color-surface)),
    var(--color-surface) 70%);
  border: 1px solid color-mix(in srgb, var(--dt-lime) 35%, var(--color-border));
  border-radius: 14px;
  padding: 1.1rem 1.4rem 1.2rem;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
}
/* Tighter variant for "Today in APEX" above the dashboard tabs —
   the card must not dominate the page; prose is clipped with a fade
   and revealed via a More/Less toggle. */
.apex-news-card--compact {
  padding: 0.7rem 1rem 0.6rem;
  border-radius: 12px;
}
.apex-news-card--compact .apex-news-header {
  margin-bottom: 0.35rem;
}
.apex-news-card--compact .apex-news-title {
  font-size: 0.95rem;
}
.apex-news-card--compact .apex-news-body {
  font-size: 0.85rem;
  line-height: 1.55;
}
/* Body wrapper holds the prose + fade overlay. max-height transitions
   between the collapsed clip (~120px ≈ 4 lines @ 0.85rem/1.55) and a
   generous expanded ceiling so the card animates open.
   NOTE: max-height + overflow live on the *wrap*, not the inner body, so
   the absolutely-positioned fade overlay clips at the same boundary. */
.apex-news-body-wrap {
  position: relative;
}
.apex-news-card--compact .apex-news-body-wrap {
  max-height: 120px;
  overflow: hidden;
  transition: max-height 0.35s ease;
}
[data-expanded="true"] .apex-news-card--compact .apex-news-body-wrap {
  max-height: 9999px;
}
/* Gradient fade at the bottom of the clipped prose — uses
   --color-surface so it blends in light + dark modes. */
.apex-news-fade {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 36px;
  pointer-events: none;
  background: linear-gradient(to bottom,
    color-mix(in srgb, var(--color-surface) 0%, transparent),
    var(--color-surface) 92%);
  transition: opacity 0.2s ease;
}
[data-expanded="true"] .apex-news-fade {
  opacity: 0;
}
/* More/Less toggle — small inline link, not a button-y CTA. */
.apex-news-toggle {
  appearance: none;
  background: transparent;
  border: 0;
  padding: 0.25rem 0;
  margin-top: 0.3rem;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--color-text-muted);
  cursor: pointer;
  letter-spacing: 0.02em;
}
.apex-news-toggle:hover {
  color: var(--color-text);
}
.apex-news-toggle .apex-news-toggle-less { display: none; }
[data-expanded="true"] .apex-news-toggle .apex-news-toggle-more { display: none; }
[data-expanded="true"] .apex-news-toggle .apex-news-toggle-less { display: inline; }
.apex-news-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 0.6rem;
  flex-wrap: wrap;
}
.apex-news-title {
  margin: 0;
  font-size: 1.05rem;
  font-weight: 700;
  letter-spacing: 0.01em;
  color: var(--color-text);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.apex-news-title::before {
  content: "📰";
  font-size: 1rem;
}
.apex-news-stats {
  font-size: 0.78rem;
  color: var(--color-text);
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.02em;
}
.apex-news-stats strong {
  font-weight: 700;
}
.apex-news-body {
  font-size: 0.92rem;
  line-height: 1.65;
  color: var(--color-text);
}
.apex-news-body p {
  margin: 0 0 0.5rem;
}
.apex-news-body p:last-child {
  margin-bottom: 0;
}
.apex-news-body a {
  color: #2563eb;
  text-decoration: underline;
  text-underline-offset: 2px;
}
[data-theme="dark"] .apex-news-body a {
  color: #7dd3fc;
}
.apex-news-body a:hover {
  opacity: 0.8;
}
.apex-news-fallback,
.apex-news-quiet {
  font-style: italic;
  color: var(--color-text-muted);
  margin: 0;
}
/* Loading skeleton */
.apex-news-skeleton {
  display: inline-block;
  background: linear-gradient(90deg,
    color-mix(in srgb, var(--color-text) 6%, transparent),
    color-mix(in srgb, var(--color-text) 12%, transparent),
    color-mix(in srgb, var(--color-text) 6%, transparent));
  background-size: 200% 100%;
  animation: apex-news-shimmer 1.4s ease-in-out infinite;
  border-radius: 4px;
}
.apex-news-skeleton--stats {
  width: 200px;
  height: 0.78rem;
}
.apex-news-skeleton--body {
  width: 100%;
  height: 3.6rem;
}
@keyframes apex-news-shimmer {
  0% { background-position: 100% 0; }
  100% { background-position: -100% 0; }
}
[data-theme="dark"] .apex-news-card {
  background: linear-gradient(135deg,
    color-mix(in srgb, var(--dt-lime) 8%, var(--color-surface)),
    var(--color-surface) 70%);
  border-color: color-mix(in srgb, var(--dt-lime) 40%, var(--color-border));
  border-width: 1.5px;
}

/* ── Navigate tree ──────────────────────────────────────────────── */
.nav-filter-input {
  width: 100%;
  max-width: 32rem;
  padding: .5rem .75rem;
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  background: var(--color-surface);
  color: var(--color-text);
  font-size: .95rem;
  margin-bottom: 1.5rem;
  display: block;
}
.navigate-tree { font-size: .9rem; }
.tree-dir { margin-bottom: .25rem; }
.tree-dir-summary {
  cursor: pointer;
  padding: .3rem .5rem;
  border-radius: var(--radius-sm);
  font-weight: 600;
  color: var(--color-text);
  list-style: none;
  display: flex;
  align-items: center;
  gap: .5rem;
}
.tree-dir-summary::-webkit-details-marker { display: none; }
.tree-dir-summary:hover { background: var(--color-surface-raised); }
.tree-dir-summary::before { content: "\1F4C1"; font-size: .85rem; }
details[open] > .tree-dir-summary::before { content: "\1F4C2"; }
.tree-dir-name { flex: 1; }
.tree-dir-count {
  color: var(--color-text-muted);
  font-size: .75rem;
  font-weight: 400;
}
.tree-dir > .tree-dir,
.tree-dir > .tree-leaf { margin-left: 1.25rem; }
.tree-leaf {
  display: flex;
  align-items: center;
  gap: .5rem;
  padding: .2rem .5rem;
  border-radius: var(--radius-sm);
}
.tree-leaf:hover { background: var(--color-surface-raised); }
.tree-leaf-link { flex: 1; color: var(--color-link); text-decoration: none; }
.tree-leaf-link:hover { text-decoration: underline; }

/* EPIC 6: Browse + Search unified page — tab-style mode toggle. */
.browse-mode-toggle {
  display: flex;
  gap: 0;
  margin-bottom: 1.5rem;
  border-bottom: 2px solid var(--color-border);
}
.browse-mode-tab {
  padding: 0.5rem 1.25rem;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--color-text-muted);
  text-decoration: none;
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
}
.browse-mode-tab:hover { color: var(--color-text); }
.browse-mode-tab--active {
  color: var(--color-primary);
  border-bottom-color: var(--color-primary);
  font-weight: 600;
}
