/* 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 */
  --dt-midnight:       #061e21;
  --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-sans: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-mono: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;

  --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);
}

/* 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);
}

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 */
/* ------------------------------------------------------------------ */
.site-header {
  background: var(--color-header-bg);
  border-bottom: 1px solid rgba(255,255,255,.06);
  position: sticky;
  top: 0;
  z-index: 100;
}

.header-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1.5rem;
  height: 56px;
  display: flex;
  align-items: center;
  gap: 2rem;
  justify-content: space-between;
}

/* Left group: logo + nav */
.header-inner .logo,
.header-inner .site-nav {
  flex-shrink: 0;
}

/* Push nav auth to the right */
.nav-auth {
  margin-left: auto;
  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;
}

.site-nav { display: flex; gap: 1.25rem; margin-left: auto; }
.site-nav a { color: var(--color-header-nav); font-size: .9rem; }
.site-nav a:hover { color: var(--color-header-nav-hover); text-decoration: none; }


/* 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;
}

.site-footer {
  text-align: center;
  padding: 1.5rem;
  color: var(--color-text-muted);
  font-size: .8rem;
  border-top: 1px solid var(--color-border);
}

/* ------------------------------------------------------------------ */
/* 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; }

.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; }

/* 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;
}

/* 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);
}

.fm-list { font-size: .82rem; }
.fm-list dt {
  font-weight: 600;
  color: var(--color-text-muted);
  margin-top: .5rem;
  text-transform: capitalize;
}
.fm-list dd {
  color: var(--color-text);
  word-break: break-word;
}

/* ------------------------------------------------------------------ */
/* 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 #dc3545;
  border-radius: var(--radius);
  padding: 1rem 1.25rem;
  box-shadow: var(--shadow);
}

.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;
}
/* ------------------------------------------------------------------ */
/* 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; }

/* "Sign in with Google" button */
.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;
  margin-right: .5rem;
}
.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; }

/* Google identity chip */
.google-chip {
  display: inline-flex;
  align-items: center;
  gap: .35rem;
  padding: .25rem .6rem;
  background: rgba(196,255,69,.1);
  border: 1px solid rgba(196,255,69,.3);
  border-radius: 999px;
  font-size: .8rem;
  color: var(--color-header-text);
  margin-right: .5rem;
}
.google-avatar { border-radius: 50%; display: block; }
.google-avatar-fallback {
  width: 24px; height: 24px;
  border-radius: 50%;
  background: #4285f4;
  color: #fff;
  font-size: .75rem;
  font-weight: 700;
  display: flex; align-items: center; justify-content: center;
}
.google-name { font-weight: 500; max-width: 120px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.google-signout {
  color: rgba(234,255,190,.5);
  text-decoration: none;
  font-size: .75rem;
  margin-left: .1rem;
  line-height: 1;
}
.google-signout:hover { color: var(--dt-lime); text-decoration: none; }

/* add gap between nav-auth items */
.nav-auth { gap: .25rem; }

/* Profile trigger button */
.profile-menu { position: relative; }

.profile-trigger {
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
  display: flex;
  align-items: center;
}

.profile-avatar {
  border-radius: 50%;
  display: block;
  border: 2px solid rgba(196,255,69,.4);
  transition: border-color .15s;
}
.profile-trigger:hover .profile-avatar { border-color: var(--dt-lime); }

/* Dropdown panel */
.profile-dropdown {
  display: none;
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  min-width: 200px;
  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; }

/* Profile identity header inside dropdown */
.profile-info {
  display: flex;
  align-items: center;
  gap: .6rem;
  padding: .75rem 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.2; }
.profile-login { font-size: .78rem; color: var(--color-text-muted); }

/* Dropdown links */
.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; }

/* ------------------------------------------------------------------ */
/* 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;
}
.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; }

/* 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; }

/* 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); }
.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; }

/* 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); }

/* 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); white-space: pre-wrap; background: var(--color-bg); border: 1px solid var(--color-border); border-radius: var(--radius); padding: .6rem .75rem; }

/* 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, var(--dt-teal) 0%, var(--dt-midnight) 100%);
  border-radius: var(--radius);
  padding: 1rem 1.25rem;
  margin-bottom: 1.5rem;
  color: var(--dt-lime-soft);
  min-height: 3.5rem;
}
.pr-ai-summary-icon {
  font-size: 1.2rem;
  line-height: 1.5;
  flex-shrink: 0;
  color: var(--dt-lime);
  opacity: .5;
  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: var(--dt-lime);
  margin-bottom: .3rem;
}
.pr-ai-text {
  font-size: .9rem;
  line-height: 1.55;
  color: var(--dt-lime-soft);
  margin: 0;
  opacity: .6;
  transition: opacity .4s;
}
.pr-ai-summary.loaded .pr-ai-text { opacity: 1; }

/* ------------------------------------------------------------------ */
/* PR detail — Media viewer                                            */
/* ------------------------------------------------------------------ */
.media-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: .75rem;
}

.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;
}
.media-thumb-btn:hover { border-color: var(--color-primary); box-shadow: var(--shadow); }

.media-thumb {
  width: 100%;
  height: 100px;
  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; }

/* ------------------------------------------------------------------ */
/* PR detail — Quick action buttons                                    */
/* ------------------------------------------------------------------ */
.quick-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: .5rem;
  margin-bottom: .75rem;
}
.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; }
