:root {
  color-scheme: light;

  /* Interaction tokens */
  --disabled-opacity: 0.5;

  /* Brand colors */
  --brand-primary: #2563EB;
  --brand-primary-hover: #1D4ED8;
  --brand-sidebar: #0F172A;
  --brand-sidebar-hover: #1E293B;

  /* Neutral scale (12 steps) */
  --neutral-0: #FFF;
  --neutral-25: #FAFBFC;
  --neutral-50: #F8FAFC;
  --neutral-100: #F1F5F9;
  --neutral-200: #E2E8F0;
  --neutral-300: #CBD5E1;
  --neutral-400: #94A3B8;
  --neutral-500: #64748B;
  --neutral-600: #475569;
  --neutral-700: #334155;
  --neutral-800: #1E293B;
  --neutral-900: #0F172A;

  /* Status colors (base, bg, text) */
  --success: #10B981;
  --success-bg: #D1FAE5;
  --success-text: #065F46;
  --warning: #F59E0B;
  --warning-bg: #FEF3C7;
  --warning-text: #92400E;
  --danger: #EF4444;
  --danger-bg: #FEE2E2;
  --danger-text: #991B1B;
  --info: #3B82F6;
  --info-bg: #DBEAFE;
  --info-text: #1E40AF;
  --neutral-badge: #F1F5F9;
  --neutral-badge-bg: #F1F5F9;
  --neutral-badge-text: #475569;

  /* KPI accents */
  --accent-indigo: #6366F1;
  --accent-emerald: #10B981;
  --accent-amber: #FB923C;
  --accent-rose: #F87171;
  --accent-violet: #8B5CF6;
  --accent-lime: #22C55E;
  --accent-bg-indigo: #EFF6FF;
  --accent-bg-emerald: #ECFDF5;
  --accent-bg-amber: #FFF7ED;
  --accent-bg-rose: #FEF2F2;
  --accent-bg-violet: #F5F3FF;
  --accent-bg-lime: #F0FDF4;

  /* Decision outcome tokens (#633) */
  --color-decision-proceed-bg:   var(--success-bg);
  --color-decision-proceed-text: var(--success-text);
  --color-decision-proceed-solid: #10B981;
  --color-decision-clarify-bg:   var(--warning-bg);
  --color-decision-clarify-text: var(--warning-text);
  --color-decision-clarify-solid: #F59E0B;
  --color-decision-split-bg:     var(--info-bg);
  --color-decision-split-text:   var(--info-text);
  --color-decision-split-solid:  #3B82F6;
  --color-decision-defer-bg:     var(--danger-bg);
  --color-decision-defer-text:   var(--danger-text);
  --color-decision-defer-solid:  #EF4444;

  /* Run mode tokens - what kind of operation ran (orthogonal to outcome) */
  --color-mode-preflight:        #6366F1;
  --color-mode-preflight-subtle: #EEF2FF;
  --color-mode-preflight-text:   #3730A3;
  --color-mode-build:        #10B981;
  --color-mode-build-subtle: #D1FAE5;
  --color-mode-build-text:   #065F46;

  /* Typography */
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-mono: 'JetBrains Mono', 'SF Mono', Menlo, monospace;
  --fs-xs: 11px;
  --fs-sm: 13px;
  --fs-base: 14px;
  --fs-lg: 16px;
  --fs-xl: 18px;
  --fs-2xl: 22px;
  --fs-3xl: 28px;
  --fs-4xl: 32px;
  --fw-regular: 400;
  --fw-medium: 500;
  --fw-semibold: 600;
  --fw-bold: 700;
  --tracking-tight: -0.02em;
  --tracking-normal: 0;
  --tracking-table: 0.02em;
  --tracking-wide: 0.04em;

  /* Spacing (1-12 steps, 4-48px).
     Padding/margin/gap MUST snap to this 4px grid via --space-* (see STYLEGUIDE
     section 1.4 and issue #1722). Off-grid px in spacing declarations is rounded
     to the nearest step. Documented sub-grid exceptions, NOT governed by the
     rhythm grid: 1px (hairlines / 1px border-overlap nudges) and 2px (micro
     stacking gaps that would collapse to 0 or double if snapped). One computed
     layout offset (54px landing connector) is also exempt. Dynamic inline styles
     (width:%, --hue) stay in markup. Guarded by test/spacing-grid.test.mjs. */
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 20px;
  --space-6: 24px;
  --space-7: 28px;
  --space-8: 32px;
  --space-9: 36px;
  --space-10: 40px;
  --space-11: 44px;
  --space-12: 48px;

  /* Radius */
  --radius-sm: 6px;
  --radius-md: 8px;
  --radius-lg: 12px;
  --radius-xl: 16px;
  --radius-full: 9999px;

  /* Shadow */
  --shadow-xs: 0 1px 2px 0 rgba(15, 23, 42, 0.04);
  --shadow-sm: 0 1px 3px 0 rgba(15, 23, 42, 0.06), 0 1px 2px -1px rgba(15, 23, 42, 0.04);
  --shadow-md: 0 4px 6px -1px rgba(15, 23, 42, 0.08), 0 2px 4px -2px rgba(15, 23, 42, 0.04);
  --shadow-lg: 0 10px 15px -3px rgba(15, 23, 42, 0.10), 0 4px 6px -4px rgba(15, 23, 42, 0.05);
  --shadow-ring: 0 0 0 3px rgba(37, 99, 235, 0.15);

  /* Motion */
  --duration-instant: 100ms;
  --duration-fast: 150ms;
  --duration-base: 200ms;
  --duration-slow: 300ms;
  --ease-standard: cubic-bezier(0.4, 0, 0.2, 1);
  --ease-decelerate: cubic-bezier(0, 0, 0.2, 1);
  --ease-accelerate: cubic-bezier(0.4, 0, 1, 1);

  /* Risk level */
  --risk-low: #2da44e;
  --risk-medium: #d6891c;
  --risk-high: #c83b3b;

  /* Conflict severity text */
  --conflict-low-text: #1a7f37;
  --conflict-medium-text: #9a5a02;
  --conflict-high-text: #a02d2d;

  /* Provider brands */
  --brand-azure: #0078d4;
  --brand-azure-hover: #0063b1;
  --brand-azure-bg: #cee0f5;
  --brand-github: #24292f;

  /* Cost confidence segment fills */
  --confidence-low: #d8b270;
  --confidence-medium: #6b8eb5;
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

.skip-link {
  position: absolute;
  left: 0;
  top: 0;
  z-index: 10001;
  transform: translateY(-120%);
  padding: var(--space-2) var(--space-4);
  background: var(--neutral-0);
  color: var(--brand-primary-hover);
  border: 2px solid var(--brand-primary-hover);
  border-radius: 6px;
  font: inherit;
  font-weight: 700;
  text-decoration: none;
  outline-offset: 2px;
}

.skip-link:focus-visible {
  transform: translateY(12px);
  margin-left: 12px;
  clip: unset;
}

.page-header {
  margin-bottom: var(--space-4);
}

.page-header-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

.page-header-toolbar .breadcrumb {
  margin: 0;
  flex: 1 1 auto;
  min-width: 0;
  align-items: center;
}

.page-header-toolbar .page-head-actions {
  flex: 0 0 auto;
  margin-left: auto;
}

.page-header .page-head {
  margin-bottom: 0;
}

.page-head-main--empty {
  display: none;
}

.breadcrumb {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 8px;
  margin: 0 0 var(--space-4);
  font-size: 13.5px;
  font-weight: 600;
  color: var(--neutral-500);
}

.page-header .breadcrumb {
  margin-bottom: 0;
}

.breadcrumb a,
.breadcrumb > span:not(.breadcrumb-sep):not(.page-title) {
  max-width: min(280px, 38vw);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  display: inline-block;
  vertical-align: bottom;
}

#breadcrumb-project {
  max-width: min(320px, 42vw);
}

.page-header-toolbar .breadcrumb {
  flex-wrap: nowrap;
  overflow: hidden;
}

.page-header-toolbar .breadcrumb .page-title.breadcrumb-current {
  flex-shrink: 0;
  white-space: nowrap;
}

.breadcrumb-sep {
  color: var(--neutral-300);
  font-weight: 400;
}

.breadcrumb-current {
  color: var(--neutral-700);
  font-weight: 700;
}

.breadcrumb .page-title {
  display: inline-flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0;
  font-size: 22px;
  font-weight: 700;
  line-height: 1.2;
}

.breadcrumb + .page-head {
  margin-top: 0;
}

.page-header:not(:has(.page-header-toolbar)) .breadcrumb {
  margin-bottom: var(--space-4);
}

.page-head-project-detail {
  align-items: center;
}

.page-head-project-detail .page-subtitle {
  margin-top: 0;
}

.loading-panel {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: var(--space-5);
  border: 1px solid var(--neutral-200);
  border-radius: 8px;
  background: var(--neutral-0);
  box-shadow: var(--shadow-sm);
  color: var(--neutral-500);
}

.loading-spinner {
  flex-shrink: 0;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: 2px solid var(--neutral-200);
  border-top-color: var(--brand-primary-hover);
  animation: loading-spin 0.7s linear infinite;
}

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

.loading-skeleton-stack {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  width: 100%;
  min-width: 0;
  margin-top: 4px;
}

.skeleton-line {
  height: 12px;
  border-radius: 6px;
  background: linear-gradient(
    90deg,
    var(--neutral-100) 0%,
    var(--neutral-200) 50%,
    var(--neutral-100) 100%
  );
  background-size: 200% 100%;
  animation: skeleton-shimmer 1.1s ease-in-out infinite;
}

.skeleton-line.short {
  width: 55%;
}

.skeleton-line.medium {
  width: 75%;
}

@keyframes skeleton-shimmer {
  0% {
    background-position: 100% 0;
  }
  100% {
    background-position: -100% 0;
  }
}

.error-panel {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 12px;
  padding: var(--space-5);
  border: 1px solid rgba(155, 45, 45, 0.35);
  border-radius: 8px;
  background: var(--neutral-0);
  color: var(--danger);
  box-shadow: var(--shadow-sm);
}

.loading-panel-body {
  flex: 1;
  min-width: 0;
}

.loading-panel-message {
  font-weight: 600;
  color: var(--neutral-700);
  margin-bottom: 2px;
}

.error-panel-message {
  margin: 0;
  font-size: 14px;
  font-weight: 600;
}

.error-panel-actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-3);
  align-items: center;
}

.empty-actions {
  margin-top: 12px;
}

body {
  margin: 0;
  background: var(--neutral-25);
  color: var(--neutral-700);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 14px;
  line-height: 1.4;
}

a {
  color: var(--brand-primary);
  text-decoration: none;
}

a:hover {
  color: var(--brand-primary-hover);
  text-decoration: underline;
}

:where(a, button, input, select, textarea, summary, [tabindex]):focus-visible {
  outline: none;
  box-shadow: var(--shadow-ring);
}

.page-title[tabindex="-1"]:focus {
  outline: none;
  box-shadow: none;
}

/* Skip-link target: show where keyboard focus landed (main is not in the global focus ring list). */
#app:focus-visible {
  outline: 2px solid var(--brand-primary);
  outline-offset: -2px;
  box-shadow: none;
}

.app-sidebar-banner {
  display: flex;
  flex-direction: column;
  gap: var(--space-5);
}

.shell {
  min-height: 100vh;
}

/* App shell: light left rail + main stage (replaces the legacy dark topbar). */
.shell--app {
  display: grid;
  grid-template-columns: minmax(200px, 228px) minmax(0, 1fr);
  min-height: 100vh;
  background: var(--neutral-50);
}

/* Sign-in and first-admin bootstrap: full-width stage, no sidebar navigation. */
.shell--app.shell--auth {
  grid-template-columns: 1fr;
}

.shell--app.shell--auth .app-sidebar {
  display: none;
}

.app-sidebar {
  display: flex;
  flex-direction: column;
  gap: 0;
  padding: var(--space-5) var(--space-4);
  border-right: 1px solid var(--neutral-200);
  background: var(--neutral-0);
  min-height: 100vh;
}

.app-sidebar-body {
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  flex-direction: column;
}

.app-topbar-user {
  position: relative;
}

.app-topbar-user .user-menu-email {
  display: none;
}

.user-menu-shell {
  position: relative;
}

.user-menu-trigger {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  width: auto;
  padding: 8px;
  border: 1px solid transparent;
  border-radius: var(--radius-md);
  background: transparent;
  color: var(--neutral-900);
  font: inherit;
  text-align: left;
  cursor: pointer;
}

.user-menu-trigger:hover,
.user-menu-trigger[aria-expanded="true"] {
  background: var(--neutral-100);
  border-color: var(--neutral-200);
}

.user-menu-avatar {
  flex-shrink: 0;
  width: 36px;
  height: 36px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: var(--fs-xs);
  font-weight: var(--fw-bold);
  letter-spacing: 0.02em;
  background: hsl(var(--user-avatar-hue, 220) 45% 88%);
  border: 1px solid hsl(var(--user-avatar-hue, 220) 35% 78%);
  color: hsl(var(--user-avatar-hue, 220) 40% 32%);
}

.user-menu-identity {
  flex: 1 1 auto;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.user-menu-name {
  font-size: var(--fs-sm);
  font-weight: var(--fw-semibold);
  color: var(--neutral-900);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.user-menu-email {
  font-size: var(--fs-xs);
  color: var(--neutral-500);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.user-menu-chevron {
  flex-shrink: 0;
  color: var(--neutral-500);
  transition: transform 0.15s ease;
}

.user-menu-trigger[aria-expanded="true"] .user-menu-chevron {
  transform: rotate(180deg);
}

.user-menu-panel {
  position: absolute;
  left: auto;
  right: 0;
  top: calc(100% + 6px);
  min-width: 220px;
  z-index: 20;
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: var(--space-2);
  background: var(--neutral-0);
  border: 1px solid var(--neutral-200);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-md);
}

.user-menu-panel-head {
  padding: var(--space-1) var(--space-2) var(--space-2);
}

.user-menu-role {
  display: inline-block;
  font-size: 10px;
  font-weight: var(--fw-semibold);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--neutral-600);
  background: var(--neutral-100);
  border-radius: 999px;
  padding: 2px 8px;
}

.user-menu-role--admin {
  color: var(--brand-primary-hover);
  background: var(--info-bg);
}

.user-menu-item {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: var(--space-2) var(--space-3);
  border: none;
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--neutral-700);
  font-size: var(--fs-sm);
  font-weight: var(--fw-medium);
  text-decoration: none;
  text-align: left;
  cursor: pointer;
}

.user-menu-item:hover {
  background: var(--neutral-100);
  color: var(--neutral-900);
  text-decoration: none;
}

.user-menu-item-icon {
  flex-shrink: 0;
  color: var(--neutral-500);
}

.user-menu-item--danger {
  color: var(--danger-fg, #b42318);
}

.user-menu-item--danger .user-menu-item-icon {
  color: currentColor;
}

.user-menu-item--danger:hover {
  background: var(--danger-bg, #fef3f2);
  color: var(--danger-fg, #b42318);
}

.user-menu-divider {
  height: 1px;
  margin: var(--space-1) var(--space-2);
  background: var(--neutral-200);
}

.account-profile-card {
  display: flex;
  align-items: center;
  gap: var(--space-4);
  margin-bottom: var(--space-5);
  padding: var(--space-4) var(--space-5);
  border: 1px solid var(--neutral-200);
  border-radius: var(--radius-lg);
  background: var(--neutral-0);
}

.account-profile-avatar {
  flex-shrink: 0;
  width: 52px;
  height: 52px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: var(--fs-base);
  font-weight: var(--fw-bold);
  background: hsl(var(--user-avatar-hue, 220) 45% 88%);
  border: 1px solid hsl(var(--user-avatar-hue, 220) 35% 78%);
  color: hsl(var(--user-avatar-hue, 220) 40% 32%);
}

.account-profile-name {
  margin: 0 0 2px;
  font-size: var(--fs-lg);
  font-weight: var(--fw-bold);
  color: var(--neutral-900);
}

.account-profile-email {
  margin: 0 0 var(--space-2);
  font-size: var(--fs-sm);
  color: var(--neutral-500);
}

.account-section + .account-section {
  margin-top: var(--space-6);
}

.account-sessions-table {
  margin-top: var(--space-3);
}

/* Users admin - team member management (/users) */
.users-admin-section {
  margin-top: var(--space-4);
}

.users-admin-section > .notice {
  margin-bottom: var(--space-3);
}

.users-admin-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
  margin-bottom: var(--space-3);
}

.users-admin-stats {
  margin: 0;
  font-size: var(--fs-sm);
  color: var(--neutral-500);
}

.users-admin-filters {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-2);
}

.users-admin-search {
  min-width: 220px;
  max-width: 280px;
}

.users-admin-filter {
  min-width: 140px;
}

.users-admin-table tbody tr:hover {
  background: var(--neutral-50);
}

.users-member-cell {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  min-width: 0;
}

.users-member-avatar {
  flex-shrink: 0;
  width: 36px;
  height: 36px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: var(--fs-xs);
  font-weight: var(--fw-bold);
  background: hsl(var(--user-avatar-hue, 220) 45% 88%);
  border: 1px solid hsl(var(--user-avatar-hue, 220) 35% 78%);
  color: hsl(var(--user-avatar-hue, 220) 40% 32%);
}

.users-member-identity {
  display: flex;
  flex-direction: column;
  min-width: 0;
  gap: 2px;
}

.users-member-name {
  font-weight: var(--fw-semibold);
  color: var(--neutral-900);
}

.users-member-email {
  font-size: var(--fs-sm);
  color: var(--neutral-500);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.users-you-badge {
  margin-left: var(--space-2);
  vertical-align: middle;
  font-size: var(--fs-xs);
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.users-role-select {
  min-width: 148px;
  font-size: var(--fs-sm);
}

.users-admin-actions {
  white-space: nowrap;
}

.users-admin-empty-row {
  text-align: center;
  padding: var(--space-5) var(--space-4);
}

.users-admin-create-form .users-admin-form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--space-3) var(--space-4);
}

.users-admin-form-grid .field-full {
  grid-column: 1 / -1;
}

.user-create-modal-form {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}

.user-create-section {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  padding-top: var(--space-3);
  border-top: 1px solid var(--neutral-200);
}

.user-create-section:first-child {
  padding-top: 0;
  border-top: 0;
}

.user-create-section-title {
  margin: 0;
  font-size: var(--fs-sm);
  font-weight: var(--fw-semibold);
  color: var(--neutral-800);
  letter-spacing: var(--tracking-wide);
  text-transform: uppercase;
}

.user-create-section-lead {
  margin: calc(-1 * var(--space-2)) 0 0;
}

.field-password-wrap {
  position: relative;
  display: flex;
  align-items: center;
}

.field-password-wrap input {
  padding-right: 40px;
  width: 100%;
}

.field-password-toggle {
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: 0;
  padding: 4px;
  color: var(--neutral-500);
  cursor: pointer;
  border-radius: var(--radius-sm);
}

.field-password-toggle:hover,
.field-password-toggle:focus-visible {
  color: var(--neutral-800);
}

.field-password-toggle .field-password-icon-hide {
  display: none;
}

.field-password-toggle[data-showing="true"] .field-password-icon-show {
  display: none;
}

.field-password-toggle[data-showing="true"] .field-password-icon-hide {
  display: inline;
}

.field-full .password-rules {
  border-left: 2px solid var(--neutral-200);
  padding-left: var(--space-3);
  margin-top: 8px;
}

.users-admin-create-form .notice {
  margin-top: var(--space-3);
}

.users-project-search {
  width: 100%;
  min-height: 36px;
  padding: var(--space-2) var(--space-3);
  border: 1px solid var(--neutral-200);
  border-radius: var(--radius-md);
  background: var(--neutral-0);
  color: var(--neutral-700);
  font: inherit;
  font-size: var(--fs-base);
}

.users-project-search:focus {
  outline: none;
  border-color: var(--brand-primary);
  box-shadow: var(--shadow-ring);
}

.users-project-picker {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  max-height: 160px;
  overflow-y: auto;
  overflow-x: hidden;
  border: 1px solid var(--neutral-200);
  border-radius: var(--radius-md);
  padding: var(--space-2);
  background: var(--neutral-50);
}

.users-project-picker-item {
  display: flex;
  align-items: flex-start;
  gap: var(--space-3);
  padding: var(--space-2) var(--space-3);
  border: 1px solid transparent;
  border-radius: var(--radius-md);
  cursor: pointer;
  background: var(--neutral-0);
}

.users-project-picker-item:hover {
  border-color: var(--neutral-200);
  background: var(--neutral-25);
}

.users-project-picker-item input[type="checkbox"] {
  flex-shrink: 0;
  margin-top: 2px;
  cursor: pointer;
}

.users-project-picker-text {
  min-width: 0;
}

.users-project-picker-name {
  display: block;
  color: var(--neutral-800);
  font-family: var(--font-mono);
  font-size: var(--fs-sm);
  line-height: 1.4;
  word-break: break-word;
}

@media (max-width: 640px) {
  .users-admin-toolbar {
    flex-direction: column;
    align-items: stretch;
  }

  .users-admin-filters {
    flex-direction: column;
    align-items: stretch;
  }

  .users-admin-search,
  .users-admin-filter {
    max-width: none;
    width: 100%;
  }

  .users-admin-create-form .users-admin-form-grid {
    grid-template-columns: 1fr;
  }
}

.app-sidebar-brand.brand {
  color: var(--neutral-900);
  font-weight: var(--fw-bold);
}

.app-sidebar-brand.brand:hover {
  color: var(--brand-primary-hover);
  text-decoration: none;
}

.app-sidebar-nav.topbar-nav {
  display: flex;
  margin-left: 0;
  flex-direction: column;
  align-items: stretch;
  gap: 2px;
}

.app-sidebar-nav.topbar-nav a {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: var(--space-2) var(--space-2);
  color: var(--neutral-700);
  border-radius: var(--radius-md);
  font-weight: var(--fw-semibold);
}

.topbar-nav-icon {
  display: block;
  flex-shrink: 0;
}

.app-sidebar-nav.topbar-nav a:hover {
  background: var(--neutral-100);
  color: var(--neutral-900);
  text-decoration: none;
}

.app-sidebar-nav.topbar-nav a[aria-current="page"] {
  background: var(--info-bg);
  color: var(--brand-primary-hover);
}

.app-stage {
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 100vh;
}


.main.app-main {
  width: 100%;
  max-width: none;
  margin: 0;
  flex: 1;
  padding: var(--space-5) var(--space-6) var(--space-8);
}

@media (max-width: 900px) {
  .shell--app {
    grid-template-columns: 1fr;
    grid-template-rows: auto 1fr;
  }

  .app-sidebar {
    flex-direction: column;
    flex-wrap: nowrap;
    align-items: stretch;
    gap: var(--space-3);
    min-height: 0;
    padding: var(--space-3) var(--space-4);
    border-right: none;
    border-bottom: 1px solid var(--neutral-200);
  }

  .app-sidebar-footer {
    margin-top: 0;
    padding-top: var(--space-3);
  }

  .user-menu-panel {
    bottom: auto;
    top: calc(100% + 6px);
  }

  .app-sidebar-nav.topbar-nav {
    flex-direction: row;
    flex-wrap: wrap;
    flex: 1 1 auto;
    justify-content: flex-start;
    gap: var(--space-2);
  }

  .app-sidebar-nav.topbar-nav a {
    white-space: nowrap;
  }

  .main.app-main {
    padding: var(--space-4) var(--space-4) var(--space-6);
  }
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--neutral-0);
  font-weight: 700;
  letter-spacing: 0;
  text-decoration: none;
}

.brand-icon {
  display: block;
  flex-shrink: 0;
}

.main {
  width: min(1440px, 100%);
  margin: 0 auto;
  padding: 20px;
}

.page-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: var(--space-4);
}

.page-title {
  margin: 0;
  font-size: 22px;
  font-weight: 700;
  letter-spacing: 0;
}

/* Projects index header bumps the title to the DS §3.1 spec (32/700, tight
 * tracking, slate-900). Gated behind .page-head-projects so other dashboards
 * keep the existing 22/700 line until they migrate. */
.page-head-projects .page-title {
  font-size: var(--fs-4xl);
  font-weight: var(--fw-bold);
  letter-spacing: var(--tracking-tight);
  color: var(--neutral-900);
}

.page-head-projects .page-subtitle {
  font-size: var(--fs-base);
  font-weight: var(--fw-regular);
  color: var(--neutral-500);
}

.page-head-control-center {
  flex-wrap: wrap;
  align-items: flex-start;
  gap: var(--space-4) var(--space-6);
  margin-bottom: var(--space-4);
  padding-bottom: var(--space-4);
  border-bottom: 1px solid var(--neutral-200);
}

.page-head-control-center-main {
  flex: 1 1 280px;
  min-width: 0;
}

.control-center-eyebrow {
  margin: 0 0 var(--space-1);
  font-size: var(--fs-xs);
  font-weight: var(--fw-bold);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--neutral-500);
}

.control-center-status-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: var(--space-3);
  min-height: 28px;
}

.cc-chip {
  display: inline-flex;
  align-items: center;
  padding: var(--space-1) var(--space-3);
  border-radius: var(--radius-full);
  font-size: var(--fs-xs);
  font-weight: var(--fw-semibold);
  border: 1px solid var(--neutral-200);
  background: var(--neutral-0);
  color: var(--neutral-700);
}

.cc-chip-muted {
  color: var(--neutral-500);
  background: var(--neutral-100);
}

.cc-chip-live {
  border-color: rgba(37, 99, 235, 0.35);
  background: var(--info-bg);
  color: var(--info-text);
}

.cc-chip-danger {
  border-color: var(--danger);
  background: var(--danger-bg);
  color: var(--danger-text);
}

.cc-chip-warning {
  border-color: var(--warning);
  background: var(--warning-bg);
  color: var(--warning-text);
}

a.cc-chip {
  text-decoration: none;
  cursor: pointer;
}

a.cc-chip:hover {
  opacity: 0.85;
}

.cc-chip-neutral {
  color: var(--neutral-700);
  background: var(--neutral-50);
  font-variant-numeric: tabular-nums;
}

/* Live status dot - pulses while runs are in flight to make the operational
 * state of the portfolio glanceable from the header. Suppressed under reduced
 * motion so users with vestibular disorders don't get an unsolicited animation. */
.cc-chip-dot {
  display: inline-block;
  width: 6px;
  height: 6px;
  margin-right: var(--space-2);
  border-radius: var(--radius-full);
  background: currentColor;
  animation: cc-chip-pulse 1.8s ease-in-out infinite;
}

@keyframes cc-chip-pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.35; }
}

@media (prefers-reduced-motion: reduce) {
  .cc-chip-dot { animation: none; }
}


.projects-workflow-strip {
  margin: 0 0 var(--space-5);
  padding: var(--space-4) var(--space-5);
  border: 1px solid var(--neutral-200);
  border-radius: var(--radius-lg);
  background: linear-gradient(135deg, var(--neutral-25) 0%, var(--neutral-0) 55%);
  box-shadow: var(--shadow-xs);
}

.projects-workflow-strip-head {
  margin-bottom: var(--space-4);
}

.projects-workflow-strip-title {
  margin: 0 0 var(--space-2);
  font-size: var(--fs-lg);
  font-weight: var(--fw-bold);
  color: var(--neutral-900);
  letter-spacing: var(--tracking-tight);
}

.projects-workflow-strip-lede {
  margin: 0;
  font-size: var(--fs-sm);
  color: var(--neutral-600);
  line-height: 1.45;
  max-width: 62rem;
}

.projects-workflow-strip-steps {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
}

.projects-workflow-strip-step {
  margin: 0;
  padding: var(--space-3) var(--space-4);
  border-radius: var(--radius-md);
  border: 1px solid var(--neutral-100);
  background: var(--neutral-0);
}

.projects-workflow-strip-badge {
  display: inline-block;
  margin-bottom: var(--space-2);
  padding: 2px var(--space-2);
  border-radius: var(--radius-sm);
  font-size: var(--fs-xs);
  font-weight: var(--fw-bold);
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--neutral-700);
  background: var(--neutral-100);
}

.projects-workflow-strip-detail {
  margin: 0;
  font-size: var(--fs-sm);
  color: var(--neutral-700);
  line-height: 1.45;
}

.projects-workflow-strip-detail a {
  text-decoration: underline;
  text-underline-offset: 2px;
}

.projects-workflow-strip-loop {
  display: flex;
  align-items: flex-start;
  gap: var(--space-2);
  margin: var(--space-4) 0 0;
  padding: var(--space-3) var(--space-4);
  border-radius: var(--radius-md);
  border: 1px dashed var(--neutral-200);
  background: var(--neutral-0);
  font-size: var(--fs-sm);
  font-weight: var(--fw-semibold);
  color: var(--neutral-800);
}

.projects-workflow-strip-loop-icon {
  flex-shrink: 0;
  font-size: var(--fs-lg);
  line-height: 1;
  color: var(--neutral-500);
}

.projects-workflow-strip-foot {
  margin: var(--space-3) 0 0;
  font-size: var(--fs-xs);
  line-height: 1.45;
}

@media (min-width: 900px) {
  .projects-workflow-strip-steps {
    flex-direction: row;
    align-items: stretch;
    gap: var(--space-3);
  }

  .projects-workflow-strip-step {
    flex: 1 1 0;
    min-width: 0;
  }
}

/* Build waves list empty state — workflow strip + centered hero CTA */
.build-waves-workflow-strip {
  margin: 0 0 var(--space-5);
  padding: var(--space-4) var(--space-5);
  border: 1px solid var(--neutral-200);
  border-radius: var(--radius-lg);
  background: linear-gradient(135deg, var(--neutral-25) 0%, var(--neutral-0) 55%);
  box-shadow: var(--shadow-xs);
}

.build-waves-workflow-strip-head {
  margin-bottom: var(--space-4);
}

.build-waves-workflow-strip-title {
  margin: 0 0 var(--space-2);
  font-size: var(--fs-lg);
  font-weight: var(--fw-bold);
  color: var(--neutral-900);
  letter-spacing: var(--tracking-tight);
}

.build-waves-workflow-strip-lede {
  margin: 0;
  font-size: var(--fs-sm);
  color: var(--neutral-600);
  line-height: 1.45;
  max-width: 62rem;
}

.build-waves-workflow-strip-steps {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
}

.build-waves-workflow-strip-step {
  margin: 0;
  padding: var(--space-3) var(--space-4);
  border-radius: var(--radius-md);
  border: 1px solid var(--neutral-100);
  background: var(--neutral-0);
}

.build-waves-workflow-strip-badge {
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
  margin-bottom: var(--space-2);
  padding: 2px var(--space-2);
  border-radius: var(--radius-sm);
  font-size: var(--fs-xs);
  font-weight: var(--fw-bold);
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--neutral-700);
  background: var(--neutral-100);
}

.build-waves-workflow-strip-icon {
  flex-shrink: 0;
  color: var(--neutral-600);
}

.build-waves-workflow-strip-detail {
  margin: 0;
  font-size: var(--fs-sm);
  color: var(--neutral-700);
  line-height: 1.45;
}

@media (min-width: 900px) {
  .build-waves-workflow-strip-steps {
    flex-direction: row;
    align-items: stretch;
    gap: var(--space-3);
  }

  .build-waves-workflow-strip-step {
    flex: 1 1 0;
    min-width: 0;
  }
}

.build-waves-list-empty .build-waves-empty-hero {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.build-waves-empty-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  margin-bottom: var(--space-4);
  border-radius: 50%;
  background: color-mix(in srgb, var(--brand-primary) 8%, transparent);
  color: var(--brand-primary);
}

.build-waves-empty-icon-svg {
  display: block;
}

.build-waves-list-empty .empty {
  width: 100%;
  padding: var(--space-12) var(--space-6);
  text-align: center;
  color: var(--neutral-900);
  font-size: var(--fs-lg);
  font-weight: var(--fw-bold);
}

.build-waves-list-empty .empty-description {
  margin: var(--space-2) 0 0;
  font-size: var(--fs-base);
  font-weight: var(--fw-normal);
  color: var(--neutral-600);
  line-height: 1.5;
  max-width: 36rem;
  margin-left: auto;
  margin-right: auto;
}

.build-waves-list-empty .empty-actions {
  margin-top: var(--space-4);
  justify-content: center;
}

.build-waves-list-empty .empty:not(:only-child) {
  margin-top: 0;
}

.projects-dashboard--control-center {
  background: var(--neutral-100);
  border-radius: var(--radius-lg);
  padding: var(--space-6);
}

.projects-dashboard--control-center .dashboard-insights-grid.cc-module-grid {
  margin-bottom: var(--space-3);
}

.cc-project-directory .section-title {
  font-size: var(--fs-xl);
}

.page-subtitle {
  margin: 4px 0 0;
  color: var(--neutral-500);
}

.filter-stack {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  margin-bottom: 16px;
}

.filter-active-chips {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
  align-items: center;
  min-height: 0;
}

.filter-chip {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-1) var(--space-3);
  border: 1px solid var(--neutral-200);
  border-radius: 999px;
  background: var(--neutral-100);
  color: var(--neutral-700);
  font: inherit;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
}

.filter-chip:hover {
  border-color: var(--neutral-300);
  background: var(--neutral-0);
}

.filter-presets {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.filter-presets-label {
  color: var(--neutral-500);
  font-size: 12px;
  font-weight: 700;
}

.btn-filter-preset {
  padding: var(--space-1) var(--space-3);
  font-size: 12px;
  min-height: 28px;
}

.btn-filter-preset.is-active {
  border-color: var(--brand-primary);
  background: var(--info-bg);
  color: var(--brand-primary);
  font-weight: 700;
}

.filterbar {
  display: grid;
  grid-template-columns: repeat(5, minmax(136px, 1fr));
  gap: var(--space-3);
  align-items: end;
  padding: 12px;
  border: 1px solid var(--neutral-200);
  border-radius: 8px;
  background: var(--neutral-0);
  box-shadow: var(--shadow-sm);
}

.filterbar.detail {
  grid-template-columns: repeat(6, minmax(110px, 1fr));
}

.field.filter-actions {
  align-self: end;
}

.filter-actions-label {
  visibility: hidden;
  height: 0;
  margin: 0;
  padding: 0;
}

.field {
  display: grid;
  gap: var(--space-1);
}

.field label {
  color: var(--neutral-500);
  font-size: 12px;
  font-weight: 600;
}

.field input,
.field select {
  width: 100%;
  min-height: 36px;
  padding: var(--space-2) var(--space-3);
  border: 1px solid var(--neutral-200);
  border-radius: var(--radius-md);
  background: var(--neutral-0);
  color: var(--neutral-700);
  font: inherit;
  font-size: var(--fs-base);
  transition:
    border-color var(--duration-fast) var(--ease-standard),
    box-shadow var(--duration-fast) var(--ease-standard);
}

.field input:hover,
.field select:hover {
  border-color: var(--neutral-300);
}

.field input:focus,
.field select:focus,
.field input:focus-visible,
.field select:focus-visible {
  outline: none;
  border-color: var(--brand-primary);
  box-shadow: var(--shadow-ring);
}

/* -- BuildWave creation form -- */
.wave-form {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
  max-width: 880px;
}

.wave-form-sheet {
  border: 1px solid var(--neutral-200);
  border-radius: var(--radius-lg);
  background: var(--neutral-0);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}

.wave-form-group {
  display: flex;
  flex-direction: column;
}

.wave-form-group + .wave-form-group {
  border-top: 1px solid var(--neutral-200);
}

.wave-form-group-title {
  margin: 0;
  padding: var(--space-4) var(--space-6) var(--space-2);
  font-size: var(--fs-sm);
  font-weight: var(--fw-semibold);
  color: var(--neutral-500);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.wave-form-field-row {
  display: grid;
  grid-template-columns: 200px minmax(0, 1fr);
  grid-template-rows: auto auto;
  gap: var(--space-1) var(--space-6);
  padding: var(--space-4) var(--space-6);
  border-top: 1px solid var(--neutral-100);
  align-items: center;
}

.wave-form-field-row--tall {
  align-items: start;
}

.wave-form-field-row--tall .wave-form-field-label {
  padding-top: var(--space-3);
}

.wave-form-group-title + .wave-form-field-row {
  border-top: none;
}

.wave-form-field-label {
  grid-column: 1;
  grid-row: 1;
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
  align-self: center;
}

.wave-form-field-row--tall .wave-form-field-label {
  align-self: start;
}

.wave-form-field-label label,
.wave-form-field-label-text {
  font-size: var(--fs-sm);
  font-weight: var(--fw-semibold);
  color: var(--neutral-700);
  line-height: 1.35;
}

.wave-form-field-anchor {
  grid-column: 2;
  grid-row: 1;
  min-width: 0;
  align-self: center;
}

.wave-form-field-row--tall .wave-form-field-anchor {
  align-self: start;
}

.wave-form-field-support {
  grid-column: 2;
  grid-row: 2;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
}

.wave-form-field-anchor input:not([type="checkbox"]):not([type="radio"]),
.wave-form-field-anchor textarea,
.wave-form-field-anchor .input-prefix-wrap {
  width: 100%;
  max-width: 420px;
}

.wave-form-field-anchor .checkbox-label {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  max-width: 420px;
  font-size: var(--fs-sm);
  font-weight: var(--fw-normal);
  color: var(--neutral-700);
  cursor: pointer;
}

.wave-form-field-anchor .checkbox-label input[type="checkbox"] {
  width: auto;
  max-width: none;
  flex-shrink: 0;
}

.wave-form-field-anchor--wide,
.wave-form-field-anchor--wide .form-choice-cards {
  max-width: 420px;
}

.wave-form-field-row.required .wave-form-field-label label::after {
  content: " *";
  color: var(--danger);
}

.wave-form-field-row.recommended .wave-form-field-label label::after {
  content: " (recommended)";
  color: var(--neutral-500);
  font-weight: var(--fw-normal);
}

@media (max-width: 640px) {
  .wave-form-field-row {
    grid-template-columns: 1fr;
    grid-template-rows: auto auto auto;
    gap: var(--space-2);
    padding: var(--space-4);
  }

  .wave-form-field-label,
  .wave-form-field-anchor,
  .wave-form-field-support {
    grid-column: 1;
  }

  .wave-form-field-label {
    grid-row: 1;
    align-self: start;
    padding-top: 0;
  }

  .wave-form-field-anchor {
    grid-row: 2;
  }

  .wave-form-field-support {
    grid-row: 3;
  }

  .wave-form-field-anchor input:not([type="checkbox"]):not([type="radio"]),
  .wave-form-field-anchor textarea,
  .wave-form-field-anchor .input-prefix-wrap,
  .wave-form-field-anchor--wide,
  .wave-form-field-anchor--wide .form-choice-cards,
  .wave-form-field-anchor .checkbox-label {
    max-width: none;
  }
}

.wave-form-repo-chip {
  margin: 0;
  display: inline-flex;
  align-items: center;
  max-width: 100%;
  padding: var(--space-1) var(--space-3);
  border-radius: var(--radius-md);
  background: var(--neutral-50);
  border: 1px solid var(--neutral-200);
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: var(--fs-sm);
  color: var(--neutral-700);
  word-break: break-all;
}

.wave-form-footer {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  padding: var(--space-4) var(--space-6);
  border-top: 1px solid var(--neutral-200);
  background: linear-gradient(to bottom, var(--neutral-50), var(--neutral-0));
}

.wave-form-footer-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: var(--space-3);
}

.wave-form-footer-cancel,
.wave-form-footer-submit {
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.wave-form-footer-cancel {
  min-height: 40px;
  padding: var(--space-2) var(--space-5);
  font-weight: var(--fw-semibold);
  background: var(--neutral-0);
  border-color: var(--neutral-300);
  color: var(--neutral-700);
  box-shadow: var(--shadow-xs);
}

.wave-form-footer-cancel:hover {
  background: var(--neutral-100);
  border-color: var(--neutral-400);
  color: var(--neutral-900);
}

.wave-form-footer-submit {
  min-height: 40px;
  padding: var(--space-2) var(--space-6);
  font-weight: var(--fw-semibold);
  box-shadow: 0 1px 2px rgba(37, 99, 235, 0.22);
}

.wave-form-footer-submit:not(:disabled):hover {
  box-shadow: 0 2px 6px rgba(37, 99, 235, 0.28);
}

@media (max-width: 640px) {
  .wave-form-footer {
    padding: var(--space-4);
  }

  .wave-form-footer-actions {
    width: 100%;
  }

  .wave-form-footer-cancel,
  .wave-form-footer-submit {
    flex: 1 1 auto;
    justify-content: center;
    text-align: center;
  }
}

.fieldset-plain {
  border: none;
  margin: 0;
  padding: 0;
  min-width: 0;
}

.radio-stack {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 4px;
}

.radio-stack-option {
  display: flex;
  align-items: flex-start;
  gap: var(--space-3);
  cursor: pointer;
}

.radio-stack-option input {
  margin-top: var(--space-1);
  flex-shrink: 0;
}

.radio-stack-body {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.radio-stack-title {
  font-size: var(--fs-base);
  font-weight: 600;
  color: var(--neutral-700);
}

.wave-form-batch-field {
  margin-top: 0;
}

.wave-form-action-bar {
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-3);
  justify-content: flex-end;
}

.wave-form-token-inline {
  margin: 0;
}

.form-action-bar-buttons {
  display: flex;
  gap: var(--space-2);
  align-items: center;
  margin-left: auto;
}

/* Dispatch mode choice cards */
.form-choice-cards {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-3);
  max-width: 520px;
}

.form-choice-cards--stacked {
  grid-template-columns: 1fr;
  max-width: 420px;
}

@media (max-width: 640px) {
  .form-choice-cards {
    grid-template-columns: 1fr;
    max-width: none;
  }
}

.form-choice-card {
  position: relative;
  display: block;
  cursor: pointer;
  margin: 0;
}

.form-choice-card-input {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
  margin: 0;
  pointer-events: none;
}

.form-choice-card-body {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  height: 100%;
  padding: var(--space-4);
  border: 1px solid var(--neutral-200);
  border-radius: var(--radius-md);
  background: var(--neutral-0);
  transition:
    border-color var(--duration-fast) var(--ease-standard),
    box-shadow var(--duration-fast) var(--ease-standard),
    background var(--duration-fast) var(--ease-standard);
}

.form-choice-card:hover .form-choice-card-body {
  border-color: var(--neutral-300);
  background: var(--neutral-50);
}

.form-choice-card-input:checked + .form-choice-card-body {
  border-color: var(--brand-primary);
  background: color-mix(in srgb, var(--brand-primary) 4%, var(--neutral-0));
  box-shadow: var(--shadow-ring);
}

.form-choice-card-input:focus-visible + .form-choice-card-body {
  outline: none;
  box-shadow: var(--shadow-ring);
}

.form-choice-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-2);
}

.form-choice-card-title {
  font-size: var(--fs-base);
  font-weight: var(--fw-semibold);
  color: var(--neutral-900);
}

.form-choice-card-desc {
  font-size: var(--fs-xs);
  color: var(--neutral-500);
  line-height: 1.45;
}

.form-choice-card-badge {
  flex-shrink: 0;
  font-size: 10px;
  padding: 2px var(--space-2);
  background: var(--neutral-badge-bg);
  color: var(--neutral-badge-text);
  border-color: transparent;
}

.field.required > label::after {
  content: " *";
  color: var(--danger);
}

.field.recommended > label::after {
  content: " (recommended)";
  color: var(--neutral-500);
  font-weight: 500;
}

.input-prefix-wrap {
  display: flex;
  align-items: stretch;
  border: 1px solid var(--neutral-200);
  border-radius: var(--radius-md);
  overflow: hidden;
  background: var(--neutral-0);
  transition:
    border-color var(--duration-fast) var(--ease-standard),
    box-shadow var(--duration-fast) var(--ease-standard);
}

.input-prefix-wrap:hover {
  border-color: var(--neutral-300);
}

.input-prefix-wrap:focus-within {
  border-color: var(--brand-primary);
  box-shadow: var(--shadow-ring);
}

.input-prefix {
  padding: 0 var(--space-3);
  color: var(--neutral-500);
  font-size: var(--fs-base);
  font-weight: 600;
  background: var(--neutral-50);
  border-right: 1px solid var(--neutral-200);
  display: flex;
  align-items: center;
  user-select: none;
  min-height: 36px;
}

.input-prefix-wrap input {
  border: none !important;
  box-shadow: none !important;
  border-radius: 0;
  flex: 1;
  min-width: 0;
}

.input-prefix-wrap input:focus,
.input-prefix-wrap input:focus-visible {
  outline: none;
  border: none !important;
  box-shadow: none !important;
}

.field textarea {
  width: 100%;
  padding: var(--space-2) var(--space-3);
  border: 1px solid var(--neutral-200);
  border-radius: var(--radius-md);
  background: var(--neutral-0);
  color: var(--neutral-700);
  font: inherit;
  font-size: var(--fs-base);
  resize: vertical;
  transition:
    border-color var(--duration-fast) var(--ease-standard),
    box-shadow var(--duration-fast) var(--ease-standard);
}

.field textarea:hover { border-color: var(--neutral-300); }

.field textarea:focus,
.field textarea:focus-visible {
  outline: none;
  border-color: var(--brand-primary);
  box-shadow: var(--shadow-ring);
}

.field-hint {
  display: block;
  font-size: var(--fs-xs);
  color: var(--neutral-500);
  line-height: 1.4;
  margin-top: 4px;
}

.field-hint code {
  color: var(--neutral-700);
}

/* Live password-rule checklist (J-BOOT1 #1121). */
.password-rules {
  list-style: none;
  margin: var(--space-2) 0 0;
  padding: 0;
  font-size: var(--fs-xs);
  line-height: 1.5;
}
.password-rule {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  color: var(--neutral-500);
}
.password-rule-icon {
  display: inline-block;
  width: 1em;
  text-align: center;
  flex: 0 0 auto;
}
.password-rule-icon::before {
  content: "○";
}
.password-rule-met {
  color: var(--success-text);
}
.password-rule-met .password-rule-icon::before {
  content: "✓";
  color: var(--success);
}

.field-error {
  display: block;
  font-size: 11px;
  color: var(--danger);
  line-height: 1.4;
  margin-top: var(--space-1);
}

.field-presets {
  display: flex;
  gap: var(--space-2);
  margin-top: var(--space-2);
  flex-wrap: wrap;
}

.wave-form-preview {
  font-size: 12px;
  color: var(--neutral-500);
  margin: 0;
  padding: var(--space-3) var(--space-4);
  background: var(--neutral-50);
  border-radius: 6px;
  border: 1px solid var(--neutral-200);
}

.wave-form-preview:empty { display: none; }

.form-action-bar {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  align-items: center;
}

.summary-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: var(--space-3);
  margin-bottom: 16px;
}

/* Project detail header runs six KPI tiles (incl. readiness). Use auto-fit so
   the strip reflows smoothly through 6-up → 5/4/3/2-up without the abrupt jumps
   the old explicit-breakpoint stack produced. minmax(180px, 1fr) keeps each
   tile readable; below ~360px viewport the grid naturally collapses to 1-up. */
.summary-grid.project-kpis {
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
}

@media (max-width: 520px) {
  .summary-grid.project-kpis {
    grid-template-columns: 1fr;
  }
}

/*
 * KPI strip (Phase 3 - issue #261)
 * Tile chassis adopts §3.2 of the styleguide: 12px radius, 24px padding,
 * 1px neutral-200 border, ds-shadow-sm. Per-tile accent is a 40x40 tinted
 * circular icon top-right. The Budget remaining tile additionally renders a
 * 4px progress bar at the card's bottom edge.
 */
.metric {
  position: relative;
  padding: var(--space-6);
  border: 1px solid var(--neutral-200);
  border-radius: var(--radius-lg);
  background: var(--neutral-0);
  box-shadow: var(--shadow-sm);
}

.metric-label {
  color: var(--neutral-500);
  font-size: var(--fs-sm);
  font-weight: var(--fw-medium);
}

.metric-value {
  margin-top: var(--space-2);
  font-size: var(--fs-3xl);
  font-weight: var(--fw-bold);
  letter-spacing: var(--tracking-tight);
  color: var(--neutral-900);
}

.metric-sub {
  display: block;
  margin-top: var(--space-1);
  color: var(--neutral-500);
  font-size: var(--fs-xs);
  line-height: 1.3;
  font-variant-numeric: tabular-nums;
}

.project-kpis .metric .cost {
  font-weight: var(--fw-bold);
}

.metric-budget-remaining {
  font-variant-numeric: tabular-nums;
}

/* Per-tile circular tinted icon (top-right). Color is the accent at full
 * saturation; background is the matching 10%-tint. */
.metric-kpi-icon {
  position: absolute;
  top: var(--space-5);
  right: var(--space-5);
  width: 40px;
  height: 40px;
  border-radius: var(--radius-full);
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.metric-kpi-icon svg {
  width: 20px;
  height: 20px;
  stroke-width: 2;
}

.metric-kpi-invocations .metric-kpi-icon {
  background: var(--accent-bg-indigo);
  color: var(--accent-indigo);
}
.metric-kpi-issues .metric-kpi-icon {
  background: var(--accent-bg-emerald);
  color: var(--accent-emerald);
}
.metric-kpi-spend .metric-kpi-icon {
  background: var(--accent-bg-violet);
  color: var(--accent-violet);
}
.metric-kpi-budget .metric-kpi-icon {
  background: var(--accent-bg-amber);
  color: var(--accent-amber);
}
.metric-kpi-runtime .metric-kpi-icon {
  background: var(--accent-bg-rose);
  color: var(--accent-rose);
}
.metric-kpi-preflight .metric-kpi-icon {
  background: var(--accent-bg-amber);
  color: var(--accent-amber);
}
.metric-kpi-build .metric-kpi-icon {
  background: var(--accent-bg-emerald);
  color: var(--accent-emerald);
}

/* Portfolio (/projects) KPI strip - issue #277. Same chassis as the project
 * detail page (#261) but with a dedicated four-up role palette: Projects →
 * indigo, Invocations → emerald, Distinct issues → amber, Observed cost →
 * rose. The Observed cost tile keeps the existing `.cost-*` confidence color
 * classes intact; only the icon chip carries the rose accent. */
.metric-kpi-projects .metric-kpi-icon {
  background: var(--accent-bg-indigo);
  color: var(--accent-indigo);
}

.summary-grid.projects-portfolio .metric-kpi-invocations .metric-kpi-icon {
  background: var(--accent-bg-emerald);
  color: var(--accent-emerald);
}

.summary-grid.projects-portfolio .metric-kpi-issues .metric-kpi-icon {
  background: var(--accent-bg-amber);
  color: var(--accent-amber);
}

.metric-kpi-cost .metric-kpi-icon {
  background: var(--accent-bg-rose);
  color: var(--accent-rose);
}

/* Subtle hover lift for the portfolio KPI tiles to match the §3.10 motion
 * spec. Detail-page tiles intentionally stay static to avoid distracting
 * focus from the active issue list directly below them. */
.summary-grid.projects-portfolio .metric {
  transition:
    transform var(--duration-base) var(--ease-standard),
    box-shadow var(--duration-base) var(--ease-standard);
}

.summary-grid.projects-portfolio .metric:hover {
  transform: translateY(-1px);
  box-shadow: var(--shadow-md);
}

/* Hierarchy tweak: make the value dominate and demote the label to a tracked
 * small-caps treatment so the KPI tiles read as data, not decoration. */
.summary-grid.projects-portfolio .metric-value {
  font-size: var(--fs-3xl);
  font-weight: var(--fw-bold);
  font-variant-numeric: tabular-nums;
  letter-spacing: var(--tracking-tight);
}

.summary-grid.projects-portfolio .metric-label {
  font-size: var(--fs-xs);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--neutral-500);
}

@media (prefers-reduced-motion: reduce) {
  .summary-grid.projects-portfolio .metric {
    transition: none;
  }
  .summary-grid.projects-portfolio .metric:hover {
    transform: none;
  }
}

/* Make room above the icon for the label/value when content runs long. */
.metric-kpi .metric-label,
.metric-kpi .metric-value,
.metric-kpi .metric-sub {
  padding-right: 52px;
}

/* Budget remaining tile: 4px progress bar pinned to the card's bottom edge. */
.metric-kpi-budget {
  padding-bottom: calc(var(--space-6) + 4px);
  overflow: hidden;
}

.metric-progress {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 4px;
  background: var(--neutral-100);
}

.metric-progress-fill {
  height: 100%;
  width: var(--budget-pct, 0%);
  background: var(--brand-primary);
}

/* Stagger reveal: 300ms fade + 4px translate-up, delays 0/60/120/180/240/300. */
@keyframes ds-kpi-rise {
  from { opacity: 0; transform: translateY(4px); }
  to   { opacity: 1; transform: none; }
}

.summary-grid.project-kpis .metric,
.summary-grid.projects-portfolio .metric {
  animation: ds-kpi-rise var(--duration-slow) var(--ease-decelerate) both;
}

.summary-grid.project-kpis .metric:nth-child(1),
.summary-grid.projects-portfolio .metric:nth-child(1) { animation-delay: 0ms; }
.summary-grid.project-kpis .metric:nth-child(2),
.summary-grid.projects-portfolio .metric:nth-child(2) { animation-delay: 60ms; }
.summary-grid.project-kpis .metric:nth-child(3),
.summary-grid.projects-portfolio .metric:nth-child(3) { animation-delay: 120ms; }
.summary-grid.project-kpis .metric:nth-child(4),
.summary-grid.projects-portfolio .metric:nth-child(4) { animation-delay: 180ms; }
.summary-grid.project-kpis .metric:nth-child(5) { animation-delay: 240ms; }
.summary-grid.project-kpis .metric:nth-child(6) { animation-delay: 300ms; }

@media (prefers-reduced-motion: reduce) {
  .summary-grid.project-kpis .metric,
  .summary-grid.projects-portfolio .metric {
    animation: none;
  }
}

/* Portfolio control center v2 (#773): operational + business KPI rows and triage queues. */
.portfolio-kpi-section-label {
  margin: 0 0 var(--space-3);
  font-size: var(--fs-xs);
  font-weight: var(--fw-semibold);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--neutral-500);
}

.summary-grid.projects-portfolio--business {
  margin-bottom: var(--space-6);
}

/* Density overrides: tighten portfolio KPI tiles relative to the generic
 * .metric baseline (--space-6/24px → --space-4/16px). The budget tile gets
 * a matching bottom padding to preserve its progress-bar gutter. */
.summary-grid.projects-portfolio .metric {
  padding: var(--space-4);
}

.summary-grid.projects-portfolio .metric-kpi-budget {
  padding-bottom: calc(var(--space-4) + 4px);
}

.summary-grid.projects-portfolio {
  gap: var(--space-2);
}

.summary-grid.projects-portfolio .metric--link {
  text-decoration: none;
  color: inherit;
}

.summary-grid.projects-portfolio .metric-sub {
  display: block;
  margin-top: var(--space-1);
  font-size: var(--fs-xs);
  color: var(--neutral-500);
  line-height: 1.35;
  padding-right: 52px;
}

.metric-kpi-ready .metric-kpi-icon {
  background: var(--accent-bg-emerald);
  color: var(--accent-emerald);
}

.metric-kpi-triage .metric-kpi-icon {
  background: var(--accent-bg-amber);
  color: var(--accent-amber);
}

.metric-kpi-preflight-gap .metric-kpi-icon {
  background: var(--accent-bg-violet);
  color: var(--accent-violet);
}

.metric-kpi-live .metric-kpi-icon {
  background: var(--accent-bg-indigo);
  color: var(--accent-indigo);
}

.metric-kpi-period .metric-kpi-icon {
  background: var(--accent-bg-emerald);
  color: var(--accent-emerald);
}

.metric-kpi-success .metric-kpi-icon {
  background: var(--accent-bg-indigo);
  color: var(--accent-indigo);
}

.summary-grid.projects-portfolio .metric-value--emphasis-ready {
  color: var(--success);
}

.summary-grid.projects-portfolio .metric-value--emphasis-triage {
  color: var(--warning);
}

.summary-grid.projects-portfolio .metric-value--emphasis-live {
  color: var(--accent-indigo);
}

.portfolio-queue-strip {
  margin-bottom: var(--space-6);
  padding: var(--space-4);
  background: var(--neutral-0);
  border: 1px solid var(--neutral-200);
  border-radius: var(--radius-lg);
}

.portfolio-queue-strip-chips {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
}

.portfolio-queue-chip {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-2) var(--space-4);
  border-radius: var(--radius-full);
  border: 1px solid var(--neutral-200);
  background: var(--neutral-50);
  font-size: var(--fs-sm);
  font-weight: var(--fw-medium);
  color: var(--neutral-700);
  text-decoration: none;
}

.portfolio-queue-chip:hover:not(.portfolio-queue-chip--disabled) {
  border-color: var(--brand-primary);
  background: var(--info-bg);
}

.portfolio-queue-chip--disabled {
  opacity: 0.55;
  cursor: default;
}

.portfolio-queue-chip-count {
  display: inline-grid;
  place-items: center;
  min-width: 22px;
  height: 22px;
  padding: 0 var(--space-2);
  border-radius: var(--radius-full);
  font-size: var(--fs-xs);
  font-weight: var(--fw-bold);
}

.portfolio-queue-chip--ready .portfolio-queue-chip-count {
  background: var(--success-bg);
  color: var(--success-text);
}

.portfolio-queue-chip--triage .portfolio-queue-chip-count {
  background: var(--warning-bg);
  color: var(--warning-text);
}

.portfolio-queue-chip--preflight .portfolio-queue-chip-count {
  background: var(--accent-bg-violet);
  color: var(--accent-violet);
}

.portfolio-queue-chip--live .portfolio-queue-chip-count {
  background: var(--accent-bg-indigo);
  color: var(--accent-indigo);
}

.portfolio-queue-chip--budget .portfolio-queue-chip-count {
  background: var(--warning-bg);
  color: var(--warning-text);
}

/* Readiness tile: chassis adopts the new chrome; only the icon and value text
 * carry the state-driven coloring. No coloured background - the card itself
 * stays neutral so the strip reads as a uniform six-up. */
.metric-readiness {
  display: flex;
  flex-direction: column;
}

.metric-value-readiness {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  font-size: var(--fs-xl);
  line-height: 1.2;
}

.metric-value-readiness .readiness-icon {
  font-size: var(--fs-lg);
  line-height: 1;
}

.metric-readiness.readiness-state-ready .readiness-icon {
  color: var(--success);
}

.metric-readiness.readiness-state-blocked .readiness-icon,
.metric-readiness.readiness-state-blocked .metric-value-readiness {
  color: var(--warning-text);
}

.metric-readiness.readiness-state-na .readiness-icon,
.metric-readiness.readiness-state-loading .readiness-icon,
.metric-readiness.readiness-state-na .metric-value-readiness,
.metric-readiness.readiness-state-loading .metric-value-readiness {
  color: var(--neutral-500);
}

.section {
  margin-top: var(--space-5);
}

.section-title {
  margin: 0 0 8px;
  font-size: 15px;
  font-weight: 700;
}

.section-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--space-3);
  margin-bottom: var(--space-4);
}

.section-header .section-title {
  margin-bottom: 4px;
}

.section-desc {
  margin: 0;
  font-size: var(--fs-sm);
  color: var(--neutral-500);
  max-width: 60ch;
  line-height: 1.45;
}

.issues-table-meta {
  margin: 0 0 var(--space-3);
  font-size: 13px;
  color: var(--neutral-500);
}

.issues-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 12px;
  margin-bottom: var(--space-3);
}

.issues-toolbar-sort {
  gap: var(--space-2) var(--space-3);
}

.issues-toolbar-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--neutral-500);
  margin-right: 4px;
}

a.issues-sort-link {
  font-size: 13px;
  color: var(--brand-primary);
  text-decoration: none;
  padding: var(--space-1) var(--space-2);
  border-radius: 6px;
}

a.issues-sort-link:hover {
  text-decoration: underline;
}

a.issues-sort-link.is-active {
  background: var(--neutral-0);
  border: 1px solid var(--neutral-200);
  font-weight: 600;
  color: var(--neutral-700);
  text-decoration: none;
}

.issues-toolbar-pagination {
  gap: 12px;
}

.issues-page-indicator {
  font-size: 13px;
  color: var(--neutral-500);
}

a.issues-page-btn,
span.issues-page-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 32px;
  padding: 4px 12px;
  font-size: 13px;
}

span.issues-page-btn.is-disabled {
  opacity: var(--disabled-opacity);
  cursor: not-allowed;
  pointer-events: none;
}

.table-wrap {
  overflow-x: auto;
  overflow-y: visible;
  border: 1px solid var(--neutral-200);
  border-radius: var(--radius-lg);
  background: var(--neutral-0);
  box-shadow: var(--shadow-sm);
}

.table-wrap:has(.issues-table) {
  overflow-x: auto;
  position: relative;
}

table {
  width: 100%;
  min-width: 0;
  border-collapse: collapse;
  table-layout: fixed;
}

th,
td {
  padding: var(--space-2) var(--space-3);
  border-bottom: 1px solid var(--neutral-200);
  text-align: left;
  vertical-align: top;
}

.issues-table {
  width: 100%;
  min-width: 1040px;
}

.issues-table th:nth-child(1),
.issues-table td.issue-col-issue {
  width: 39%;
}

.issues-table th:nth-child(2),
.issues-table td.issue-col-run {
  width: 120px;
}

.run-inline-error {
  display: block;
  font-size: 0.7rem;
  color: var(--danger-text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
}

.issues-table th:nth-child(3),
.issues-table td.issue-col-cost {
  width: 180px;
}

.issues-table th.issue-col-cost-header {
  text-align: right;
}

.issues-table th:nth-child(4),
.issues-table td.issue-col-activity {
  width: 190px;
}

.issues-table th:nth-child(5),
.issues-table td.issue-col-actions {
  width: 142px;
}

@media (min-width: 1101px) {
  .issues-table .issue-col-issue {
    position: static;
    left: auto;
    box-shadow: none;
    background: var(--neutral-0);
  }

  .issues-table thead .issue-col-issue {
    background: var(--neutral-100);
    z-index: auto;
    box-shadow: none;
  }

  .issues-table td.issue-col-actions {
    position: static;
    right: auto;
    box-shadow: none;
    background-color: var(--neutral-0);
  }

  .issues-table thead th:last-child {
    position: static;
    right: auto;
    box-shadow: none;
  }
}

@media (max-width: 1100px) {
  .issues-table .issue-col-issue {
    position: sticky;
    left: 0;
    background: var(--neutral-0);
    z-index: 1;
    box-shadow: 6px 0 8px -4px rgba(23, 32, 42, 0.08);
  }

  .issues-table thead .issue-col-issue {
    background: var(--neutral-100);
    z-index: 2;
    box-shadow: 6px 0 8px -4px rgba(23, 32, 42, 0.06);
  }

  .issues-table td.issue-col-actions {
    position: sticky;
    right: 0;
    z-index: 2;
    background-color: var(--neutral-0);
    box-shadow: -6px 0 8px -4px rgba(23, 32, 42, 0.08);
  }

  .issues-table thead th:last-child {
    position: sticky;
    right: 0;
    z-index: 3;
    box-shadow: -6px 0 8px -4px rgba(23, 32, 42, 0.06);
  }
}

.issue-cell-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-bottom: 4px;
}

.issue-cell-num {
  font-weight: 700;
}

.issue-cell-title {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
  overflow: hidden;
  word-break: break-word;
  line-height: 1.35;
  font-size: 13px;
}

.stack-cell {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 13px;
  line-height: 1.35;
}

.stack-cell-line {
  min-width: 0;
}

.stack-cell-sub {
  color: var(--neutral-500);
  font-size: 12px;
}

.stack-cell-k {
  color: var(--neutral-500);
  font-weight: 600;
  font-size: 11px;
  margin-right: 4px;
}

.cell-muted {
  color: var(--neutral-500);
  font-size: 13px;
}

.timeline-collapsed-count {
  display: inline-block;
  margin-left: var(--space-2);
  padding: 1px var(--space-2);
  border: 1px solid var(--neutral-200);
  border-radius: 999px;
  background: var(--neutral-100);
  color: var(--neutral-500);
  font-size: 11px;
  font-weight: 600;
  vertical-align: baseline;
}

.timeline-cost-progress {
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
  margin-left: 8px;
  padding: 1px var(--space-2);
  border: 1px solid var(--neutral-200);
  border-radius: 999px;
  background: var(--neutral-50, #f9f9f9);
  font-size: 11px;
  font-variant-numeric: tabular-nums;
  color: var(--neutral-600);
  vertical-align: baseline;
  white-space: nowrap;
}

.timeline-cost-value {
  font-weight: 700;
  color: var(--neutral-800);
}

.timeline-cost-bar {
  display: inline-block;
  width: 40px;
  height: 5px;
  border-radius: 3px;
  background: var(--neutral-200);
  overflow: hidden;
  vertical-align: middle;
}

.timeline-cost-bar-fill {
  display: block;
  height: 100%;
  border-radius: 3px;
  background: var(--brand-primary, #4f6ef7);
  min-width: 2px;
}

.timeline-cost-bar-fill--over {
  background: var(--danger, #d93025);
}

.timeline-cost-pct {
  color: var(--neutral-500);
}

.pill-unknown-wrap .pill.unknown {
  border-color: rgba(148, 98, 0, 0.45);
  background: #fff7df;
  color: var(--warning);
}

.cost-summary-cell {
  display: grid;
  grid-template-columns: max-content 1fr;
  gap: var(--space-1) var(--space-2);
  font-size: 12px;
  line-height: 1.35;
}

.cost-summary-span {
  grid-column: 1 / -1;
}

.cost-summary-k {
  color: var(--neutral-500);
  font-weight: 600;
}

.cost-summary-cell .cost {
  justify-self: end;
  font-variant-numeric: tabular-nums;
}

.cost-row-details {
  grid-column: 1 / -1;
  margin-top: 4px;
  width: 100%;
  text-align: right;
}

.cost-row-details-summary {
  cursor: pointer;
  color: var(--brand-primary);
  font-weight: 700;
  font-size: 12px;
  list-style: none;
}

.cost-row-details-summary::-webkit-details-marker {
  display: none;
}

.cost-breakdown-expanded {
  margin-top: var(--space-2);
  padding: 8px;
  border: 1px solid var(--neutral-200);
  border-radius: 6px;
  background: var(--neutral-100);
  text-align: left;
}

/*
 * Tables (Phase 3 - issue #261).
 * Header: 12/500 in slate-500 with the table-tracking token. Body cells inherit
 * sm body color. Row dividers are neutral-100 (lighter than the page border)
 * to keep the row interior airy. Issues table opts into 52px row height and
 * a hover wash. Legacy `var(--neutral-100)` and `var(--neutral-200)` references are
 * deliberately left in place outside of these rules - Phase 4 cleanup will
 * sweep them.
 */
th {
  background: var(--neutral-50);
  color: var(--neutral-500);
  font-size: var(--fs-xs);
  font-weight: var(--fw-medium);
  letter-spacing: var(--tracking-table);
  text-transform: none;
}

td {
  font-size: var(--fs-sm);
  color: var(--neutral-700);
  border-bottom-color: var(--neutral-100);
}

tr:last-child td {
  border-bottom: 0;
}

.issues-table tbody tr {
  height: 52px;
}

.issues-table tbody tr:hover {
  background: var(--neutral-50);
}

/* Issue numbers (#N) read as work-item IDs - they get JetBrains Mono in
 * brand-primary, with underline-on-hover when wrapped in a link. */
.issue-cell-num {
  font-family: var(--font-mono);
  color: var(--brand-primary);
}

.issue-cell-head a:hover .issue-cell-num,
a:hover > .issue-cell-num {
  text-decoration: underline;
}

.wrap {
  max-width: 340px;
  overflow: hidden;
  text-overflow: ellipsis;
}

.wrap.wide {
  max-width: 520px;
}

.num {
  text-align: right;
  font-variant-numeric: tabular-nums;
}

/*
 * Status pill state → DS status palette mapping (Phase 2)
 *
 * succeeded, closed (positive)                         → success  (#D1FAE5 / #065F46)
 * running, creating_agent                              → warning  (#FEF3C7 / #92400E)
 * failed, cancelled                                    → danger   (#FEE2E2 / #991B1B)
 * open, sent, proceed, build                       → info     (#DBEAFE / #1E40AF)
 * released, na, defer - and the base pill default      → neutral  (#F1F5F9 / #475569)
 *
 * cost-high / cost-medium are not pills - kept on their own rules below.
 */

.pill {
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
  min-height: 22px;
  padding: var(--space-1) var(--space-2);
  border-radius: var(--radius-full);
  border: 1px solid var(--neutral-200);
  background: var(--neutral-badge-bg);
  color: var(--neutral-badge-text);
  font-size: var(--fs-xs);
  font-weight: var(--fw-medium);
  text-transform: capitalize;
}

.pill-icon {
  display: inline-flex;
  align-items: center;
  flex-shrink: 0;
  width: 10px;
  height: 10px;
}

.pill.succeeded,
.pill.closed {
  border-color: transparent;
  background: var(--success-bg);
  color: var(--success-text);
}

.pill.failed,
.pill.cancelled {
  border-color: transparent;
  background: var(--danger-bg);
  color: var(--danger-text);
}

.pill.running,
.pill.creating_agent,
.cost-medium {
  border-color: transparent;
  background: var(--warning-bg);
  color: var(--warning-text);
}

/* In-flight status pills — pulsing dot signals active work */
.pill.running::before,
.pill.creating_agent::before,
.pill.requested::before,
.pill.sent::before,
.pill.dispatch-status-running::before,
.pill.wave-plan-status-running::before,
.pill.queue-item-status-dispatched::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
  flex-shrink: 0;
  animation: pill-live-pulse 1.4s ease-in-out infinite;
}

@keyframes pill-live-pulse {
  0%, 100% { opacity: 0.35; transform: scale(0.88); }
  50% { opacity: 1; transform: scale(1); }
}

@media (prefers-reduced-motion: reduce) {
  .pill.running::before,
  .pill.creating_agent::before,
  .pill.requested::before,
  .pill.sent::before,
  .pill.dispatch-status-running::before,
  .pill.wave-plan-status-running::before,
  .pill.queue-item-status-dispatched::before {
    animation: none;
    opacity: 0.85;
  }
}

.pill.sent,
.pill.open,
.pill.proceed {
  border-color: transparent;
  background: var(--info-bg);
  color: var(--info-text);
}

.pill.build {
  border-color: transparent;
  background: var(--color-mode-build-subtle);
  color: var(--color-mode-build-text);
}

.pill.pill-preflight-decision {
  border-color: transparent;
  background: var(--success-bg);
  color: var(--success-text);
  font-weight: var(--fw-semibold);
}

/* ===== Ranked candidates - score utilities, bar, cost, cell helpers ===== */

.score-positive { color: var(--success-text); }
.score-negative { color: var(--danger-text); }
.score-neutral  { color: var(--neutral-badge-text); }

.pill.eligibility-eligible {
  border-color: transparent;
  background: var(--success-bg);
  color: var(--success-text);
}
.pill.eligibility-ineligible {
  border-color: transparent;
  background: var(--danger-bg);
  color: var(--danger-text);
}

.score-bar-wrap {
  display: inline-flex;
  flex-direction: column;
  align-items: flex-end;
  gap: var(--space-1);
  min-width: 72px;
}
.score-bar {
  width: 100%;
  height: 4px;
  border-radius: 2px;
  background: var(--neutral-200);
  overflow: hidden;
}
.score-bar-fill {
  height: 100%;
  border-radius: 2px;
  background: var(--neutral-400);
}
.score-bar-fill.score-positive { background: var(--success); }
.score-bar-fill.score-negative { background: var(--danger); }
.score-bar-fill.score-neutral  { background: var(--neutral-400); }

/* ===== Issue Queue curation panel (#1799) ===== */

.score-breakdown {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  align-items: center;
}
.score-chip {
  display: inline-flex;
  align-items: baseline;
  gap: var(--space-1);
  padding: 1px var(--space-2);
  border-radius: 10px;
  font-size: var(--fs-xs);
  font-variant-numeric: tabular-nums;
  background: var(--neutral-100);
  border: 1px solid var(--neutral-200);
}
.score-chip .score-chip-abbr { font-weight: var(--fw-semibold); opacity: 0.7; }
.score-chip-pos  { background: var(--success-bg); color: var(--success-text); border-color: transparent; }
.score-chip-neg  { background: var(--danger-bg); color: var(--danger-text); border-color: transparent; }
.score-chip-zero { color: var(--neutral-badge-text); }
.score-chip-total {
  font-weight: var(--fw-semibold);
  background: var(--neutral-200);
  border-color: transparent;
}

.section-header-actions {
  display: flex;
  gap: 8px;
  align-items: center;
}

.suggested-issue-title,
.queue-item-title {
  display: inline;
  margin-left: var(--space-2);
  font-weight: var(--fw-medium);
}
.suggested-issue-link,
.queue-item-number {
  font-weight: var(--fw-semibold);
}

.queue-item-prio { white-space: nowrap; }
.queue-item-rank {
  display: inline-block;
  min-width: 1.4em;
  font-variant-numeric: tabular-nums;
  font-weight: var(--fw-semibold);
}
.queue-item-reorder {
  display: inline-flex;
  gap: 2px;
  margin-left: var(--space-2);
}
.btn.btn-icon {
  padding: 2px var(--space-2);
  line-height: 1;
}
.pill.queue-item-status-queued     { background: var(--info-bg, var(--neutral-100)); }
.pill.queue-item-status-dispatched { background: var(--warning-bg, var(--neutral-100)); }
.pill.queue-item-status-completed  { background: var(--success-bg); color: var(--success-text); }
.pill.queue-item-status-failed     { background: var(--danger-bg); color: var(--danger-text); }

.cell-secondary {
  display: block;
  margin-top: 2px;
  font-size: var(--fs-xs);
  color: var(--neutral-500);
  font-weight: var(--fw-regular);
}

.subsection-title {
  font-size: 14px;
  font-weight: 600;
  margin: 0 0 8px;
  color: var(--neutral-700);
  letter-spacing: 0.01em;
}

/* #240 - invocation detail page splits "Agent analysis" (forecast for a future
   build run) from "Execution telemetry" (what happened while running the
   preflight itself). The banner introduces each domain with a heading + short
   subtitle so labels like "observed cost" can no longer be confused with the
   build forecast. */
.invocation-group-banner {
  margin-top: 28px;
  padding: var(--space-4) var(--space-4);
  border: 1px solid var(--neutral-200);
  border-left: 4px solid var(--brand-primary);
  border-radius: 8px;
  background: var(--neutral-0);
  box-shadow: var(--shadow-sm);
}

.invocation-group-banner:first-of-type {
  margin-top: 0;
}

.invocation-group-banner[data-invocation-group="execution-telemetry"] {
  border-left-color: var(--neutral-500);
}

.invocation-group-banner-title {
  margin: 0;
  font-size: 16px;
  font-weight: 700;
  letter-spacing: 0.01em;
}

.invocation-group-banner-title-extra {
  margin-left: var(--space-3);
  vertical-align: middle;
  font-size: 13px;
  font-weight: 400;
  letter-spacing: 0;
  text-transform: none;
}

.invocation-group-banner-subtitle {
  margin: 4px 0 0;
  font-size: 13px;
  line-height: 1.5;
  color: var(--neutral-500);
}

/* Inline subtitle below a section title - used on Build forecast and
   Observed preflight run cost to make the contrast between the two costs
   explicit at the section level (#240). */
.section-subtitle {
  margin: var(--space-1) 0 var(--space-3);
  font-size: 13px;
  line-height: 1.5;
  color: var(--neutral-500);
}

.inline-legend {
  margin: 4px 0 12px;
  font-size: 12px;
  color: var(--neutral-500);
}

.inline-legend summary {
  cursor: pointer;
  user-select: none;
  color: var(--neutral-500);
  font-size: 12px;
}

.inline-legend-list {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: var(--space-1) var(--space-3);
  margin: var(--space-2) 0 0 var(--space-4);
  align-items: baseline;
}

.inline-legend-list dt {
  font-weight: 600;
}

.inline-legend-list dd {
  margin: 0;
  color: var(--neutral-600);
}

.preflight-recommendation {
  margin: var(--space-3) 0 0;
  font-size: 13px;
  line-height: 1.5;
}

.preflight-budget-note {
  margin: var(--space-3) 0 var(--space-4);
  font-size: 13px;
  line-height: 1.5;
  color: var(--neutral-500);
}

.preflight-budget-note code {
  font-size: 12px;
}

.preflight-business-outcome {
  margin-top: 12px;
}

/* Preflight / run detail page — tighter vertical rhythm, less scroll for signal */
.invocation-detail .section {
  margin-top: 16px;
}

.invocation-detail .invocation-group-banner {
  margin-top: 20px;
  padding: var(--space-3) var(--space-4);
}

.invocation-detail .invocation-group-banner:first-of-type {
  margin-top: 0;
}

.invocation-detail .details-block {
  margin-top: 12px;
}

.invocation-forecast-details-body {
  padding: var(--space-3) var(--space-4) var(--space-4);
  border: 1px solid var(--neutral-200);
  border-top: 0;
  border-radius: 0 0 8px 8px;
  background: var(--neutral-0);
}

.invocation-forecast-details[open] .invocation-forecast-details-body {
  margin-top: -1px;
}

.conflict-risk-inline {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-2);
  margin: 0 0 var(--space-2);
  font-size: 14px;
}

.conflict-risk-inline-score {
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.section--compact .section-subtitle {
  margin-bottom: 0;
}

.preflight-likely-files {
  margin-top: 12px;
}

/* ----- Preflight outcome panel (unified hero) ------------------------------ */

.preflight-outcome-eyebrow {
  margin: 0 0 10px;
  font-size: 12px;
  line-height: 1.45;
  color: var(--neutral-500);
}

.verdict-panel {
  border: 1px solid var(--neutral-200);
  border-radius: 14px;
  background: var(--neutral-0);
  box-shadow: var(--shadow-md);
  overflow: hidden;
}

.verdict-panel[data-decision="proceed"] { border-top: 4px solid var(--color-decision-proceed-solid); }
.verdict-panel[data-decision="clarify"] { border-top: 4px solid var(--color-decision-clarify-solid); }
.verdict-panel[data-decision="split"]   { border-top: 4px solid var(--color-decision-split-solid); }
.verdict-panel[data-decision="defer"]   { border-top: 4px solid var(--color-decision-defer-solid); }

.verdict-panel-head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px 24px;
  padding: 16px 20px 16px;
}

.verdict-panel-primary {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 14px 18px;
  min-width: 0;
}

.verdict-panel-metrics {
  display: flex;
  flex-wrap: wrap;
  align-items: stretch;
  justify-content: flex-end;
  gap: 10px;
  min-width: 0;
  flex: 1 1 320px;
}

.verdict-score-compact {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.verdict-score-compact-num {
  font-size: 28px;
  font-weight: 800;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}

.verdict-score-compact-good .verdict-score-compact-num { color: var(--success); }
.verdict-score-compact-warn .verdict-score-compact-num { color: var(--warning); }
.verdict-score-compact-bad  .verdict-score-compact-num { color: var(--danger); }

.cost-range-compact {
  display: inline-flex;
  flex-wrap: wrap;
  align-items: stretch;
  gap: 6px;
  padding: 6px;
  border: 1px solid var(--neutral-200);
  border-radius: 10px;
  background: var(--neutral-50);
}

.cost-range-compact-slot {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  min-width: 72px;
  padding: 6px 8px;
  border-radius: 8px;
}

.cost-range-compact-highlight {
  background: var(--neutral-0);
  box-shadow: var(--shadow-xs);
  border: 1px solid rgba(37, 99, 235, 0.18);
}

.cost-range-compact-val {
  font-size: 15px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  line-height: 1.2;
}

.cost-range-compact-label {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--neutral-500);
}

.cost-range-compact-conf {
  align-self: center;
  margin-left: 2px;
  text-transform: capitalize;
}

.verdict-model-chip,
.verdict-conflict-chip {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 4px;
  min-height: 100%;
  padding: 8px 12px;
  border: 1px solid var(--neutral-200);
  border-radius: 10px;
  background: var(--neutral-0);
  font-size: 13px;
}

.verdict-model-chip-label,
.verdict-conflict-chip-label {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--neutral-500);
}

.verdict-conflict-chip {
  flex-direction: row;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
}

.verdict-conflict-chip-score {
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.verdict-panel .verdict-next-step,
.verdict-panel .verdict-decision-adjusted,
.verdict-panel .verdict-calibration-note {
  margin-left: 20px;
  margin-right: 20px;
}

.verdict-panel .verdict-next-step {
  margin-top: 0;
  margin-bottom: 10px;
}

.verdict-signal-bars-compact {
  margin: 0 20px 12px;
  padding-top: 10px;
  border-top: 1px solid var(--neutral-100);
}

.verdict-panel-actions {
  padding: 14px 20px 16px;
  border-top: 1px solid var(--neutral-200);
  background: linear-gradient(180deg, var(--neutral-50), var(--neutral-0));
}

.verdict-panel-actions .preflight-cta-group {
  margin-top: 0;
  padding: 0;
  border: 0;
  background: transparent;
  box-shadow: none;
}

.invocation-followup-hint {
  margin: 6px 0 0;
  font-size: 12px;
  line-height: 1.4;
}

.invocation-drivers-details-body,
.invocation-telemetry-details-body {
  padding: 0 16px 16px;
  border: 1px solid var(--neutral-200);
  border-top: 0;
  border-radius: 0 0 8px 8px;
  background: var(--neutral-0);
}

.invocation-telemetry-details[open] .invocation-telemetry-details-body,
.invocation-drivers-details[open] .invocation-drivers-details-body {
  margin-top: -1px;
}

@media (max-width: 720px) {
  .verdict-panel-head {
    flex-direction: column;
  }

  .verdict-panel-metrics {
    justify-content: flex-start;
    width: 100%;
  }
}

/* ---------- No-file-changes hero ---------- */

.no-changes-hero {
  margin-bottom: 24px;
  padding: 20px 24px;
  border: 1px solid rgba(217, 119, 6, 0.3);
  border-radius: 12px;
  background: linear-gradient(180deg, rgba(255, 251, 235, 0.9), var(--neutral-0));
  box-shadow: var(--shadow-sm);
}

[data-theme="dark"] .no-changes-hero {
  background: linear-gradient(180deg, rgba(120, 53, 15, 0.18), var(--neutral-0));
  border-color: rgba(217, 119, 6, 0.4);
}

.no-changes-hero-run-type {
  margin-bottom: 4px;
  color: var(--neutral-500);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.no-changes-hero-title {
  margin: 0 0 var(--space-2);
  font-size: 18px;
  font-weight: 700;
  color: rgb(146, 64, 14);
}

[data-theme="dark"] .no-changes-hero-title {
  color: rgb(253, 186, 116);
}

.no-changes-hero-cause {
  margin: 0 0 4px;
  font-size: 14px;
  color: var(--neutral-700);
}

.no-changes-hero-recovery {
  margin: 0;
  font-size: 13px;
  color: var(--neutral-500);
}

/* ---------- Partial wind-down hero (#1977 display status) ---------- */

.pill.partial_wind_down,
.pill--partial-wind-down {
  border-color: transparent;
  background: var(--warning-bg);
  color: var(--warning-text);
}

.partial-wind-down-hero {
  margin-bottom: 24px;
  padding: 20px 24px;
  border: 1px solid rgba(217, 119, 6, 0.35);
  border-radius: 12px;
  background: linear-gradient(180deg, rgba(255, 247, 237, 0.95), var(--neutral-0));
  box-shadow: var(--shadow-sm);
}

[data-theme="dark"] .partial-wind-down-hero {
  background: linear-gradient(180deg, rgba(120, 53, 15, 0.22), var(--neutral-0));
  border-color: rgba(217, 119, 6, 0.45);
}

.partial-wind-down-hero-run-type {
  margin-bottom: 4px;
  color: var(--neutral-500);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.partial-wind-down-hero-title {
  margin: 0 0 var(--space-2);
  font-size: 18px;
  font-weight: 700;
  color: rgb(154, 52, 18);
}

[data-theme="dark"] .partial-wind-down-hero-title {
  color: rgb(253, 186, 116);
}

.partial-wind-down-hero-cause {
  margin: 0 0 4px;
  font-size: 14px;
  color: var(--neutral-700);
}

.partial-wind-down-hero-recovery {
  margin: 0;
  font-size: 13px;
  color: var(--neutral-500);
}

.partial-wind-down-hero-actions {
  margin-top: 12px;
}

/* ---------- Failure diagnosis hero (#567) ---------- */

.failure-diagnosis-hero {
  margin-bottom: 24px;
  padding: 20px 24px;
  border: 1px solid rgba(220, 38, 38, 0.3);
  border-radius: 12px;
  background: linear-gradient(180deg, rgba(254, 242, 242, 0.8), var(--neutral-0));
  box-shadow: var(--shadow-sm);
}

[data-theme="dark"] .failure-diagnosis-hero {
  background: linear-gradient(180deg, rgba(127, 29, 29, 0.18), var(--neutral-0));
  border-color: rgba(220, 38, 38, 0.4);
}

.failure-diagnosis-header {
  margin-bottom: 16px;
}

.failure-diagnosis-run-type {
  margin-bottom: 4px;
  color: var(--neutral-500);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.failure-diagnosis-title {
  margin: 0 0 var(--space-2);
  font-size: 18px;
  font-weight: 700;
  color: rgb(185, 28, 28);
}

[data-theme="dark"] .failure-diagnosis-title {
  color: rgb(252, 165, 165);
}

.failure-diagnosis-cause {
  margin: 0 0 4px;
  font-size: 14px;
  color: var(--neutral-700);
}

.failure-diagnosis-recovery {
  margin: 0;
  font-size: 13px;
  color: var(--neutral-500);
}

.failure-diagnosis-metrics {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 16px;
}

.failure-diagnosis-metric {
  padding: 12px;
  border: 1px solid var(--neutral-200);
  border-radius: 8px;
  background: var(--neutral-0);
}

.failure-diagnosis-metric-label {
  color: var(--neutral-500);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}

.failure-diagnosis-metric-value {
  margin-top: var(--space-2);
  font-size: 15px;
  font-weight: 600;
  overflow-wrap: anywhere;
}

.failure-diagnosis-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.failure-hero-rerun-form {
  display: contents;
}

@media (max-width: 640px) {
  .failure-diagnosis-metrics {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

/* ---------- end failure diagnosis hero ---------- */

.preflight-hero {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

.preflight-hero-tile {
  min-width: 0;
  padding: 16px;
  border: 1px solid rgba(37, 99, 235, 0.22);
  border-radius: 12px;
  background: linear-gradient(180deg, var(--accent-bg-indigo), var(--neutral-0));
  box-shadow: var(--shadow-sm);
}

.preflight-hero-label {
  color: var(--neutral-500);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}

.preflight-hero-value {
  min-height: 28px;
  margin-top: 8px;
  font-size: 18px;
  font-weight: 700;
  overflow-wrap: anywhere;
}

.preflight-hero-description {
  margin-top: 8px;
  color: var(--neutral-500);
  font-size: 12px;
  line-height: 1.45;
}

.invocation-followup-form {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-3) var(--space-4);
  margin-top: 12px;
  padding: 12px;
  border: 1px solid var(--neutral-200);
  border-radius: 8px;
  background: var(--neutral-0);
  box-shadow: var(--shadow-sm);
}

.invocation-followup-primary {
  min-height: 36px;
}

.invocation-followup-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  color: var(--neutral-500);
  font-size: 12px;
  line-height: 1.4;
}

.invocation-followup-meta > span {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  min-height: 24px;
  padding: 2px 8px;
  border: 1px solid var(--neutral-200);
  border-radius: 9999px;
  background: var(--neutral-50);
}

.invocation-followup-meta > span.invocation-followup-guardrail-val {
  background: var(--warning-bg);
  color: var(--warning-text);
  border-color: transparent;
  font-weight: 600;
}

.preflight-cost-triple {
  display: inline;
  line-height: 1.4;
}

.preflight-cost-slot .cost {
  vertical-align: baseline;
}

.pill.pill-warning,
.pill.clarify,
.pill.split,
.pill.defer,
.pill.pill-observed-confidence-low {
  border-color: transparent;
  background: var(--warning-bg);
  color: var(--warning-text);
}

.pill.pill-ok {
  border-color: transparent;
  background: var(--success-bg);
  color: var(--success-text);
}

.pill.preflight {
  border-color: transparent;
  background: var(--color-mode-preflight-subtle);
  color: var(--color-mode-preflight-text);
}

.pill.pill-observed-confidence-medium {
  border-color: transparent;
  background: var(--info-bg);
  color: var(--info-text);
}

.pill.pill-observed-confidence-high {
  border-color: transparent;
  background: var(--success-bg);
  color: var(--success-text);
}

.score {
  display: inline;
  color: var(--neutral-500);
  font-size: 12px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.cost {
  display: inline-flex;
  gap: var(--space-2);
  align-items: center;
  font-variant-numeric: tabular-nums;
  font-weight: 700;
}

.cost-low {
  color: var(--warning);
}


.cost-none,
.cost-unknown {
  color: var(--neutral-500);
}

.cost-conf-letter {
  font-size: 0.65em;
  vertical-align: super;
  margin-left: 1px;
  opacity: 0.85;
  font-weight: 600;
}

/* "awaiting usage sync" placeholder shown instead of $0 for a freshly
   succeeded run whose Cursor usage events have not synced yet (#1114). */
.cost-pending {
  color: var(--neutral-500);
  font-weight: 600;
  font-style: italic;
}

/* In-flight run progress banner: milestone + live elapsed time (#1115). */
.running-progress {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: var(--space-3) var(--space-4);
  margin-bottom: 16px;
  border: 1px solid var(--info);
  background: var(--info-bg);
  color: var(--info-text);
  border-radius: 8px;
  font-size: var(--fs-sm);
}
.running-progress-spinner {
  width: 14px;
  height: 14px;
  flex: 0 0 auto;
  border: 2px solid currentColor;
  border-right-color: transparent;
  border-radius: 50%;
  animation: loading-spin 0.7s linear infinite;
}
.running-progress-milestone {
  font-weight: 600;
}
.running-progress-sep {
  color: var(--neutral-400);
}
.running-progress-elapsed {
  font-variant-numeric: tabular-nums;
}

.parse-error-snippet {
  margin-top: var(--space-2);
  padding: var(--space-2) var(--space-2);
  border: 1px solid var(--neutral-200);
  border-radius: 6px;
  background: var(--neutral-100);
  font-family: ui-monospace, SFMono-Regular, Consolas, "Liberation Mono", monospace;
  font-size: 12px;
  line-height: 1.4;
  white-space: pre-wrap;
  word-break: break-word;
}

.parse-error-snippet-context {
  color: var(--neutral-500);
}

.parse-error-snippet-mark {
  padding: 0 2px;
  border-radius: 3px;
  background: #fff7df;
  color: var(--warning);
  font-weight: 700;
}

.callout-warn {
  margin: 0 0 12px;
  padding: var(--space-3) var(--space-3);
  border: 1px solid rgba(245, 158, 11, 0.32);
  border-radius: 8px;
  background: var(--warning-bg);
  color: var(--warning-text);
  font-size: 13px;
  line-height: 1.4;
}

.callout-warn a {
  color: var(--brand-primary-hover);
  font-weight: 700;
  text-underline-offset: 2px;
}

.callout-warn a:hover {
  color: var(--brand-primary-hover);
}

.callout-warn code {
  padding: 1px var(--space-1);
  border-radius: 4px;
  background: rgba(148, 98, 0, 0.12);
  font-size: 12px;
}

.empty,
.error,
.loading,
.notice {
  padding: var(--space-5);
  border: 1px solid var(--neutral-200);
  border-radius: 8px;
  background: var(--neutral-0);
  color: var(--neutral-500);
  box-shadow: var(--shadow-sm);
}

.loading {
  display: flex;
  align-items: center;
  gap: 8px;
}

.notice {
  margin-bottom: var(--space-3);
}

.notice a {
  text-decoration: underline;
  text-underline-offset: 2px;
}

.notice.warning {
  border-color: rgba(245, 158, 11, 0.32);
  background: var(--warning-bg);
  color: var(--warning-text);
}

.error {
  border-color: rgba(155, 45, 45, 0.35);
  color: var(--danger);
}

.external {
  font-weight: 700;
}

.kv-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: var(--space-3);
  padding: 12px;
  border: 1px solid var(--neutral-200);
  border-radius: 8px;
  background: var(--neutral-0);
  box-shadow: var(--shadow-sm);
}

.kv-item {
  min-width: 0;
}

.kv-label {
  color: var(--neutral-500);
  font-size: 12px;
  font-weight: 700;
}

.kv-value {
  min-height: 22px;
  margin-top: var(--space-1);
  overflow-wrap: anywhere;
}

code {
  padding: 1px var(--space-1);
  border-radius: 4px;
  background: var(--neutral-100);
  font-family: ui-monospace, SFMono-Regular, Consolas, "Liberation Mono", monospace;
  font-size: 12px;
}

.details-block,
.json-details {
  margin-top: var(--space-3);
}

.details-block summary,
.json-details summary {
  cursor: pointer;
  color: var(--brand-primary);
  font-weight: 700;
}

.details-block summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: var(--space-3) var(--space-3);
  border: 1px solid var(--neutral-200);
  border-radius: 8px;
  background: var(--neutral-0);
  color: var(--neutral-700);
  box-shadow: var(--shadow-xs);
}

.details-block[open] summary {
  border-bottom-color: transparent;
  border-radius: 8px 8px 0 0;
  background: var(--neutral-50);
}

.details-block > ul {
  margin: 0;
  padding: var(--space-3) var(--space-3) var(--space-3) var(--space-7);
  border: 1px solid var(--neutral-200);
  border-top: 0;
  border-radius: 0 0 8px 8px;
  background: var(--neutral-0);
}

.details-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 24px;
  height: 22px;
  padding: 0 8px;
  border-radius: 9999px;
  background: var(--neutral-100);
  color: var(--neutral-500);
  font-size: 12px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.preflight-structured-list {
  list-style: none;
  padding-left: var(--space-3);
  padding-right: var(--space-3);
}

.preflight-structured-list > li + li {
  margin-top: var(--space-3);
  padding-top: var(--space-3);
  border-top: 1px solid var(--neutral-100);
}

.preflight-structured-item .preflight-item-title {
  font-weight: 600;
  color: var(--neutral-800);
  line-height: 1.45;
}

.preflight-item-note {
  margin: var(--space-2) 0 0;
  color: var(--neutral-600);
  font-size: 0.9375rem;
  line-height: 1.5;
}

.preflight-item-meta {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
  margin-top: var(--space-2);
}

.preflight-item-meta-chip {
  display: inline-flex;
  padding: 2px 8px;
  border-radius: 9999px;
  background: var(--neutral-100);
  color: var(--neutral-600);
  font-size: 0.8125rem;
  font-weight: 500;
}

.preflight-risk-fields {
  display: grid;
  gap: var(--space-2);
  margin-top: var(--space-2);
}

.preflight-risk-field {
  display: grid;
  grid-template-columns: minmax(72px, auto) 1fr;
  gap: var(--space-2) var(--space-3);
  align-items: baseline;
}

.preflight-risk-label {
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--neutral-500);
  text-transform: uppercase;
  letter-spacing: 0.02em;
}

.preflight-risk-value {
  color: var(--neutral-700);
  font-size: 0.9375rem;
  line-height: 1.45;
}

.details-block pre,
.json-details pre {
  max-height: 360px;
  margin: 8px 0 0;
  overflow: auto;
  padding: var(--space-3);
  border: 1px solid var(--neutral-200);
  border-radius: 6px;
  background: var(--neutral-50);
  color: var(--neutral-700);
  font-family: ui-monospace, SFMono-Regular, Consolas, "Liberation Mono", monospace;
  font-size: 12px;
  line-height: 1.45;
  white-space: pre-wrap;
}

.telemetry-diagnostics {
  display: grid;
  gap: 12px;
  margin-top: 12px;
}

.telemetry-diagnostics-details {
  border: 1px solid var(--neutral-200);
  border-radius: 10px;
  background: var(--neutral-0);
  box-shadow: var(--shadow-sm);
}

.telemetry-diagnostics-details > summary {
  display: grid;
  gap: var(--space-1);
  padding: var(--space-4) var(--space-4);
  cursor: pointer;
}

.telemetry-diagnostics-title {
  color: var(--neutral-700);
  font-size: 14px;
  font-weight: 700;
}

.telemetry-diagnostics-subtitle {
  color: var(--neutral-500);
  font-size: 12px;
  line-height: 1.45;
}

.telemetry-diagnostics-body {
  padding: 0 16px 16px;
}

.telemetry-diagnostics-body > .section:first-child {
  margin-top: 0;
}

@media (max-width: 860px) {
  .main.app-main {
    padding: var(--space-4);
  }

  .page-head {
    display: grid;
  }

  .filterbar,
  .filterbar.detail,
  .summary-grid,
  .kv-grid,
  .preflight-hero {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .field.search {
    grid-column: 1 / -1;
  }

  .issues-table th:nth-child(n),
  .issues-table td.issue-col-issue,
  .issues-table td.issue-col-run,
  .issues-table td.issue-col-cost,
  .issues-table td.issue-col-activity,
  .issues-table td.issue-col-actions {
    width: auto;
    min-width: 0;
  }

  .table-wrap:has(.issues-table) {
    overflow-x: auto;
  }

  table:not(.issues-table) {
    min-width: 720px;
  }

  th,
  td {
    white-space: nowrap;
  }

  .issues-table th,
  .issues-table td {
    white-space: normal;
  }
}

@media (max-width: 520px) {
  .filterbar,
  .filterbar.detail,
  .summary-grid,
  .kv-grid,
  .preflight-hero {
    grid-template-columns: 1fr;
  }

  .page-title {
    font-size: 20px;
  }
}

.btn {
  display: inline-block;
  padding: var(--space-2) var(--space-3);
  border: 1px solid var(--neutral-200);
  border-radius: var(--radius-md);
  background: var(--neutral-0);
  color: var(--neutral-700);
  font: inherit;
  font-size: var(--fs-base);
  font-weight: var(--fw-medium);
  cursor: pointer;
}

.btn:hover:not(:disabled) {
  background: var(--neutral-50);
  color: var(--neutral-700);
  text-decoration: none;
}

.btn:disabled {
  cursor: not-allowed;
  opacity: var(--disabled-opacity);
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.issue-action-form.preflight-form {
  flex-wrap: wrap;
  gap: 4px;
  align-items: center;
}

.issue-action-form {
  display: inline-flex;
  margin: 0;
}

.actions-cell {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
  align-items: flex-start;
}

.btn-sm {
  padding: var(--space-1) var(--space-2);
  font-size: 13px;
  min-height: 32px;
}

.issue-action-button {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  white-space: nowrap;
}

.issue-action-icon {
  font-size: 14px;
  line-height: 1;
  opacity: 0.85;
}

.cost-breakdown-cell {
  vertical-align: top;
}

.cost-breakdown {
  display: flex;
  flex-direction: column;
  gap: 2px;
  font-size: 12px;
  line-height: 1.35;
  text-align: right;
  white-space: nowrap;
}

.cost-breakdown-row {
  display: flex;
  justify-content: flex-end;
  align-items: baseline;
  gap: 8px;
}

.cost-breakdown-total {
  margin-top: 2px;
  padding-top: 4px;
  border-top: 1px solid var(--neutral-200);
  font-weight: 600;
}

.cost-breakdown-label {
  color: var(--neutral-500);
  flex-shrink: 0;
}

.cost-delta {
  font-variant-numeric: tabular-nums;
}

/* .btn-build is a thin alias; brand-primary definition lives below with .btn-primary */

.wave-status,
.reservation-status {
  font-variant-caps: small-caps;
  letter-spacing: 0.02em;
}

.wave-status-active {
  background: var(--success-bg);
  color: var(--success-text);
}

.wave-status-closed {
  background: var(--neutral-badge-bg);
  color: var(--neutral-badge-text);
}

.wave-status-cancelled {
  background: var(--danger-bg);
  color: var(--danger-text);
}

/* BuildWave readiness badges (#568) */
.wave-readiness {
  font-variant-caps: small-caps;
  letter-spacing: 0.02em;
}

.wave-readiness-ready {
  background: var(--success-bg);
  color: var(--success-text);
}

.wave-readiness-running {
  background: var(--accent-bg-indigo);
  color: var(--accent-text-indigo, var(--info-text));
}

.wave-readiness-not_open,
.wave-readiness-window_closed {
  background: var(--warning-bg);
  color: var(--warning-text);
}

.wave-readiness-budget_exhausted {
  background: var(--neutral-badge-bg);
  color: var(--neutral-badge-text);
}

.wave-readiness-needs_suggestions {
  background: var(--warning-bg);
  color: var(--warning-text);
}

.wave-readiness-closed,
.wave-readiness-cancelled {
  background: var(--neutral-badge-bg);
  color: var(--neutral-500);
}

.wave-list-surface {
  border: 1px solid var(--neutral-200);
  border-radius: var(--radius-lg);
  background: var(--neutral-0);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}

.wave-list-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-4);
  flex-wrap: wrap;
  padding: var(--space-3) var(--space-4);
  border-bottom: 1px solid var(--neutral-200);
  background: var(--neutral-50);
}

.wave-list-toolbar-filters {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  flex-wrap: wrap;
}

.wave-list-filter-select {
  min-width: 9rem;
  padding: var(--space-2) var(--space-3);
  border: 1px solid var(--neutral-200);
  border-radius: var(--radius-md);
  background: var(--neutral-0);
  color: var(--neutral-700);
  font-size: var(--fs-sm);
}

.wave-list-filter-select:focus-visible {
  outline: 2px solid var(--brand-primary);
  outline-offset: 1px;
}

.wave-list-kpi-row {
  display: flex;
  align-items: stretch;
  gap: var(--space-2);
  flex-wrap: wrap;
}

.wave-list-kpi-item {
  display: inline-flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 1px;
  padding: var(--space-2) var(--space-3);
  border-radius: var(--radius-md);
  background: var(--neutral-0);
  border: 1px solid var(--neutral-200);
  min-width: 4.5rem;
}

.wave-list-kpi-value {
  font-size: var(--fs-sm);
  font-weight: var(--fw-bold);
  font-variant-numeric: tabular-nums;
  color: var(--neutral-900);
  line-height: 1.2;
}

.wave-list-kpi-label {
  font-size: var(--fs-xs);
  color: var(--neutral-500);
  line-height: 1.2;
}

.wave-list-kpi-active .wave-list-kpi-value {
  color: var(--success-text);
}

.wave-list-kpi-budget .wave-list-kpi-value {
  color: var(--brand-primary);
}

.wave-list-table-wrap {
  border: 0;
  border-radius: 0;
  box-shadow: none;
  background: transparent;
}

.data-table.build-wave-list {
  min-width: 720px;
}

.data-table.build-wave-list .wave-col-wave { width: 28%; }
.data-table.build-wave-list .wave-col-budget { width: 18%; }
.data-table.build-wave-list .wave-col-window { width: 18%; }
.data-table.build-wave-list .wave-col-candidates { width: 16%; }
.data-table.build-wave-list .wave-col-session { width: 10%; }
.data-table.build-wave-list .wave-col-action { width: 10%; }

.data-table.build-wave-list thead th {
  background: var(--neutral-100);
  color: var(--neutral-600);
  font-weight: var(--fw-semibold);
  font-size: var(--fs-xs);
  letter-spacing: 0.02em;
  text-transform: uppercase;
  padding-top: var(--space-3);
  padding-bottom: var(--space-3);
}

.data-table.build-wave-list tbody td {
  vertical-align: middle;
}

.wave-list-name {
  font-weight: var(--fw-semibold);
  font-size: var(--fs-sm);
  color: var(--brand-primary);
  text-decoration: none;
}

.wave-list-name:hover {
  text-decoration: underline;
}

.wave-list-row-meta {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: var(--space-2);
  margin-top: var(--space-1);
}

.wave-list-scope {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 1px 6px;
  background: var(--neutral-100);
  color: var(--neutral-600);
}

.wave-list-notes {
  display: block;
  margin-top: 2px;
  color: var(--neutral-500);
  font-size: 12px;
}

.wave-list-row-readiness {
  margin-top: 4px;
}

.wave-list-action {
  font-size: 12px;
  color: var(--neutral-500);
}

.wave-list-window {
  white-space: nowrap;
  font-size: 13px;
}

.wave-list-budget {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 100px;
}

.wave-list-budget-summary {
  display: flex;
  align-items: baseline;
  gap: var(--space-2);
  flex-wrap: wrap;
}

.wave-list-budget-available {
  font-size: 13px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

.wave-list-budget-meta {
  font-size: 11px;
  color: var(--neutral-500);
  font-variant-numeric: tabular-nums;
}

.wave-list-budget-pct {
  margin-left: auto;
  font-size: 11px;
  color: var(--success-text);
  font-weight: var(--fw-medium);
}

.wave-list-budget-total {
  font-size: 13px;
  color: var(--neutral-600);
  font-variant-numeric: tabular-nums;
}

.wave-list-budget-bar {
  height: 6px;
  border-radius: 999px;
  background: var(--neutral-100);
  display: flex;
  overflow: hidden;
  border: 1px solid var(--neutral-200);
}

.wave-list-candidates {
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
  min-width: 0;
}

.wave-list-candidate-chip {
  display: inline-flex;
  align-items: baseline;
  gap: 4px;
  font-size: 12px;
  color: var(--neutral-600);
  white-space: nowrap;
}

.wave-list-candidate-value {
  font-weight: var(--fw-semibold);
  font-variant-numeric: tabular-nums;
  color: var(--neutral-800);
}

.wave-list-candidate-chip-warn {
  color: var(--warning-text);
}

.wave-list-candidate-chip-warn .wave-list-candidate-value {
  color: var(--warning-text);
}

.wave-list-window {
  display: block;
  font-size: 12px;
  color: var(--neutral-600);
  line-height: 1.35;
  max-width: 100%;
}

.wave-list-window-open {
  color: var(--neutral-500);
}

.wave-list-window-soon {
  color: var(--warning-text);
}

.wave-list-window-closed {
  color: var(--neutral-500);
}

.wave-list-candidates-ready {
  font-size: 13px;
  font-variant-numeric: tabular-nums;
}

.wave-list-candidates-preflight {
  font-size: 12px;
  color: var(--neutral-500);
}

.wave-list-candidates-warn {
  color: var(--warning-text);
}

.wave-list-window-cell {
  min-width: 0;
}

.wave-list-next-action {
  font-size: 12px;
  font-weight: 500;
  text-decoration: none;
  white-space: nowrap;
}

.wave-list-next-action:hover {
  text-decoration: underline;
}

.wave-list-edit {
  font-size: 12px;
  margin-left: 8px;
  text-decoration: none;
  white-space: nowrap;
}

.wave-list-edit:hover {
  text-decoration: underline;
}

.wave-list-next-action-ready {
  color: var(--success-text);
}

.wave-list-next-action-needs_suggestions {
  color: var(--warning-text);
}

.wave-list-next-action-budget_exhausted,
.wave-list-next-action-window_closed {
  color: var(--neutral-500);
}

.wave-list-next-action-running {
  color: var(--accent-text-indigo, var(--info-text));
}

.wave-list-next-action-not_open {
  font-size: 12px;
  color: var(--neutral-500);
}

.wave-list-budget-cell {
  white-space: nowrap;
}

.wave-list-wave-cell {
  min-width: 0;
}

.wave-list-session-cell,
.wave-list-action-cell {
  white-space: nowrap;
}

.wave-list-candidates-cell {
  min-width: 0;
}

.data-table.build-wave-list tbody tr {
  transition: background-color 0.12s ease;
}

.data-table.build-wave-list tbody tr:hover {
  background: var(--neutral-50);
}

.data-table.build-wave-list tbody tr:hover .wave-list-name {
  text-decoration: underline;
}

.reservation-status-reserved {
  background: var(--info-bg);
  color: var(--info-text);
}

.reservation-status-consumed {
  background: var(--success-bg);
  color: var(--success-text);
}

.reservation-status-partially_consumed {
  background: var(--warning-bg);
  color: var(--warning-text);
}

.reservation-status-exceeded {
  background: var(--danger-bg);
  color: var(--danger-text);
}

.reservation-status-released,
.reservation-status-cancelled {
  background: var(--neutral-badge-bg);
  color: var(--neutral-badge-text);
}

.dispatch-status {
  font-variant-caps: small-caps;
  letter-spacing: 0.02em;
}

.dispatch-status-running {
  background: var(--warning-bg);
  color: var(--warning-text);
}

.dispatch-status-completed {
  background: var(--success-bg);
  color: var(--success-text);
}

.dispatch-status-cancelled {
  background: var(--neutral-badge-bg);
  color: var(--neutral-badge-text);
}

.dispatch-status-failed {
  background: var(--danger-bg);
  color: var(--danger-text);
}

.dispatch-session-card {
  padding: var(--space-6);
  border: 1px solid var(--neutral-200);
  border-left: 3px solid var(--brand-primary);
  border-radius: var(--radius-lg);
  background: var(--neutral-0);
  box-shadow: var(--shadow-sm);
}

.dispatch-session-empty {
  border-left-color: var(--neutral-300);
  background: var(--neutral-50);
}

.dispatch-session-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.dispatch-session-actions {
  display: flex;
  gap: 8px;
  align-items: center;
}

.dispatch-session-cancel {
  background: var(--danger-bg);
  color: var(--danger-text);
  border: 1px solid transparent;
  border-radius: 4px;
  padding: var(--space-1) var(--space-3);
  cursor: pointer;
}

.dispatch-session-cancel:disabled {
  opacity: var(--disabled-opacity);
  cursor: not-allowed;
}

.dispatch-session-detail-link {
  font-size: 0.95em;
}

.dispatch-session-meta,
.dispatch-session-money {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  margin-top: 8px;
  font-size: 0.95em;
}

.dispatch-session-meta strong,
.dispatch-session-money strong {
  margin-right: 4px;
  color: var(--neutral-500);
  font-weight: 500;
}

.dispatch-session-metrics {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(110px, 1fr));
  gap: 12px;
  margin-top: 12px;
}

.dispatch-metric-tile {
  background: var(--neutral-0);
  border: 1px solid var(--neutral-200);
  border-radius: var(--radius-md);
  padding: var(--space-2) var(--space-3);
}

.dispatch-metric-label {
  font-size: 0.85em;
  color: var(--neutral-500);
}

.dispatch-metric-value {
  font-size: 1.4em;
  font-weight: 600;
}

.dispatch-skip-bar {
  background: var(--neutral-100);
  border-radius: 3px;
  height: 8px;
  overflow: hidden;
}

.dispatch-skip-bar-fill {
  background: var(--brand-primary);
  height: 100%;
}

.wave-gauge {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.wave-gauge-bar {
  display: flex;
  width: 100%;
  height: 18px;
  border-radius: 999px;
  background: var(--neutral-100);
  border: 1px solid var(--neutral-200);
  overflow: hidden;
}

.wave-gauge-segment {
  height: 100%;
}

.wave-gauge-consumed {
  background: var(--brand-primary);
}

.wave-gauge-reserved {
  background: var(--info);
}

.wave-gauge-exceeded {
  background: var(--danger);
}

.wave-gauge-available {
  background: color-mix(in srgb, var(--success) 42%, var(--neutral-0));
}

.wave-gauge-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  font-size: 13px;
  color: var(--neutral-500);
}

.wave-gauge-legend .dot {
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  margin-right: var(--space-2);
  vertical-align: middle;
}

.wave-gauge-legend .dot-consumed {
  background: var(--brand-primary);
}

.wave-gauge-legend .dot-reserved {
  background: var(--info);
}

.wave-gauge-legend .dot-exceeded {
  background: var(--danger);
}

.wave-gauge-legend .dot-available {
  background: var(--neutral-100);
  border: 1px solid var(--neutral-200);
}

.wave-gauge-total {
  margin-left: auto;
  color: var(--neutral-500);
  font-style: italic;
}

.wave-gauge-compact {
  gap: var(--space-2);
}

.wave-gauge-compact-summary {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.wave-gauge-compact-available {
  font-size: var(--fs-lg);
  font-weight: var(--fw-bold);
  color: var(--neutral-900);
}

.wave-gauge-compact-meta {
  font-size: var(--fs-xs);
  color: var(--neutral-500);
}

.wave-gauge-compact-legend {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2) var(--space-3);
  font-size: var(--fs-xs);
  color: var(--neutral-500);
  line-height: 1.2;
}

.wave-gauge-compact-legend .dot {
  display: inline-block;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  margin-right: 4px;
  vertical-align: middle;
}

.wave-gauge-bar-compact {
  height: 10px;
}

/* Build wave detail - execution hero + tabs */
.wave-hero {
  position: sticky;
  top: 0;
  z-index: 20;
  display: grid;
  grid-template-columns: minmax(0, 0.72fr) minmax(0, 1.85fr) minmax(0, 0.68fr) minmax(0, 0.75fr);
  gap: 0;
  padding: 0;
  margin-bottom: var(--space-5);
  background: var(--neutral-0);
  border: 1px solid var(--neutral-200);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
  align-items: stretch;
}

.wave-hero-kpi {
  min-width: 0;
  padding: var(--space-2) var(--space-3);
  border-right: 1px solid var(--neutral-150, var(--neutral-200));
  position: relative;
  border-top: 3px solid transparent;
  transition: background var(--duration-fast) var(--ease-standard);
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 2px;
}

.wave-hero-kpi:last-of-type,
.wave-hero-kpi:has(+ .wave-hero-callout) {
  border-right: none;
}

/* Per-card accent stripe */
.wave-hero-kpi-readiness  { border-top-color: var(--brand-primary); }
.wave-hero-kpi-budget     { border-top-color: var(--success); }
.wave-hero-kpi-repo       { border-top-color: var(--accent-violet); }
.wave-hero-kpi-candidates { border-top-color: var(--warning); }
.wave-hero-kpi-session    { border-top-color: var(--accent-indigo); }

.wave-hero-kpi-label {
  display: flex;
  align-items: center;
  gap: var(--space-1);
  font-size: var(--fs-xs);
  font-weight: var(--fw-semibold);
  color: var(--neutral-400);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

/* Colored dot per card type */
.wave-hero-kpi-label::before {
  content: "";
  display: inline-block;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  flex-shrink: 0;
  opacity: 0.7;
}
.wave-hero-kpi-readiness  .wave-hero-kpi-label::before { background: var(--brand-primary); }
.wave-hero-kpi-budget     .wave-hero-kpi-label::before { background: var(--success); }
.wave-hero-kpi-repo       .wave-hero-kpi-label::before { background: var(--accent-violet); }
.wave-hero-kpi-candidates .wave-hero-kpi-label::before { background: var(--warning); }
.wave-hero-kpi-session    .wave-hero-kpi-label::before { background: var(--accent-indigo); }

.wave-hero-kpi-value {
  margin-top: 0;
  font-size: var(--fs-sm);
  font-weight: var(--fw-semibold);
  color: var(--neutral-900);
  min-width: 0;
  overflow: hidden;
  line-height: 1.25;
}

.wave-hero-kpi-inline {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0 var(--space-1);
}

.wave-hero-kpi-inline .wave-hero-kpi-meta {
  margin-top: 0;
  font-weight: var(--fw-normal);
}

.wave-hero-kpi-sep {
  color: var(--neutral-400);
  font-weight: var(--fw-normal);
}

.wave-hero-kpi-meta {
  margin-top: 0;
  font-size: var(--fs-xs);
  color: var(--neutral-500);
  line-height: 1.25;
}

/* Large count display for numeric KPI values (e.g. Candidates) */
.wave-kpi-count {
  font-size: var(--fs-lg);
  font-weight: var(--fw-bold);
  color: var(--neutral-800);
  font-variant-numeric: tabular-nums;
  line-height: 1.1;
  letter-spacing: var(--tracking-tight);
}

.wave-hero-kpi-budget .wave-gauge-compact {
  margin-top: 0;
  gap: var(--space-1);
}

.wave-hero-kpi-budget .wave-gauge-compact-summary {
  flex-direction: row;
  flex-wrap: wrap;
  align-items: baseline;
  column-gap: var(--space-2);
  row-gap: 0;
}

.wave-hero-kpi-budget .wave-gauge-compact-available {
  font-size: var(--fs-sm);
  font-weight: var(--fw-bold);
  white-space: nowrap;
}

.wave-hero-kpi-budget .wave-gauge-compact-meta {
  white-space: nowrap;
}

.wave-hero-kpi-budget .wave-gauge-bar-compact {
  height: 6px;
}

.wave-hero-kpi-budget .wave-gauge-compact-legend {
  display: none;
}

.wave-hero-kpi-forecast .wave-hero-kpi-value,
.wave-hero-kpi-projection .wave-hero-kpi-value {
  font-size: var(--fs-xs);
  font-weight: var(--fw-medium);
}

.wave-hero-repo-value {
  font-weight: var(--fw-medium);
}

.wave-hero-callout {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-2) var(--space-3);
  border-top: 1px solid var(--neutral-200);
  border-radius: 0;
  font-size: var(--fs-xs);
  line-height: 1.35;
}

.wave-hero-kpi .pill {
  font-size: var(--fs-xs);
  padding: 2px 8px;
  line-height: 1.3;
}

.wave-hero-callout-icon {
  flex-shrink: 0;
  line-height: 1;
  display: flex;
  align-items: center;
}

.wave-callout-svg {
  width: 14px;
  height: 14px;
}

.wave-hero-callout-text {
  display: inline;
}

.wave-hero-callout-action {
  margin-left: var(--space-2);
  font-weight: var(--fw-semibold);
  color: inherit;
  text-underline-offset: 2px;
}

/* Compact dispatch-session empty state - avoids nested-card feel */
.dispatch-session-empty .empty {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-3) var(--space-5);
  padding: var(--space-3) var(--space-4);
  border: 1px solid var(--neutral-200);
  box-shadow: none;
  background: var(--neutral-50);
  border-radius: var(--radius-md);
}

.dispatch-session-empty .empty-description {
  flex: 1 1 200px;
  margin: 0;
  font-size: var(--fs-sm);
  color: var(--neutral-500);
}

.dispatch-session-empty .empty-actions {
  flex-shrink: 0;
  margin: 0;
}

/* Permalink display in buildWave subtitle */
.wave-subtitle-permalink {
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
}

.wave-slug-code {
  font-family: var(--font-mono, monospace);
  font-size: var(--fs-xs);
  color: var(--neutral-600);
  background: var(--neutral-100);
  padding: 1px var(--space-1);
  border-radius: var(--radius-sm);
  border: 1px solid var(--neutral-200);
}

.wave-repo-panel {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-2);
}

.wave-repo-panel-hint {
  margin: 0;
  font-size: var(--fs-sm);
  color: var(--neutral-500);
}

.wave-repo-add-form {
  margin-top: var(--space-2);
}

.wave-repo-chip {
  display: inline-block;
  min-width: 0;
  max-width: 100%;
  padding: var(--space-1) var(--space-3);
  border-radius: 999px;
  background: var(--neutral-100);
  font-size: var(--fs-sm);
  font-weight: var(--fw-medium);
  color: var(--neutral-900);
  text-decoration: none;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  vertical-align: middle;
}

.wave-repo-chip:hover {
  background: var(--neutral-200);
}

.wave-repo-provider {
  font-size: var(--fs-xs);
}

.wave-tabs-shell {
  margin-bottom: var(--space-6);
}

.wave-tabs {
  display: flex;
  gap: var(--space-1);
  margin-bottom: var(--space-5);
  border-bottom: 1px solid var(--neutral-200);
}

.wave-tab {
  margin-bottom: -1px;
  padding: var(--space-3) var(--space-4);
  border: none;
  border-bottom: 2px solid transparent;
  background: transparent;
  font: inherit;
  font-size: var(--fs-sm);
  font-weight: var(--fw-semibold);
  color: var(--neutral-500);
  cursor: pointer;
}

.wave-tab:hover {
  color: var(--neutral-900);
}

.wave-tab[aria-selected="true"] {
  color: var(--brand-primary);
  border-bottom-color: var(--brand-primary);
}

.wave-tab-panel[hidden] {
  display: none !important;
}

/* ===== Wave candidates panel (devtools-style workspace) ===== */

.wave-candidates-panel {
  border: 1px solid var(--neutral-200);
  border-radius: var(--radius-lg);
  background: var(--neutral-0);
  box-shadow: var(--shadow-sm);
  /* Avoid overflow:hidden here — it becomes the sticky scrollport for
     .wave-candidates-commandbar and offsets the bar by `top`, overlapping
     .wave-candidates-workspace. Round corners on the head/body instead. */
  overflow: visible;
}

.wave-candidates-panel-head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--space-3) var(--space-4);
  padding: var(--space-4) var(--space-5);
  border-bottom: 1px solid var(--neutral-200);
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
  background: linear-gradient(180deg, var(--neutral-50) 0%, var(--neutral-0) 100%);
}

.wave-candidates-panel-title {
  margin: 0;
}

.wave-candidates-panel-desc {
  margin: 4px 0 0;
  max-width: 52ch;
  font-size: var(--fs-sm);
  color: var(--neutral-500);
  line-height: 1.45;
}

.wave-candidates-stat-chips {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
}

.wave-stat-chip {
  display: inline-flex;
  align-items: baseline;
  gap: 4px;
  padding: var(--space-1) var(--space-3);
  border-radius: 999px;
  font-size: var(--fs-xs);
  font-weight: var(--fw-semibold);
  color: var(--neutral-600);
  background: var(--neutral-100);
  border: 1px solid var(--neutral-200);
}

.wave-stat-chip-primary {
  color: var(--brand-primary-hover);
  background: var(--info-bg);
  border-color: color-mix(in srgb, var(--brand-primary) 25%, var(--neutral-200));
}

.wave-stat-chip-warn {
  color: var(--warning-text);
  background: var(--warning-bg);
  border-color: color-mix(in srgb, var(--warning-text) 20%, var(--neutral-200));
}

.wave-stat-chip-value {
  font-variant-numeric: tabular-nums;
  font-weight: var(--fw-bold);
  color: inherit;
}

.wave-candidates-commandbar {
  position: sticky;
  top: calc(var(--space-4) + 120px);
  z-index: 15;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-2) var(--space-3);
  padding: var(--space-3) var(--space-4);
  border-bottom: 1px solid var(--neutral-200);
  background: var(--neutral-0);
  box-shadow: 0 1px 0 color-mix(in srgb, var(--neutral-200) 80%, transparent);
}

.wave-candidates-commandbar-group {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-2);
}

.wave-candidates-commandbar-start {
  flex: 1 1 280px;
  min-width: 0;
}

.wave-candidates-commandbar-center {
  flex: 0 1 auto;
}

.wave-candidates-commandbar-end {
  flex: 0 0 auto;
  margin-left: auto;
}

.wave-strategy-segmented {
  display: inline-flex;
  padding: 2px;
  border: 1px solid var(--neutral-200);
  border-radius: var(--radius-md);
  background: var(--neutral-100);
  gap: 1px;
}

.wave-strategy-seg {
  border: none;
  background: transparent;
  padding: var(--space-1) var(--space-3);
  border-radius: calc(var(--radius-md) - 2px);
  font: inherit;
  font-size: var(--fs-xs);
  font-weight: var(--fw-semibold);
  color: var(--neutral-600);
  cursor: pointer;
  white-space: nowrap;
}

.wave-strategy-seg:hover {
  color: var(--neutral-900);
  background: color-mix(in srgb, var(--neutral-0) 70%, transparent);
}

.wave-strategy-seg.is-active,
.wave-strategy-seg[aria-pressed="true"] {
  color: var(--neutral-900);
  background: var(--neutral-0);
  box-shadow: var(--shadow-sm);
}

.wave-candidates-search {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  min-width: 0;
  flex: 1 1 140px;
  max-width: 220px;
  padding: 0 var(--space-3);
  border: 1px solid var(--neutral-200);
  border-radius: var(--radius-md);
  background: var(--neutral-0);
}

.wave-candidates-search:focus-within {
  border-color: var(--brand-primary);
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--brand-primary) 18%, transparent);
}

.wave-candidates-search-icon {
  flex-shrink: 0;
  font-size: 14px;
  color: var(--neutral-400);
  line-height: 1;
}

.wave-candidates-search-input {
  width: 100%;
  min-width: 0;
  border: none;
  background: transparent;
  padding: var(--space-2) 0;
  font: inherit;
  font-size: var(--fs-sm);
  color: var(--neutral-900);
}

.wave-candidates-search-input:focus {
  outline: none;
}

.wave-candidates-search-input::placeholder {
  color: var(--neutral-400);
}

.wave-candidate-selection-pill {
  display: inline-flex;
  align-items: center;
  padding: var(--space-1) var(--space-3);
  border-radius: 999px;
  font-size: var(--fs-xs);
  font-weight: var(--fw-semibold);
  font-variant-numeric: tabular-nums;
  color: var(--neutral-600);
  background: var(--neutral-100);
  border: 1px solid var(--neutral-200);
  white-space: nowrap;
}

.wave-candidates-filter-empty {
  font-size: var(--fs-xs);
  font-weight: var(--fw-semibold);
  color: var(--warning-text);
}

.wave-candidates-workspace {
  padding: var(--space-4) var(--space-5) var(--space-5);
  border-radius: 0 0 var(--radius-lg) var(--radius-lg);
}

.wave-candidates-subhead {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  margin: 0 0 var(--space-3);
  font-size: var(--fs-sm);
  font-weight: var(--fw-semibold);
  color: var(--neutral-700);
}

.wave-candidates-subhead-label {
  text-transform: uppercase;
  letter-spacing: 0.04em;
  font-size: var(--fs-xs);
  color: var(--neutral-500);
}

.wave-candidates-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 1.5rem;
  padding: 1px var(--space-2);
  border-radius: 999px;
  font-size: var(--fs-xs);
  font-weight: var(--fw-bold);
  font-variant-numeric: tabular-nums;
  color: var(--neutral-700);
  background: var(--neutral-100);
}

.wave-candidates-count-warn {
  color: var(--warning-text);
  background: var(--warning-bg);
}

.wave-candidates-table-shell {
  max-height: min(420px, 55vh);
  overflow: auto;
  border: 1px solid var(--neutral-200);
  border-radius: var(--radius-md);
  background: var(--neutral-0);
}

.wave-candidates-table-wrap {
  border: none;
  border-radius: 0;
  box-shadow: none;
  overflow: visible;
}

.wave-candidates-table-shell .data-table.suggestions-ranked thead th {
  position: sticky;
  top: 0;
  z-index: 2;
  background: var(--neutral-50);
  box-shadow: 0 1px 0 var(--neutral-200);
}

.wave-candidate-row.is-row-selected {
  background: color-mix(in srgb, var(--brand-primary) 8%, var(--neutral-0));
}

.wave-candidate-row.is-row-selected:hover {
  background: color-mix(in srgb, var(--brand-primary) 12%, var(--neutral-0));
}

.wave-candidate-row[hidden] {
  display: none;
}

.wave-candidates-empty {
  margin: 0;
  text-align: center;
}

.wave-candidates-empty .empty-title {
  margin: 0 0 var(--space-2);
  font-size: var(--fs-base);
  font-weight: var(--fw-semibold);
  color: var(--neutral-800);
}

.wave-candidates-secondary {
  margin-top: var(--space-5);
  border: 1px solid var(--neutral-200);
  border-radius: var(--radius-md);
  background: var(--neutral-50);
}

.wave-candidates-secondary-summary {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-3) var(--space-4);
  font-size: var(--fs-sm);
  font-weight: var(--fw-semibold);
  color: var(--neutral-700);
  cursor: pointer;
  list-style: none;
}

.wave-candidates-secondary-summary::-webkit-details-marker {
  display: none;
}

.wave-candidates-secondary-summary::before {
  content: "▸";
  display: inline-block;
  width: 1em;
  color: var(--neutral-400);
  transition: transform 0.15s ease;
}

.wave-candidates-secondary[open] > .wave-candidates-secondary-summary::before {
  transform: rotate(90deg);
}

.wave-candidates-secondary-body {
  padding: 0 var(--space-4) var(--space-4);
}

.wave-candidates-secondary-table {
  border-radius: var(--radius-md);
}

.wave-candidates-secondary-empty {
  margin: 0;
  padding: var(--space-3) 0;
  font-size: var(--fs-sm);
  color: var(--neutral-500);
}

.wave-dispatch-preview {
  margin: 0 var(--space-5) var(--space-4);
  padding: var(--space-4);
  border: 1px solid var(--neutral-200);
  border-radius: var(--radius-md);
  background: var(--neutral-50);
}

.wave-dispatch-preview[hidden] {
  display: none !important;
}

#wave-header-actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
  align-items: center;
}

@media (max-width: 768px) {
  .wave-hero {
    position: static;
    grid-template-columns: 1fr 1fr;
  }

  .wave-hero-kpi-budget {
    grid-column: 1 / -1;
  }

  .wave-hero-kpi {
    border-right: none;
    border-bottom: 1px solid var(--neutral-150, var(--neutral-200));
  }

  .wave-hero-kpi:nth-child(2n) {
    border-right: none;
  }

  .wave-candidates-commandbar {
    top: 0;
  }

  .wave-candidates-commandbar-end {
    width: 100%;
    margin-left: 0;
    justify-content: flex-end;
  }

  .wave-candidates-search {
    max-width: none;
    flex: 1 1 100%;
  }

  .wave-queue-zone-head {
    flex-direction: column;
    align-items: flex-start;
  }
}

@media (max-width: 480px) {
  .wave-hero {
    grid-template-columns: 1fr;
  }

  .wave-hero-kpi-budget {
    grid-column: auto;
  }
}

@media (min-width: 769px) {
  .wave-hero:has(.wave-hero-kpi-repo) {
    grid-template-columns: minmax(0, 0.65fr) minmax(0, 1.55fr) minmax(0, 0.85fr) minmax(0, 0.62fr) minmax(0, 0.68fr);
  }

  .wave-hero-kpi-forecast,
  .wave-hero-kpi-projection {
    border-top: 1px solid var(--neutral-150, var(--neutral-200));
  }
}

/* Wave detail workflow strip */
.wave-detail-workflow {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-2);
  margin-bottom: var(--space-5);
  padding: var(--space-3) var(--space-4);
  border: 1px solid var(--neutral-200);
  border-radius: var(--radius-md);
  background: var(--neutral-50);
  font-size: var(--fs-sm);
}

.wave-detail-workflow-step {
  font-weight: var(--fw-semibold);
  color: var(--neutral-500);
}

.wave-detail-workflow-step.is-active {
  color: var(--brand-primary-hover);
}

.wave-detail-workflow-sep {
  color: var(--neutral-400);
  user-select: none;
}

/* Header overflow menu */
.page-actions-overflow {
  position: relative;
  display: inline-flex;
}

.page-actions-overflow-trigger {
  min-width: 2rem;
  padding-left: var(--space-2);
  padding-right: var(--space-2);
  font-size: var(--fs-lg);
  line-height: 1;
}

.page-actions-overflow-menu {
  position: absolute;
  top: calc(100% + var(--space-1));
  right: 0;
  z-index: 40;
  min-width: 11rem;
  padding: var(--space-1);
  border: 1px solid var(--neutral-200);
  border-radius: var(--radius-md);
  background: var(--neutral-0);
  box-shadow: var(--shadow-md);
}

.page-actions-overflow-menu[hidden] {
  display: none !important;
}

.page-actions-overflow-item {
  display: block;
  width: 100%;
  padding: var(--space-2) var(--space-3);
  border: none;
  border-radius: calc(var(--radius-md) - 2px);
  background: transparent;
  font: inherit;
  font-size: var(--fs-sm);
  font-weight: var(--fw-medium);
  color: var(--neutral-800);
  text-align: left;
  text-decoration: none;
  cursor: pointer;
}

.page-actions-overflow-item:hover {
  background: var(--neutral-100);
}

.page-actions-overflow-item-danger {
  color: var(--danger-text, var(--danger));
}

/* Dispatch workspace queue zone */
.wave-queue-zone {
  margin-bottom: var(--space-5);
  padding-bottom: var(--space-4);
  border-bottom: 1px dashed var(--neutral-200);
}

.wave-queue-zone-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-2) var(--space-4);
  margin-bottom: var(--space-3);
}

.wave-queue-zone-actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
}

.wave-queue-zone-table-wrap {
  max-height: min(240px, 35vh);
  overflow: auto;
}

.wave-in-queue-badge {
  margin-right: var(--space-2);
  font-size: var(--fs-xs);
}

.ranked-queue-cell {
  white-space: nowrap;
}

.wave-backlog-pagination {
  padding: var(--space-3) var(--space-4);
  text-align: center;
  border-top: 1px solid var(--neutral-200);
}

/* Collapsible review + AI planning */
.wave-dispatch-review-section,
.wave-planning-collapsible {
  margin-bottom: var(--space-5);
  border: 1px solid var(--neutral-200);
  border-radius: var(--radius-md);
  background: var(--neutral-0);
}

.wave-dispatch-review-summary,
.wave-planning-collapsible-summary {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: var(--space-2) var(--space-4);
  padding: var(--space-3) var(--space-4);
  cursor: pointer;
  list-style: none;
}

.wave-dispatch-review-summary::-webkit-details-marker,
.wave-planning-collapsible-summary::-webkit-details-marker {
  display: none;
}

.wave-dispatch-review-summary::before,
.wave-planning-collapsible-summary::before {
  content: "▸";
  color: var(--neutral-400);
  transition: transform 0.15s ease;
}

.wave-dispatch-review-section[open] > .wave-dispatch-review-summary::before,
.wave-planning-collapsible[open] > .wave-planning-collapsible-summary::before {
  transform: rotate(90deg);
}

.wave-dispatch-review-body,
.wave-planning-collapsible-body {
  padding: 0 var(--space-4) var(--space-4);
  border-top: 1px solid var(--neutral-200);
}

.wave-planning-collapsible-summary .section-desc {
  margin: 0;
  font-size: var(--fs-sm);
  font-weight: var(--fw-normal);
  color: var(--neutral-500);
}

.blocked-issues-section {
  margin-top: var(--space-4);
}

/* ===== KPI count + unit inline alignment ===== */
.wave-kpi-count-row {
  display: flex;
  align-items: baseline;
  gap: var(--space-1);
  flex-wrap: nowrap;
}

.wave-kpi-count-unit {
  font-size: var(--fs-sm);
  font-weight: var(--fw-medium);
  color: var(--neutral-500);
  white-space: nowrap;
}

.wave-hero-kpi-session-value {
  display: flex;
  align-items: center;
}

/* ===== Wave plan launcher ===== */
.wave-plan-launcher {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}

.wave-plan-goal-textarea {
  resize: vertical;
  min-height: 56px;
}

.wave-plan-launcher-actions {
  display: flex;
  align-items: center;
  gap: var(--space-3);
}

.wave-plan-status {
  font-size: var(--fs-sm);
  color: var(--neutral-500);
}

.wave-plan-hint {
  margin: 0;
  font-size: var(--fs-sm);
  color: var(--neutral-400);
}

.wave-plan-result {
  margin-top: var(--space-2);
}

/* ===== Wave plan card ===== */
.wave-plan-card {
  border: 1px solid var(--neutral-200);
  border-radius: var(--radius-lg);
  background: var(--neutral-0);
  overflow: hidden;
}

.wave-plan-card-header {
  padding: var(--space-4) var(--space-5);
  border-bottom: 1px solid var(--neutral-200);
  background: var(--neutral-50);
}

.wave-plan-card-title {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  margin-bottom: var(--space-2);
}

.wave-plan-card-meta {
  font-size: var(--fs-sm);
  color: var(--neutral-500);
}

.wave-plan-card-goal {
  margin: 0;
  font-size: var(--fs-sm);
  color: var(--neutral-700);
}

.wave-plan-parse-err {
  margin: var(--space-3) var(--space-5);
}

.wave-plan-waves {
  padding: var(--space-4) var(--space-5);
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}

.wave-plan-empty {
  margin: 0;
  font-size: var(--fs-sm);
  color: var(--neutral-500);
  text-align: center;
  padding: var(--space-4) 0;
}

.wave-plan-status-badge {
  font-size: var(--fs-xs);
  text-transform: capitalize;
}

.wave-plan-status-succeeded {
  background: var(--success-bg);
  color: var(--success-text);
}

.wave-plan-status-failed,
.wave-plan-status-parse_failed {
  background: var(--danger-bg);
  color: var(--danger-text);
}

.wave-plan-status-running {
  background: var(--info-bg);
  color: var(--info-text);
}

/* ===== Wave card (individual wave inside a plan) ===== */
.wave-card {
  border: 1px solid var(--neutral-200);
  border-radius: var(--radius-md);
  background: var(--neutral-0);
  overflow: hidden;
}

.wave-card-summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
  padding: var(--space-3) var(--space-4);
  background: var(--neutral-50);
  cursor: pointer;
  list-style: none;
  font-size: var(--fs-sm);
  font-weight: var(--fw-semibold);
  color: var(--neutral-800);
  user-select: none;
}

.wave-card-summary::-webkit-details-marker {
  display: none;
}

.wave-card-summary::before {
  content: "▸";
  display: inline-block;
  width: 1em;
  color: var(--neutral-400);
  transition: transform 0.15s ease;
  flex-shrink: 0;
}

.wave-card[open] > .wave-card-summary::before {
  transform: rotate(90deg);
}

.wave-card-title {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  min-width: 0;
}

.wave-card-name {
  color: var(--neutral-600);
  font-weight: var(--fw-normal);
}

.wave-card-meta {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  flex-shrink: 0;
}

.wave-card-concurrency {
  font-size: var(--fs-xs);
  color: var(--neutral-400);
  font-weight: var(--fw-normal);
}

.wave-card-rationale {
  margin: 0;
  padding: var(--space-3) var(--space-4);
  font-size: var(--fs-sm);
  color: var(--neutral-600);
  border-bottom: 1px solid var(--neutral-100);
  font-style: italic;
}

.wave-items-table-wrap {
  margin: 0;
  border-top: none;
  border-radius: 0;
  box-shadow: none;
}

.wave-items-table-wrap .table-wrap {
  border: none;
  border-radius: 0;
  box-shadow: none;
}

.wave-items .wrap {
  max-width: 280px;
  font-size: var(--fs-xs);
  color: var(--neutral-600);
  white-space: normal;
}

.wave-item-provider {
  font-size: var(--fs-xs);
  padding: 2px var(--space-2);
}

.wave-item-provider-github {
  background: color-mix(in srgb, var(--neutral-200) 60%, transparent);
  color: var(--neutral-700);
}

.wave-item-provider-azure {
  background: color-mix(in srgb, var(--brand-azure) 12%, transparent);
  color: var(--brand-azure-hover);
}

.wave-item-remove-cell {
  width: 36px;
  text-align: center;
}

.wave-item-remove-btn {
  padding: 2px var(--space-2);
  font-size: var(--fs-xs);
  color: var(--neutral-400);
}

.wave-item-remove-btn:hover {
  color: var(--danger-text);
}

.wave-card-actions {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-3) var(--space-4);
  border-top: 1px solid var(--neutral-200);
  background: var(--neutral-50);
}

/* Header actions: Re-plan + Dispatch-all sit above the goal line. */
.wave-plan-card-actions-top {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-2);
  margin-bottom: var(--space-2);
}

/* Per-item dependency / touch-overlap badges and the move-to-wave control. */
.wave-item-badges {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-1);
  margin-top: var(--space-1);
}

.wave-item-depends {
  color: var(--neutral-600);
}

.wave-item-overlap {
  color: var(--warning-text);
}

.wave-item-move-cell {
  width: 132px;
}

.wave-item-move-select {
  width: 100%;
  font-size: var(--fs-xs);
}

/* Discarded candidates: a collapsed table beneath the planned waves. */
.wave-plan-discarded {
  margin: var(--space-3) var(--space-4) var(--space-4);
}

.wave-plan-discarded > summary {
  cursor: pointer;
  font-size: var(--fs-sm);
  color: var(--neutral-500);
}

.wave-plan-discarded-table {
  margin-top: var(--space-2);
}

/* ===== Wave plan history ===== */
.wave-plan-history-section {
  margin-top: var(--space-5);
  padding-top: var(--space-5);
  border-top: 1px solid var(--neutral-200);
}

.wave-plan-history-heading {
  margin: 0 0 var(--space-3);
  font-size: var(--fs-sm);
  font-weight: var(--fw-semibold);
  color: var(--neutral-600);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.wave-plan-history-empty {
  margin: var(--space-4) 0 0;
  font-size: var(--fs-sm);
  color: var(--neutral-400);
}

.wave-plan-history-row {
  cursor: pointer;
}

.wave-plan-history-row:hover td {
  background: var(--neutral-50);
}

.pill.pill-sm {
  padding: 1px var(--space-2);
  font-size: var(--fs-xs);
}

/* Preflight pill rendered as a drill-down link */
.preflight-drilldown {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  text-decoration: none;
  color: inherit;
  cursor: pointer;
}

.preflight-drilldown:hover .pill,
.preflight-drilldown:focus-visible .pill {
  filter: brightness(0.96);
}

.preflight-drilldown:focus-visible {
  outline: 2px solid var(--brand-primary);
  outline-offset: 2px;
  border-radius: var(--radius-sm);
}

.build-wave-list .num,
.reservation-list .num,
.wave-events-list .num {
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.reservation-block .kv-grid {
  margin-top: 4px;
}

.muted {
  color: var(--neutral-500);
  font-weight: normal;
}

.page-head-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.page-head-actions-wrap {
  justify-content: flex-end;
}

.page-head-actions .btn-with-icon {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  text-decoration: none;
  white-space: nowrap;
}

.page-head-actions .btn-icon-provider {
  flex-shrink: 0;
}

.btn-cancel {
  border-color: transparent;
  background: var(--danger-bg);
  color: var(--danger-text);
}

.btn-cancel:hover:not(:disabled) {
  background: var(--danger-bg);
  color: var(--danger-text);
  filter: brightness(0.95);
}

.cancel-confirm-actions {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-left: 12px;
}

.cancel-confirm-actions input[type="password"] {
  min-height: 36px;
  padding: var(--space-2) var(--space-3);
  border: 1px solid var(--neutral-200);
  border-radius: var(--radius-md);
  background: var(--neutral-0);
  font: inherit;
  font-size: var(--fs-base);
}

/* ===== Phase 1 - dashboard polish ===== */

/* BuildWave dispatch and reservation tables share the issues-table row spec
 * (52px tall, neutral-50 hover wash). Compact/zebra modifiers below opt out
 * of the row height when explicitly requested. */
.data-table.build-wave-list tbody tr,
.data-table.reservation-list tbody tr,
.data-table.wave-events-list tbody tr {
  height: 52px;
}

.data-table.build-wave-list tbody tr:hover,
.data-table.reservation-list tbody tr:hover,
.data-table.wave-events-list tbody tr:hover {
  background: var(--neutral-50);
}

/* Table density modifiers */
.data-table.compact th,
.data-table.compact td,
table.compact th,
table.compact td {
  padding: var(--space-2) var(--space-2);
}

.data-table.compact tbody tr {
  height: auto;
}

.data-table.zebra tbody tr:nth-child(even),
table.zebra:not(.issues-table) tbody tr:nth-child(even) {
  background: rgba(0, 0, 0, 0.02);
}

table.issues-table.compact.zebra tbody tr:nth-child(even) {
  background: transparent;
}

table.issues-table.compact.zebra tbody tr.issue-row-zebra-alt {
  background: rgba(0, 0, 0, 0.02);
}

/* ===== .suggestions-ranked column layout ===== */

.data-table.suggestions-ranked {
  table-layout: fixed;
  min-width: 640px;
}
.data-table.suggestions-ranked .ranked-col-select   { width: 36px; }
.data-table.suggestions-ranked .ranked-col-issue    { width: auto; }
.data-table.suggestions-ranked .ranked-col-score    { width: 100px; }
.data-table.suggestions-ranked .ranked-col-cost     { width: 130px; }
.data-table.suggestions-ranked .ranked-col-preflight{ width: 150px; }
.data-table.suggestions-ranked .ranked-col-action   { width: 120px; }
.ranked-select-cell { vertical-align: middle; text-align: center; }

.suggestions-actions { display: inline-flex; gap: 8px; }

.data-table.suggestions-ranked tbody tr.wave-candidate-row:hover { background: var(--neutral-50); }

.ranked-issue-cell {
  display: flex;
  align-items: flex-start;
  gap: var(--space-3);
  padding-top: var(--space-3);
  padding-bottom: var(--space-3);
}
.ranked-issue-rank {
  flex-shrink: 0;
  min-width: 18px;
  font-size: var(--fs-xs);
  font-weight: var(--fw-semibold);
  color: var(--neutral-400);
  text-align: right;
  padding-top: 1px;
}
.ranked-issue-body {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}
.ranked-issue-link {
  font-size: var(--fs-xs);
  font-weight: var(--fw-semibold);
  color: var(--brand-primary);
  text-decoration: none;
  white-space: nowrap;
}
.ranked-issue-link:hover { text-decoration: underline; }
.ranked-issue-title {
  display: block;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: var(--fs-sm);
  color: var(--neutral-800);
}
.ranked-score-cell  { vertical-align: middle; }
.ranked-cost-cell   { vertical-align: middle; }
.ranked-cost-likely {
  display: block;
}
.ranked-preflight-cell { vertical-align: top; }
.ranked-action-cell { vertical-align: middle; text-align: right; }

/* Sortable table headers */
.sort-th {
  cursor: pointer;
  user-select: none;
}

.sort-th:hover {
  color: var(--brand-primary-hover);
}

.sort-th .sort-indicator {
  display: inline-block;
  margin-left: 4px;
  color: var(--neutral-500);
  font-size: 10px;
  font-variant-numeric: tabular-nums;
}

.sort-th[aria-sort="ascending"] .sort-indicator,
.sort-th[aria-sort="descending"] .sort-indicator {
  color: var(--brand-primary-hover);
}

/* Issue state badges - outline-only, lower-case */
.issue-state-badge {
  display: inline-flex;
  align-items: center;
  padding: 1px var(--space-2);
  border-radius: 999px;
  background: transparent;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.02em;
  text-transform: lowercase;
  border: 1px solid var(--neutral-200);
  color: var(--neutral-500);
}

.issue-state-badge.issue-state-open {
  border-color: rgba(25, 98, 58, 0.45);
  color: var(--success);
}

.issue-state-badge.issue-state-closed {
  border-color: rgba(155, 45, 45, 0.45);
  color: var(--danger);
}

/* Decision pill modifier — extends .pill with a leading icon and 4px gap */
.pill--decision {
  gap: 4px;
}

.pill--decision .decision-icon {
  font-size: 11px;
  line-height: 1;
}

.pill--decision.decision-proceed {
  background: var(--info-bg);
  color: var(--info-text);
  border-color: transparent;
}

.pill--decision.decision-clarify,
.pill--decision.decision-split,
.pill--decision.decision-defer {
  background: var(--warning-bg);
  color: var(--warning-text);
  border-color: transparent;
}

/* Cost confidence - three-segment indicator */
.confidence-bar {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  font-size: 12px;
  color: var(--neutral-500);
}

.confidence-bar-segments {
  display: inline-flex;
  gap: 2px;
}

.confidence-bar-segments .seg {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--neutral-200);
  border: 1px solid var(--neutral-300);
}

.confidence-bar-low .seg-1 {
  background: var(--confidence-low);
  border-color: rgba(148, 98, 0, 0.45);
}

.confidence-bar-medium .seg-1,
.confidence-bar-medium .seg-2 {
  background: var(--confidence-medium);
  border-color: rgba(43, 71, 116, 0.45);
}

.confidence-bar-high .seg-1,
.confidence-bar-high .seg-2,
.confidence-bar-high .seg-3 {
  background: var(--success);
  border-color: rgba(5, 89, 60, 0.45);
}

.confidence-bar-empty .seg {
  background: transparent;
  border-style: dashed;
}

.confidence-bar-label {
  text-transform: capitalize;
  font-weight: 600;
}

.confidence-bar-label-compact {
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.05em;
  color: var(--neutral-500);
  line-height: 1;
}

.modal-build-confidence-pair .confidence-bar-label-compact {
  display: none;
}

/* Compact issue rows ----------------------------------------- */

.issues-table.compact td {
  vertical-align: middle;
}

.issue-cell-compact {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.issue-cell-compact--stacked {
  flex-direction: column;
  align-items: stretch;
  gap: 4px;
}

.issue-cell-head {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  flex-shrink: 0;
}

.issue-refs {
  display: inline-flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 4px 8px;
  min-width: 0;
}

.issue-ref-sep {
  color: var(--neutral-400);
  font-weight: var(--fw-semibold);
}

.issue-ref-icon {
  flex-shrink: 0;
  display: inline-block;
  vertical-align: middle;
}

.issue-ref-icon-pr {
  color: var(--neutral-500);
}

.issue-state-dot,
.op-state-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}

.issue-state-dot-open,
.op-state-dot-open { background: var(--risk-low); }

.issue-state-dot-closed,
.op-state-dot-closed { background: var(--status-muted, #9aa1a8); }

.issue-state-dot-unknown,
.op-state-dot-unknown { background: var(--neutral-300); }

.issue-cell-compact-body {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.issue-cell-compact-num {
  font-weight: 700;
  flex-shrink: 0;
}

.issue-cell-compact-title {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  line-height: 1.25;
  color: var(--neutral-700);
}

.issue-cell-compact-title.muted {
  color: var(--neutral-500);
  font-style: italic;
}

.issue-cell-compact-decision {
  flex-shrink: 0;
}

.issue-cell-compact-conflict {
  flex-shrink: 0;
}

/* Conflict risk pill modifier — extends .pill; semibold weight, no text-transform, nowrap */
.pill--conflict-risk {
  font-weight: var(--fw-semibold);
  text-transform: none;
  white-space: nowrap;
}

.pill--conflict-risk.conflict-risk-low {
  background: var(--success-bg);
  color: var(--success-text);
  border-color: transparent;
}

.pill--conflict-risk.conflict-risk-medium {
  background: var(--warning-bg);
  color: var(--warning-text);
  border-color: transparent;
}

.pill--conflict-risk.conflict-risk-high {
  background: var(--danger-bg);
  color: var(--danger-text);
  border-color: transparent;
}

.cost-compact {
  display: inline-flex;
  align-items: baseline;
  gap: var(--space-2);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.cost-compact .cost-compact-sep {
  color: var(--neutral-500);
}

.cost-compact .cost-compact-arrow {
  font-size: 11px;
  font-weight: 700;
}

.cost-compact .cost-compact-arrow.under {
  color: var(--success);
}

.cost-compact .cost-compact-arrow.over {
  color: var(--danger);
}

.activity-compact {
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  color: var(--neutral-500);
}

.activity-compact .activity-strong {
  color: var(--neutral-700);
  font-weight: 600;
}

.activity-compact .activity-sep {
  margin: 0 4px;
}

.actions-compact {
  display: inline-flex;
  gap: var(--space-2);
  white-space: nowrap;
  align-items: center;
}

/* Open issues show stacked Preflight / Build; closed issues show "-". Keep a
   stable column height and layout so later rows do not look "compressed" vs open rows. */
.issues-table.compact td.issue-col-actions.actions-compact {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  justify-content: center;
  gap: var(--space-2);
  white-space: normal;
  min-height: 58px;
}

.issues-table.compact td.issue-col-actions.actions-compact > .issue-action-form {
  width: 100%;
}

.issues-table.compact td.issue-col-actions.actions-compact .issue-action-button {
  box-sizing: border-box;
  width: 100%;
  justify-content: center;
}

.cost-compact-with-confidence {
  align-items: baseline;
  flex-wrap: nowrap;
  gap: 0 var(--space-2);
}

.cost-compact-with-confidence .confidence-bar-inline {
  flex-shrink: 0;
}

.cost.forecast-confidence-low {
  color: #8a5f12;
  border-bottom: 1px dotted rgba(148, 98, 0, 0.5);
}

.cost.forecast-confidence-medium {
  color: #2f4f7a;
}

.cost.forecast-confidence-high {
  color: var(--brand-primary-hover);
}

.confidence-bar-inline {
  gap: 2px;
  align-items: baseline;
  vertical-align: baseline;
}

.confidence-bar-inline .confidence-bar-segments .seg {
  width: 6px;
  height: 6px;
}

/* ----- Cost variance bar (#1464) ----------------------------------------- */

.cost-variance-bar-wrap {
  display: inline-flex;
  align-items: center;
  vertical-align: middle;
}

.cost-variance-bar {
  display: inline-block;
  vertical-align: middle;
}

.cost-variance-bar .cost-variance-bar-track {
  fill: var(--neutral-200);
}

.cost-variance-bar .cost-variance-bar-fill {
  fill: var(--neutral-400);
}

.cost-variance-bar--under .cost-variance-bar-fill {
  fill: var(--success);
}

.cost-variance-bar--over .cost-variance-bar-fill {
  fill: var(--danger);
}

.cost-variance-bar--matches .cost-variance-bar-fill {
  fill: var(--brand-primary, #1f6feb);
}

/* ----- KPI sparkline (#1464) --------------------------------------------- */

.kpi-sparkline {
  display: block;
  margin-top: 4px;
}

.kpi-sparkline-line {
  stroke: var(--brand-primary, #1f6feb);
  stroke-width: 1.5;
  stroke-linejoin: round;
  stroke-linecap: round;
}

.issues-table.compact .issue-action-button.btn-sm {
  padding: 2px 8px;
  min-height: 32px;
  font-size: 12px;
}

@media (pointer: coarse) {
  .issues-table.compact .issue-action-button.btn-sm {
    min-height: 44px;
  }
}

.issues-table.compact .issue-action-icon {
  font-size: 12px;
}

.issue-row-state-open {
  box-shadow: inset 3px 0 0 rgba(25, 107, 71, 0.55);
}

.issue-row-state-closed {
  box-shadow: inset 3px 0 0 rgba(120, 128, 140, 0.55);
}

.run-history-list {
  list-style: none;
  margin: 0;
  padding: 0;
  font-size: 12px;
}

.run-history-item {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px 8px;
  padding: var(--space-2) 0;
  border-top: 1px solid var(--neutral-200);
}

.run-history-item:first-child {
  border-top: 0;
  padding-top: 0;
}

.run-history-date {
  flex: 0 0 auto;
  white-space: nowrap;
}

.run-history-pills {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 4px;
}

.run-history-meta {
  white-space: nowrap;
}

.run-history-pr {
  margin-left: auto;
}


/* Filter summary row (collapsed-by-default filter UI) */
.filter-summary {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-bottom: 12px;
  padding: var(--space-2) var(--space-3);
  border: 1px solid var(--neutral-200);
  border-radius: 8px;
  background: var(--neutral-0);
  box-shadow: var(--shadow-sm);
  font-size: 13px;
}

.filter-summary-label {
  color: var(--neutral-500);
  font-weight: 600;
}

.filter-summary-presets {
  display: inline-flex;
  gap: 4px;
}

.filter-summary-presets button {
  border: 1px solid var(--neutral-300);
  border-radius: 6px;
  background: var(--neutral-0);
  color: var(--neutral-700);
  font: inherit;
  font-size: 12px;
  font-weight: 600;
  padding: 2px 8px;
  cursor: pointer;
}

.filter-summary-presets button.is-active {
  border-color: var(--brand-primary);
  background: var(--info-bg);
  color: var(--brand-primary);
  font-weight: var(--fw-semibold);
}

.filter-summary-spacer {
  flex: 1;
}

.filter-form-host[hidden] {
  display: none;
}

/* Pagination footer */
.pagination-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 0 4px;
  border-top: 1px solid var(--neutral-200);
  margin-top: 2px;
  flex-wrap: wrap;
}

.pagination-footer .range {
  color: var(--neutral-500);
  font-size: 13px;
}

.pagination-footer .pages {
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
}

.pagination-footer .pages a,
.pagination-footer .pages span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 32px;
  height: 32px;
  padding: 0 8px;
  border: 1px solid var(--neutral-200);
  border-radius: var(--radius-sm);
  background: var(--neutral-0);
  color: var(--neutral-700);
  font-size: 13px;
  font-weight: 500;
  text-decoration: none;
  transition: background 0.1s, border-color 0.1s, color 0.1s;
}

.pagination-footer .pages a:hover {
  background: var(--neutral-50);
  border-color: var(--neutral-300);
  color: var(--neutral-900);
  text-decoration: none;
}

.pagination-footer .pages .is-current {
  background: var(--brand-primary);
  border-color: var(--brand-primary);
  color: var(--neutral-0);
  font-weight: var(--fw-bold);
}

.pagination-footer .pages .is-current:hover {
  background: var(--brand-primary-hover);
  border-color: var(--brand-primary-hover);
}

.pagination-footer .pages .is-disabled {
  color: var(--neutral-400);
  pointer-events: none;
  background: var(--neutral-50);
  border-color: var(--neutral-200);
}

.pagination-footer .pages .is-ellipsis {
  border: none;
  background: none;
  color: var(--neutral-400);
  cursor: default;
  pointer-events: none;
  min-width: 24px;
  padding: 0 2px;
}

/* Prev/Next navigation controls */
.pagination-footer .pages .page-nav {
  color: var(--neutral-600);
  padding: 0 12px;
  letter-spacing: 0.01em;
}

.pagination-footer .pages a.page-nav:hover {
  color: var(--brand-primary);
  border-color: var(--brand-primary);
  background: var(--neutral-0);
}

.pagination-footer .pages .page-nav.is-disabled {
  color: var(--neutral-400);
  background: var(--neutral-50);
}

/* ---------- Phase 2 - Settings page redesign ---------- */

.settings-admin-token-host {
  margin-bottom: var(--space-5);
  padding: var(--space-3) var(--space-4);
  border: 1px solid var(--neutral-200);
  border-radius: 8px;
  background: var(--neutral-100);
  display: grid;
  gap: var(--space-2);
}

.settings-admin-token-host label {
  font-weight: 600;
  font-size: 13px;
  color: var(--neutral-700);
}

.settings-admin-token-host .field-hint {
  color: var(--neutral-700);
}

.settings-admin-token-host input {
  min-height: 32px;
  padding: var(--space-2) var(--space-2);
  border: 1px solid var(--neutral-300);
  border-radius: 6px;
  font: inherit;
  background: var(--neutral-0);
}

.settings-section + .settings-section {
  margin-top: 12px;
}

.settings-rows {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}

.settings-group-panel .settings-rows {
  gap: 0;
}

/* #1119: filter box + section jump links over the settings list. */
.settings-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  gap: var(--space-4);
  margin: 12px 0;
}

.settings-filter {
  flex: 1 1 280px;
  min-width: 220px;
  display: grid;
  gap: 4px;
}

.settings-filter-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--neutral-600);
}

.settings-filter-input {
  width: 100%;
  min-height: 34px;
  padding: var(--space-2) var(--space-3);
  border: 1px solid var(--neutral-300);
  border-radius: 6px;
  font: inherit;
  background: var(--neutral-0);
  color: inherit;
}

.settings-filter-empty {
  margin: 2px 0 0;
  font-size: 13px;
  color: var(--neutral-500);
}

.settings-anchors {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
  flex: 1 1 320px;
}

.settings-anchor {
  font-size: 12px;
  padding: var(--space-1) var(--space-3);
  border: 1px solid var(--neutral-200);
  border-radius: 999px;
  background: var(--neutral-0);
  color: var(--neutral-700);
  text-decoration: none;
}

.settings-anchor:hover {
  background: var(--neutral-100);
}

.settings-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: var(--space-2) var(--space-4);
  align-items: start;
  padding: var(--space-6);
  border: 1px solid var(--neutral-200);
  border-radius: var(--radius-lg);
  background: var(--neutral-0);
  box-shadow: var(--shadow-sm);
}

/* #1323: dense, divider-separated rows (no per-card shadow/border) for the
   general settings two-pane list. Scoped so the project-overrides panel, which
   reuses .settings-row, keeps its card look. */
.settings-group-panel .settings-row {
  align-items: center;
  padding: var(--space-3) 0;
  border: none;
  border-bottom: 1px solid var(--neutral-200);
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

.settings-group-panel .settings-row:last-child {
  border-bottom: none;
}

/* #1324: the row label area is the click target that opens the editing drawer. */
.settings-row-open {
  display: grid;
  gap: 4px;
  width: 100%;
  min-width: 0;
  padding: 0;
  border: none;
  background: transparent;
  text-align: left;
  font: inherit;
  color: inherit;
  cursor: pointer;
}

.settings-row-open:hover .settings-row-label,
.settings-row-open:focus-visible .settings-row-label {
  text-decoration: underline;
}

.settings-row-lock {
  font-size: 11px;
  color: var(--neutral-500);
}

.settings-row-main {
  min-width: 0;
  display: grid;
  gap: 4px;
}

.settings-row-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.settings-row-label {
  font-weight: 700;
  font-size: 14px;
}

.settings-row-value {
  font-size: 14px;
}

.settings-mask {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  letter-spacing: 0.08em;
  color: var(--neutral-500);
}

.settings-value {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 13px;
  color: var(--neutral-700);
}

.settings-row-hint {
  font-size: 12px;
  color: var(--neutral-500);
}

.settings-row-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  font-size: 12px;
  color: var(--neutral-500);
  margin-top: 2px;
}

.settings-row-actions {
  display: flex;
  gap: var(--space-2);
  align-items: flex-start;
}

.settings-row-form {
  grid-column: 1 / -1;
  display: flex;
  gap: var(--space-2);
  margin-top: var(--space-2);
}

.settings-row-form .settings-row-input {
  flex: 1;
  min-height: 32px;
  padding: var(--space-2) var(--space-2);
  border: 1px solid var(--neutral-300);
  border-radius: 6px;
  font: inherit;
  background: var(--neutral-0);
  color: inherit;
}

.settings-row-status {
  grid-column: 1 / -1;
  margin-top: 4px;
  padding: var(--space-2) var(--space-3);
  border-radius: 6px;
  font-size: 13px;
  background: var(--neutral-100);
  color: var(--neutral-700);
}

.settings-row-status.warning {
  background: var(--warning-bg);
  color: var(--warning-text);
}

.settings-row-status.error {
  background: var(--danger-bg);
  color: var(--danger);
}

/* Source pills inside settings rows */
.pill.settings-source-db {
  background: var(--success-bg);
  color: var(--success-text);
  border-color: transparent;
}

.pill.settings-source-env {
  background: var(--info-bg);
  color: var(--info-text);
  border-color: transparent;
}

.pill.settings-source-default {
  background: var(--neutral-badge-bg);
  color: var(--neutral-badge-text);
}

.pill.settings-source-unset {
  background: var(--warning-bg);
  color: var(--warning-text);
  border-color: transparent;
}

.pill.settings-secret-pill {
  background: var(--neutral-badge-bg);
  color: var(--neutral-badge-text);
  border-color: var(--neutral-200);
  font-variant-caps: small-caps;
  letter-spacing: 0.04em;
}

.pill.settings-required-pill {
  background: var(--danger-bg);
  color: var(--danger-text);
  border-color: transparent;
  font-variant-caps: small-caps;
  letter-spacing: 0.04em;
}

/* #1457: per-row "N overrides" badge on the global Settings page. */
.pill.settings-override-pill {
  background: var(--info-bg, var(--neutral-100));
  color: var(--info-text, var(--neutral-badge-text));
  border-color: transparent;
  font-variant-caps: small-caps;
  letter-spacing: 0.04em;
}

.pill.settings-secret-set {
  background: var(--success-bg);
  color: var(--success-text);
  border-color: transparent;
}

.pill.settings-secret-unset {
  background: var(--warning-bg);
  color: var(--warning-text);
  border-color: transparent;
}

/* Setup progress card */
.setup-progress {
  margin-bottom: var(--space-4);
  padding: var(--space-5) var(--space-6);
  border: 1px solid var(--neutral-200);
  border-radius: var(--radius-lg);
  background: var(--neutral-0);
  box-shadow: var(--shadow-sm);
}

.setup-progress-status {
  margin: 0 0 var(--space-3);
  font-size: var(--fs-md);
  font-weight: var(--fw-semibold);
  color: var(--neutral-800);
}

.setup-progress-status.is-ready {
  color: var(--success-text);
}

.setup-progress-subtitle {
  margin: -4px 0 var(--space-3);
  font-size: var(--fs-sm);
  color: var(--neutral-500);
}

.setup-progress-list {
  margin: 0;
  padding: 0;
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-3) var(--space-5);
}

.setup-progress-item {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  font-size: var(--fs-sm);
  color: var(--neutral-600);
}

.setup-progress-item.is-done {
  color: var(--success-text);
}

.setup-progress-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--neutral-100);
  font-size: 12px;
  font-weight: var(--fw-bold);
}

.setup-progress-item.is-done .setup-progress-icon {
  background: var(--success-bg);
}

/* Section hint copy */
.section-hint {
  margin: -4px 0 var(--space-3);
  font-size: var(--fs-sm);
  color: var(--neutral-500);
}

/* Glossary line in page subtitle */
.page-subtitle.settings-glossary {
  margin-top: 4px;
  font-size: var(--fs-xs);
  color: var(--neutral-500);
}

.page-subtitle.settings-glossary strong {
  color: var(--neutral-700);
  font-weight: var(--fw-semibold);
}

/* Advanced settings sections collapsed by default */
.settings-section-advanced {
  border: 1px solid var(--neutral-200);
  border-radius: var(--radius-lg);
  background: var(--neutral-0);
  padding: var(--space-4) var(--space-6);
}

.settings-section-advanced > summary {
  cursor: pointer;
  list-style: revert;
  padding: 4px 0;
}

.settings-section-advanced[open] > summary {
  margin-bottom: var(--space-3);
}

/* ------------------------------------------------------------------ */
/* #1322–#1325: two-pane settings layout, state pills, search, drawer */
/* ------------------------------------------------------------------ */
.settings-layout {
  display: grid;
  grid-template-columns: 220px minmax(0, 1fr);
  gap: var(--space-6);
  align-items: start;
}

.settings-nav {
  position: sticky;
  top: var(--space-4);
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

.settings-nav-ready {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-2) var(--space-3);
  border-radius: 999px;
  background: var(--success-bg);
  color: var(--success-text);
  font-size: var(--fs-sm);
  font-weight: var(--fw-semibold);
}

.settings-nav-list {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.settings-nav-item {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: var(--space-2) var(--space-3);
  border: none;
  border-radius: var(--radius-md);
  background: transparent;
  color: var(--neutral-700);
  font: inherit;
  text-align: left;
  cursor: pointer;
  text-decoration: none;
}

.settings-nav-item:hover {
  background: var(--neutral-100);
}

.settings-nav-item[aria-current="page"] {
  background: var(--neutral-100);
  color: var(--neutral-900);
  font-weight: var(--fw-semibold);
  box-shadow: inset 2px 0 0 var(--accent-indigo);
}

.settings-nav-icon {
  font-size: 14px;
  line-height: 1;
}

.settings-main {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
}

.settings-search {
  display: grid;
  gap: 4px;
}

.settings-search-empty {
  margin-top: var(--space-2);
}

.settings-panels {
  display: block;
}

.settings-group-heading {
  margin: 0 0 var(--space-2);
  font-size: var(--fs-lg);
  font-weight: var(--fw-semibold);
  color: var(--neutral-900);
}

.settings-group-panel + .settings-group-panel {
  margin-top: var(--space-6);
}

.settings-section-title {
  margin: var(--space-4) 0 var(--space-1);
  font-size: var(--fs-xs);
  font-weight: var(--fw-semibold);
  color: var(--neutral-600);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.settings-section:first-child .settings-section-title {
  margin-top: 0;
}

/* Single per-row state indicator (#1322). */
.pill.settings-state {
  font-variant-caps: small-caps;
  letter-spacing: 0.04em;
}

.pill.settings-state-set {
  background: var(--success-bg);
  color: var(--success-text);
  border-color: transparent;
}

.pill.settings-state-unset {
  background: var(--warning-bg);
  color: var(--warning-text);
  border-color: transparent;
}

.pill.settings-state-default {
  background: var(--neutral-badge-bg);
  color: var(--neutral-badge-text);
}

.pill.settings-state-env {
  background: var(--info-bg);
  color: var(--info-text);
  border-color: transparent;
}

.setup-progress-actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
  margin-top: var(--space-3);
}

/* #1324: slide-over editing drawer. */
.settings-drawer {
  position: fixed;
  inset: 0;
  z-index: 60;
}

.settings-drawer[hidden] {
  display: none;
}

.settings-drawer-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.4);
  opacity: 0;
  transition: opacity 0.15s ease;
}

.settings-drawer.is-open .settings-drawer-backdrop {
  opacity: 1;
}

.settings-drawer-panel {
  position: absolute;
  top: 0;
  right: 0;
  height: 100%;
  width: min(440px, 100%);
  background: var(--neutral-0);
  box-shadow: var(--shadow-lg);
  padding: var(--space-6);
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
  transform: translateX(100%);
  transition: transform 0.18s ease;
}

.settings-drawer.is-open .settings-drawer-panel {
  transform: translateX(0);
}

.settings-drawer-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
}

.settings-drawer-title {
  margin: 0;
  font-size: var(--fs-lg);
}

.settings-drawer-close {
  border: none;
  background: transparent;
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
  color: var(--neutral-500);
}

.settings-drawer-hint {
  margin: 0;
  font-size: var(--fs-sm);
  color: var(--neutral-500);
}

.settings-drawer-hint[hidden] {
  display: none;
}

.settings-drawer-form {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}

.settings-drawer-input .settings-row-input {
  width: 100%;
  min-height: 36px;
  padding: var(--space-2) var(--space-2);
  border: 1px solid var(--neutral-300);
  border-radius: 6px;
  font: inherit;
  background: var(--neutral-0);
  color: inherit;
}

.settings-drawer-actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
}

.settings-drawer-status[hidden] {
  display: none;
}

.settings-drawer-history {
  font-size: var(--fs-xs);
  color: var(--neutral-500);
  border-top: 1px solid var(--neutral-200);
  padding-top: var(--space-3);
}

.settings-drawer-history p {
  margin: 0;
}

/* Anthropic allowed models multi-select (#1666) */
.settings-models-select {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.settings-models-list {
  display: flex;
  flex-direction: column;
  max-height: 340px;
  overflow-y: auto;
  border: 1px solid var(--neutral-200);
  border-radius: 6px;
  padding: 4px;
}

.settings-models-group-title {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--neutral-500);
  padding: var(--space-2) var(--space-2) 2px;
}

.settings-model-option {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: var(--space-2) var(--space-2);
  border-radius: 4px;
  cursor: pointer;
  font-size: 13px;
  line-height: 1.4;
}

.settings-model-option:hover {
  background: var(--neutral-50);
}

.settings-model-option input[type="checkbox"] {
  flex-shrink: 0;
}

.settings-model-name {
  flex: 1;
  font-weight: 500;
}

.settings-model-id {
  font-family: var(--font-mono, monospace);
  font-size: 11px;
  color: var(--neutral-500);
}

.settings-models-note {
  font-size: var(--fs-xs);
  color: var(--neutral-500);
  margin: 0;
}

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

  .settings-nav {
    position: static;
  }

  .settings-nav-list {
    flex-direction: row;
    flex-wrap: nowrap;
    overflow-x: auto;
  }

  .settings-nav-item {
    flex: 0 0 auto;
  }

  .settings-nav-item[aria-current="page"] {
    box-shadow: inset 0 -2px 0 var(--accent-indigo);
  }

  .settings-drawer-panel {
    width: 100%;
  }
}

/* Dashboard: project archived (AgentDock operator archive, not GitHub) */
.project-archived-banner {
  margin: 0 0 20px;
  padding: 12px 16px;
  background: var(--warning-bg);
  color: var(--warning-text);
  border-radius: 8px;
  border: 1px solid rgba(245, 158, 11, 0.32);
  font-size: 14px;
  line-height: 1.45;
}

.project-archived-banner a {
  font-weight: 600;
  text-underline-offset: 2px;
}

/* Onboarding banner */
.onboarding-banner {
  position: sticky;
  top: 0;
  z-index: 30;
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  padding: var(--space-3) var(--space-4);
  background: var(--warning-bg);
  color: var(--warning-text);
  border-bottom: 1px solid rgba(245, 158, 11, 0.32);
  font-weight: 600;
  font-size: 13px;
}

.onboarding-banner a {
  color: var(--brand-primary-hover);
  font-weight: 700;
  text-underline-offset: 2px;
}

.onboarding-banner a:hover {
  color: var(--brand-primary-hover);
}

.onboarding-banner a.btn-primary,
.onboarding-banner a.btn-build {
  color: var(--neutral-0);
}

.onboarding-banner .onboarding-banner-dismiss {
  margin-left: auto;
  background: transparent;
  border-color: rgba(245, 158, 11, 0.32);
  color: inherit;
}

/* Project readiness card (Phase 4) */
.project-readiness-card .readiness-rows {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.readiness-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: var(--space-3) var(--space-3);
  border-radius: 6px;
  border: 1px solid var(--neutral-200);
  background: var(--neutral-25);
  font-size: 14px;
}

.readiness-row .readiness-icon {
  font-size: 18px;
  width: 22px;
  text-align: center;
  flex-shrink: 0;
}

.readiness-row .readiness-label {
  flex: 1;
  font-weight: 500;
}

.readiness-row .readiness-detail {
  color: var(--neutral-500);
  font-size: 12px;
}

.readiness-row.readiness-state-ready {
  border-color: var(--neutral-200);
  background: var(--success-bg);
}

.readiness-row.readiness-state-ready .readiness-icon {
  color: var(--success-text);
}

.readiness-row.readiness-state-blocked {
  border-color: var(--neutral-200);
  background: var(--warning-bg);
}

.readiness-row.readiness-state-blocked .readiness-icon,
.readiness-row.readiness-state-blocked .readiness-label {
  color: var(--warning-text);
}

.readiness-row.readiness-state-na {
  border-color: var(--neutral-200);
  background: var(--neutral-badge-bg);
}

.readiness-row.readiness-state-na .readiness-icon,
.readiness-row.readiness-state-na .readiness-label {
  color: var(--neutral-badge-text);
}

/* Per-project overrides panel reuses .settings-row look from Phase 2. */
.project-overrides-panel .settings-row {
  margin-bottom: 0;
}

/* Project settings two-pane: dense rows inside group panels (match /settings). */
.project-settings-panels .settings-group-panel .settings-row {
  align-items: center;
  padding: var(--space-3) 0;
  border: none;
  border-bottom: 1px solid var(--neutral-200);
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  grid-template-columns: 1fr auto;
}

.project-settings-panels .settings-group-panel .settings-row:last-child {
  border-bottom: none;
}

.project-readiness-summary {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  padding: var(--space-4);
  border-radius: var(--radius-lg);
  border: 1px solid var(--neutral-200);
  margin-bottom: var(--space-4);
}

.project-readiness-summary-ready {
  flex-direction: row;
  align-items: center;
  gap: var(--space-3);
  background: var(--success-bg);
  color: var(--success-text);
}

.project-readiness-summary-blocked,
.project-readiness-summary-na {
  background: var(--warning-bg);
  color: var(--warning-text);
}

.project-readiness-summary-heading {
  margin: 0;
  font-weight: 600;
}

.project-readiness-summary-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

.project-readiness-summary-item {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-2);
  font-size: var(--fs-sm);
}

.project-readiness-summary-detail {
  color: var(--neutral-600);
  font-size: var(--fs-xs);
}

.project-readiness-summary-details {
  margin-top: var(--space-2);
}

.project-readiness-summary-details summary {
  cursor: pointer;
  font-size: var(--fs-sm);
  color: var(--neutral-600);
}

.project-settings-overview-hint {
  margin-top: var(--space-4);
}

.project-danger-zone {
  margin-top: var(--space-6);
  padding: var(--space-4);
  border: 1px solid var(--danger, #ef4444);
  border-radius: var(--radius-lg);
  background: var(--danger-bg);
}

.project-danger-zone .settings-section-title {
  color: var(--danger-text);
}

.memory-list-row .memory-confidence {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin-left: var(--space-2);
}

.memory-list-row .confidence-bar {
  width: 48px;
  height: 6px;
}

.memory-value-preview {
  display: block;
  color: var(--neutral-600);
  font-size: var(--fs-sm);
}

.memory-panel-actions {
  margin-top: var(--space-4);
  display: flex;
  align-items: center;
  gap: var(--space-3);
}

.memory-drawer-fields {
  display: grid;
  gap: var(--space-3);
}

#project-settings-admin-token-host[hidden] {
  display: none;
}

/* Project header subtitle: prevent long GitHub URLs from breaking the layout
   on narrow viewports while keeping the link discoverable. */
.page-head-main {
  min-width: 0;
  flex: 1;
}

#project-subtitle {
  overflow-wrap: anywhere;
  word-break: break-word;
}

/* Toast notifications (top-right region, max 3 visible) */
#toast-region {
  position: fixed;
  top: 16px;
  right: 16px;
  z-index: 1000;
  display: flex;
  flex-direction: column;
  gap: 8px;
  pointer-events: none;
  max-width: calc(100vw - 32px);
}

/*
 * Toasts (Phase 3 - issue #261). Chassis adopts the DS card chrome with a 4px
 * coloured left rule per kind. Kind backgrounds use the matching --*-bg
 * tokens so info/success/warn/error read consistently with status pills.
 */
.toast {
  pointer-events: auto;
  display: flex;
  align-items: flex-start;
  gap: var(--space-2);
  min-width: 240px;
  max-width: 420px;
  padding: var(--space-3) var(--space-4);
  border: 1px solid var(--neutral-200);
  border-left-width: 4px;
  border-radius: var(--radius-md);
  background: var(--neutral-0);
  box-shadow: var(--shadow-md);
  font-size: var(--fs-sm);
  color: var(--neutral-700);
  line-height: 1.4;
  animation: toast-in 160ms var(--ease-decelerate);
}

@keyframes toast-in {
  from { transform: translateX(8px); opacity: 0; }
  to   { transform: translateX(0);   opacity: 1; }
}

.toast-info    { border-left-color: var(--info);    background: var(--info-bg);    color: var(--info-text); }
.toast-success { border-left-color: var(--success); background: var(--success-bg); color: var(--success-text); }
.toast-warn    { border-left-color: var(--warning); background: var(--warning-bg); color: var(--warning-text); }
.toast-error   { border-left-color: var(--danger);  background: var(--danger-bg);  color: var(--danger-text); }

@media (prefers-reduced-motion: reduce) {
  .toast { animation: none; }
}

.toast-message {
  flex: 1;
  word-wrap: break-word;
  color: inherit;
}

.toast-dismiss {
  flex-shrink: 0;
  width: 22px;
  height: 22px;
  padding: 0;
  border: none;
  background: transparent;
  color: var(--neutral-500);
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
  border-radius: 4px;
}

.toast-dismiss:hover {
  background: rgba(0, 0, 0, 0.06);
  color: var(--neutral-700);
}

/*
 * Modal dialog (Phase 3 - issue #261). Native <dialog> chassis adopts §3.4:
 * 12px radius, 24px padding, ds-shadow-md, neutral-0 bg. Title weight is
 * semibold (DS) instead of legacy bold. Kind variants tint only the title.
 */
dialog.modal {
  width: min(560px, calc(100vw - 32px));
  padding: 0;
  border: 1px solid var(--neutral-200);
  border-radius: var(--radius-lg);
  background: var(--neutral-0);
  color: var(--neutral-700);
  box-shadow: var(--shadow-md);
}

dialog.modal.modal--form {
  width: min(480px, calc(100vw - 32px));
}

dialog.modal.modal--form .modal-body {
  overflow: visible;
}

dialog.modal.modal--form .modal-actions {
  flex-shrink: 0;
  margin-top: var(--space-1);
  padding-top: var(--space-3);
  border-top: 1px solid var(--neutral-200);
}

/* Scroll only when the viewport is too short to show the full form */
@media (max-height: 720px) {
  dialog.modal.modal--form {
    max-height: calc(100dvh - var(--space-8));
    overflow: hidden;
  }

  dialog.modal.modal--form > .modal-form {
    max-height: inherit;
    overflow: hidden;
  }

  dialog.modal.modal--form .modal-body {
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
    padding-right: var(--space-1);
  }
}

dialog.modal::backdrop {
  background: rgba(15, 23, 42, 0.36);
}

.modal-form {
  margin: 0;
  padding: var(--space-6);
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}

.modal-title {
  margin: 0;
  font-size: var(--fs-lg);
  font-weight: var(--fw-semibold);
  color: var(--neutral-900);
}

.modal-body {
  margin: 0;
  font-size: var(--fs-base);
  font-weight: var(--fw-regular);
  line-height: 1.5;
  color: var(--neutral-700);
  white-space: pre-wrap;
}

/* #241 - Build confirmation modal sections (issue, budget, forecast,
   model, real-cost warning). Inline `pre-wrap` from `.modal-body` would otherwise
   collapse the structured HTML; reset it for the Build modal sections. */
.modal-body .modal-section {
  white-space: normal;
  margin-top: var(--space-3);
  padding-top: var(--space-3);
  border-top: 1px solid var(--neutral-200);
}

.modal-body .modal-section:first-child {
  margin-top: 0;
  padding-top: 0;
  border-top: 0;
}

.modal-body .modal-section--warn .modal-section-title {
  color: var(--warning);
}

.modal-body .modal-section-title {
  margin: 0 0 4px;
  font-size: 13px;
  font-weight: 700;
}

.modal-body .modal-kv {
  margin: 4px 0 0;
  display: grid;
  grid-template-columns: max-content 1fr;
  gap: 2px 12px;
}

.modal-body .modal-kv > div {
  display: contents;
}

.modal-body .modal-kv dt {
  color: var(--neutral-500);
  font-weight: 600;
}

.modal-body .modal-kv dd {
  margin: 0;
}

.modal-body .modal-tag {
  display: inline-block;
  margin-left: var(--space-2);
  padding: 0 var(--space-2);
  font-size: 11px;
  font-weight: 600;
  color: var(--neutral-500);
  background: var(--neutral-0);
  border: 1px solid var(--neutral-200);
  border-radius: 999px;
}

.modal-body .modal-warn-line {
  margin: 0;
  color: var(--warning);
}

.modal-body .modal-hint {
  margin: 4px 0 0;
  color: var(--neutral-500);
  font-size: 12px;
}

.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 4px;
}

.modal-form.modal-neutral .modal-title {
  color: var(--neutral-900);
}

.modal-form.modal-warn .modal-title {
  color: var(--warning-text);
}

.modal-form.modal-danger .modal-title {
  color: var(--danger-text);
}

/* #429 - Build confirm modal: subtitle, overrun banner, hero + forecast grid */
.modal-form .modal-subtitle {
  margin: -4px 0 0;
  font-size: 13px;
  font-weight: var(--fw-regular);
  line-height: 1.35;
  color: var(--neutral-600);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.modal-body .users-create-form,
.modal-body .user-create-modal-form {
  white-space: normal;
}

.modal-body .modal-build-root {
  white-space: normal;
  display: flex;
  flex-direction: column;
  gap: 0;
}

.modal-build-banner {
  display: flex;
  gap: 8px;
  align-items: flex-start;
  margin-bottom: var(--space-3);
  padding: var(--space-3) var(--space-3);
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
}

.modal-build-banner--warn {
  background: var(--warning-bg);
  border-color: rgba(180, 83, 9, 0.25);
}

.modal-build-banner--warn .modal-build-banner-icon,
.modal-build-banner--warn .modal-build-banner-text {
  color: var(--warning-text);
}

.modal-build-banner--danger {
  background: var(--danger-bg);
  border-color: rgba(185, 28, 28, 0.22);
}

.modal-build-banner--danger .modal-build-banner-icon,
.modal-build-banner--danger .modal-build-banner-text {
  color: var(--danger-text);
}

.modal-build-banner-icon {
  flex-shrink: 0;
  font-size: 15px;
  line-height: 1.4;
}

.modal-build-banner-text {
  margin: 0;
  font-size: 13px;
  font-weight: var(--fw-semibold);
  line-height: 1.45;
}

.modal-body .modal-build-block {
  margin-top: var(--space-3);
  padding-top: var(--space-3);
  border-top: 1px solid var(--neutral-200);
}

.modal-build-root > .modal-build-block:first-of-type {
  margin-top: 0;
  padding-top: 0;
  border-top: 0;
}

.modal-build-block--empty {
  margin-top: 0;
  padding-top: 0;
  border-top: 0;
}

.modal-build-empty-banner {
  padding: var(--space-3) var(--space-3);
  border-radius: var(--radius-sm);
  background: var(--warning-bg);
  border: 1px solid rgba(180, 83, 9, 0.25);
  color: var(--warning-text);
  font-size: 13px;
  line-height: 1.45;
}

.modal-build-empty-budget {
  display: inline;
  font-weight: var(--fw-semibold);
}

.modal-build-empty-model {
  white-space: normal;
}

.modal-build-hero-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: var(--space-3) var(--space-3);
}

.modal-build-hero-label {
  font-size: 11px;
  font-weight: 700;
  color: var(--neutral-500);
  text-transform: uppercase;
  letter-spacing: 0.02em;
  margin-bottom: 2px;
}

.modal-build-hero-value {
  font-size: 15px;
  font-weight: var(--fw-semibold);
  color: var(--neutral-900);
}

.modal-build-hero-value--chip {
  font-weight: var(--fw-regular);
}

.modal-hero-cap-amount {
  font-weight: 700;
  color: var(--neutral-900);
}

.modal-hero-cap-source {
  font-size: 12px;
  font-weight: var(--fw-regular);
  color: var(--neutral-500);
}

.modal-build-glyph-svg {
  display: block;
}

.modal-build-section-glyph {
  display: inline-flex;
  flex-shrink: 0;
  color: var(--neutral-500);
}

.modal-build-section-glyph--on-hero-label {
  position: relative;
  top: 0.5px;
}

.modal-build-hero-label--with-glyph {
  display: flex;
  align-items: center;
  gap: var(--space-2);
}

.modal-build-confidence-pair {
  display: inline-flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}

.modal-build-confidence-chip-slot {
  display: inline-flex;
  align-items: center;
}

/* #431 - Forecast amounts: cost-* = ratio vs cap (scoped overrides; global cost-* also encodes confidence elsewhere). */
.modal-build-forecast-col-value > .cost.cost-low {
  color: var(--success-text);
  border: none;
  background: transparent;
  padding: 0;
  min-height: unset;
}

.modal-build-forecast-col-value > .cost.cost-low::before {
  display: none;
}

.modal-build-forecast-col-value > .cost.cost-medium {
  color: var(--warning-text);
  border: none;
  background: transparent;
  padding: 0;
  min-height: unset;
}

.modal-build-forecast-col-value > .cost.cost-high {
  color: var(--danger-text);
  border: none;
  background: transparent;
  padding: 0;
  min-height: unset;
}

.modal-build-footnote--warn-row {
  display: flex;
  align-items: flex-start;
  gap: 8px;
}

.modal-build-footnote-glyph {
  flex-shrink: 0;
  display: inline-flex;
  margin-top: 2px;
  color: var(--warning);
}

.modal-build-footnote-copy {
  color: var(--neutral-700);
}

.modal-body .modal-chip {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  border-radius: 999px;
  border: 1px solid transparent;
}

.modal-chip--low {
  background: var(--warning-bg);
  color: var(--warning-text);
}

.modal-chip--medium {
  background: var(--info-bg);
  color: var(--info-text);
}

.modal-chip--high {
  background: var(--success-bg);
  color: var(--success-text);
}

.modal-build-dash {
  color: var(--neutral-400);
}

.modal-build-forecast-head {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  font-size: 11px;
  font-weight: 700;
  color: var(--neutral-500);
  text-transform: uppercase;
  letter-spacing: 0.02em;
  margin-bottom: var(--space-2);
}

.modal-build-forecast-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: var(--space-2) var(--space-3);
}

.modal-build-forecast-col-label {
  font-size: 11px;
  font-weight: 600;
  color: var(--neutral-500);
}

.modal-build-forecast-col-value {
  font-size: 14px;
  font-weight: var(--fw-medium);
  color: var(--neutral-900);
}

.modal-build-forecast-col-value--strong {
  font-weight: var(--fw-semibold);
}

.modal-build-asterisk-note {
  margin: var(--space-2) 0 0;
  font-size: 11px;
  color: var(--neutral-500);
}

.modal-build-updated {
  margin: 4px 0 0;
  font-size: 12px;
  color: var(--neutral-500);
}

.modal-build-model-line {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 4px 8px;
  font-size: 13px;
}

.modal-build-model-label {
  display: inline-flex;
  align-items: baseline;
  gap: var(--space-2);
  font-weight: 700;
  color: var(--neutral-700);
}

.modal-build-model-sep {
  color: var(--neutral-400);
}

.modal-build-model-hint {
  color: var(--neutral-500);
  font-size: 12px;
}

.modal-build-model-line--select {
  align-items: center;
}

.modal-build-model-select {
  flex: 1 1 auto;
  min-width: 0;
  padding: var(--space-1) var(--space-2);
  font-size: 13px;
  border: 1px solid var(--neutral-300);
  border-radius: 6px;
  background: var(--neutral-0);
  color: var(--neutral-800);
}

.modal-build-model-hint--block {
  flex-basis: 100%;
  margin: var(--space-2) 0 0;
}

.modal-build-footnote {
  margin: 12px 0 0;
  padding-top: var(--space-3);
  border-top: 1px solid var(--neutral-200);
  font-size: 12px;
  color: var(--neutral-500);
  line-height: 1.45;
}

.btn-ghost {
  background: transparent;
  border-color: var(--neutral-200);
  color: var(--neutral-700);
}

.btn-ghost:hover {
  background: var(--neutral-50);
}

.btn-primary,
.btn-build {
  background: var(--brand-primary-hover);
  border-color: transparent;
  color: var(--neutral-0);
}

.btn-primary:hover:not(:disabled),
.btn-build:hover:not(:disabled) {
  background: #1e3a8a;
  color: var(--neutral-0);
}

.btn-primary:disabled,
.btn-build:disabled {
  cursor: not-allowed;
  opacity: var(--disabled-opacity);
}

/* Larger primary action used as the focal CTA on /projects and /projects/new.
 * Heavier visual weight than the default 6/12 button so the import action reads
 * as primary at a glance without being treated like a marketing call-to-action. */
.btn-primary-lg {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-3) var(--space-4);
  font-size: var(--fs-sm);
  font-weight: var(--fw-semibold);
  box-shadow: 0 1px 2px rgba(37, 99, 235, 0.25);
}

.btn-icon {
  flex-shrink: 0;
  display: inline-block;
}

/* -- Projects dashboard (portfolio overview) -- */
.projects-dashboard {
  display: flex;
  flex-direction: column;
  gap: 0;
}

/* Period hint for the portfolio dashboard. Rendered as an info-toned callout
 * (DS info palette) only when at least one filter param is active, so users
 * get a clear "current view is filtered" cue without competing with the KPI
 * strip below. */
.dashboard-info-callout {
  display: block;
  margin: 0 0 var(--space-3);
  padding: var(--space-2) var(--space-3);
  border-left: 3px solid var(--info);
  border-radius: var(--radius-sm);
  background: var(--info-bg);
  color: var(--info-text);
  font-size: var(--fs-sm);
  line-height: 1.4;
}

.dashboard-insights {
  margin-top: 4px;
}

.dashboard-insights-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: var(--space-4);
}

@media (max-width: 960px) {
  .dashboard-insights-grid {
    grid-template-columns: 1fr;
  }
}

.insight-panel {
  padding: var(--space-4);
  border: 1px solid var(--neutral-200);
  border-radius: var(--radius-lg);
  background: var(--neutral-0);
  box-shadow: var(--shadow-sm);
  min-height: 0;
}

.insight-panel-title {
  margin: 0 0 var(--space-2);
  font-size: var(--fs-sm);
  font-weight: var(--fw-bold);
  color: var(--neutral-700);
  letter-spacing: var(--tracking-table);
}

.insight-panel-desc {
  margin: 0 0 var(--space-3);
  font-size: var(--fs-xs);
  color: var(--neutral-500);
  line-height: 1.4;
}

.portfolio-stack-bar {
  display: flex;
  flex-direction: row;
  width: 100%;
  height: 10px;
  border-radius: 6px;
  overflow: hidden;
  background: var(--neutral-100);
  border: 1px solid var(--neutral-200);
}

.portfolio-bar-seg {
  min-width: 2px;
  height: 100%;
  transition: opacity 0.15s ease;
}

.portfolio-bar-seg:hover {
  opacity: 0.88;
}

.portfolio-bar-empty {
  width: 100%;
  height: 100%;
  background: var(--neutral-100);
}

.portfolio-legend {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2) var(--space-4);
  margin-top: var(--space-3);
  font-size: 11px;
  color: var(--neutral-500);
}

.portfolio-legend-item {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
}

.portfolio-legend-swatch {
  width: 10px;
  height: 10px;
  border-radius: 3px;
  flex-shrink: 0;
  border: 1px solid var(--neutral-200);
}

/* Status mix (invocations) */
.portfolio-bar-seg.st-succeeded,
.portfolio-legend-swatch.st-succeeded,
.project-card-bar-seg.st-succeeded {
  background: var(--success);
  border-color: transparent;
}

.portfolio-bar-seg.st-failed,
.portfolio-bar-seg.st-cancelled,
.portfolio-legend-swatch.st-failed,
.portfolio-legend-swatch.st-cancelled,
.project-card-bar-seg.st-failed,
.project-card-bar-seg.st-cancelled {
  background: var(--danger);
  border-color: transparent;
}

.portfolio-bar-seg.st-running,
.portfolio-bar-seg.st-sent,
.portfolio-bar-seg.st-creating_agent,
.portfolio-legend-swatch.st-running,
.portfolio-legend-swatch.st-sent,
.portfolio-legend-swatch.st-creating_agent,
.project-card-bar-seg.st-running,
.project-card-bar-seg.st-sent,
.project-card-bar-seg.st-creating_agent {
  background: var(--brand-primary-hover);
  border-color: transparent;
}

.portfolio-bar-seg.st-requested,
.portfolio-legend-swatch.st-requested,
.project-card-bar-seg.st-requested {
  background: var(--neutral-500);
  border-color: transparent;
  opacity: 0.85;
}

.portfolio-bar-seg.st-unknown,
.portfolio-legend-swatch.st-unknown,
.project-card-bar-seg.st-unknown {
  background: var(--neutral-300);
  border-color: transparent;
}

/* Cost confidence mix */
.portfolio-bar-seg.conf-high,
.portfolio-legend-swatch.conf-high {
  background: var(--success);
  border-color: transparent;
}

.portfolio-bar-seg.conf-medium,
.portfolio-legend-swatch.conf-medium {
  background: var(--brand-primary-hover);
  border-color: transparent;
}

.portfolio-bar-seg.conf-low,
.portfolio-legend-swatch.conf-low {
  background: var(--warning);
  border-color: transparent;
}

.portfolio-bar-seg.conf-unknown,
.portfolio-legend-swatch.conf-unknown {
  background: var(--neutral-300);
  border-color: transparent;
}

/* Preflight decision distribution (#354) */
.portfolio-bar-seg.dec-proceed,
.portfolio-legend-swatch.dec-proceed,
.project-card-bar-seg.dec-proceed {
  background: rgb(22, 163, 74);
  border-color: transparent;
}

.portfolio-bar-seg.dec-clarify,
.portfolio-legend-swatch.dec-clarify,
.project-card-bar-seg.dec-clarify {
  background: var(--warning);
  border-color: transparent;
}

.portfolio-bar-seg.dec-split,
.portfolio-legend-swatch.dec-split,
.project-card-bar-seg.dec-split {
  background: var(--danger);
  border-color: transparent;
}

.portfolio-bar-seg.dec-defer,
.portfolio-legend-swatch.dec-defer,
.project-card-bar-seg.dec-defer {
  background: var(--neutral-400);
  border-color: transparent;
}

.insight-panel-footnote {
  margin: -4px 0 var(--space-3);
  font-size: 11px;
  line-height: 1.35;
  color: var(--neutral-500);
}

.project-card-preflight-decisions {
  margin: 0 0 8px;
}

.project-card-bar-decisions {
  height: 4px;
  border-radius: 3px;
  overflow: hidden;
  border: 1px solid var(--neutral-200);
  background: var(--neutral-100);
}

.project-card-decision-counts {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 12px;
  margin-top: 4px;
  font-size: 10px;
  font-family: var(--font-mono);
  letter-spacing: var(--tracking-wide);
  color: var(--neutral-600);
  text-transform: lowercase;
}

.project-card-decision-count {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  cursor: default;
}

.project-card-decision-count strong {
  color: var(--neutral-900);
  font-weight: var(--fw-semibold);
}

.project-card-decision-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  display: inline-block;
}

.project-card-decision-count.dec-proceed .project-card-decision-dot {
  background: rgba(22, 163, 74, 0.85);
}
.project-card-decision-count.dec-clarify .project-card-decision-dot {
  background: rgba(217, 119, 6, 0.85);
}
.project-card-decision-count.dec-split .project-card-decision-dot {
  background: rgba(244, 63, 94, 0.85);
}
.project-card-decision-count.dec-defer .project-card-decision-dot {
  background: var(--neutral-400);
}

.project-card-preflight-decisions--empty {
  font-size: var(--fs-xs);
  line-height: 1.4;
}

.portfolio-series-chart-wrap {
  width: 100%;
  overflow: hidden;
}

.portfolio-series-chart {
  display: block;
  width: 100%;
  max-height: 140px;
}

.portfolio-series-bar {
  fill: var(--brand-primary);
  transition: opacity var(--duration-fast) var(--ease-standard);
}

.portfolio-series-bar:hover {
  opacity: 0.8;
}

.portfolio-series-axis {
  fill: var(--neutral-400);
  font-family: var(--font-mono);
}

.portfolio-series-axis-end {
  text-anchor: end;
}

.portfolio-series-empty {
  height: 72px;
  border-radius: 8px;
  background: var(--neutral-100);
  border: 1px dashed var(--neutral-200);
}

.project-directory-section {
  margin-top: 8px;
}


.project-directory-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-4);
  margin-bottom: var(--space-3);
}

.project-sort-controls {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: var(--space-2);
}

.project-sort-option.is-active {
  border-color: var(--brand-primary);
  background: var(--info-bg);
  color: var(--brand-primary);
}

@media (max-width: 720px) {
  .project-directory-head {
    flex-direction: column;
    align-items: stretch;
  }

  .project-sort-controls {
    justify-content: flex-start;
  }
}

.project-card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(380px, 1fr));
  gap: var(--space-4);
  margin-bottom: var(--space-4);
}

@media (min-width: 1280px) {
  .project-card-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

.project-cards-expand {
  margin-bottom: 16px;
  border: 1px solid var(--neutral-200);
  border-radius: 8px;
  background: var(--neutral-100);
  padding: 0 12px 8px;
}

.project-cards-expand-summary {
  cursor: pointer;
  font-size: var(--fs-sm);
  font-weight: var(--fw-medium);
  color: var(--brand-primary);
  padding: var(--space-3) 0;
}

.project-cards-expand[open] .project-cards-expand-summary {
  color: var(--neutral-600);
  margin-bottom: 8px;
}

.project-card {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  padding: var(--space-3) var(--space-4);
  border: 1px solid var(--neutral-200);
  border-radius: var(--radius-md);
  background: var(--neutral-0);
  box-shadow: var(--shadow-xs);
  transition:
    transform var(--duration-base) var(--ease-standard),
    box-shadow var(--duration-base) var(--ease-standard);
}

@media (prefers-reduced-motion: reduce) {
  .project-card {
    transition: none;
  }
}

.project-card-head {
  display: flex;
  align-items: flex-start;
  gap: var(--space-3);
}

.project-card-avatar {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  border: 1px solid var(--neutral-200);
  flex-shrink: 0;
  object-fit: cover;
  background: var(--neutral-100);
}

.project-card-avatar-fallback {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  background: hsl(var(--project-card-avatar-hue, 220) 45% 88%);
  border: 1px solid hsl(var(--project-card-avatar-hue, 220) 35% 78%);
  color: hsl(var(--project-card-avatar-hue, 220) 40% 32%);
  font-size: var(--fs-xs);
  font-weight: var(--fw-semibold);
  letter-spacing: 0.02em;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.project-card-titles {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.project-card-title {
  display: block;
  font-size: var(--fs-base);
  font-weight: var(--fw-semibold);
  color: var(--neutral-900);
  text-decoration: none;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.project-card-title:hover {
  color: var(--neutral-700);
  text-decoration: underline;
  text-underline-offset: 2px;
}

.project-card-repo-path {
  font-size: var(--fs-xs);
  color: var(--neutral-500);
  font-family: var(--font-mono);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 100%;
}

.project-card-provider-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 22px;
  height: 16px;
  padding: 0 4px;
  font-size: 9.5px;
  font-weight: 700;
  letter-spacing: 0.04em;
  border-radius: 3px;
  background: var(--neutral-200);
  color: var(--neutral-800);
  flex-shrink: 0;
}

.project-card-provider-badge--azure_devops {
  background: var(--brand-azure-bg);
  color: var(--brand-azure-hover);
}

.project-card-bar {
  display: flex;
  height: 6px;
  border-radius: 4px;
  overflow: hidden;
  background: var(--neutral-100);
  border: 1px solid var(--neutral-200);
}

.project-card-bar-empty {
  opacity: 0.6;
}

.project-card-bar-seg {
  min-width: 2px;
  height: 100%;
}

.project-card-funnel {
  margin: 2px 0 var(--space-3);
  font-size: var(--fs-xs);
  color: var(--neutral-600);
  line-height: 1.45;
}

.project-card-funnel-row {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: var(--space-2) var(--space-3);
}

.project-card-funnel-arrow {
  color: var(--neutral-400);
  user-select: none;
}

.project-card-funnel-muted {
  font-weight: var(--fw-regular);
  color: var(--neutral-500);
}

.project-card-funnel strong {
  font-weight: var(--fw-semibold);
  color: var(--neutral-900);
}

.project-card-runmode-wrap {
  margin-bottom: var(--space-3);
}

.project-card-runmode-split {
  display: flex;
  gap: 2px;
  height: 6px;
  border-radius: 3px;
  overflow: hidden;
  border: 1px solid var(--neutral-200);
  background: var(--neutral-100);
}

.project-card-runmode-track {
  display: flex;
  min-width: 0;
  overflow: hidden;
}

.project-card-runmode-track--preflight {
  box-shadow: inset 0 0 0 1px rgba(99, 102, 241, 0.25);
}

.project-card-runmode-track--build {
  box-shadow: inset 0 0 0 1px rgba(16, 185, 129, 0.28);
}

.project-card-bar-inner {
  height: 100%;
  width: 100%;
  border: none;
  border-radius: 0;
  background: transparent;
}

.project-card-bar-inner-empty {
  min-height: 100%;
  opacity: 0.35;
}

.project-card-runmode-inline-labels {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  margin-top: 4px;
  font-size: 10px;
  font-family: var(--font-mono);
  letter-spacing: var(--tracking-wide);
  color: var(--neutral-500);
}

.project-card-runmode-badge {
  cursor: default;
}

.project-card-runmode-badge--preflight {
  color: var(--color-mode-preflight);
}

.project-card-runmode-badge--build {
  color: var(--color-mode-build);
}

.project-card-stats {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-2) var(--space-3);
  margin: 0;
}

.project-card-stats.project-card-stats--3col {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

@media (max-width: 360px) {
  .project-card-stats.project-card-stats--3col {
    grid-template-columns: 1fr 1fr;
  }
}

.project-card-subtitles {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.project-card-runmode-wrap {
  margin-bottom: var(--space-2);
}

.project-card-inert-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
}

.project-card-inert-row {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: 8px 8px;
  border-radius: 4px;
  font-size: var(--fs-xs);
}

.project-card-inert-row:hover {
  background: var(--neutral-50);
}

.project-card-inert-body {
  flex: 1;
  min-width: 0;
}

.project-card-inert-body .project-card-titles {
  gap: 2px;
}

.project-card-inert-meta {
  flex-shrink: 0;
}

.project-cards-inert {
  margin-top: var(--space-3);
  margin-bottom: var(--space-4);
  border: 1px solid var(--neutral-200);
  border-radius: 8px;
  background: var(--neutral-50);
  padding: 0 12px 8px;
}

.project-cards-inert-summary {
  cursor: pointer;
  font-size: var(--fs-sm);
  font-weight: var(--fw-medium);
  color: var(--neutral-600);
  padding: var(--space-3) 0;
}

.project-cards-inert[open] .project-cards-inert-summary {
  margin-bottom: 4px;
}

.project-card-stats dt {
  margin: 0;
  font-size: var(--fs-xs);
  font-weight: var(--fw-medium);
  text-transform: uppercase;
  letter-spacing: var(--tracking-wide);
  color: var(--neutral-500);
}

.project-card-stats dd {
  margin: 0;
  font-size: var(--fs-xs);
  font-weight: var(--fw-semibold);
  color: var(--neutral-900);
  font-variant-numeric: tabular-nums;
}

.project-card-footer {
  font-size: var(--fs-xs);
  color: var(--neutral-500);
  border-top: 1px solid var(--neutral-100);
  padding-top: 8px;
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.project-card-last.muted {
  color: var(--neutral-400);
  font-weight: var(--fw-regular);
}

.project-card-wave-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: var(--fs-xs);
  background: var(--neutral-100);
  color: var(--neutral-600);
  border-radius: 4px;
  padding: 1px var(--space-2);
  white-space: nowrap;
}

.project-card-wave-badge--warning {
  background: var(--warning-bg);
  color: var(--warning-text);
}

.project-card-wave-badge--muted {
  background: var(--neutral-50);
  color: var(--neutral-400);
}

.project-card-wave-name--muted {
  text-decoration: line-through;
}

.project-card-wave-balance {
  font-variant-numeric: tabular-nums;
  font-family: var(--font-mono);
}

/* ===== Rich project card (redesigned) ===== */

.project-card--rich {
  gap: var(--space-3);
  padding: var(--space-4) var(--space-5);
}

.project-card--rich .project-card-head {
  align-items: center;
  gap: var(--space-3);
}

.project-card-head-meta {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  margin-left: auto;
  flex-shrink: 0;
}

.project-card-status-pill {
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
  font-size: var(--fs-xs);
  font-weight: var(--fw-medium);
  padding: 2px 8px;
  border-radius: 999px;
  border: 1px solid var(--neutral-200);
  background: var(--neutral-50);
  color: var(--neutral-600);
  white-space: nowrap;
}

.project-card-status-pill--live {
  background: var(--success-bg, #e6f7ed);
  color: var(--success-text, #1f7a3d);
  border-color: var(--success-bg, #cdebd9);
}

.project-card-status-pill--idle {
  background: var(--neutral-50);
  color: var(--neutral-500);
}

.project-card-status-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
  display: inline-block;
  animation: project-card-pulse 1.6s ease-in-out infinite;
}

@keyframes project-card-pulse {
  0%, 100% { opacity: 0.4; }
  50% { opacity: 1; }
}

.project-card-menu {
  position: relative;
}

.project-card-menu-trigger {
  list-style: none;
  cursor: pointer;
  user-select: none;
  width: 26px;
  height: 26px;
  border-radius: var(--radius-sm);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--neutral-500);
  font-size: 16px;
  line-height: 1;
}

.project-card-menu-trigger::-webkit-details-marker { display: none; }
.project-card-menu-trigger:hover { background: var(--neutral-100); color: var(--neutral-700); }

.project-card-menu-popover {
  position: absolute;
  right: 0;
  top: calc(100% + 4px);
  min-width: 180px;
  background: var(--neutral-0);
  border: 1px solid var(--neutral-200);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
  padding: 4px;
  display: flex;
  flex-direction: column;
  z-index: 5;
}

.project-card-menu-item {
  padding: var(--space-2) var(--space-3);
  font-size: var(--fs-xs);
  color: var(--neutral-700);
  text-decoration: none;
  border-radius: var(--radius-sm);
  white-space: nowrap;
}

.project-card-menu-item:hover {
  background: var(--neutral-100);
  color: var(--neutral-900);
}

/* Latest invocation strip */
.project-card-latest {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: var(--fs-xs);
  padding: var(--space-2) var(--space-3);
  background: var(--neutral-50);
  border-radius: var(--radius-sm);
  color: var(--neutral-700);
}

.project-card-latest--empty {
  color: var(--neutral-500);
  background: transparent;
  border: 1px dashed var(--neutral-200);
}

.project-card-latest-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  display: inline-block;
  background: var(--neutral-400);
  flex-shrink: 0;
}

.project-card-latest-text {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.project-card-latest-issue {
  font-family: var(--font-mono);
  font-size: var(--fs-xs);
  color: var(--neutral-600);
}

.project-card-latest-time {
  font-size: var(--fs-xs);
  white-space: nowrap;
}

/* Hero metric tiles */
.project-card-hero {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--space-2);
}

.project-card-hero-tile {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
  padding: var(--space-2) var(--space-3);
  background: var(--neutral-50);
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
}

.project-card-hero-tile--ready {
  background: var(--success-bg, #e6f7ed);
  border-color: var(--success-bg, #cdebd9);
}

.project-card-hero-tile--triage {
  background: var(--warning-bg, #fff4e0);
  border-color: var(--warning-bg, #ffe4b8);
}

.project-card-hero-value {
  font-size: 18px;
  font-weight: var(--fw-semibold);
  color: var(--neutral-900);
  font-variant-numeric: tabular-nums;
  line-height: 1.1;
}

.project-card-hero-label {
  font-size: 10px;
  color: var(--neutral-600);
  font-weight: var(--fw-medium);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  line-height: 1.2;
}

/* Sparkline */
.project-card-spark {
  display: flex;
  align-items: flex-end;
  gap: var(--space-2);
}

.project-card-spark-label {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  flex-shrink: 0;
}

.project-card-spark-track {
  display: flex;
  align-items: flex-end;
  gap: 2px;
  height: 28px;
  flex: 1;
  min-width: 0;
}

.project-card-spark-bar {
  flex: 1;
  min-width: 4px;
  background: transparent;
  display: flex;
  flex-direction: column;
  border-radius: 2px;
  overflow: hidden;
  min-height: 6px;
}

.project-card-spark-seg {
  display: block;
  width: 100%;
}

.project-card-spark-seg.seg-build-ok { background: var(--success-text, #1f7a3d); }
.project-card-spark-seg.seg-build-fail { background: var(--danger-text, #b42318); }
.project-card-spark-seg.seg-preflight-ok { background: var(--brand-primary, #2563eb); }
.project-card-spark-seg.seg-preflight-fail { background: var(--warning-text, #b54708); }

/* Stats single-line */
.project-card-stats-line {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  font-size: var(--fs-xs);
  flex-wrap: wrap;
}

.project-card-stats-line .num,
.project-card-stats-line .cost {
  font-variant-numeric: tabular-nums;
}

/* Action row */
.project-card-actions {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  flex-wrap: wrap;
  border-top: 1px solid var(--neutral-100);
  padding-top: var(--space-2);
}

.project-card-actions-ctas {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  flex-wrap: wrap;
  flex: 1;
  min-width: 0;
}

.project-card-actions-meta {
  margin-left: auto;
  flex-shrink: 0;
}

.project-card-cta {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: var(--fs-xs);
  white-space: nowrap;
}

.project-card-cta-icon {
  font-size: 11px;
  line-height: 1;
}

/* Thin decisions bar inside rich card */
.project-card--rich .project-card-bar-decisions {
  height: 4px;
}

.project-card--rich .project-card-decision-counts {
  font-size: 10px;
  gap: 8px;
}

.active-buildWaves-strip {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  font-size: var(--fs-xs);
  color: var(--neutral-600);
  background: var(--neutral-50);
  border: 1px solid var(--neutral-200);
  border-radius: 6px;
  padding: var(--space-2) var(--space-3);
  margin-bottom: 12px;
}

.active-buildWaves-label {
  color: var(--neutral-500);
  font-weight: var(--fw-medium);
  white-space: nowrap;
}

.active-buildWaves-item {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  color: var(--neutral-700);
  text-decoration: none;
  padding: 1px 0;
}

.active-buildWaves-item:hover {
  color: var(--neutral-900);
  text-decoration: underline;
}

.active-buildWaves-item--warning {
  color: var(--warning-text);
}

.active-buildWaves-balance {
  font-variant-numeric: tabular-nums;
  font-family: var(--font-mono);
  color: var(--neutral-500);
}

.active-buildWaves-sep {
  color: var(--neutral-300);
}

.active-buildWaves-manage {
  margin-left: auto;
  color: var(--neutral-500);
  text-decoration: none;
  white-space: nowrap;
}

.active-buildWaves-manage:hover {
  color: var(--neutral-700);
  text-decoration: underline;
}

/* `.projects-portfolio-table` - 44px rows, 12/16 cell padding; numeric cells use
 * `--font-mono` via `.num` plus `font-feature-settings: tabular-nums`. */
.projects-portfolio-table tbody tr {
  height: 44px;
  transition: background-color var(--duration-instant) var(--ease-standard);
}

.projects-portfolio-table tbody tr:hover {
  background: var(--neutral-50);
}

.projects-portfolio-table th,
.projects-portfolio-table td {
  padding: var(--space-3) var(--space-4);
}

.projects-portfolio-table td.num {
  font-family: var(--font-mono);
  font-size: var(--fs-sm);
  font-weight: var(--fw-medium);
}

.projects-portfolio-table td a {
  color: var(--brand-primary);
  font-weight: var(--fw-medium);
}

.projects-portfolio-table td a:hover {
  text-decoration: underline;
}

@media (prefers-reduced-motion: reduce) {
  .projects-portfolio-table tbody tr {
    transition: none;
  }
}

/* Portfolio empty state - center-aligned with generous padding (DS §3.9) so
 * the import CTA reads as the primary action when no projects are present. */
.projects-dashboard .empty {
  padding: var(--space-12) var(--space-6);
  text-align: center;
  color: var(--neutral-500);
  font-size: var(--fs-base);
}

.projects-dashboard .empty .empty-actions {
  margin-top: var(--space-4);
}

/*
 * Reduced motion (Phase 3 - issue #261). The KPI stagger and toast slide-in
 * are guarded inline next to their keyframe rules; the loading spinner and
 * skeleton shimmer are guarded here so any future additions sit in the same
 * place. Keep this block at the bottom of the file so its declarations win
 * over any earlier `animation:` shorthand.
 */
@media (prefers-reduced-motion: reduce) {
  .loading-spinner {
    animation: none;
    border-top-color: var(--brand-primary);
  }

  .skeleton-line {
    animation: none;
  }
}

/* ----- Issues "Tabela | Operacional" view toggle (#492) -------------------- */

.view-toggle {
  display: inline-flex;
  gap: 0;
  margin: 0 0 12px 0;
  border: 1px solid var(--neutral-300);
  border-radius: 6px;
  overflow: hidden;
  background: var(--neutral-0);
  transition: box-shadow 0.15s ease;
}

.view-toggle-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-2) var(--space-4);
  font-size: 13px;
  font-weight: 500;
  color: var(--neutral-700);
  text-decoration: none;
  background: transparent;
  border-right: 1px solid var(--neutral-300);
  transition: background-color 0.15s ease, color 0.15s ease;
}

.view-toggle-btn:last-child {
  border-right: none;
}

.view-toggle-btn:hover {
  background: var(--neutral-100);
}

.view-toggle-btn.is-active {
  background: var(--brand-primary, #1f6feb);
  color: var(--neutral-0);
  font-weight: 600;
}

@media (prefers-reduced-motion: reduce) {
  .view-toggle,
  .view-toggle-btn {
    transition: none;
  }
}

/* ----- Execution table - cost semantics legend ----------------------------- */

.execution-table-legend {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px 8px;
  padding: 0 0 var(--space-3);
  font-size: 11px;
  color: var(--neutral-500);
}

.execution-table-legend .legend-item {
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
}

.execution-table-legend .legend-sep {
  color: var(--neutral-300);
}

/* ----- Operational view shell --------------------------------------------- */

/* Single-column layout: the filter bar stacks above the table so the wide
 * table can use the full width (no horizontal scroll from a 260px sidebar). */
.issues-operational-shell {
  display: block;
}

.issues-operational-sidebar {
  padding: var(--space-3);
  margin-bottom: var(--space-4);
  background: var(--neutral-0);
  border: 1px solid var(--neutral-200);
  border-radius: var(--radius-md, 8px);
  box-shadow: var(--shadow-sm);
}

.op-sidebar-placeholder {
  margin: 0;
  font-size: 12.5px;
}

.issues-operational-controls {
  margin-bottom: var(--space-3);
}

.issues-operational-controls .issues-searchbar,
.issues-operational-controls .runs-view-searchbar {
  margin-bottom: var(--space-2);
}

.issues-operational-main {
  min-width: 0;
}

@media (max-width: 1024px) {
  .issues-operational-sidebar:not(.ops-filter-sidebar) {
    display: none;
  }
}

.issues-operational-table-wrap {
  overflow-x: auto;
}

.issues-operational-table {
  width: 100%;
  min-width: 1160px;
  border-collapse: collapse;
  font-size: 12.5px;
}

/* Unified project-detail issues table (5 columns) — use full width, not the
 * legacy 1160px min-width meant for the old 10-column operational grid. */
.issues-unified-table-wrap.table-wrap {
  width: 100%;
}

.issues-operational-table.issues-unified-table {
  min-width: 0;
  table-layout: fixed;
}

.issues-unified-table .op-col-select {
  width: 36px;
  padding-left: var(--space-2);
  padding-right: 4px;
}

.issues-unified-table .op-col-issue-unified {
  width: 36%;
  min-width: 240px;
}

.issues-unified-table .op-col-triage {
  width: 36%;
  min-width: 280px;
}

.issues-unified-table .op-col-cost {
  width: 16%;
  min-width: 124px;
}

.issues-unified-table .op-col-actions-unified {
  width: 136px;
}

.issues-unified-table tbody tr.issue-row-state-open {
  box-shadow: inset 3px 0 0 rgba(25, 107, 71, 0.45);
}

.issues-unified-table tbody tr.issue-row-state-closed {
  box-shadow: inset 3px 0 0 rgba(120, 128, 140, 0.45);
}

.issues-unified-table tbody td {
  padding: var(--space-2) var(--space-3);
  vertical-align: middle;
}

.issues-unified-table tbody tr {
  height: auto;
  min-height: 36px;
}

.issues-unified-table .op-th.sort-th a {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  color: inherit;
  text-decoration: none;
}

.issues-unified-table .op-th.sort-th.op-col-cost a {
  justify-content: flex-end;
  width: 100%;
}

.issues-unified-table td.op-col-cost,
.issues-unified-table thead .op-col-cost,
.issues-unified-table .op-th.op-col-cost {
  text-align: right;
}

.issues-unified-table td.op-col-cost .op-cost-cell,
.issues-unified-table td.op-col-cost .cost-compact {
  display: flex;
  width: 100%;
  justify-content: flex-end;
}

.issues-unified-table .op-th.op-col-actions-unified {
  text-align: right;
}

.issues-unified-table td.op-col-actions-unified {
  text-align: right;
}

.issues-unified-table td.op-col-actions-unified.actions-compact {
  display: table-cell;
  vertical-align: middle;
  min-height: 0;
  white-space: nowrap;
}

.issues-unified-table td.op-col-actions-unified .issue-action-form {
  display: inline-flex;
  width: auto;
}

.issues-unified-table td.op-col-actions-unified .issue-action-button {
  width: auto;
}

/* Triage metrics in fixed sub-columns so score / decision / risk align row-to-row */
.op-triage-grid {
  display: grid;
  grid-template-columns: 92px 32px 92px minmax(0, auto);
  align-items: center;
  column-gap: var(--space-3);
  row-gap: var(--space-1);
  min-width: 0;
}

.op-triage-grid > :nth-child(1) {
  justify-self: end;
}

.op-triage-grid > :nth-child(2) {
  justify-self: center;
}

.op-triage-grid > :nth-child(3) {
  justify-self: start;
}

.op-triage-grid > :nth-child(4) {
  justify-self: end;
}

.op-triage-grid .conflict-percent,
.op-triage-grid .effort-cell,
.op-triage-grid .op-cell-empty {
  flex-shrink: 0;
}

/* Secondary triage signals (conflict + effort) behind a <details> expand */
.triage-secondary-details {
  display: inline-flex;
  align-items: center;
  flex-shrink: 0;
}

.triage-secondary-summary {
  list-style: none;
  cursor: pointer;
  font-size: 11px;
  color: var(--neutral-500);
  padding: 1px 3px;
  border-radius: 3px;
  line-height: 1;
  user-select: none;
}

.triage-secondary-summary::-webkit-details-marker {
  display: none;
}

.triage-secondary-summary:hover {
  color: var(--neutral-700);
  background: var(--neutral-100);
}

.triage-secondary-body {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2) var(--space-3);
  margin-left: var(--space-2);
}

/* Issue column: #issue · PR on one band, title on the next line */
.op-issue-cell-unified.issue-cell-compact {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 4px;
  min-width: 0;
}

.op-issue-cell-unified .op-issue-cell-head {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  min-width: 0;
  flex-wrap: nowrap;
  line-height: 1.25;
}

.op-issue-cell-unified .issue-refs {
  display: inline-flex;
  align-items: center;
  flex-wrap: nowrap;
  gap: 4px 6px;
  min-width: 0;
  font-size: 12.5px;
}

.op-issue-cell-unified .issue-ref-issue,
.op-issue-cell-unified .issue-ref-sep,
.op-issue-cell-unified .issue-pr-link {
  flex-shrink: 0;
}

.op-issue-cell-unified .issue-pr-link {
  font-size: inherit;
}

.issue-pr-link {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 11.5px;
  font-weight: 600;
  white-space: nowrap;
}

.issue-pr-link .external {
  color: var(--neutral-600);
  text-decoration: none;
}

.issue-pr-link .external:hover {
  color: var(--brand-primary, #1f6feb);
  text-decoration: underline;
}

.op-issue-cell-unified .op-issue-cell-body {
  min-width: 0;
}

.op-issue-cell-unified .op-title-text,
.op-issue-cell-unified .issue-cell-compact-title {
  display: block;
  max-width: none;
  -webkit-line-clamp: unset;
  line-clamp: unset;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.op-issue-cell-unified .op-issue-meta {
  margin-top: 2px;
}

.issues-operational-main .runs-view-search-input {
  max-width: none;
}

.issues-operational-main .issues-searchbar {
  margin-bottom: var(--space-3);
}

.issues-operational-main .execution-table-legend {
  margin-bottom: 8px;
}

@media (max-width: 1100px) {
  .issues-unified-table {
    min-width: 720px;
  }

  .issues-unified-table .op-col-issue-unified {
    position: sticky;
    left: 0;
    z-index: 1;
    background: var(--neutral-0);
    box-shadow: 6px 0 8px -4px rgba(23, 32, 42, 0.08);
  }

  .issues-unified-table thead .op-col-issue-unified {
    z-index: 2;
    background: var(--neutral-50, #f8f9fb);
    box-shadow: 6px 0 8px -4px rgba(23, 32, 42, 0.06);
  }

  .issues-unified-table .op-col-actions-unified {
    position: sticky;
    right: 0;
    z-index: 2;
    background: var(--neutral-0);
    box-shadow: -6px 0 8px -4px rgba(23, 32, 42, 0.08);
  }

  .issues-unified-table thead .op-col-actions-unified {
    z-index: 3;
    background: var(--neutral-50, #f8f9fb);
    box-shadow: -6px 0 8px -4px rgba(23, 32, 42, 0.06);
  }
}

@media (max-width: 720px) {
  .issues-unified-table .op-col-triage .effort-cell {
    display: none;
  }
}

.issues-operational-table .op-th {
  padding: var(--space-2) var(--space-2);
  text-align: left;
  font-weight: 600;
  font-size: 11.5px;
  color: var(--neutral-700);
  border-bottom: 1px solid var(--neutral-200);
  background: var(--neutral-50, #f8f9fb);
  white-space: nowrap;
}

.issues-operational-table .op-th.num,
.issues-operational-table td.num {
  text-align: right;
  font-variant-numeric: tabular-nums;
  font-feature-settings: "tnum";
}

.issues-operational-table .op-col-select { width: 28px; padding: 4px; }
.issues-operational-table .op-col-num { width: 56px; }
.issues-operational-table .op-col-title { width: auto; min-width: 200px; }
.issues-operational-table .op-col-score { width: 90px; text-align: right; }
.issues-operational-table .op-col-decision { width: 56px; text-align: center; }
.issues-operational-table .op-col-risk { width: 90px; }
.issues-operational-table .op-col-conflict { width: 80px; text-align: right; }
.issues-operational-table .op-col-cost { width: 138px; min-width: 138px; text-align: right; }
.issues-operational-table .op-col-effort { width: 80px; text-align: right; }
.issues-operational-table .op-col-age {
  width: 64px;
  min-width: 64px;
  text-align: right;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.issues-operational-table .op-col-lastrun {
  width: 156px;
  min-width: 156px;
  white-space: nowrap;
}
.issues-operational-table .op-col-actions { width: 86px; text-align: right; }

.issues-operational-table tbody tr {
  height: 36px;
}

.issues-operational-table tbody td {
  padding: 4px 8px;
  border-bottom: 1px solid var(--neutral-100);
  vertical-align: middle;
  font-feature-settings: "tnum";
}

.issues-operational-table tbody tr:hover {
  background: var(--neutral-50, #f8f9fb);
}

.op-row-closed .op-title-text {
  text-decoration: line-through;
  opacity: 0.75;
}

/* Rows with no preflight, no estimate, and no conflict signal fade so the eye
 * skims past them to the scored issues that actually need attention. The
 * semantic "No preflight" / "No signal" / "No estimate" labels stay (for a11y
 * and clarity) but the whole row sinks. Color de-emphasis preserves WCAG AA
 * contrast (opacity blending fails the 4.5:1 threshold at any useful strength). */
.op-row-low-signal {
  color: var(--neutral-500);
}

.op-row-low-signal .issue-cell-compact-title {
  color: var(--neutral-500);
}

.op-row-low-signal:hover,
.op-row-low-signal:focus-within {
  color: inherit;
}

.op-row-low-signal:hover .issue-cell-compact-title,
.op-row-low-signal:focus-within .issue-cell-compact-title {
  color: var(--neutral-700);
}

/* Empty / low-signal cells: a faint dash that inherits the column's alignment
 * (right for numeric columns, left otherwise) so the placeholder sits where a
 * real value would. The explanatory phrase lives in the title/aria-label. */
.op-cell-empty {
  color: var(--neutral-400);
}

.op-number-cell {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-weight: 600;
}

.op-provider-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 22px;
  height: 16px;
  padding: 0 4px;
  font-size: 9.5px;
  font-weight: 700;
  letter-spacing: 0.04em;
  border-radius: 3px;
  background: var(--neutral-200);
  color: var(--neutral-800);
}

.op-provider-azure_devops {
  background: var(--brand-azure-bg);
  color: var(--brand-azure-hover);
}

.op-title-cell {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  max-width: 100%;
}

.op-title-text {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 36ch;
}

.op-running-dot {
  color: var(--brand-primary, #1f6feb);
  font-size: 16px;
  line-height: 1;
  animation: pulseDot 1.4s ease-in-out infinite;
}

@keyframes pulseDot {
  0%, 100% { opacity: 0.4; }
  50% { opacity: 1; }
}

@media (prefers-reduced-motion: reduce) {
  .op-running-dot {
    animation: none;
    opacity: 1;
  }
}

/* ----- Score cell + mini-bar ---------------------------------------------- */

.score-cell {
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  gap: var(--space-2);
  padding: 2px 4px;
  margin: 0;
  background: transparent;
  border: none;
  cursor: pointer;
  font-variant-numeric: tabular-nums;
  font-feature-settings: "tnum";
  color: inherit;
  border-radius: 4px;
  transition: background-color 0.12s ease;
}

.score-cell:hover,
.score-cell:focus-visible {
  background: var(--neutral-100);
  outline: none;
}

.score-cell-number {
  min-width: 36px;
  text-align: right;
  font-weight: 600;
}

.score-cell-empty {
  display: inline-block;
  min-width: 36px;
  text-align: right;
}

.score-bar {
  display: inline-block;
  vertical-align: middle;
}

.score-bar .score-bar-track {
  fill: var(--neutral-300);
}

.score-bar .score-bar-fill {
  fill: var(--brand-primary, #1f6feb);
}

.score-bar-negative .score-bar-fill {
  fill: var(--risk-high);
}

@media (prefers-reduced-motion: reduce) {
  .score-cell {
    transition: none;
  }
}

/* ----- Risk composite pill ------------------------------------------------ */

.risk-composite-pill {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  padding: 2px var(--space-2);
  border-radius: 999px;
  font-size: 11.5px;
  font-weight: 600;
  background: var(--neutral-100);
  color: var(--neutral-800);
}

.risk-composite-pill.risk-low {
  background: rgba(45, 164, 78, 0.12);
  color: var(--conflict-low-text);
}

.risk-composite-pill.risk-medium {
  background: rgba(214, 137, 28, 0.14);
  color: var(--conflict-medium-text);
}

.risk-composite-pill.risk-high {
  background: rgba(200, 59, 59, 0.14);
  color: var(--conflict-high-text);
}

.risk-letter {
  font-variant-numeric: tabular-nums;
  font-feature-settings: "tnum";
}

.risk-dots {
  display: inline-flex;
  gap: 2px;
}

.risk-dot {
  display: inline-block;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--neutral-300);
}

.risk-dot-low { background: var(--risk-low); }
.risk-dot-medium { background: var(--risk-medium); }
.risk-dot-high { background: var(--risk-high); }
.risk-dot-unknown { background: var(--neutral-300); }

/* ----- Conflict percent --------------------------------------------------- */

.conflict-percent {
  display: inline-flex;
  align-items: baseline;
  gap: 1px;
  font-variant-numeric: tabular-nums;
  font-feature-settings: "tnum";
  font-weight: 600;
}

.conflict-percent-low { color: var(--conflict-low-text); }
.conflict-percent-medium { color: var(--conflict-medium-text); }
.conflict-percent-high { color: var(--conflict-high-text); }
.conflict-percent-unknown { color: var(--neutral-700); }

.conflict-confidence {
  font-size: 9.5px;
  font-weight: 700;
  margin-left: 1px;
  opacity: 0.75;
}

/* ----- Effort / age cells ------------------------------------------------- */

.effort-cell,
.age-cell {
  font-variant-numeric: tabular-nums;
  font-feature-settings: "tnum";
}

/* ----- Cost cell shared visual treatment ---------------------------------- */

.op-cost-cell,
.ranked-cost-cell {
  font-variant-numeric: tabular-nums;
  font-feature-settings: "tnum";
}

.op-cost-cell .cost-range-val-likely,
.ranked-cost-likely {
  font-size: var(--fs-sm);
  font-weight: var(--fw-medium);
}

/* ----- Cost cell (operational) -------------------------------------------- */

.op-cost-cell {
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: nowrap;
  white-space: nowrap;
  line-height: 1.2;
  gap: var(--space-2);
}

/* In the dense operational table the per-value colour dots are redundant with
 * the dollar-amount colour coding + tooltips and force the cell to wrap onto
 * multiple lines (ragged row heights). Suppress them here; the roomier
 * project-detail issues table keeps the dots. */
.op-cost-cell .cost-range-val::before {
  display: none;
}

.op-cost-cell .inline-cost-range {
  white-space: nowrap;
}

.op-cost-confidence {
  display: inline-flex;
  gap: 1px;
}

.op-cost-seg {
  display: inline-block;
  width: 8px;
  height: 4px;
  border-radius: 1px;
  background: var(--neutral-300);
}

.op-cost-seg.is-active {
  background: var(--brand-primary, #1f6feb);
}

/* Cost amount thresholds: caution colours for non-trivial spend (#720); green removed (#2061). */
.cost-amt-amber { color: var(--warning-text, #9a6700); }
.cost-amt-red   { color: var(--danger-text,  #cf222e); }

/* ----- Last run cell (operational) ---------------------------------------- */

.op-lastrun-cell {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
}

.op-lastrun-rel {
  color: var(--neutral-600);
  font-size: 11.5px;
}

/* ----- Compact pill modifier --------------------------------------------- */

.pill--compact {
  justify-content: center;
  min-width: 24px;
  height: 22px;
  padding: 0 var(--space-2);
  font-size: 12px;
}

/* Operator-set readiness override marker on the Decision cell. Readiness was
   merged into Decision; the dot flags the rows where an operator manually set
   readiness independently of the preflight decision. */
.op-decision-overridden {
  position: relative;
  display: inline-flex;
  align-items: center;
}

.op-override-dot {
  display: inline-block;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--brand-primary, #1f6feb);
  border: 1px solid var(--neutral-0);
}

.op-decision-overridden .op-override-dot {
  position: absolute;
  top: -2px;
  right: -2px;
}

.op-override-dot-legend {
  position: static;
  vertical-align: middle;
  margin: 0 2px 0 var(--space-2);
}

/* ----- Compact actions ---------------------------------------------------- */

.compact-actions-form {
  display: inline-flex;
  margin: 0;
  padding: 0;
}

.compact-action-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  padding: 0;
  margin-right: 4px;
  background: transparent;
  border: 1px solid var(--neutral-200);
  border-radius: 4px;
  cursor: pointer;
  color: var(--neutral-700);
  font-size: 12px;
  line-height: 1;
}

.compact-action-btn:hover:not([disabled]) {
  background: var(--neutral-100);
  border-color: var(--neutral-300);
}

.compact-action-btn[disabled] {
  opacity: var(--disabled-opacity);
  cursor: not-allowed;
}

.compact-action-build {
  color: var(--brand-primary, #1f6feb);
}

/* ----- Score breakdown popover ------------------------------------------- */

.score-breakdown-popover {
  padding: 0;
  border: 1px solid var(--neutral-300);
  border-radius: 10px;
  box-shadow: 0 12px 32px rgba(23, 32, 42, 0.18);
  max-width: 420px;
  width: min(420px, 90vw);
  background: var(--neutral-0);
}

.score-breakdown-popover::backdrop {
  background: rgba(23, 32, 42, 0.25);
}

.score-breakdown-form {
  margin: 0;
  padding: var(--space-4) var(--space-5) var(--space-4);
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.score-breakdown-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.score-breakdown-title {
  margin: 0;
  font-size: 14px;
  font-weight: 700;
}

.score-breakdown-close {
  font-size: 18px;
  line-height: 1;
  padding: 0 var(--space-2);
}

.score-breakdown-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12.5px;
  font-feature-settings: "tnum";
}

.score-breakdown-table th,
.score-breakdown-table td {
  padding: var(--space-1) var(--space-2);
  border-bottom: 1px solid var(--neutral-100);
  text-align: left;
}

.score-breakdown-table td.num,
.score-breakdown-table th.num {
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.score-term-positive { color: var(--conflict-low-text); }
.score-term-negative { color: var(--conflict-high-text); }

/* ----- Operational view filter sidebar (#493) -------------------------------- */

.ops-filter-sidebar {
  width: 100%;
  padding: 0;
  margin-bottom: 0;
}

.ops-filter-toolbar {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  width: 100%;
}

.ops-filter-toolbar-head {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  width: 100%;
}

.ops-filter-toolbar-primary {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-2) var(--space-3);
  width: 100%;
  min-width: 0;
}

.ops-filter-toolbar-actions {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  margin-left: auto;
  flex-shrink: 0;
}

.ops-search-field {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  flex: 1 1 240px;
  max-width: min(100%, 360px);
  min-width: 0;
  min-height: 36px;
  margin: 0;
  padding: 0 var(--space-3);
  border: 1px solid var(--neutral-200);
  border-radius: var(--radius-md, 8px);
  background: var(--neutral-0);
  box-sizing: border-box;
}

.ops-search-field:focus-within {
  border-color: var(--brand-primary);
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--brand-primary) 18%, transparent);
}

.ops-search-icon {
  flex-shrink: 0;
  font-size: 14px;
  color: var(--neutral-400);
  line-height: 1;
}

.ops-search-input,
.ops-search-field .runs-view-search-input {
  width: 100%;
  min-width: 0;
  max-width: none;
  border: none;
  border-radius: 0;
  background: transparent;
  padding: 0;
  font: inherit;
  font-size: 13px;
  color: var(--neutral-900);
  box-shadow: none;
}

.ops-search-input:focus,
.ops-search-field .runs-view-search-input:focus {
  outline: none;
  border: none;
  box-shadow: none;
}

.ops-search-input::placeholder,
.ops-search-field .runs-view-search-input::placeholder {
  color: var(--neutral-400);
}

.ops-search-clear {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 24px;
  min-height: 24px;
  padding: 0 6px;
  line-height: 1;
  color: var(--neutral-500);
}

.ops-search-clear[hidden] {
  display: none;
}

.ops-filter-toolbar-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-2);
  width: 100%;
  min-width: 0;
}

.ops-filter-toolbar-meta:empty {
  display: none;
}

.ops-filter-drawer {
  flex: 0 0 auto;
}

.ops-filter-panel {
  display: none;
  width: 100%;
  min-width: 0;
  max-height: min(44vh, 380px);
  overflow-x: hidden;
  overflow-y: auto;
  padding-top: var(--space-3);
  border-top: 1px solid var(--neutral-200);
  scrollbar-width: thin;
}

.ops-filter-section {
  border: 1px solid var(--neutral-200);
  border-radius: var(--radius-md, 8px);
  background: var(--neutral-0);
  margin-bottom: var(--space-2);
}

.ops-filter-section:last-child {
  margin-bottom: 0;
}

.ops-filter-section-summary {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-2) var(--space-3);
  font-size: 12px;
  font-weight: 600;
  color: var(--neutral-700);
  cursor: pointer;
  list-style: none;
  user-select: none;
}

.ops-filter-section-summary::-webkit-details-marker {
  display: none;
}

.ops-filter-section-summary::before {
  content: "▸";
  font-size: 10px;
  color: var(--neutral-500);
  transition: transform 0.12s ease;
}

.ops-filter-section[open] > .ops-filter-section-summary::before {
  transform: rotate(90deg);
}

.ops-filter-section-body {
  padding: 0 var(--space-3) var(--space-3);
  border-top: 1px solid var(--neutral-100);
}

.ops-filter-section-body .ops-filter-grid {
  padding-top: var(--space-3);
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
}

.ops-filter-section-body .ops-filter-group--wide {
  grid-column: 1 / -1;
}

.ops-filter-section-body .ops-filter-group--compact {
  max-width: none;
}

.ops-facet-search-input {
  width: 100%;
  margin-bottom: var(--space-2);
  font-size: 12px;
  padding: 5px 8px;
  box-sizing: border-box;
  border: 1px solid var(--neutral-200);
  border-radius: var(--radius-sm, 6px);
  background: var(--neutral-0);
  color: var(--neutral-800);
}

.ops-facet-search-input:focus-visible {
  outline: none;
  border-color: var(--brand-primary);
  box-shadow: var(--shadow-ring, 0 0 0 3px rgba(37, 99, 235, 0.15));
}

.ops-filter-pill[hidden] {
  display: none;
}

.ops-filter-result-count {
  flex-shrink: 0;
  font-size: 12px;
  color: var(--neutral-500);
  white-space: nowrap;
}

.ops-filter-toolbar:has(.ops-filter-drawer[open]) .ops-filter-panel {
  display: block;
}

.ops-filter-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(155px, 1fr));
  gap: var(--space-3) var(--space-4);
}

.ops-filter-group {
  border: none;
  margin: 0;
  padding: 0;
  min-width: 0;
}

.ops-filter-group--compact {
  max-width: none;
}

.ops-filter-group--wide {
  grid-column: 1 / -1;
}

@media (min-width: 960px) {
  .ops-filter-grid {
    grid-template-columns: repeat(6, minmax(0, 1fr));
  }

  .ops-filter-group--compact {
    max-width: none;
  }

  .ops-filter-group--wide {
    grid-column: span 2;
  }
}

.ops-filter-legend {
  display: block;
  font-size: 11px;
  font-weight: var(--fw-semibold, 600);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--neutral-500);
  margin: 0 0 var(--space-2);
  padding: 0;
}

/* Pill toggles (multi-select facets) */
.ops-filter-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}

.ops-filter-pills--scroll {
  flex-wrap: nowrap;
  overflow-x: auto;
  max-height: 88px;
  flex-direction: column;
  align-content: flex-start;
  padding-right: 2px;
  scrollbar-width: thin;
}

.ops-filter-pill {
  position: relative;
  display: inline-flex;
  align-items: center;
  cursor: pointer;
  user-select: none;
}

.ops-filter-pill-input {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
  margin: 0;
  pointer-events: none;
}

.ops-filter-pill-text {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 10px;
  min-height: 24px;
  border: 1px solid var(--neutral-200);
  border-radius: 999px;
  background: var(--neutral-0);
  color: var(--neutral-700);
  font-size: 12px;
  font-weight: 500;
  line-height: 1.3;
  white-space: nowrap;
  transition: background 0.12s ease, border-color 0.12s ease, color 0.12s ease, box-shadow 0.12s ease;
}

.ops-filter-pill:hover .ops-filter-pill-text {
  border-color: var(--neutral-300);
  background: var(--neutral-50);
}

.ops-filter-pill-input:checked + .ops-filter-pill-text {
  border-color: var(--brand-primary);
  background: var(--info-bg);
  color: var(--brand-primary);
  font-weight: 600;
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--brand-primary) 12%, transparent);
}

.ops-filter-pill-input:focus-visible + .ops-filter-pill-text {
  outline: none;
  box-shadow: var(--shadow-ring, 0 0 0 3px rgba(37, 99, 235, 0.15));
}

.ops-level-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  flex-shrink: 0;
}

.ops-level-dot--low { background: var(--conflict-low-text, #16a34a); }
.ops-level-dot--medium { background: var(--warning, #d97706); }
.ops-level-dot--high { background: var(--conflict-high-text, #dc2626); }

/* Segmented single-select (state, preflight) */
.ops-segmented {
  display: inline-flex;
  width: 100%;
  max-width: 100%;
  padding: 2px;
  border: 1px solid var(--neutral-200);
  border-radius: var(--radius-md, 8px);
  background: var(--neutral-100);
  gap: 1px;
}

.ops-segmented-item {
  flex: 1 1 0;
  min-width: 0;
  position: relative;
  cursor: pointer;
}

.ops-segmented-input {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
  margin: 0;
  pointer-events: none;
}

.ops-segmented-label {
  display: block;
  padding: 5px 8px;
  border-radius: calc(var(--radius-md, 8px) - 2px);
  font-size: 12px;
  font-weight: 600;
  color: var(--neutral-600);
  text-align: center;
  white-space: nowrap;
  transition: background 0.12s ease, color 0.12s ease, box-shadow 0.12s ease;
}

.ops-segmented-item:hover .ops-segmented-label {
  color: var(--neutral-900);
  background: color-mix(in srgb, var(--neutral-0) 70%, transparent);
}

.ops-segmented-input:checked + .ops-segmented-label {
  color: var(--neutral-900);
  background: var(--neutral-0);
  box-shadow: var(--shadow-sm);
}

.ops-segmented-input:focus-visible + .ops-segmented-label {
  outline: none;
  box-shadow: var(--shadow-ring, 0 0 0 3px rgba(37, 99, 235, 0.15));
}

/* Styled native select */
.ops-select-wrap {
  position: relative;
}

.ops-select-wrap::after {
  content: "";
  position: absolute;
  right: 10px;
  top: 50%;
  width: 0;
  height: 0;
  border-left: 4px solid transparent;
  border-right: 4px solid transparent;
  border-top: 5px solid var(--neutral-500);
  transform: translateY(-35%);
  pointer-events: none;
}

.ops-select,
.ops-filter-sidebar [data-runs-filter-select] {
  width: 100%;
  appearance: none;
  font-size: 12.5px;
  padding: 6px 28px 6px 10px;
  box-sizing: border-box;
  cursor: pointer;
  border: 1px solid var(--neutral-200);
  border-radius: var(--radius-sm, 6px);
  background: var(--neutral-0);
  color: var(--neutral-800);
}

.ops-cost-range {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: end;
  gap: var(--space-2);
}

.ops-cost-range-field {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}

.ops-cost-range-hint {
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--neutral-400);
}

.ops-cost-range-input,
.ops-text-input {
  width: 100%;
  font-size: 12.5px;
  padding: 6px 10px;
  box-sizing: border-box;
  border: 1px solid var(--neutral-200);
  border-radius: var(--radius-sm, 6px);
  background: var(--neutral-0);
  color: var(--neutral-800);
}

.ops-cost-range-input::placeholder {
  color: var(--neutral-400);
}

.ops-cost-range-sep {
  color: var(--neutral-400);
  font-size: 12px;
  padding-bottom: 8px;
}

.ops-select:focus-visible,
.ops-filter-sidebar [data-runs-filter-select]:focus-visible,
.ops-text-input:focus-visible,
.ops-cost-range-input:focus-visible {
  outline: none;
  border-color: var(--brand-primary);
  box-shadow: var(--shadow-ring, 0 0 0 3px rgba(37, 99, 235, 0.15));
}

/* Legacy checkbox list (runs filter bar, other surfaces) */
.checkbox-list {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.checkbox-label {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  font-size: 12.5px;
  cursor: pointer;
  padding: 2px var(--space-1);
  margin: 0 -4px;
  border-radius: 4px;
  transition: background 0.1s ease;
}

.checkbox-label:hover {
  background: var(--neutral-100);
}

.ops-active-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin: 0;
}

.ops-filter-chip {
  font-size: 11.5px;
}

.ops-filter-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 18px;
  height: 18px;
  padding: 0 6px;
  border-radius: 999px;
  background: var(--brand-primary);
  color: var(--neutral-0);
  font-size: 10px;
  font-weight: 700;
  line-height: 1;
}

.ops-clear-all-btn {
  flex-shrink: 0;
  font-size: 12px;
  color: var(--neutral-600);
}

.ops-filter-drawer-summary {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 36px;
  box-sizing: border-box;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  padding: 6px 10px;
  list-style: none;
  user-select: none;
  border: 1px solid var(--neutral-200);
  border-radius: var(--radius-md, 8px);
  background: var(--neutral-0);
  color: var(--neutral-700);
  transition: background 0.12s ease, border-color 0.12s ease, color 0.12s ease, box-shadow 0.12s ease;
}

.ops-filter-drawer-summary:hover {
  background: var(--neutral-50);
  border-color: var(--neutral-300);
  color: var(--neutral-900);
}

.ops-filter-drawer[open] > .ops-filter-drawer-summary {
  border-color: var(--brand-primary);
  background: var(--info-bg);
  color: var(--brand-primary);
}

.ops-filter-drawer-summary::-webkit-details-marker {
  display: none;
}

.ops-filter-icon {
  flex-shrink: 0;
  color: currentColor;
  opacity: 0.85;
}

.ops-filter-drawer-label {
  line-height: 1;
}

/* Disclosure caret that rotates when the drawer is open. */
.ops-filter-drawer-summary::before {
  content: "▸";
  font-size: 10px;
  color: currentColor;
  opacity: 0.7;
  transition: transform 0.12s ease;
}

.ops-filter-drawer[open] > .ops-filter-drawer-summary::before {
  transform: rotate(90deg);
}

@media (max-width: 640px) {
  .ops-filter-grid {
    grid-template-columns: 1fr;
  }

  .ops-filter-toolbar-primary {
    display: grid;
    grid-template-columns: 1fr auto;
    grid-template-areas:
      "search search"
      "filters actions";
    align-items: center;
    gap: var(--space-2);
  }

  .ops-search-field {
    grid-area: search;
    flex: none;
    max-width: none;
    width: 100%;
  }

  .ops-filter-drawer {
    grid-area: filters;
  }

  .ops-filter-toolbar-actions {
    grid-area: actions;
    margin-left: 0;
    justify-self: end;
  }

  .ops-filter-toolbar-meta {
    width: 100%;
  }
}

/* ── Correlation page ─────────────────────────────────────────────── */

.corr-buckets {
  display: flex;
  gap: var(--space-4);
  flex-wrap: wrap;
  margin-bottom: var(--space-6);
}

.corr-bucket {
  flex: 1 1 140px;
  border: 1px solid var(--neutral-200);
  border-radius: var(--radius-md);
  padding: var(--space-4);
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

.corr-bucket-bar {
  height: 6px;
  border-radius: var(--radius-full);
  background: var(--neutral-200);
  position: relative;
  overflow: hidden;
}

.corr-bucket-bar::after {
  content: "";
  position: absolute;
  inset-block: 0;
  left: 0;
  width: var(--bucket-pct, 0%);
  border-radius: inherit;
  transition: width 0.3s var(--ease-standard);
}

.corr-bucket-good  .corr-bucket-bar::after { background: var(--success); }
.corr-bucket-warn  .corr-bucket-bar::after { background: var(--warning); }
.corr-bucket-danger .corr-bucket-bar::after { background: var(--danger); }

.corr-bucket-label {
  font-size: var(--fs-xs);
  font-weight: var(--fw-semibold);
  color: var(--neutral-500);
  text-transform: uppercase;
  letter-spacing: var(--tracking-wide);
}

.corr-bucket-count {
  font-size: var(--fs-lg);
  font-weight: var(--fw-bold);
  color: var(--neutral-900);
}

.corr-err-good   { color: var(--success-text); font-weight: var(--fw-semibold); font-variant-numeric: tabular-nums; }
.corr-err-warn   { color: var(--warning-text); font-weight: var(--fw-semibold); font-variant-numeric: tabular-nums; }
.corr-err-danger { color: var(--danger-text);  font-weight: var(--fw-semibold); font-variant-numeric: tabular-nums; }

/* ----- Utility classes used to retire inline styles in v1.0 ----------------- */

.form-narrow .field {
  max-width: 640px;
}

.field-spaced {
  margin-top: var(--space-3);
}

.form-actions-spaced {
  margin-top: var(--space-4);
}

.notice-spaced {
  margin-top: var(--space-3);
}

.radio-row {
  display: flex;
  gap: var(--space-4);
  align-items: center;
  padding-top: var(--space-2);
}

.radio-row-option {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  cursor: pointer;
}

/* ----- Help tip popover ----------------------------------------------------- */

.help-tip {
  position: relative;
  display: inline-flex;
  align-items: center;
  margin-left: 4px;
}

.help-tip-trigger {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 16px;
  height: 16px;
  padding: 0;
  border: 1px solid var(--neutral-300);
  border-radius: 50%;
  background: var(--neutral-50);
  color: var(--neutral-600);
  font-size: 11px;
  font-weight: var(--fw-bold);
  line-height: 1;
  cursor: help;
}

.help-tip-trigger:hover,
.help-tip-trigger:focus-visible {
  background: var(--brand-primary);
  border-color: var(--brand-primary);
  color: var(--neutral-0);
  outline: none;
}

.help-tip-bubble {
  position: absolute;
  bottom: calc(100% + 6px);
  left: 50%;
  transform: translateX(-50%);
  z-index: 50;
  display: none;
  width: max-content;
  max-width: 280px;
  padding: var(--space-2) var(--space-3);
  border-radius: var(--radius-md);
  background: var(--neutral-900);
  color: var(--neutral-0);
  font-size: var(--fs-xs);
  font-weight: var(--fw-regular);
  line-height: 1.4;
  box-shadow: var(--shadow-md);
  white-space: normal;
  text-align: left;
}

.help-tip:hover .help-tip-bubble,
.help-tip:focus-within .help-tip-bubble {
  display: block;
}

.help-tip-bubble::after {
  content: "";
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%);
  border: 4px solid transparent;
  border-top-color: var(--neutral-900);
}

/* ----- Inline spinner inside buttons --------------------------------------- */

.btn.is-loading {
  position: relative;
  pointer-events: none;
}

.btn.is-loading::before {
  content: "";
  display: inline-block;
  width: 12px;
  height: 12px;
  margin-right: var(--space-2);
  border: 2px solid currentColor;
  border-top-color: transparent;
  border-radius: 50%;
  animation: btn-spin 0.7s linear infinite;
  vertical-align: -2px;
}

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

@media (prefers-reduced-motion: reduce) {
  .btn.is-loading::before {
    animation: none;
    border-top-color: currentColor;
    opacity: 0.5;
  }
}

/* ----- Preflight sticky outcome bar ---------------------------------------- */

.preflight-sticky-bar {
  position: sticky;
  top: 0;
  z-index: 40;
  display: flex;
  align-items: center;
  padding: var(--space-3) var(--space-4);
  background: var(--neutral-0);
  border-bottom: 1px solid var(--neutral-200);
  box-shadow: var(--shadow-sm);
}

.preflight-sticky-bar[hidden] {
  display: none;
}

.preflight-sticky-bar--compact .preflight-sticky-expanded {
  display: none;
}

.preflight-sticky-bar-content {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: var(--space-3) var(--space-4);
  width: 100%;
}

.preflight-sticky-bar-pills {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: var(--space-2);
}

.preflight-sticky-score {
  font-size: 13px;
  font-weight: 600;
  color: var(--neutral-700);
}

.preflight-sticky-cost {
  font-size: 13px;
  font-weight: 600;
  color: var(--neutral-700);
}

.preflight-sticky-model {
  font-size: 12px;
  color: var(--neutral-600);
}

.preflight-sticky-pess-cost {
  color: var(--neutral-500);
}

.preflight-sticky-risk {
  font-size: 12px;
  font-weight: 500;
  padding: 1px var(--space-1);
  border-radius: 4px;
  background: var(--neutral-100);
  color: var(--neutral-600);
}

.preflight-sticky-risk-high {
  background: rgba(239, 68, 68, 0.12);
  color: #b91c1c;
}

.preflight-sticky-risk-medium {
  background: rgba(245, 158, 11, 0.12);
  color: #b45309;
}

/* ----- Preflight CTA group (hero section) ---------------------------------- */

.preflight-cta-group {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 16px;
  padding: 12px 16px;
  border: 1px solid var(--neutral-200);
  border-radius: 10px;
  background: var(--neutral-50);
  box-shadow: var(--shadow-sm);
}

.preflight-cta-group .invocation-followup-form {
  flex: 1 1 280px;
  margin-top: 0;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

/* Decision-tinted CTA group */
.preflight-business-outcome[data-decision="proceed"] .preflight-cta-group { border-color: rgba(16, 185, 129, 0.25); }
.preflight-business-outcome[data-decision="clarify"] .preflight-cta-group { border-color: rgba(245, 158, 11, 0.25); }
.preflight-business-outcome[data-decision="split"]   .preflight-cta-group { border-color: rgba(59, 130, 246, 0.25); }
.preflight-business-outcome[data-decision="defer"]   .preflight-cta-group { border-color: rgba(239, 68, 68, 0.25); }

/* ----- Diagnostics page link (replaces the old collapsible section) -------- */

.diagnostics-page-link {
  margin-top: 16px;
}

/* ----- Diagnostics collapsible section ------------------------------------- */

.diagnostics-section {
  margin-top: 16px;
  border: 1px solid var(--neutral-200);
  border-radius: 8px;
  background: var(--neutral-0);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}

.diagnostics-section-summary {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: var(--space-4) var(--space-4);
  cursor: pointer;
  list-style: none;
  user-select: none;
}

.diagnostics-section-summary::-webkit-details-marker {
  display: none;
}

.diagnostics-section-summary::before {
  content: "▶";
  position: absolute;
  right: 16px;
  font-size: 11px;
  color: var(--neutral-400);
  transition: transform 0.15s ease;
}

.diagnostics-section[open] > .diagnostics-section-summary::before {
  transform: rotate(90deg);
}

.diagnostics-section-summary {
  position: relative;
}

.diagnostics-section-title {
  font-size: 14px;
  font-weight: 700;
  color: var(--neutral-800);
}

.diagnostics-section-subtitle {
  font-size: 12px;
  color: var(--neutral-500);
  line-height: 1.4;
}

.diagnostics-section-body {
  padding: 0 16px 16px;
  border-top: 1px solid var(--neutral-100);
}

/* ----- Import project page ------------------------------------------------- */

.page-lede {
  max-width: 640px;
  margin: var(--space-2) 0 0;
  color: var(--neutral-500);
  font-size: var(--fs-base);
  line-height: 1.5;
}

.form-card {
  max-width: 680px;
  padding: var(--space-5);
  border: 1px solid var(--neutral-200);
  border-radius: var(--radius-md);
  background: var(--neutral-0);
  box-shadow: var(--shadow-sm);
}

.field-label-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
}

.field-pill {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: 999px;
  background: var(--neutral-100);
  color: var(--neutral-600);
  font-size: var(--fs-xs);
  font-weight: var(--fw-semibold);
  letter-spacing: 0.02em;
  text-transform: none;
}

.field-pill--provider {
  background: #EFF6FF;
  color: var(--brand-primary-hover);
}

.field-pill[hidden] {
  display: none;
}

.field--error input {
  border-color: var(--danger);
  background: var(--neutral-0);
}

.field--error input:focus,
.field--error input:focus-visible {
  border-color: var(--danger);
  box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.18);
}

.field-input-row {
  display: flex;
  gap: var(--space-2);
  align-items: stretch;
}

.field-input-row input {
  flex: 1 1 auto;
}

.field-reveal-toggle {
  flex: 0 0 auto;
  min-height: 36px;
  padding: 0 var(--space-3);
  border: 1px solid var(--neutral-200);
  border-radius: var(--radius-md);
  background: var(--neutral-50);
  color: var(--neutral-600);
  font: inherit;
  font-size: var(--fs-sm);
  font-weight: var(--fw-semibold);
  cursor: pointer;
  transition:
    border-color var(--duration-fast) var(--ease-standard),
    background var(--duration-fast) var(--ease-standard);
}

.field-reveal-toggle:hover {
  border-color: var(--neutral-300);
  background: var(--neutral-100);
}

.field-reveal-toggle:focus-visible {
  outline: none;
  border-color: var(--brand-primary);
  box-shadow: var(--shadow-ring);
}

.btn .btn-spinner {
  display: none;
  width: 14px;
  height: 14px;
  margin-right: 8px;
  border: 2px solid currentColor;
  border-right-color: transparent;
  border-radius: 50%;
  vertical-align: -2px;
  animation: btn-spinner-spin 0.7s linear infinite;
}

.btn.is-loading .btn-spinner {
  display: inline-block;
}

.btn.is-loading {
  cursor: progress;
}

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

/* Provider pill with SVG icon */
.field-pill--provider-icon {
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
  padding: var(--space-1) var(--space-3) var(--space-1) var(--space-2);
}

.field-pill--provider-icon svg {
  display: block;
  flex-shrink: 0;
}

/* Auto-test spinner hint under URL field */
.field-hint--testing {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  color: var(--neutral-500);
}

.field-hint--testing::before {
  content: "";
  display: inline-block;
  width: 10px;
  height: 10px;
  border: 1.5px solid var(--neutral-300);
  border-top-color: var(--brand-primary);
  border-radius: 50%;
  animation: btn-spinner-spin 0.7s linear infinite;
  flex-shrink: 0;
}

@media (prefers-reduced-motion: reduce) {
  .field-hint--testing::before { animation: none; }
}

/* Bulk import indicator on URL textarea */
.field--bulk textarea {
  border-left: 3px solid var(--brand-primary);
  padding-left: calc(var(--space-3) - 2px);
}

/* Missing textarea error state (input was already covered) */
.field--error textarea {
  border-color: var(--danger);
  background: var(--neutral-0);
}

.field--error textarea:focus,
.field--error textarea:focus-visible {
  border-color: var(--danger);
  box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.18);
}

/* Progressive-disclosure token section */
.import-token-details {
  border: 1px solid var(--neutral-200);
  border-radius: var(--radius-md);
  overflow: hidden;
}

.import-token-details[open] {
  background: var(--neutral-0);
}

.import-token-summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
  padding: var(--space-2) var(--space-3);
  cursor: pointer;
  list-style: none;
  user-select: none;
  font-size: var(--fs-sm);
  font-weight: var(--fw-semibold);
  color: var(--neutral-600);
  background: var(--neutral-50);
}

.import-token-summary::-webkit-details-marker { display: none; }

.import-token-summary::before {
  content: "›";
  font-size: 1.1em;
  margin-right: var(--space-1);
  display: inline-block;
  transition: transform 0.15s ease;
  color: var(--neutral-400);
}

.import-token-details[open] .import-token-summary::before {
  transform: rotate(90deg);
}

@media (prefers-reduced-motion: reduce) {
  .import-token-summary::before { transition: none; }
}

.import-token-summary-label {
  flex: 1;
}

.import-token-help {
  font-size: var(--fs-xs);
  font-weight: var(--fw-regular);
  color: var(--brand-primary);
  flex-shrink: 0;
}

.import-token-help:hover {
  color: var(--brand-primary-hover);
}

.import-token-body {
  padding: var(--space-3);
  border-top: 1px solid var(--neutral-200);
}

/* Inline error banner inside form card */
.notice-inline-error {
  padding: var(--space-3) var(--space-4);
  margin-bottom: var(--space-4);
  border: 1px solid rgba(239, 68, 68, 0.35);
  border-radius: var(--radius-md);
  background: var(--danger-bg, #FEF2F2);
  color: var(--danger-text, #B91C1C);
  font-size: var(--fs-sm);
  line-height: 1.4;
}

/* Tighter lede on import page */
.import-lede {
  margin: 0 0 var(--space-4);
  font-size: var(--fs-sm);
}

/* Import wizard */
.import-wizard-form {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
}

.import-wizard-stepper {
  display: flex;
  list-style: none;
  margin: 0 0 var(--space-4);
  padding: 0;
  border: 1px solid var(--neutral-200);
  border-radius: var(--radius-md);
  overflow: hidden;
}

.import-wizard-stepper-item {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: var(--space-2) var(--space-2);
  background: var(--neutral-0);
  border-right: 1px solid var(--neutral-200);
  text-align: center;
}

.import-wizard-stepper-item:last-child {
  border-right: none;
}

.import-wizard-stepper-item--active {
  background: var(--neutral-50);
}

.import-wizard-stepper-item--done {
  background: var(--neutral-50);
}

.import-wizard-stepper-num {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: var(--fs-xs);
  font-weight: var(--fw-semibold);
  background: var(--neutral-200);
  color: var(--neutral-600);
}

.import-wizard-stepper-item--active .import-wizard-stepper-num,
.import-wizard-stepper-item--done .import-wizard-stepper-num {
  background: var(--brand-primary);
  color: var(--neutral-0);
}

.import-wizard-stepper-label {
  font-size: var(--fs-xs);
  font-weight: var(--fw-semibold);
  color: var(--neutral-600);
}

.import-wizard-stepper-item--active .import-wizard-stepper-label {
  color: var(--neutral-900);
}

.import-wizard-panel-title {
  margin: 0 0 var(--space-2);
  font-size: var(--fs-lg);
  font-weight: var(--fw-semibold);
}

.import-wizard-panel-title:focus {
  outline: none;
}

.import-wizard-panel-title:focus-visible {
  box-shadow: var(--shadow-ring);
  border-radius: var(--radius-sm);
}

.import-wizard-panel-lede {
  margin: 0 0 var(--space-4);
}

.import-access-context {
  margin: 0 0 var(--space-4);
  font-size: var(--fs-sm);
  font-weight: var(--fw-semibold);
  color: var(--neutral-700);
}

.import-access-fields {
  margin-top: var(--space-2);
}

.import-access-fields .import-token-help {
  margin-left: auto;
  font-size: var(--fs-xs);
  font-weight: var(--fw-regular);
  color: var(--brand-primary);
  flex-shrink: 0;
}

.import-access-fields .import-token-help:hover {
  color: var(--brand-primary-hover);
}

.import-pat-scopes-hint {
  color: var(--neutral-500);
  font-size: var(--fs-xs);
}

.import-wizard-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
  flex-wrap: wrap;
  margin-top: var(--space-2);
  padding-top: var(--space-4);
  border-top: 1px solid var(--neutral-200);
}

.import-wizard-nav-primary {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
  align-items: center;
  margin-left: auto;
}

.import-preview-card {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-3);
  margin-top: var(--space-3);
  border: 1px solid var(--neutral-200);
  border-radius: var(--radius-md);
  background: var(--neutral-50);
}

.import-preview-card-avatar .project-card-avatar-fallback {
  width: 40px;
  height: 40px;
  font-size: var(--fs-sm);
}

.import-preview-card-body {
  flex: 1;
  min-width: 0;
}

.import-preview-card-title-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-2);
}

.import-preview-card-slug {
  font-weight: var(--fw-semibold);
  font-size: var(--fs-sm);
}

.import-preview-card-status {
  margin: 4px 0 0;
}

.import-review-summary {
  margin: 0 0 var(--space-4);
}

.import-review-row {
  display: grid;
  grid-template-columns: 140px 1fr;
  gap: var(--space-3);
  padding: var(--space-2) 0;
  border-bottom: 1px solid var(--neutral-200);
}

.import-review-row:last-child {
  border-bottom: none;
}

.import-review-row dt {
  margin: 0;
  font-size: var(--fs-xs);
  color: var(--neutral-500);
}

.import-review-row dd {
  margin: 0;
  font-size: var(--fs-sm);
  font-weight: var(--fw-medium);
}

.import-bulk-toggle-row {
  margin: var(--space-3) 0 0;
}

.import-pat-scopes-details {
  border: 1px solid var(--neutral-200);
  border-radius: var(--radius-md);
}

.import-pat-scopes-summary {
  font-size: var(--fs-xs);
  font-weight: var(--fw-semibold);
}

@media (max-width: 520px) {
  .import-wizard-stepper-label {
    font-size: 10px;
  }

  .import-review-row {
    grid-template-columns: 1fr;
    gap: 2px;
  }
}

/* ----- Verdict hero (issue #633) ------------------------------------------ */

.verdict-hero {
  display: grid;
  grid-template-columns: 3fr 2fr;
  gap: 20px;
  align-items: start;
}

.verdict-hero-left {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
  padding: 20px;
  border: 1px solid var(--neutral-200);
  border-radius: var(--radius-lg);
  background: var(--neutral-0);
  box-shadow: var(--shadow-sm);
  min-width: 0;
}

.verdict-hero-left[data-decision="proceed"] { border-left: 3px solid var(--color-decision-proceed-solid); background: linear-gradient(135deg, rgba(16, 185, 129, 0.05) 0%, var(--neutral-0) 55%); }
.verdict-hero-left[data-decision="clarify"] { border-left: 3px solid var(--color-decision-clarify-solid); background: linear-gradient(135deg, rgba(245, 158, 11, 0.05) 0%, var(--neutral-0) 55%); }
.verdict-hero-left[data-decision="split"]   { border-left: 3px solid var(--color-decision-split-solid);   background: linear-gradient(135deg, rgba(59, 130, 246, 0.05) 0%, var(--neutral-0) 55%); }
.verdict-hero-left[data-decision="defer"]   { border-left: 3px solid var(--color-decision-defer-solid);   background: linear-gradient(135deg, rgba(239, 68, 68, 0.05) 0%, var(--neutral-0) 55%); }

.verdict-hero-right {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
  min-width: 0;
}

/* Combined right-column card: three metric rows separated by hairlines so the
 * outcome hero reads as a single compact panel instead of three stacked tiles
 * that tower over the left column. */
.verdict-hero-right-combined {
  padding: 4px 16px;
  border: 1px solid var(--neutral-200);
  border-radius: var(--radius-lg);
  background: var(--neutral-0);
  box-shadow: var(--shadow-sm);
  gap: 0;
}

.verdict-hero-right-combined .verdict-metric-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 0;
  min-width: 0;
}

.verdict-hero-right-combined .verdict-metric-row + .verdict-metric-row {
  border-top: 1px solid var(--neutral-100);
}

.verdict-hero-right-combined .verdict-metric-label {
  margin: 0;
  flex-shrink: 0;
}

.verdict-hero-right-combined .quality-gauge-svg {
  width: 80px;
  height: 80px;
}

.verdict-hero-right-combined .quality-gauge-empty {
  height: 80px;
}

.verdict-quality-row {
  flex-direction: row;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
  padding-top: 12px;
  padding-bottom: 12px;
}

.verdict-quality-row .quality-gauge-wrap {
  flex-direction: row;
  align-items: center;
  gap: var(--space-2);
}

.verdict-hero-right-combined .cost-range-chart {
  flex: 1;
  gap: var(--space-2);
  min-width: 0;
}

.verdict-hero-right-combined .verdict-metric-value {
  text-align: right;
}

.verdict-next-step {
  margin: 0;
  font-size: 15px;
  line-height: 1.55;
  color: var(--neutral-700);
}

.verdict-signal-bars {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.verdict-metric {
  padding: var(--space-4) var(--space-4);
  border: 1px solid var(--neutral-200);
  border-radius: var(--radius-lg);
  background: var(--neutral-0);
  box-shadow: var(--shadow-sm);
}

.verdict-metric-label {
  color: var(--neutral-500);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  margin-bottom: 8px;
}

.verdict-metric-value {
  font-size: 14px;
  font-weight: 600;
  overflow-wrap: anywhere;
}

/* ----- Decision badge XL --------------------------------------------------- */

.decision-badge-xl {
  display: inline-flex;
  align-items: center;
  padding: var(--space-2) var(--space-5);
  border-radius: var(--radius-full);
  font-size: 22px;
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 1.2;
  border: 2px solid transparent;
  align-self: flex-start;
}

.verdict-panel .decision-badge-xl {
  font-size: 20px;
  padding: 8px 18px;
}

.decision-badge-icon { margin-right: 8px; font-style: normal; }

.decision-badge-proceed {
  background: var(--color-decision-proceed-bg);
  color: var(--color-decision-proceed-solid);
  border-color: rgba(16, 185, 129, 0.3);
}

.decision-badge-clarify {
  background: var(--color-decision-clarify-bg);
  color: var(--color-decision-clarify-solid);
  border-color: rgba(245, 158, 11, 0.3);
}

.decision-badge-split {
  background: var(--color-decision-split-bg);
  color: var(--color-decision-split-solid);
  border-color: rgba(59, 130, 246, 0.3);
}

.decision-badge-defer {
  background: var(--color-decision-defer-bg);
  color: var(--color-decision-defer-solid);
  border-color: rgba(239, 68, 68, 0.3);
}

/* ----- Signal bars --------------------------------------------------------- */

.signal-bar-row {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
}

.signal-bar-label {
  color: var(--neutral-500);
  min-width: 80px;
  flex-shrink: 0;
}

.signal-bar {
  display: flex;
  gap: var(--space-1);
  flex: 1;
  min-width: 0;
}

.signal-bar-seg {
  height: 10px;
  flex: 1;
  border-radius: 4px;
  background: var(--neutral-200);
}

/* Tone (colour) is set per row by polarity-aware classes so it reflects
   goodness, not magnitude. Fill (how many segments light up) is set on the
   bar itself and reflects the literal level. Testability is positive-sense,
   so a high value is green/full; ambiguity & scope risk are negative-sense. */
.signal-bar-row { --signal-tone: var(--neutral-300); }
.signal-tone-good    { --signal-tone: var(--success); }
.signal-tone-warn    { --signal-tone: var(--warning); }
.signal-tone-bad     { --signal-tone: var(--danger); }
.signal-tone-unknown { --signal-tone: var(--neutral-300); }

.signal-fill-1 .signal-bar-seg-1,
.signal-fill-2 .signal-bar-seg-1,
.signal-fill-2 .signal-bar-seg-2,
.signal-fill-3 .signal-bar-seg-1,
.signal-fill-3 .signal-bar-seg-2,
.signal-fill-3 .signal-bar-seg-3 {
  background: var(--signal-tone);
}

.signal-bar-value {
  color: var(--signal-tone);
  font-weight: 600;
  min-width: 48px;
  text-transform: capitalize;
  flex-shrink: 0;
}

/* ----- Quality gauge SVG --------------------------------------------------- */

.quality-gauge-svg {
  width: 80px;
  height: 80px;
  display: block;
}

.quality-gauge-empty {
  display: flex;
  align-items: center;
  height: 48px;
}

.quality-gauge-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
}

.quality-tier {
  display: inline-block;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  padding: 2px var(--space-3);
  border-radius: 9999px;
  line-height: 1.6;
}
.quality-tier-good { color: var(--success-text); background: var(--success-bg); }
.quality-tier-warn { color: var(--warning-text); background: var(--warning-bg); }
.quality-tier-bad  { color: var(--danger-text);  background: var(--danger-bg); }

/* ----- Cost range chart ---------------------------------------------------- */

.cost-range-chart {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}

.cost-range-track {
  position: relative;
  height: 10px;
  border-radius: 5px;
  background: var(--neutral-100);
  margin: var(--space-2) 0;
}

.cost-range-fill {
  position: absolute;
  top: 0;
  bottom: 0;
  border-radius: 5px;
  background: rgba(37, 99, 235, 0.15);
}

.cost-range-marker {
  position: absolute;
  top: 50%;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  transform: translate(-50%, -50%);
  border: 2px solid var(--neutral-0);
  box-shadow: var(--shadow-xs);
}

.cost-range-marker-opt {
  background: var(--success);
  z-index: 2;
}

.cost-range-marker-likely {
  background: var(--brand-primary);
  z-index: 3;
  width: 18px;
  height: 18px;
  border-width: 3px;
}

.cost-range-marker-pess {
  background: var(--warning);
  z-index: 2;
}

.cost-range-vals {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 2px var(--space-2);
  font-size: 12px;
}

.cost-range-val::before {
  content: "";
  display: inline-block;
  width: 8px; height: 8px;
  border-radius: 50%;
  margin-right: 4px;
  vertical-align: middle;
}
.cost-range-val-opt::before    { background: var(--success); }
.cost-range-val-likely::before { background: var(--brand-primary); }
.cost-range-val-pess::before   { background: var(--warning); }

.cost-range-val-tag {
  margin-left: 4px;
  color: var(--neutral-500);
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.cost-range-confidence {
  margin: 0;
  font-size: 11px;
  text-transform: capitalize;
}

.cost-range-legend {
  margin: 0;
  font-size: 11px;
  color: var(--neutral-500);
}

.cost-range-chart .cost-conf-letter {
  display: none;
}

/* ----- Sticky bar risk/conflict dots --------------------------------------- */

.preflight-sticky-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}

.preflight-sticky-dot-risk {
  background: var(--danger);
}

.preflight-sticky-dot-conflict {
  background: var(--warning);
}

.preflight-sticky-dot-security {
  background: var(--danger);
}

/* ----- Verdict notes: decision-adjusted + calibration provenance ----------- */

.verdict-decision-adjusted {
  margin: 4px 0 0;
  font-size: 12px;
}

.verdict-calibration-note {
  margin: var(--space-2) 0 0;
  font-size: 11px;
  color: var(--neutral-500);
}

/* ----- Risk & safety section ----------------------------------------------- */

.risk-safety-header {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-bottom: var(--space-3);
}

.risk-safety-review {
  margin: 0 0 var(--space-3);
}

.risk-safety-flags {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
  margin-bottom: var(--space-3);
}

.security-touch-pill {
  background: var(--warning-bg);
  color: var(--warning-text);
}

.auto-proceed-safe {
  background: var(--success-bg);
  color: var(--success-text);
}

.auto-proceed-gated {
  background: var(--warning-bg);
  color: var(--warning-text);
}

/* ----- Sequencing chips ---------------------------------------------------- */

.sequencing-chips {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
}

.issue-chip {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 12px;
  font-size: 12px;
  font-weight: 600;
  background: var(--neutral-100);
  color: var(--neutral-700, var(--neutral-500));
  text-decoration: none;
}

a.issue-chip:hover {
  background: var(--neutral-200);
}

/* ----- Responsive: verdict hero collapses to single column ---------------- */

@media (max-width: 860px) {
  .verdict-hero {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 520px) {
  .verdict-hero {
    grid-template-columns: 1fr;
  }
}

/* ----- Queue chips (#564, #604, #605) --------------------------------------- */

.queue-chips {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
  align-items: center;
  margin: 0 0 12px;
}

.queue-chip {
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
  padding: var(--space-1) var(--space-3);
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  border: 1px solid var(--neutral-200);
  background: var(--neutral-50);
  color: var(--neutral-700);
  text-decoration: none;
  cursor: pointer;
  white-space: nowrap;
  transition: border-color 0.12s, background 0.12s, color 0.12s;
}

.queue-chip:hover {
  background: var(--neutral-0);
  border-color: var(--neutral-300);
  color: var(--neutral-900);
}

.queue-chip:focus-visible {
  outline: 2px solid var(--brand-primary);
  outline-offset: 2px;
}

.queue-chip-active {
  background: var(--info-bg, #dbeafe);
  border-color: var(--brand-primary, #1f6feb);
  color: var(--brand-primary, #1f6feb);
}

.queue-chip-empty {
  opacity: 0.45;
  cursor: default;
  pointer-events: none;
}

.queue-chip-count {
  font-size: 11px;
  font-weight: 700;
  color: var(--neutral-600);
  background: var(--neutral-200);
  border-radius: 999px;
  padding: 0 var(--space-2);
  min-width: 18px;
  text-align: center;
}

.queue-chip-active .queue-chip-count {
  color: var(--brand-primary, #1f6feb);
  background: rgba(31, 111, 235, 0.14);
}

.queue-chip-group {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
}

.queue-chip-group + .queue-chip-group {
  margin-left: var(--space-3);
}

.queue-chip-group-label {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--neutral-500);
}

/* ----- Issue funnel header (JTBD stage navigation) ------------------------- */

.issue-funnel {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
  align-items: center;
  margin: 0 0 12px;
}

.issue-funnel-stage {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-2) var(--space-3);
  border-radius: 8px;
  font-size: 12px;
  font-weight: 600;
  border: 1px solid var(--neutral-200);
  background: var(--neutral-0);
  color: var(--neutral-700);
  text-decoration: none;
  cursor: pointer;
  white-space: nowrap;
  transition: border-color 0.12s, background 0.12s, color 0.12s;
}

.issue-funnel-stage:hover {
  border-color: var(--neutral-300);
  color: var(--neutral-900);
}

.issue-funnel-stage:focus-visible {
  outline: 2px solid var(--brand-primary);
  outline-offset: 2px;
}

.issue-funnel-stage-active {
  background: var(--info-bg, #dbeafe);
  border-color: var(--brand-primary, #1f6feb);
  color: var(--brand-primary, #1f6feb);
}

.issue-funnel-stage-empty {
  opacity: 0.45;
  cursor: default;
  pointer-events: none;
}

.issue-funnel-count {
  font-size: 11px;
  font-weight: 700;
  color: var(--neutral-600);
  background: var(--neutral-100);
  border-radius: 999px;
  padding: 0 var(--space-2);
  min-width: 18px;
  text-align: center;
}

.issue-funnel-stage-active .issue-funnel-count {
  color: var(--brand-primary, #1f6feb);
  background: rgba(31, 111, 235, 0.14);
}

.issue-funnel-arrow {
  color: var(--neutral-400);
  font-size: 12px;
}

.issue-funnel-break {
  width: 1px;
  align-self: stretch;
  background: var(--neutral-200);
  margin: 0 var(--space-2);
}

@media (max-width: 720px) {
  .issue-funnel-arrow { display: none; }
}

/* ----- Smart next action + overflow menu (unified issues table) ------------ */

.op-next-action {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: var(--space-1);
}

.op-next-action-btn {
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
  min-width: 84px;
  justify-content: center;
  white-space: nowrap;
}

.op-action-menu {
  position: relative;
}

.op-action-menu-trigger {
  list-style: none;
  cursor: pointer;
  user-select: none;
  width: 26px;
  height: 26px;
  border-radius: var(--radius-sm);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--neutral-500);
  font-size: 16px;
  line-height: 1;
}

.op-action-menu-trigger::-webkit-details-marker { display: none; }
.op-action-menu-trigger:hover { background: var(--neutral-100); color: var(--neutral-700); }

.op-action-menu-popover {
  position: absolute;
  right: 0;
  top: calc(100% + 4px);
  min-width: 160px;
  background: var(--neutral-0);
  border: 1px solid var(--neutral-200);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
  padding: 4px;
  display: flex;
  flex-direction: column;
  z-index: 6;
}

.op-action-menu-item {
  display: block;
}

.op-action-menu-link,
.op-action-menu-btn {
  display: block;
  width: 100%;
  text-align: left;
  padding: var(--space-2) var(--space-3);
  font-size: var(--fs-xs);
  color: var(--neutral-700);
  text-decoration: none;
  border-radius: var(--radius-sm);
  white-space: nowrap;
  background: none;
  border: none;
  cursor: pointer;
  font-family: inherit;
}

.op-action-menu-btn {
  display: flex;
  align-items: center;
  gap: var(--space-2);
}

.op-action-menu-link:hover,
.op-action-menu-btn:hover {
  background: var(--neutral-100);
  color: var(--neutral-900);
}

.op-action-menu-btn:disabled {
  opacity: 0.5;
  cursor: default;
}

.op-action-menu-btn:disabled:hover {
  background: none;
  color: var(--neutral-700);
}

/* ----- Row failure badge (job R2) ------------------------------------------ */

.op-failure-badge {
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
  padding: 0 var(--space-2);
  border-radius: 999px;
  font-size: 11px;
  font-weight: 600;
  background: var(--danger-bg);
  color: var(--danger-text);
  text-decoration: none;
  white-space: nowrap;
}

.op-failure-badge:hover {
  text-decoration: underline;
}

/* ----- Row partial-build badge (wind-down, #2076) -------------------------- */

.op-partial-badge {
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
  padding: 0 var(--space-2);
  border-radius: 999px;
  font-size: 11px;
  font-weight: 600;
  background: var(--warning-bg);
  color: var(--warning-text);
  text-decoration: none;
  white-space: nowrap;
}

.op-partial-badge:hover {
  text-decoration: underline;
}

/* ----- Triage table legend (#595) ----------------------------------------- */

.op-table-legend {
  margin-bottom: var(--space-2);
}

.op-table-legend-summary {
  font-size: 11.5px;
  color: var(--neutral-500);
  cursor: pointer;
  user-select: none;
  padding: 2px 0;
  list-style: none;
}

.op-table-legend-summary::before {
  content: "▸ ";
  font-size: 10px;
}

details[open].op-table-legend .op-table-legend-summary::before {
  content: "▾ ";
}

.op-table-legend-body {
  padding-top: 4px;
}

/* ----- Bulk actions toolbar (#597) ----------------------------------------- */

.op-bulk-toolbar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: var(--space-2) var(--space-2);
  background: var(--brand-primary-light, #dbeafe);
  border: 1px solid var(--brand-primary, #1f6feb);
  border-radius: 6px;
  margin-bottom: var(--space-2);
  font-size: 12.5px;
}

.op-bulk-count {
  font-weight: 600;
  color: var(--neutral-700);
  margin-right: 4px;
}

/* ----- Calibration compact strip (#596) ------------------------------------ */

.section-calibration-strip {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: var(--space-2) 0 var(--space-3);
  font-size: 12.5px;
  color: var(--neutral-700);
  flex-wrap: wrap;
}

.section-calibration-strip-meta {
  color: var(--neutral-500);
}

/* ----- Issue decision summary strip (#598) --------------------------------- */

.issue-decision-summary {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  padding: 0 0 var(--space-3);
}

.issue-summary-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: var(--space-1) var(--space-2);
  border-radius: 20px;
  font-size: 12px;
  border: 1px solid var(--neutral-200);
  background: var(--neutral-50);
  color: var(--neutral-600);
  text-decoration: none;
  white-space: nowrap;
}

.issue-summary-chip:hover {
  background: var(--neutral-100);
  border-color: var(--neutral-300);
}

.issue-summary-chip strong {
  color: var(--neutral-900);
}

/* ----- Preflight staleness badge (#569) ------------------------------------ */

.preflight-staleness-warn {
  background: var(--warning-bg);
  color: var(--warning-text);
  border-color: transparent;
  font-size: 10px;
  padding: 1px var(--space-1);
  vertical-align: middle;
}

/* ----- Calibration action banner (#569) ------------------------------------ */

.calibration-action-banner {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  padding: var(--space-3) var(--space-4);
  border-radius: var(--radius);
  border: 1px solid transparent;
  margin-bottom: 12px;
  font-size: 13px;
  line-height: 1.5;
}

.calibration-action-banner--warn {
  background: var(--warning-bg);
  border-color: var(--warning);
  color: var(--warning-text);
}

.calibration-action-banner--info {
  background: var(--info-bg);
  border-color: var(--info);
  color: var(--info-text);
}

.calibration-action-banner-icon {
  font-size: 14px;
  flex-shrink: 0;
  margin-top: 1px;
}

.calibration-action-banner-text {
  margin: 0;
}

/* ----- Low-confidence forecast note (#569) --------------------------------- */

.modal-build-block--low-conf {
  padding: 0;
}

.modal-build-low-conf-note {
  display: flex;
  align-items: flex-start;
  gap: var(--space-2);
  margin: 0;
  padding: 8px 12px;
  background: var(--warning-bg);
  border: 1px solid var(--warning);
  border-radius: var(--radius);
  font-size: 12.5px;
  color: var(--warning-text);
  line-height: 1.5;
}

.modal-build-low-conf-icon {
  flex-shrink: 0;
  font-style: normal;
}

/* #655: cap slider inside the build confirm modal --------------------------- */

.modal-build-cap-slider-block {
  margin-top: 12px;
  padding-top: var(--space-3);
  border-top: 1px dashed var(--neutral-200);
}

.modal-build-cap-slider-label {
  display: block;
  font-size: 11px;
  font-weight: 700;
  color: var(--neutral-500);
  text-transform: uppercase;
  letter-spacing: 0.02em;
  margin-bottom: var(--space-2);
}

.modal-build-cap-track {
  position: relative;
  height: 6px;
  border-radius: 999px;
  background: linear-gradient(to right, #4ade80 0%, #facc15 50%, #ef4444 100%);
  margin: 8px 0;
}

.modal-build-cap-marker {
  position: absolute;
  top: -3px;
  width: 12px;
  height: 12px;
  margin-left: -8px;
  background: var(--neutral-0);
  border: 2px solid var(--neutral-700);
  border-radius: 50%;
  box-shadow: 0 0 0 1px var(--neutral-200);
}

.modal-build-cap-marker--likely {
  border-color: #1d4ed8;
}

.modal-build-cap-slider {
  width: 100%;
  margin: 4px 0 0;
}

.modal-build-cap-line {
  display: flex;
  align-items: baseline;
  gap: var(--space-2);
  margin-top: var(--space-2);
  font-size: 13px;
}

.modal-build-cap-label-text {
  color: var(--neutral-600);
}

.modal-build-cap-value {
  font-weight: var(--fw-semibold);
}

.modal-build-cap-reset {
  margin-left: auto;
  font-size: 11px;
  padding: 2px 8px;
  background: transparent;
  border: 1px solid var(--neutral-200);
  color: var(--neutral-600);
  border-radius: 4px;
  cursor: pointer;
}

.modal-build-cap-reset:hover {
  background: var(--neutral-50);
}

.modal-build-cap-warning {
  margin: var(--space-2) 0 0;
  padding: var(--space-2) var(--space-2);
  background: #fef3c7;
  border: 1px solid #fcd34d;
  border-radius: 4px;
  font-size: 12px;
  color: #78350f;
}

.modal-build-cap-nocap-label {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  margin-top: var(--space-3);
  font-size: 12px;
  color: var(--text-secondary);
  cursor: pointer;
  user-select: none;
}

.modal-build-cap-nocap-checkbox {
  cursor: pointer;
}

.modal-build-cap-nocap-warning {
  margin: var(--space-2) 0 0;
  padding: var(--space-2) var(--space-2);
  background: #fee2e2;
  border: 1px solid #fca5a5;
  border-radius: 4px;
  font-size: 12px;
  color: #7f1d1d;
}

/* #657: toast action links -------------------------------------------------- */

.toast-actions {
  display: inline-flex;
  gap: 8px;
  margin-left: 12px;
  align-items: center;
}

.toast-action {
  font-size: 12px;
  font-weight: var(--fw-semibold);
  color: inherit;
  text-decoration: underline;
  background: transparent;
  border: 0;
  cursor: pointer;
  padding: 0;
}

.toast-action:hover {
  text-decoration: none;
}

/* #658: cancel confirmation modal ------------------------------------------ */

.cancel-modal-lede {
  margin: 0 0 var(--space-3);
}

.cancel-modal-metrics {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px 12px;
  margin: 8px 0;
  padding: var(--space-2) var(--space-3);
  background: var(--neutral-50);
  border-radius: 6px;
}

.cancel-modal-metric {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.cancel-modal-metric-label {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.02em;
  color: var(--neutral-500);
}

.cancel-modal-cost,
.cancel-modal-cap {
  font-weight: var(--fw-semibold);
}

.cancel-modal-bar {
  height: 4px;
  background: var(--neutral-200);
  border-radius: 999px;
  overflow: hidden;
  margin: var(--space-2) 0 var(--space-3);
}

.cancel-modal-bar-fill {
  height: 100%;
  background: linear-gradient(to right, #facc15 0%, #ef4444 100%);
}

.cancel-modal-reason-label {
  display: block;
  font-size: 11px;
  font-weight: 700;
  color: var(--neutral-500);
  text-transform: uppercase;
  margin-top: 4px;
}

.cancel-modal-reason {
  width: 100%;
  margin-top: 4px;
  padding: var(--space-2) var(--space-2);
  border: 1px solid var(--neutral-200);
  border-radius: 4px;
  font-family: inherit;
  font-size: 13px;
  resize: vertical;
}

/* #654: cost hint badge inside Build-now CTA --------------------------- */

.invocation-followup-cost-hint {
  margin-left: var(--space-2);
  font-size: 11px;
  font-weight: var(--fw-medium);
  opacity: 0.85;
}

/* #656: timeline pagination ------------------------------------------------ */

.timeline-pagination-note {
  font-size: 12px;
  color: var(--neutral-500);
  margin: 0 0 var(--space-2);
}

.timeline-older-details {
  margin-bottom: var(--space-3);
}

.timeline-older-details > summary {
  cursor: pointer;
  font-size: 12px;
  color: var(--neutral-600);
  padding: 4px 0;
}

/* ===== Triage journey wave ============================================== */

/* #666: responsive column hiding on the operational table. Tiers (always
 * visible vs hidden) follow what the operator actually needs to act on:
 *   Tier 1 (always):       select, title, decision, cost, actions
 *   Tier 2 (< 1400px):     number, effort, last-run
 *   Tier 3 (< 1200px):     conflict, age, risk
 *   Tier 4 (< 900px):      score
 */
@media (max-width: 1399px) {
  .issues-operational-table .op-col-num,
  .issues-operational-table .op-col-effort,
  .issues-operational-table .op-col-lastrun {
    display: none;
  }
}
@media (max-width: 1199px) {
  .issues-operational-table .op-col-conflict,
  .issues-operational-table .op-col-age,
  .issues-operational-table .op-col-risk {
    display: none;
  }
}
@media (max-width: 899px) {
  .issues-operational-table .op-col-score {
    display: none;
  }
}

/* Project-scoped paginated run list (GET /api/projects/:owner/:name/runs).
 * Filters reuse the issues operational-filter bar (.ops-filter-sidebar); the
 * run-specific KPIs + table + pagination live in the .issues-operational-main
 * column, so no bespoke toolbar styling is needed here. */
.section-project-runs {
  margin-bottom: 1rem;
}

.summary-grid.project-runs-kpis {
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
}

/* Inline shortcut row in the Issues section ("Build waves →" + "Runs →"). */
.wave-planning-shortcut {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem 1rem;
}

.runs-view-searchbar {
  margin: var(--space-2) 0 var(--space-2);
}
.runs-view-search-input {
  width: 100%;
  max-width: 360px;
  padding: var(--space-2) var(--space-3);
  font-size: 13px;
  border: 1px solid var(--neutral-200);
  border-radius: 4px;
}
.runs-view-search-input:focus {
  outline: none;
  border-color: var(--brand-primary, #2563eb);
  box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.15);
}

/* #668: Show-all toggle inside the pagination footer */
.issues-show-all-btn {
  margin-left: auto;
}

/* #670: conflict-risk pill is now a button so it can host a click handler.
 * Visually identical to the existing pill; the cursor signals interactivity.
 */
button.pill--conflict-risk {
  font: inherit;
  background: transparent;
  border: 1px solid currentColor;
  cursor: pointer;
  min-height: 24px;
}
button.pill--conflict-risk:hover {
  filter: brightness(0.95);
}
.conflict-risk-popover-score {
  font-size: 14px;
  margin: 0 0 var(--space-2);
}
.conflict-risk-popover-level {
  display: inline-block;
  padding: 1px 8px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: var(--fw-semibold);
  text-transform: capitalize;
  margin-left: var(--space-2);
}
.conflict-risk-popover-detail {
  margin: 4px 0;
  font-size: 13px;
  color: var(--neutral-700);
}
.conflict-risk-popover-hint {
  margin: 8px 0 0;
  font-size: 12px;
  color: var(--neutral-500);
  font-style: italic;
}

/* ===== Settings & Onboarding wave ====================================== */

/* #674: inherited (greyed) global value display on per-project overrides */
.settings-inherited {
  color: var(--neutral-500);
  opacity: 0.8;
}
.settings-inherited-source {
  margin-left: 4px;
  font-size: 11px;
  text-transform: lowercase;
  color: var(--neutral-400);
}

/* #671: onboarding wizard layout */
.onboarding-wizard {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin: 16px 0;
}
.onboarding-step {
  padding: 16px;
  background: var(--neutral-50, #fafafa);
  border: 1px solid var(--neutral-200, #e5e5e5);
  border-radius: 8px;
}
.onboarding-step-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--space-2);
}
.onboarding-step-title {
  margin: 0;
  font-size: 16px;
  font-weight: var(--fw-semibold, 600);
}
.onboarding-step-badge {
  font-size: 11px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 999px;
}
.onboarding-step-badge--done {
  background: #dcfce7;
  color: #14532d;
}
.onboarding-step-badge--pending {
  background: #fef3c7;
  color: #78350f;
}
.onboarding-step-lead {
  margin: 4px 0 8px;
  color: var(--neutral-700);
  font-size: 13px;
}
.onboarding-step-note {
  margin: 4px 0;
  font-size: 12px;
  color: var(--neutral-600);
}
.onboarding-missing-list {
  margin: 4px 0 8px;
  padding-left: 20px;
  font-size: 13px;
  color: var(--neutral-700);
}
.onboarding-step-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 8px;
}
.onboarding-complete-banner {
  padding: var(--space-3) var(--space-3);
  background: #dcfce7;
  border: 1px solid #86efac;
  border-radius: 6px;
  margin-bottom: 12px;
}
.onboarding-wizard-footer {
  display: flex;
  gap: 8px;
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px dashed var(--neutral-200);
}

/* #672: inline test-typed-value button visual hint */
.settings-row-form button[data-setting-test] {
  margin-left: auto;
}

/* #676: aria-live regions are visually hidden but readable by screen readers */
#invocation-aria-live,
#dispatch-aria-live {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

/* #677: copy-to-clipboard button */
.copy-btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  cursor: pointer;
  background: none;
  border: 1px solid var(--neutral-200);
  border-radius: var(--radius-sm);
  padding: 2px var(--space-2);
  font-size: var(--fs-xs);
  color: var(--neutral-500);
  transition: color var(--duration-instant), border-color var(--duration-instant);
  white-space: nowrap;
}
.copy-btn:hover {
  color: var(--neutral-800);
  border-color: var(--neutral-400);
}
.pre-copy-wrap {
  position: relative;
}
.copy-btn-pre-overlay {
  position: absolute;
  top: 6px;
  right: 6px;
  background: var(--neutral-50, #f9fafb);
  opacity: 0.85;
  z-index: 1;
}
.pre-copy-wrap:hover .copy-btn-pre-overlay {
  opacity: 1;
}

/* #716: skeleton loading tiles */
.skeleton-block {
  background: linear-gradient(90deg, var(--neutral-200) 25%, var(--neutral-100) 50%, var(--neutral-200) 75%);
  background-size: 200% 100%;
  animation: skeleton-shimmer 1.4s infinite;
  border-radius: 4px;
}
.skeleton-block--sm { height: 20px; width: 56px; }
.skeleton-block--lg { height: 16px; width: 260px; }
.skeleton-block--row { height: 36px; width: 100%; margin-bottom: 8px; }
.skeleton-block--row-sm { height: 28px; width: 70%; }
@keyframes skeleton-shimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}
.project-kpis--skeleton .metric-kpi {
  opacity: 0.7;
}
.section-calibration-strip--skeleton {
  padding: var(--space-3) 0;
  margin-bottom: 8px;
}
.skeleton-issues-placeholder {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 12px;
}
.invocation-skeleton {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 16px;
}

/* #719: project card section labels */
.project-card-section {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.project-card-section-label {
  font-size: var(--fs-xs);
  font-weight: var(--fw-semibold);
  color: var(--neutral-400);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: 8px 0 2px;
}

/* #722: calibration action banner CTA */
.calibration-action-banner-body {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

/* #723: onboarding "Don't show again" text link style */
.onboarding-dismiss-link {
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
  color: var(--neutral-400);
  font-size: var(--fs-sm);
  text-decoration: underline;
  text-underline-offset: 2px;
}
.onboarding-dismiss-link:hover {
  color: var(--neutral-600);
}

/* #724: import page provider preview hint */
.field-hint--provider-preview {
  color: var(--brand-primary);
  font-weight: var(--fw-medium);
}

.field-hint--ok {
  color: var(--success-text);
}

.field-hint--warn {
  color: var(--warning-text);
}

/* #718: buildWave state chip in list */
.wave-state {
  white-space: nowrap;
}
.wave-state-ready { background: var(--success-bg); color: var(--success-text); }
.wave-state-running { background: var(--info-bg); color: var(--info-text); }
.wave-state-not_open { background: var(--neutral-100); color: var(--neutral-600); }
.wave-state-window_closed { background: var(--warning-bg); color: var(--warning-text); }
.wave-state-budget_exhausted { background: var(--danger-bg); color: var(--danger-text); }

/* #722: analytics two-pane layout + overview cards */
.analytics-layout {
  margin-top: var(--space-4);
}

.analytics-index-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: var(--space-3);
}
.analytics-index-card {
  display: flex;
  align-items: flex-start;
  gap: var(--space-3);
  padding: var(--space-4);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  text-decoration: none;
  color: inherit;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.analytics-index-card:hover {
  border-color: var(--brand-primary);
  box-shadow: 0 2px 8px rgba(0,0,0,0.06);
}
.analytics-index-card-icon {
  flex-shrink: 0;
  color: var(--brand-primary);
  opacity: 0.8;
}
.analytics-index-card-body {
  flex: 1;
  min-width: 0;
}
.analytics-index-card-title {
  font-weight: var(--fw-medium);
  font-size: var(--fs-sm);
  color: var(--text-primary);
  margin-bottom: var(--space-1);
}
.analytics-index-card-desc {
  font-size: var(--fs-xs);
  color: var(--text-muted);
  line-height: 1.5;
}
.analytics-index-card-arrow {
  flex-shrink: 0;
  color: var(--neutral-400);
  margin-top: 2px;
}

/* ============================================================
   Landing page (public marketing surface at "/")
   ============================================================ */
.landing-body {
  background: var(--neutral-0);
  color: var(--neutral-700);
}

.landing-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-4);
  padding: var(--space-4) var(--space-8);
  border-bottom: 1px solid var(--neutral-100);
  background: rgba(255, 255, 255, 0.88);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.05);
  position: sticky;
  top: 0;
  z-index: 10;
}

.landing-brand {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  font-weight: var(--fw-bold);
  font-size: var(--fs-lg);
  color: var(--neutral-900);
  text-decoration: none;
}

.landing-brand:hover {
  color: var(--neutral-900);
  text-decoration: none;
}

.landing-nav {
  display: inline-flex;
  align-items: center;
  gap: var(--space-5);
}

.landing-nav-link {
  font-size: var(--fs-sm);
  font-weight: var(--fw-medium);
  color: var(--neutral-600);
}

.landing-nav-link:hover {
  color: var(--neutral-900);
  text-decoration: none;
}

.landing-nav-cta {
  background: var(--brand-primary);
  color: var(--neutral-0);
  border-color: var(--brand-primary);
}

.landing-nav-cta:hover:not(:disabled) {
  background: var(--brand-primary-hover);
  color: var(--neutral-0);
}

.landing-header-actions {
  display: inline-flex;
  align-items: center;
  gap: var(--space-5);
}

/* Hamburger toggle: hidden on desktop, revealed at the mobile breakpoint. */
.landing-nav-toggle {
  display: none;
  align-items: center;
  justify-content: center;
  padding: var(--space-2);
  color: var(--neutral-700);
  background: transparent;
  border: 1px solid var(--neutral-200);
  border-radius: var(--radius-md);
  cursor: pointer;
}

.landing-nav-toggle:hover {
  background: var(--neutral-50);
  color: var(--neutral-900);
}

@media (max-width: 640px) {
  .landing-header {
    padding-left: var(--space-4);
    padding-right: var(--space-4);
  }

  .landing-nav-link {
    display: none;
  }

  .landing-nav {
    gap: var(--space-3);
  }

  .landing-nav-toggle {
    display: inline-flex;
  }

  /* Collapsed menu expands into a full-width panel below the sticky header. */
  .landing-nav.is-open {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    flex-direction: column;
    align-items: stretch;
    gap: var(--space-1);
    padding: var(--space-3) var(--space-4);
    background: rgba(255, 255, 255, 0.97);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    border-bottom: 1px solid var(--neutral-100);
    box-shadow: var(--shadow-md);
  }

  .landing-nav.is-open .landing-nav-link {
    display: block;
    padding: var(--space-2) 0;
    font-size: var(--fs-base);
  }
}

.landing-main {
  /* Full-width main so sections can have edge-to-edge backgrounds.
     Inner content width is constrained per-section below. */
  padding: 0;
}

.landing-hero,
.landing-trust,
.landing-how,
.landing-benefits,
.landing-features,
.landing-cta-final {
  /* Constrain content to 1080px while letting backgrounds span full width. */
  padding-left: max(var(--space-8), calc((100% - 1080px) / 2));
  padding-right: max(var(--space-8), calc((100% - 1080px) / 2));
}

.landing-hero {
  background:
    radial-gradient(ellipse 90% 55% at 50% -5%, rgba(219, 234, 254, 0.65) 0%, transparent 58%),
    radial-gradient(ellipse 45% 35% at 85% 35%, rgba(238, 242, 255, 0.5) 0%, transparent 55%),
    radial-gradient(ellipse 40% 30% at 15% 65%, rgba(240, 253, 244, 0.4) 0%, transparent 55%),
    radial-gradient(circle at 1px 1px, rgba(15, 23, 42, 0.04) 1px, transparent 0),
    var(--neutral-0);
  background-size: auto, auto, auto, 24px 24px;
}

.landing-how {
  padding-top: var(--space-12);
  padding-bottom: var(--space-12);
  background: var(--neutral-0);
  border-top: 1px solid var(--neutral-100);
}

.landing-benefits {
  background: var(--neutral-50);
  border-top: 1px solid var(--neutral-100);
  border-bottom: 1px solid var(--neutral-100);
}

.landing-features {
  background: var(--neutral-0);
}

.landing-cta-final {
  background:
    radial-gradient(ellipse 70% 60% at 20% 50%, rgba(37, 99, 235, 0.18) 0%, transparent 60%),
    radial-gradient(ellipse 55% 50% at 80% 50%, rgba(99, 102, 241, 0.15) 0%, transparent 55%),
    var(--brand-sidebar);
  color: var(--neutral-100);
  border-top: none;
}

.landing-cta-final h2 {
  color: var(--neutral-0);
}

.landing-cta-final p {
  color: var(--neutral-300);
}

.landing-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-1) var(--space-4);
  background: var(--info-bg);
  border: 1px solid rgba(29, 78, 216, 0.2);
  border-radius: var(--radius-full);
  text-transform: uppercase;
  letter-spacing: 0.07em;
  font-size: var(--fs-xs);
  font-weight: var(--fw-semibold);
  color: var(--brand-primary-hover);
  margin: 0 0 var(--space-5);
}

.landing-eyebrow-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--brand-primary-hover);
  flex-shrink: 0;
}

.landing-hero {
  text-align: center;
  padding: 64px 0 80px;
}

.landing-hero-title {
  font-size: 40px;
  font-weight: var(--fw-bold);
  color: var(--neutral-900);
  line-height: 1.12;
  margin: 0 0 var(--space-5);
  letter-spacing: -0.025em;
}

@media (min-width: 720px) {
  .landing-hero-title {
    font-size: 56px;
  }
}

@media (min-width: 1024px) {
  .landing-hero-title {
    font-size: 64px;
  }
}

.landing-hero-accent {
  background: linear-gradient(135deg, var(--brand-primary) 0%, var(--accent-indigo) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.landing-hero-sub {
  font-size: var(--fs-lg);
  color: var(--neutral-600);
  line-height: 1.55;
  max-width: 640px;
  margin: 0 auto var(--space-8);
}

.landing-hero-ctas {
  display: inline-flex;
  flex-wrap: wrap;
  gap: var(--space-3);
  justify-content: center;
}

.landing-hero-note {
  margin: var(--space-4) 0 0;
  font-size: var(--fs-sm);
  color: var(--neutral-500);
}

/* ── Trust / key-capability strip ────────────────────────── */
.landing-trust {
  padding-top: var(--space-10);
  padding-bottom: var(--space-10);
  background: var(--neutral-0);
  border-top: 1px solid var(--neutral-100);
}

.landing-trust-grid {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: var(--space-6);
  text-align: center;
}

.landing-trust-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-1);
}

.landing-trust-value {
  font-size: var(--fs-4xl);
  font-weight: var(--fw-bold);
  color: var(--brand-primary);
  letter-spacing: -0.02em;
  line-height: 1;
}

.landing-trust-label {
  font-size: var(--fs-sm);
  color: var(--neutral-500);
  max-width: 220px;
  line-height: 1.45;
}

.landing-hero-figure {
  margin: var(--space-10) auto 0;
  max-width: 760px;
  padding: var(--space-5);
  background: var(--neutral-25);
  border: 1px solid rgba(37, 99, 235, 0.12);
  border-radius: var(--radius-xl);
  box-shadow:
    0 4px 6px -1px rgba(15, 23, 42, 0.06),
    0 20px 60px -12px rgba(15, 23, 42, 0.1),
    0 0 0 4px rgba(37, 99, 235, 0.04),
    inset 0 1px 0 rgba(255, 255, 255, 0.8);
}

.landing-hero-figure svg {
  display: block;
  width: 100%;
  height: auto;
}

.landing-cta-primary {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  background: var(--brand-primary);
  color: var(--neutral-0);
  border-color: var(--brand-primary);
  padding: 12px 24px;
  font-size: var(--fs-base);
  font-weight: var(--fw-semibold);
  border-radius: var(--radius-lg);
  box-shadow: 0 1px 2px rgba(37, 99, 235, 0.3), 0 4px 16px rgba(37, 99, 235, 0.2);
  transition: background var(--duration-fast) var(--ease-standard),
              transform var(--duration-fast) var(--ease-standard),
              box-shadow var(--duration-fast) var(--ease-standard);
}

.landing-cta-primary:hover:not(:disabled) {
  background: var(--brand-primary-hover);
  color: var(--neutral-0);
  transform: translateY(-1px);
  box-shadow: 0 2px 4px rgba(37, 99, 235, 0.3), 0 8px 20px rgba(37, 99, 235, 0.25);
  text-decoration: none;
}

.landing-cta-secondary {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  padding: 12px 24px;
  font-size: var(--fs-base);
  font-weight: var(--fw-semibold);
  border-radius: var(--radius-lg);
  transition: background var(--duration-fast) var(--ease-standard),
              transform var(--duration-fast) var(--ease-standard);
}

.landing-cta-secondary:hover:not(:disabled) {
  transform: translateY(-1px);
  text-decoration: none;
}

.landing-cta-final .landing-cta-secondary {
  border-color: rgba(255, 255, 255, 0.22);
  color: rgba(255, 255, 255, 0.82);
  background: rgba(255, 255, 255, 0.07);
}

.landing-cta-final .landing-cta-secondary:hover:not(:disabled) {
  background: rgba(255, 255, 255, 0.13);
}

.landing-section-eyebrow {
  display: block;
  text-align: center;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  font-size: var(--fs-xs);
  font-weight: var(--fw-semibold);
  color: var(--brand-primary);
  margin: 0 0 var(--space-3);
}

.landing-section-title {
  font-size: var(--fs-3xl);
  font-weight: var(--fw-bold);
  color: var(--neutral-900);
  text-align: center;
  margin: 0 0 var(--space-2);
  letter-spacing: -0.02em;
  line-height: 1.2;
}

@media (min-width: 720px) {
  .landing-section-title {
    font-size: 36px;
  }
}

.landing-section-sub {
  text-align: center;
  color: var(--neutral-500);
  font-size: var(--fs-base);
  margin: 0 auto var(--space-10);
  max-width: 520px;
  line-height: 1.6;
}

.landing-benefits,
.landing-features {
  padding: var(--space-12) 0;
  border-top: 1px solid var(--neutral-100);
}

.landing-how-steps {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: var(--space-5);
  counter-reset: how-step;
}

.landing-how-step {
  position: relative;
  padding: var(--space-6);
  border: 1px solid var(--neutral-200);
  border-radius: var(--radius-lg);
  background: linear-gradient(180deg, var(--neutral-25) 0%, var(--neutral-0) 100%);
  box-shadow: var(--shadow-xs);
  transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease;
}

.landing-how-step-number {
  position: absolute;
  top: var(--space-5);
  right: var(--space-5);
  width: 28px;
  height: 28px;
  border-radius: var(--radius-full);
  background: var(--brand-primary);
  color: var(--neutral-0);
  font-size: var(--fs-sm);
  font-weight: var(--fw-bold);
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.landing-how-step-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: var(--radius-md);
  background: var(--accent-bg-indigo);
  color: var(--brand-primary);
  margin-bottom: var(--space-4);
}

.landing-how-step h3 {
  font-size: var(--fs-xl);
  font-weight: var(--fw-semibold);
  color: var(--neutral-900);
  margin: 0 0 var(--space-2);
}

.landing-how-step p {
  font-size: var(--fs-base);
  color: var(--neutral-600);
  line-height: 1.55;
  margin: 0;
}

.landing-benefits-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: var(--space-5);
}

.landing-benefit {
  padding: var(--space-6);
  border: 1px solid var(--neutral-200);
  border-radius: var(--radius-lg);
  background: var(--neutral-0);
  box-shadow: var(--shadow-xs);
  transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease;
}

.landing-benefit:hover,
.landing-feature:hover,
.landing-how-step:hover {
  transform: translateY(-3px);
  border-color: var(--neutral-300);
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.08), 0 2px 6px rgba(15, 23, 42, 0.04);
}

.landing-card-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: var(--radius-md);
  background: var(--accent-bg-indigo);
  color: var(--brand-primary);
  margin-bottom: var(--space-4);
}

.landing-feature .landing-card-icon {
  width: 36px;
  height: 36px;
  margin-bottom: var(--space-3);
}

.landing-benefit:nth-child(4n+1) {
  background: linear-gradient(145deg, rgba(239, 246, 255, 0.6) 0%, var(--neutral-0) 55%);
  border-color: rgba(37, 99, 235, 0.15);
}
.landing-benefit:nth-child(4n+1) .landing-card-icon {
  background: var(--accent-bg-indigo);
  color: var(--brand-primary);
}

.landing-benefit:nth-child(4n+2) {
  background: linear-gradient(145deg, rgba(236, 253, 245, 0.6) 0%, var(--neutral-0) 55%);
  border-color: rgba(16, 185, 129, 0.15);
}
.landing-benefit:nth-child(4n+2) .landing-card-icon {
  background: var(--accent-bg-emerald);
  color: var(--accent-emerald);
}

.landing-benefit:nth-child(4n+3) {
  background: linear-gradient(145deg, rgba(255, 247, 237, 0.6) 0%, var(--neutral-0) 55%);
  border-color: rgba(251, 146, 60, 0.15);
}
.landing-benefit:nth-child(4n+3) .landing-card-icon {
  background: var(--accent-bg-amber);
  color: var(--accent-amber);
}

.landing-benefit:nth-child(4n+4) {
  background: linear-gradient(145deg, rgba(245, 243, 255, 0.6) 0%, var(--neutral-0) 55%);
  border-color: rgba(139, 92, 246, 0.15);
}
.landing-benefit:nth-child(4n+4) .landing-card-icon {
  background: var(--accent-bg-violet);
  color: var(--accent-violet);
}

.landing-benefit h3 {
  font-size: var(--fs-xl);
  font-weight: var(--fw-semibold);
  color: var(--neutral-900);
  margin: 0 0 var(--space-2);
}

.landing-benefit p {
  font-size: var(--fs-base);
  color: var(--neutral-600);
  line-height: 1.55;
  margin: 0;
}

.landing-features-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: var(--space-5);
}

.landing-feature {
  padding: var(--space-5) var(--space-6);
  border: 1px solid var(--neutral-200);
  border-radius: var(--radius-lg);
  background: linear-gradient(160deg, var(--neutral-25) 0%, var(--neutral-0) 100%);
  box-shadow: var(--shadow-xs);
  transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease;
}

.landing-feature:nth-child(7n+1) .landing-card-icon { background: var(--accent-bg-indigo); color: var(--brand-primary); }
.landing-feature:nth-child(7n+2) .landing-card-icon { background: var(--accent-bg-emerald); color: var(--accent-emerald); }
.landing-feature:nth-child(7n+3) .landing-card-icon { background: var(--accent-bg-amber); color: var(--accent-amber); }
.landing-feature:nth-child(7n+4) .landing-card-icon { background: var(--accent-bg-violet); color: var(--accent-violet); }
.landing-feature:nth-child(7n+5) .landing-card-icon { background: var(--accent-bg-rose); color: var(--accent-rose); }
.landing-feature:nth-child(7n+6) .landing-card-icon { background: var(--accent-bg-lime); color: var(--accent-lime); }
.landing-feature:nth-child(7n+7) .landing-card-icon { background: var(--accent-bg-indigo); color: var(--accent-indigo); }

.landing-feature h3 {
  font-size: var(--fs-lg);
  font-weight: var(--fw-semibold);
  color: var(--neutral-900);
  margin: 0 0 var(--space-2);
}

.landing-feature p {
  font-size: var(--fs-sm);
  color: var(--neutral-600);
  line-height: 1.55;
  margin: 0;
}

.landing-feature code {
  font-family: var(--font-mono);
  font-size: 0.9em;
  background: var(--neutral-100);
  padding: 1px 4px;
  border-radius: var(--radius-sm);
}

.landing-cta-final {
  text-align: center;
  padding: 80px 0;
  border-top: none;
}

.landing-cta-final h2 {
  font-size: var(--fs-3xl);
  font-weight: var(--fw-bold);
  color: var(--neutral-0);
  margin: 0 0 var(--space-4);
  letter-spacing: -0.02em;
  line-height: 1.2;
}

@media (min-width: 720px) {
  .landing-cta-final h2 {
    font-size: 36px;
  }
}

.landing-cta-final p {
  color: rgba(255, 255, 255, 0.65);
  margin: 0 0 var(--space-8);
  font-size: var(--fs-lg);
}

.landing-cta-final .landing-cta-primary {
  box-shadow: 0 1px 2px rgba(0,0,0,0.3), 0 4px 20px rgba(37, 99, 235, 0.35);
}

.landing-footer {
  padding: var(--space-10) var(--space-8) var(--space-6);
  text-align: left;
  color: var(--neutral-400);
  background: var(--brand-sidebar);
  border-top: 1px solid rgba(255, 255, 255, 0.07);
}

.landing-footer a {
  color: var(--neutral-300);
}

.landing-footer a:hover {
  color: var(--neutral-0);
  text-decoration: none;
}

.landing-footer-inner {
  max-width: 1080px;
  margin: 0 auto;
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: var(--space-8);
  padding-bottom: var(--space-6);
}

.landing-footer-brand {
  max-width: 280px;
}

.landing-footer-logo {
  color: var(--neutral-0);
}

.landing-footer-logo:hover {
  color: var(--neutral-0);
}

.landing-footer-tagline {
  margin: var(--space-2) 0 0;
  font-size: var(--fs-sm);
  color: var(--neutral-400);
  line-height: 1.55;
}

.landing-footer-cols {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-10);
}

.landing-footer-col {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

.landing-footer-col h2 {
  margin: 0 0 var(--space-1);
  font-size: var(--fs-xs);
  font-weight: var(--fw-semibold);
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--neutral-400);
}

.landing-footer-col a {
  font-size: var(--fs-sm);
  color: var(--neutral-300);
}

.landing-footer-bottom {
  max-width: 1080px;
  margin: 0 auto;
  padding-top: var(--space-5);
  border-top: 1px solid rgba(255, 255, 255, 0.07);
}

/* ── How-it-works step connectors ────────────────────────── */
.landing-how-connector {
  display: none;
  list-style: none;
}

@media (min-width: 900px) {
  .landing-how-steps {
    grid-template-columns: 1fr auto 1fr auto 1fr;
    gap: var(--space-3);
    align-items: start;
  }

  .landing-how-connector {
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding-top: 54px;
    color: var(--neutral-300);
  }
}

/* ── Scroll-reveal animation ─────────────────────────────── */
.will-animate {
  opacity: 0;
  transform: translateY(22px);
  transition: opacity 0.55s ease, transform 0.55s ease;
}

.will-animate.is-visible {
  opacity: 1;
  transform: none;
}

@media (prefers-reduced-motion: reduce) {
  .landing-cta-primary,
  .landing-cta-secondary {
    transition: none;
  }
  .landing-cta-primary:hover:not(:disabled),
  .landing-cta-secondary:hover:not(:disabled) {
    transform: none;
  }
  .will-animate {
    opacity: 1;
    transform: none;
    transition: none;
  }
}

@media print {
  .will-animate {
    opacity: 1;
    transform: none;
    transition: none;
  }
}

/* P(merge) badge - #862 */
.p-merge-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.2em;
  font-size: var(--fs-xs, 11px);
  padding: 2px var(--space-2);
  border-radius: 4px;
  font-weight: 500;
  white-space: nowrap;
}
.p-merge-badge--low  { background: #fee2e2; color: #991b1b; }
.p-merge-badge--mid  { background: #fef3c7; color: #92400e; }
.p-merge-badge--high { background: #dcfce7; color: #166534; }

/* Predictor calibration page - #862 */
.predictor-reliability-svg {
  max-width: 500px;
  width: 100%;
  height: auto;
  display: block;
  margin: var(--space-4, 16px) 0;
}
.predictor-calibration-table {
  border-collapse: collapse;
  font-size: var(--fs-sm, 13px);
  margin-top: var(--space-4, 16px);
}
.predictor-calibration-table th,
.predictor-calibration-table td {
  padding: 4px 12px;
  border: 1px solid var(--neutral-200, #e2e8f0);
  text-align: right;
}
.predictor-calibration-table th:first-child,
.predictor-calibration-table td:first-child {
  text-align: left;
}
.analytics-predictor-note {
  color: var(--neutral-600, #475569);
  font-size: var(--fs-sm, 13px);
  margin-bottom: var(--space-4, 16px);
}

/* ---------- PR readiness (run page badge) ---------- */

.pill-draft {
  background: var(--neutral-200, #e2e8f0);
  color: var(--neutral-600, #475569);
  font-size: var(--fs-xs, 11px);
  padding: 1px var(--space-2);
  border-radius: 9999px;
  font-weight: 500;
}

/* Run-page inline PR readiness badge */
.pr-readiness-badge {
  display: inline-block;
  font-size: var(--fs-xs, 11px);
  padding: 1px var(--space-2);
  border-radius: 9999px;
  font-weight: 500;
  white-space: nowrap;
}

.pr-badge-ready       { background: #dcfce7; color: #166534; }
.pr-badge-ci-failed   { background: #fee2e2; color: #991b1b; }
.pr-badge-changes     { background: #fef3c7; color: #92400e; }
.pr-badge-conflict    { background: #fee2e2; color: #7f1d1d; }
.pr-badge-stale       { background: #f1f5f9; color: #475569; }
.pr-badge-needs-human { background: #fef9c3; color: #713f12; }


/* ─── Auth pages (login + bootstrap) ─────────────────────────────────────── */

/* Remove .main.app-main padding so .auth-page controls its own spacing */
.shell--auth .app-main {
  padding: 0;
}

.auth-page {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  padding: var(--space-6) var(--space-4);
}

.auth-card {
  width: 100%;
  max-width: 400px;
  background: var(--neutral-0);
  border: 1px solid var(--neutral-200);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-lg);
  padding: var(--space-10) var(--space-8);
}

.auth-card-brand {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  margin-bottom: var(--space-8);
}

.auth-card-brand-name {
  font-size: var(--fs-base);
  font-weight: var(--fw-bold);
  color: var(--neutral-900);
  letter-spacing: var(--tracking-tight);
}

.auth-card h1 {
  margin: 0 0 var(--space-2);
  font-size: var(--fs-2xl);
  font-weight: var(--fw-bold);
  color: var(--neutral-900);
  letter-spacing: var(--tracking-tight);
  line-height: 1.2;
}

.auth-card-hint {
  margin: 0 0 var(--space-7);
  font-size: var(--fs-sm);
  color: var(--neutral-500);
  line-height: 1.5;
}

.auth-card form {
  display: flex;
  flex-direction: column;
  gap: var(--space-5);
}

.auth-card .field label {
  font-size: var(--fs-sm);
  font-weight: var(--fw-medium);
  color: var(--neutral-700);
}

.auth-card .field input {
  min-height: 40px;
  font-size: var(--fs-base);
}

/* Compact error notice -- override the global 18px padding from the .notice group rule */
.auth-card .notice {
  padding: var(--space-3) var(--space-4);
  font-size: var(--fs-sm);
  margin: 0;
}

.auth-card .form-action-bar {
  flex-direction: column;
  margin-top: var(--space-2);
}

.auth-card .form-action-bar .btn {
  width: 100%;
  text-align: center;
  padding: var(--space-3) var(--space-4);
  font-size: var(--fs-base);
  font-weight: var(--fw-semibold);
}

.auth-card-recovery {
  margin: var(--space-5) 0 0;
  font-size: var(--fs-sm);
  color: var(--neutral-500);
  line-height: 1.5;
  text-align: center;
}

@media (max-width: 480px) {
  .auth-page { padding: var(--space-4); }
  .auth-card {
    border: none;
    box-shadow: none;
    border-radius: 0;
    padding: var(--space-8) var(--space-5);
    max-width: none;
  }
}

/* ── Analytics period filter (previously unstyled) ─────────────────────── */
.filter-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-3);
  margin-bottom: var(--space-4);
}
.filter-label {
  font-size: var(--fs-sm);
  font-weight: var(--fw-medium);
  color: var(--neutral-500);
}
.pill-group {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
}
.pill-btn {
  min-height: 36px;
  padding: var(--space-2) var(--space-3);
  font: inherit;
  font-size: var(--fs-sm);
  border: 1px solid var(--neutral-200);
  border-radius: var(--radius-md);
  background: var(--neutral-0);
  color: var(--neutral-700);
  cursor: pointer;
}
.pill-btn--active {
  border-color: var(--brand-primary, #2563eb);
  color: var(--brand-primary, #2563eb);
  font-weight: var(--fw-semibold);
}
@media (pointer: coarse) {
  .pill-btn { min-height: 44px; }
}

/* ── Phone layout (≤640px): stack wide tables into label:value cards ─────
 * Tables are tagged .stack-table at runtime by components/responsive-tables.mjs,
 * which also writes the per-cell data-label used by the ::before below.
 * This block is intentionally last in the file so its source order wins the
 * specificity ties against table min-width rules (e.g. styles.css line ~3015
 * `table:not(.issues-table){min-width:720px}` is also (0,1,1)). */
@media (max-width: 640px) {
  table.stack-table { min-width: 0; }
  .table-wrap:has(.stack-table),
  .issues-operational-table-wrap:has(.stack-table) { overflow-x: visible; }

  .stack-table,
  .stack-table thead,
  .stack-table tbody,
  .stack-table tr,
  .stack-table td {
    display: block;
    width: 100%;
  }

  /* Keep header text for screen readers but remove it from the visual flow. */
  .stack-table thead {
    position: absolute;
    left: -9999px;
  }

  .stack-table tr {
    border: 1px solid var(--neutral-200);
    border-radius: var(--radius-lg);
    margin-bottom: var(--space-3);
    padding: var(--space-2) var(--space-3);
    background: var(--neutral-0);
    box-shadow: var(--shadow-sm);
  }

  /* Label-on-top (not side-by-side) so cells with multiple children — cost +
   * confidence bars, title + badges, action button groups — stack cleanly. */
  .stack-table td {
    display: block;
    padding: var(--space-2) 0;
    border: 0;
    border-bottom: 1px solid var(--neutral-100);
    text-align: left;
    white-space: normal;
  }
  .stack-table tr td:last-child { border-bottom: 0; }

  .stack-table td::before {
    content: attr(data-label);
    display: block;
    margin-bottom: 2px;
    font-weight: var(--fw-semibold);
    font-size: var(--fs-xs);
    color: var(--neutral-500);
    text-transform: uppercase;
    letter-spacing: 0.03em;
  }
  /* Cells whose header was empty (select checkbox, actions) need no label. */
  .stack-table td[data-label=""]::before,
  .stack-table td:not([data-label])::before { content: none; }

  /* Operational table: un-hide the columns the tiered rules hide above 640px
   * (styles.css ~8967-8985) so every field becomes a card row; and disable the
   * sticky first/last column so it doesn't fight display:block. */
  .issues-operational-table.stack-table .op-col-num,
  .issues-operational-table.stack-table .op-col-effort,
  .issues-operational-table.stack-table .op-col-lastrun,
  .issues-operational-table.stack-table .op-col-conflict,
  .issues-operational-table.stack-table .op-col-age,
  .issues-operational-table.stack-table .op-col-risk,
  .issues-operational-table.stack-table .op-col-score {
    display: block;
  }
  .issues-operational-table.stack-table .op-col-select,
  .issues-operational-table.stack-table td.op-col-actions {
    position: static;
    box-shadow: none;
  }

  /* Numbers right-align in normal tables; under a left label that reads oddly. */
  .stack-table td.num { text-align: left; }

  /* JSON payload cell (run timeline) must wrap inside its card, not overflow. */
  .stack-table td pre,
  .stack-table td code {
    white-space: pre-wrap;
    overflow-wrap: anywhere;
    max-width: 100%;
  }

  /* Grids that don't otherwise collapse at phone width. */
  .project-card-hero { grid-template-columns: repeat(2, 1fr); }
  .failure-diagnosis-metrics { grid-template-columns: 1fr; }

  /* Top-bar nav: comfortable tap targets; keep the user menu within viewport. */
  .app-sidebar-nav.topbar-nav a {
    min-height: 44px;
    padding: var(--space-2) var(--space-3);
  }
  .user-menu-panel { max-width: calc(100vw - 24px); }
}

/* ---------------------------------------------------------------------------
   Delivery progress (project detail) — compact strip + details
   --------------------------------------------------------------------------- */
.delivery-progress-slot {
  padding: var(--space-1) 0 var(--space-2);
}

.delivery-progress-strip {
  font-size: 12.5px;
  color: var(--neutral-700);
}

.delivery-progress-strip-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
  flex-wrap: wrap;
}

.delivery-progress-strip-main strong {
  font-weight: 600;
  color: var(--neutral-800);
}

.delivery-progress-strip-pipeline {
  display: block;
  margin-top: 4px;
  font-size: 0.82rem;
}

.delivery-progress-details {
  margin-top: var(--space-2);
}

.delivery-progress-details-summary {
  cursor: pointer;
  font-size: var(--fs-sm, 0.82rem);
  font-weight: 500;
  color: var(--neutral-600);
  list-style: none;
}

.delivery-progress-details-summary::-webkit-details-marker {
  display: none;
}

.delivery-progress-details-summary::before {
  content: "▸";
  display: inline-block;
  width: 1em;
  color: var(--neutral-400);
  transition: transform 0.15s ease;
}

.delivery-progress-details[open] > .delivery-progress-details-summary::before {
  transform: rotate(90deg);
}

.delivery-progress-details-body {
  padding: var(--space-3) 0 var(--space-1);
}

.progress-details-head {
  display: flex;
  justify-content: flex-end;
  margin-bottom: var(--space-3);
}

.progress-bar {
  display: flex;
  width: 100%;
  height: 14px;
  border-radius: 7px;
  overflow: hidden;
  background: var(--neutral-100);
  border: 1px solid var(--neutral-200);
}
.progress-bar-empty { background: var(--neutral-100); }
.progress-bar--compact {
  height: 6px;
  border-radius: 3px;
  margin-top: var(--space-2);
}
.progress-seg { display: block; height: 100%; }
.progress-seg.seg-done { background: var(--accent-emerald); }
.progress-seg.seg-in-progress { background: var(--accent-indigo); }
.progress-seg.seg-ready { background: var(--accent-lime); }
.progress-seg.seg-blocked { background: var(--accent-amber); }
.progress-seg.seg-unassessed { background: var(--neutral-300); }

.progress-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  list-style: none;
  padding: 0;
  margin: var(--space-3) 0 0;
}
.progress-legend-item {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  font-size: 0.82rem;
  color: var(--neutral-600);
}
.progress-legend-dot {
  width: 10px;
  height: 10px;
  border-radius: 3px;
  display: inline-block;
}
.progress-legend-dot.seg-done { background: var(--accent-emerald); }
.progress-legend-dot.seg-in-progress { background: var(--accent-indigo); }
.progress-legend-dot.seg-ready { background: var(--accent-lime); }
.progress-legend-dot.seg-blocked { background: var(--accent-amber); }
.progress-legend-dot.seg-unassessed { background: var(--neutral-300); }
.progress-legend-count { font-weight: 600; color: var(--neutral-800); }

.progress-window-label {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  font-size: 0.8rem;
  color: var(--neutral-600);
}
.progress-window-select {
  font: inherit;
  font-size: 0.82rem;
  padding: 2px var(--space-2);
  border-radius: var(--radius-sm, 4px);
  border: 1px solid var(--neutral-300);
  background: var(--neutral-0);
  color: var(--neutral-800);
}
.progress-sync-badge {
  font-size: 0.8rem;
  color: var(--neutral-500);
}
.progress-sync-badge.progress-sync-stale {
  color: var(--accent-amber);
  font-weight: 500;
}
.progress-stale-callout {
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: var(--space-3);
}
.progress-stale-callout .btn-sm {
  margin-left: auto;
}
.progress-seg-link,
.progress-seg-wrap {
  display: block;
  height: 100%;
  text-decoration: none;
}
.progress-seg-link:hover .progress-seg {
  filter: brightness(0.92);
}
.progress-legend-link {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  text-decoration: none;
  color: inherit;
}
.progress-legend-link:hover .progress-legend-label {
  text-decoration: underline;
}
.progress-blocked-breakdown {
  margin-bottom: 16px;
  padding: var(--space-3) var(--space-4);
  border: 1px solid var(--neutral-200);
  border-radius: var(--radius-md, 8px);
  background: var(--neutral-50, #fafafa);
}
.progress-blocked-title {
  margin: 0 0 8px;
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--neutral-800);
}
.progress-blocked-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-3) var(--space-4);
  font-size: 0.82rem;
}
.progress-blocked-link {
  color: var(--neutral-700);
  text-decoration: none;
}
.progress-blocked-link:hover {
  text-decoration: underline;
}
.progress-blocked-count {
  font-weight: 600;
  color: var(--neutral-900);
}
.progress-forecast-title {
  margin: 0 0 var(--space-3);
  font-size: 0.92rem;
  font-weight: 600;
  color: var(--neutral-800);
}
.progress-ready-link,
.progress-wave-link {
  display: inline-block;
  margin-top: var(--space-2);
  font-size: 0.78rem;
}
.progress-sparkline {
  display: flex;
  align-items: flex-end;
  gap: 2px;
  height: 24px;
  margin-top: 8px;
}
.progress-spark-bar {
  flex: 1;
  min-width: 3px;
  max-width: 8px;
  background: var(--accent-indigo);
  border-radius: 2px 2px 0 0;
  opacity: 0.65;
}
.progress-metrics {
  grid-template-columns: repeat(4, 1fr);
  border-top: 1px solid var(--neutral-200);
  padding-top: 16px;
}
@media (max-width: 900px) {
  .progress-metrics {
    grid-template-columns: repeat(2, 1fr);
  }
}
@media (max-width: 520px) {
  .progress-metrics {
    grid-template-columns: 1fr;
  }
}
.metric-value-emerald { color: var(--accent-emerald); }
.metric-value-amber { color: var(--accent-amber); }

/* #675 / notification center redesign --------------------------------------- */

.app-topbar {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: var(--space-2);
  padding: var(--space-2) var(--space-6);
  border-bottom: 1px solid var(--neutral-200);
  background: var(--neutral-0);
}

.app-topbar-spacer { flex: 1; }

.shell--auth .app-topbar { display: none; }

@media (max-width: 900px) {
  .app-topbar { padding: var(--space-2) var(--space-4); }
}

.topbar-alerts-host,
.active-runs-tray-host {
  flex: 0 1 auto;
  min-width: 0;
  max-width: min(520px, 45vw);
}

.nc-host {
  position: relative;
}

.nc-bell-slot {
  flex-shrink: 0;
  display: flex;
  align-items: stretch;
}

.topbar-alerts-actions {
  position: relative;
  flex-shrink: 0;
  display: flex;
  align-items: stretch;
}

.nc-panel-slot {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.nc-panel-slot .nc-panel {
  pointer-events: auto;
}

.nc-bell-btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  padding: 0;
  border: 1px solid transparent;
  border-radius: var(--radius-md);
  background: transparent;
  color: var(--neutral-500);
  cursor: pointer;
  font: inherit;
}

.topbar-alerts .nc-bell-btn {
  width: auto;
  height: auto;
  padding: 0.35rem 0.65rem;
  border: 0;
  border-radius: 0 var(--radius-md) var(--radius-md) 0;
  background: transparent;
}

.topbar-alerts--bell-only .nc-bell-btn {
  border-radius: var(--radius-md);
}

.nc-bell-btn:hover,
.nc-bell-btn[aria-expanded="true"] {
  background: var(--neutral-100);
  border-color: var(--neutral-200);
  color: var(--neutral-800);
}

.topbar-alerts .nc-bell-btn:hover,
.topbar-alerts .nc-bell-btn[aria-expanded="true"] {
  border-color: transparent;
}

.nc-badge {
  position: absolute;
  top: 2px;
  right: 2px;
  min-width: 16px;
  height: 16px;
  padding: 0 var(--space-1);
  border-radius: 999px;
  background: var(--danger);
  color: var(--neutral-0);
  font-size: 10px;
  font-weight: 700;
  line-height: 16px;
  text-align: center;
  pointer-events: none;
}

.nc-panel {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  z-index: 900;
  width: 360px;
  max-width: calc(100vw - 24px);
  max-height: 480px;
  display: flex;
  flex-direction: column;
  background: var(--neutral-0);
  border: 1px solid var(--neutral-200);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-md);
  overflow: hidden;
  transform-origin: top right;
  animation: nc-panel-in var(--duration-base, 160ms) var(--ease-standard, ease) both;
}

.nc-panel[hidden] { display: none; }

@keyframes nc-panel-in {
  from { opacity: 0; transform: translateY(-4px) scale(0.98); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}

.nc-panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-3) var(--space-3) var(--space-2);
  border-bottom: 1px solid var(--neutral-100);
  flex-shrink: 0;
}

.nc-panel-title {
  font-size: var(--fs-sm);
  font-weight: var(--fw-semibold);
  color: var(--neutral-800);
}

.nc-panel-actions {
  display: flex;
  gap: 8px;
}

.nc-action-link {
  font-size: 11px;
  color: var(--neutral-500);
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.nc-action-link:hover:not(:disabled) {
  color: var(--neutral-800);
}

.nc-action-link:disabled {
  opacity: 0.4;
  cursor: default;
  text-decoration: none;
}

.nc-tabs {
  display: flex;
  gap: 0;
  padding: var(--space-2) var(--space-3) 0;
  border-bottom: 1px solid var(--neutral-100);
  flex-shrink: 0;
}

.nc-tab {
  padding: var(--space-1) var(--space-3);
  font-size: 12px;
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  cursor: pointer;
  color: var(--neutral-500);
  margin-bottom: -1px;
}

.nc-tab:hover { color: var(--neutral-800); }

.nc-tab--active {
  color: var(--brand-primary);
  border-bottom-color: var(--brand-primary);
  font-weight: var(--fw-medium);
}

.nc-list {
  flex: 1;
  overflow-y: auto;
  margin: 0;
  padding: 4px 0;
  list-style: none;
}

.nc-empty,
.nc-loading {
  padding: 24px 16px;
  text-align: center;
  font-size: var(--fs-sm);
  color: var(--neutral-400);
}

.nc-empty--error { color: var(--danger-text); }

.nc-item {
  display: flex;
  align-items: stretch;
  border-left: 3px solid transparent;
  font-size: var(--fs-sm);
  transition: opacity 160ms var(--ease-standard, ease), transform 160ms var(--ease-standard, ease);
}

.nc-item + .nc-item { border-top: 1px solid var(--neutral-100); }

.nc-item--info    { border-left-color: var(--info); }
.nc-item--success { border-left-color: var(--success); }
.nc-item--warn    { border-left-color: var(--warning); }
.nc-item--error   { border-left-color: var(--danger); background: var(--danger-bg); }

.nc-item--dismissing { opacity: 0; transform: translateX(8px); }

.nc-item-main {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  flex: 1;
  min-width: 0;
  padding: 8px 4px 8px 12px;
  background: none;
  border: none;
  text-align: left;
  font: inherit;
  color: inherit;
  cursor: pointer;
  text-decoration: none;
}

.nc-item-main:hover { background: var(--neutral-50); }

.nc-item-dot {
  flex-shrink: 0;
  width: 6px;
  height: 6px;
  border-radius: 999px;
  margin-top: var(--space-1);
  background: transparent;
}

.nc-item--unread .nc-item-dot { background: var(--brand-primary); }

.nc-item-body {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
  flex: 1;
}

.nc-item-msg {
  min-width: 0;
  word-wrap: break-word;
  color: var(--neutral-800);
  line-height: 1.4;
}

.nc-item--unread .nc-item-msg { font-weight: var(--fw-medium); }

.nc-item-time {
  font-size: 11px;
  color: var(--neutral-400);
  white-space: nowrap;
}

.nc-item-dismiss {
  flex-shrink: 0;
  width: 28px;
  border: none;
  background: none;
  color: var(--neutral-400);
  font-size: 16px;
  line-height: 1;
  cursor: pointer;
}

.nc-item-dismiss:hover { color: var(--neutral-700); }

@media (max-width: 899px) {
  .nc-panel {
    position: fixed;
    top: 56px;
    left: 8px;
    right: 8px;
    width: auto;
    max-width: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  .nc-panel { animation: none; }
  .nc-item { transition: none; }
}

/* Notification preferences (account page) */
.nc-prefs-list {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

.nc-pref-row {
  display: flex;
  align-items: flex-start;
  gap: var(--space-3);
  padding: var(--space-3);
  border: 1px solid var(--neutral-200);
  border-radius: var(--radius-md);
  cursor: pointer;
}

.nc-pref-row:hover { background: var(--neutral-50); }

.nc-pref-row input { margin-top: 3px; }

.nc-pref-text { display: flex; flex-direction: column; gap: 2px; }

.nc-pref-label { font-weight: var(--fw-medium); color: var(--neutral-800); }

.nc-pref-desc { font-size: var(--fs-sm); color: var(--neutral-500); }

/* Overnight review tile ------------------------------------------ */
.overnight-review-tile {
  margin: 0 0 var(--space-6);
  padding: var(--space-4) var(--space-5);
  background: var(--neutral-50);
  border: 1px solid var(--neutral-200);
  border-radius: 8px;
}

.overnight-review-tile-title {
  margin: 0 0 var(--space-3);
  font-size: var(--fs-sm);
  font-weight: var(--fw-semibold);
  color: var(--neutral-700);
}

.overnight-review-tile-window {
  font-weight: var(--fw-normal);
}

.overnight-review-tile-stats {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-4);
}

.overnight-stat {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 72px;
}

.overnight-stat-label {
  font-size: var(--fs-xs);
  color: var(--neutral-500);
  font-weight: var(--fw-medium);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.overnight-stat-value {
  font-size: var(--fs-lg);
  font-weight: var(--fw-semibold);
  color: var(--neutral-800);
  font-variant-numeric: tabular-nums;
}

.overnight-stat--succeeded .overnight-stat-value { color: var(--success-text); }
.overnight-stat--failed .overnight-stat-value    { color: var(--danger-text); }

.overnight-review-tile--danger {
  background: var(--danger-bg);
  border-color: rgba(185, 28, 28, 0.22);
}

.overnight-review-tile--danger .overnight-review-tile-title {
  color: var(--danger-text);
}

.overnight-review-tile-alert {
  display: flex;
  align-items: flex-start;
  gap: var(--space-2);
  margin: 0 0 var(--space-4);
  color: var(--danger-text);
}

.overnight-review-tile-alert-icon {
  font-size: 14px;
  flex-shrink: 0;
  margin-top: 2px;
}

.overnight-review-tile-alert-body {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

.overnight-review-tile-alert-title {
  margin: 0;
  font-size: var(--fs-sm);
  font-weight: var(--fw-semibold);
  color: var(--danger-text);
}

.overnight-review-tile-alert-desc {
  margin: 0;
  font-size: var(--fs-sm);
  color: var(--danger-text);
}

.overnight-review-tile-alert-link {
  display: inline-block;
  font-size: var(--fs-sm);
  font-weight: var(--fw-semibold);
  color: var(--danger-text);
  text-decoration: underline;
}

.overnight-review-tile-alert-link:hover {
  opacity: 0.8;
  text-decoration: none;
}

.overnight-review-tile-all-clear {
  margin: 0 0 var(--space-3);
  font-size: var(--fs-sm);
}

.overnight-review-tile--empty .overnight-review-tile-empty-state {
  margin: 0;
  font-size: var(--fs-sm);
}

/* Live log console (SSE) on an in-flight run */
.run-console {
  margin-bottom: var(--space-5);
  border: 1px solid var(--brand-sidebar);
  border-radius: var(--radius-md);
  overflow: hidden;
  background: var(--brand-sidebar);
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.25);
}

.run-console-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
  padding: var(--space-2) var(--space-3);
  background: var(--brand-sidebar-hover);
  color: #E2E8F0;
  font-size: var(--fs-sm);
}

.run-console-title {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  font-weight: var(--fw-semibold);
  letter-spacing: var(--tracking-wide);
  text-transform: uppercase;
  font-size: var(--fs-xs);
}

.run-console-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--success);
  box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.6);
  animation: run-console-pulse 1.6s ease-out infinite;
}

.run-console--ended .run-console-dot {
  background: var(--neutral-badge-text);
  animation: none;
  box-shadow: none;
}

@keyframes run-console-pulse {
  0%   { box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.6); }
  70%  { box-shadow: 0 0 0 6px rgba(16, 185, 129, 0); }
  100% { box-shadow: 0 0 0 0 rgba(16, 185, 129, 0); }
}

@media (prefers-reduced-motion: reduce) {
  .run-console-dot { animation: none; }
}

.run-console-actions {
  display: inline-flex;
  align-items: center;
  gap: var(--space-3);
}

.run-console-autoscroll {
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
  color: #CBD5E1;
  cursor: pointer;
  user-select: none;
}

.run-console-clear {
  appearance: none;
  border: 1px solid rgba(203, 213, 225, 0.3);
  background: transparent;
  color: #CBD5E1;
  border-radius: var(--radius-sm);
  padding: 2px var(--space-2);
  font-size: var(--fs-xs);
  cursor: pointer;
}

.run-console-clear:hover {
  background: rgba(203, 213, 225, 0.12);
}

.run-console-stream {
  display: flex;
  flex-direction: column;
  min-height: 200px;
  max-height: 360px;
  overflow: auto;
  padding: var(--space-2) var(--space-3);
  font-family: var(--font-mono);
  font-size: var(--fs-xs);
  line-height: 1.6;
  color: #E2E8F0;
}

.run-console-stream--has-lines {
  min-height: 0;
}

.run-console-empty {
  display: flex;
  flex: 1 1 auto;
  flex-direction: column;
  justify-content: center;
  gap: var(--space-2);
  min-height: 168px;
  padding: var(--space-4) var(--space-2);
  text-align: center;
}

.run-console-empty[hidden] {
  display: none;
}

.run-console-empty-title {
  margin: 0;
  font-size: var(--fs-sm);
  font-weight: var(--fw-semibold);
  color: #CBD5E1;
}

.run-console-empty-desc {
  margin: 0;
  font-size: var(--fs-xs);
  color: #94A3B8;
  max-width: 36ch;
  margin-inline: auto;
}

.run-console-empty-skeleton {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  margin-top: var(--space-3);
  text-align: left;
}

.run-console-empty-skeleton-row {
  display: flex;
  align-items: center;
  gap: var(--space-2);
}

.run-console-empty-skeleton-time {
  flex: 0 0 52px;
  height: 10px;
  border-radius: var(--radius-sm);
  background: linear-gradient(90deg, rgba(148, 163, 184, 0.18) 25%, rgba(148, 163, 184, 0.32) 50%, rgba(148, 163, 184, 0.18) 75%);
  background-size: 200% 100%;
  animation: run-console-empty-shimmer 1.4s infinite;
}

.run-console-empty-skeleton-pill {
  flex: 0 0 72px;
  height: 14px;
  border-radius: 999px;
  background: linear-gradient(90deg, rgba(148, 163, 184, 0.14) 25%, rgba(148, 163, 184, 0.28) 50%, rgba(148, 163, 184, 0.14) 75%);
  background-size: 200% 100%;
  animation: run-console-empty-shimmer 1.4s infinite;
}

.run-console-empty-skeleton-msg {
  flex: 1 1 auto;
  height: 10px;
  min-width: 0;
  border-radius: var(--radius-sm);
  background: linear-gradient(90deg, rgba(148, 163, 184, 0.12) 25%, rgba(148, 163, 184, 0.24) 50%, rgba(148, 163, 184, 0.12) 75%);
  background-size: 200% 100%;
  animation: run-console-empty-shimmer 1.4s infinite;
}

@keyframes run-console-empty-shimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

@media (prefers-reduced-motion: reduce) {
  .run-console-empty-skeleton-time,
  .run-console-empty-skeleton-pill,
  .run-console-empty-skeleton-msg {
    animation: none;
    background: rgba(148, 163, 184, 0.22);
  }
}

.run-console-line {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: var(--space-2);
  padding: 1px 0;
  border-bottom: 1px solid rgba(148, 163, 184, 0.08);
  white-space: pre-wrap;
  word-break: break-word;
}

.run-console-time {
  color: #94A3B8;
  flex: 0 0 auto;
}

.run-console-pill {
  flex: 0 0 auto;
  font-size: 10px;
}

.run-console-message {
  flex: 1 1 240px;
  min-width: 0;
}

.run-console-payload {
  flex: 1 1 100%;
  margin: 2px 0 4px 0;
  padding: var(--space-2);
  background: rgba(2, 6, 23, 0.5);
  border-radius: var(--radius-sm);
  overflow: auto;
  color: #CBD5E1;
}

/* ---------------------------------------------------------------------------
   Dedicated issue page (`/:owner/:name/issue-<N>`)
   --------------------------------------------------------------------------- */
.issue-detail-page {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
}

.issue-nav-bar {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  flex-wrap: wrap;
}

.issue-nav-pos {
  flex: 1;
  text-align: center;
  font-size: 13px;
  color: var(--neutral-500);
  white-space: nowrap;
}

.issue-nav-prev,
.issue-nav-next {
  min-width: 80px;
}

.issue-summary-strip {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: var(--space-3);
  padding: var(--space-3) var(--space-4);
  background: var(--neutral-50, #f8fafc);
  border: 1px solid var(--neutral-200, #e2e8f0);
  border-radius: var(--radius-md);
}

.issue-summary-stat {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.issue-summary-stat-label {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--neutral-500);
}

.issue-summary-stat-value {
  font-size: 15px;
  line-height: 1.35;
}

.issue-summary-stat-value strong {
  font-weight: 600;
  color: var(--neutral-900);
}

.issue-summary-stat-hint {
  font-size: 12px;
  color: var(--neutral-500);
}

.issue-summary-stat-link {
  color: inherit;
  text-decoration: none;
}

.issue-summary-stat-link:hover {
  text-decoration: underline;
}

.issue-context-hint {
  margin: calc(-1 * var(--space-2)) 0 0;
  padding: var(--space-2) var(--space-3);
  font-size: 14px;
  color: var(--neutral-700);
  background: var(--neutral-50, #f8fafc);
  border-left: 3px solid var(--color-primary, #3b82f6);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
}

.issue-detail-layout {
  display: grid;
  grid-template-columns: minmax(220px, 280px) minmax(0, 1fr);
  gap: var(--space-4);
  align-items: start;
}

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

.issue-meta-section {
  position: sticky;
  top: var(--space-3);
}

.issue-meta-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-2);
  flex-wrap: wrap;
  margin-bottom: var(--space-2);
}

.issue-meta-title {
  margin: 0;
}

.issue-meta-grid .kv-grid {
  font-size: 13px;
}

.issue-subtitle-sep {
  margin: 0 var(--space-2);
  color: var(--neutral-400);
}

.issue-head-actions {
  flex-wrap: wrap;
}

.issue-intel-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: var(--space-4);
  margin-bottom: var(--space-4);
}

.issue-intel-card {
  height: 100%;
}

.issue-intel-empty {
  margin-bottom: var(--space-4);
}

.section-title-count {
  font-size: 0.85em;
  font-weight: 500;
  color: var(--neutral-500);
}

.issue-header-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--space-3);
  flex-wrap: wrap;
}
.issue-header-title {
  display: flex;
  align-items: baseline;
  gap: var(--space-2);
  flex-wrap: wrap;
}
.issue-header-number {
  color: var(--neutral-500);
  font-variant-numeric: tabular-nums;
}
.issue-header-badges {
  display: flex;
  align-items: center;
  gap: var(--space-2);
}
.issue-header-actions {
  display: flex;
  gap: var(--space-2);
  margin: var(--space-3) 0;
}
.issue-description {
  margin-top: var(--space-3);
}
.issue-description > summary {
  cursor: pointer;
  font-weight: 600;
  color: var(--neutral-700);
  margin-bottom: var(--space-2);
}
.issue-body {
  word-break: break-word;
  margin: 0;
  padding: var(--space-3);
  background: var(--neutral-50, #f8fafc);
  border: 1px solid var(--neutral-200, #e2e8f0);
  border-radius: var(--radius-md);
  font: inherit;
}
.markdown-body > :first-child {
  margin-top: 0;
}
.markdown-body > :last-child {
  margin-bottom: 0;
}
.markdown-body h1,
.markdown-body h2,
.markdown-body h3,
.markdown-body h4,
.markdown-body h5,
.markdown-body h6 {
  margin: var(--space-4) 0 var(--space-2);
  font-weight: 600;
  line-height: 1.3;
}
.markdown-body h1 {
  font-size: 1.4em;
}
.markdown-body h2 {
  font-size: 1.25em;
}
.markdown-body h3 {
  font-size: 1.1em;
}
.markdown-body h4,
.markdown-body h5,
.markdown-body h6 {
  font-size: 1em;
}
.markdown-body p {
  margin: 0 0 var(--space-3);
  line-height: 1.5;
}
.markdown-body ul,
.markdown-body ol {
  margin: 0 0 var(--space-3);
  padding-left: var(--space-5);
}
.markdown-body li {
  margin: 2px 0;
  line-height: 1.5;
}
.markdown-body ul.md-task-list {
  list-style: none;
  padding-left: var(--space-2);
}
.markdown-body .task-list-item {
  display: flex;
  align-items: flex-start;
  gap: var(--space-2);
}
.markdown-body .task-list-item input {
  margin-top: 0.25em;
}
.markdown-body code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.9em;
  padding: 0.1em 0.35em;
  background: var(--neutral-100, #f1f5f9);
  border: 1px solid var(--neutral-200, #e2e8f0);
  border-radius: var(--radius-sm, 4px);
}
.markdown-body pre.md-code {
  margin: 0 0 var(--space-3);
  padding: var(--space-3);
  overflow-x: auto;
  background: var(--neutral-100, #f1f5f9);
  border: 1px solid var(--neutral-200, #e2e8f0);
  border-radius: var(--radius-md);
}
.markdown-body pre.md-code code {
  padding: 0;
  background: none;
  border: none;
}
.markdown-body blockquote {
  margin: 0 0 var(--space-3);
  padding: var(--space-1) var(--space-3);
  color: var(--neutral-600, #475569);
  border-left: 3px solid var(--neutral-300, #cbd5e1);
}
.markdown-body a {
  color: var(--brand-primary);
}
.markdown-body hr {
  margin: var(--space-3) 0;
  border: none;
  border-top: 1px solid var(--neutral-200, #e2e8f0);
}
.issue-label-pill {
  font-size: 12px;
}
.issue-section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
}
.issue-pf-summary {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  flex-wrap: wrap;
  margin: var(--space-2) 0;
}
.issue-pf-axes {
  display: flex;
  gap: var(--space-2);
  flex-wrap: wrap;
}
.risk-axis-pill {
  font-size: 12px;
  padding: var(--space-1) var(--space-2);
  border-radius: var(--radius-sm);
  background: var(--neutral-100, #f1f5f9);
}
.issue-pf-list-title,
.issue-be-affected .issue-pf-list-title {
  font-weight: 600;
  margin: var(--space-2) 0 var(--space-1);
}
.issue-be-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: var(--space-2) var(--space-4);
  margin: var(--space-2) 0;
}
.issue-be-k {
  color: var(--neutral-500);
  margin-right: var(--space-2);
}
.issue-internal-link {
  font-variant-numeric: tabular-nums;
  font-weight: 600;
}
.issue-runs-table {
  width: 100%;
}

/* Keyboard shortcuts modal */
.kb-groups {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
}
.kb-group-label {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--neutral-400, #94a3b8);
  margin-bottom: var(--space-2);
}
.kb-table {
  width: 100%;
  border-collapse: collapse;
}
.kb-table td {
  padding: var(--space-1) 0;
  vertical-align: middle;
}
.kb-table td:first-child {
  width: 80px;
}
.kb-desc {
  color: var(--neutral-700, #334155);
  font-size: 13px;
}
.kb-key {
  display: inline-block;
  font-family: var(--font-mono, "JetBrains Mono", monospace);
  font-size: 12px;
  padding: 2px var(--space-2);
  border-radius: var(--radius-sm);
  background: var(--neutral-100, #f1f5f9);
  border: 1px solid var(--neutral-200, #e2e8f0);
  color: var(--neutral-800, #1e293b);
  white-space: nowrap;
  line-height: 1.4;
}

/* #1931 – budget-policy rule effect preview + inline help */
.policy-preview {
  font-size: 13px;
  color: var(--info-text);
  background: var(--info-bg);
  border: 1px solid var(--info, #3b82f6);
  border-radius: var(--radius-sm);
  padding: var(--space-3) var(--space-4);
  margin: var(--space-4) 0 0;
}
.rule-help {
  display: block;
  font-size: 12px;
  color: var(--neutral-500);
  margin-top: 2px;
  margin-bottom: var(--space-2);
}

/* #721 - global search / command palette (Cmd-K) */
dialog.modal.command-palette {
  width: min(620px, calc(100vw - 32px));
  margin-top: 10vh;
}
.cp-shell {
  display: flex;
  flex-direction: column;
}
.cp-input {
  width: 100%;
  box-sizing: border-box;
  border: none;
  border-bottom: 1px solid var(--neutral-200);
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
  padding: var(--space-4);
  font-size: 15px;
  font-family: inherit;
  color: var(--neutral-800);
  outline: none;
}
.cp-results {
  max-height: min(420px, 55vh);
  overflow-y: auto;
  padding: var(--space-2);
}
.cp-empty {
  margin: 0;
  padding: var(--space-4);
  color: var(--neutral-500);
  font-size: 13px;
}
.cp-group-label {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--neutral-400);
  padding: var(--space-2) var(--space-2) var(--space-1);
}
.cp-group {
  list-style: none;
  margin: 0 0 var(--space-2);
  padding: 0;
}
.cp-item {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: var(--space-2);
  border-radius: var(--radius-md);
  text-decoration: none;
  color: var(--neutral-800);
}
.cp-item:hover {
  background: var(--neutral-50);
}
.cp-item--active,
.cp-item--active:hover {
  background: var(--accent-bg-indigo);
}
.cp-item-label {
  font-size: 14px;
  font-weight: var(--fw-semibold);
}
.cp-item-meta {
  font-size: 12px;
  color: var(--neutral-500);
}
.cp-footer {
  display: flex;
  gap: var(--space-4);
  padding: var(--space-2) var(--space-4);
  border-top: 1px solid var(--neutral-200);
  color: var(--neutral-500);
  font-size: 12px;
}
.cp-footer .kb-key {
  margin-right: 4px;
}
.app-sidebar-search {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  margin-top: var(--space-2);
  padding: var(--space-2) var(--space-2);
  border: 1px solid var(--neutral-200);
  border-radius: var(--radius-md);
  background: var(--neutral-0);
  color: var(--neutral-500);
  font-family: inherit;
  font-size: 13px;
  font-weight: var(--fw-semibold);
  cursor: pointer;
}
.app-sidebar-search:hover {
  color: var(--neutral-700);
  border-color: var(--neutral-300);
}
.app-sidebar-search-kbd {
  margin-left: auto;
  font-size: 11px;
}

/* ----- Preflight page transversal improvements ------------------------------ */

/* Generic link-styled inline button (e.g. "View track record" in the verdict). */
.link-button {
  padding: 0;
  border: 0;
  background: none;
  font: inherit;
  color: var(--brand-primary);
  cursor: pointer;
}

.link-button:hover {
  color: var(--brand-primary-hover);
  text-decoration: underline;
}

/* Conflict/files chips are now buttons that scroll to their detail sections —
   keep the chip look, drop the native button chrome. */
button.verdict-conflict-chip,
button.verdict-files-chip {
  font: inherit;
  text-align: left;
  cursor: pointer;
}

button.verdict-conflict-chip:hover,
button.verdict-files-chip:hover {
  border-color: var(--brand-primary);
}

.verdict-files-chip {
  display: flex;
  flex-direction: row;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  min-height: 100%;
  padding: 8px 12px;
  border: 1px solid var(--neutral-200);
  border-radius: 10px;
  background: var(--neutral-0);
  font-size: 13px;
}

.verdict-files-chip-label {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--neutral-500);
}

.verdict-files-chip-count {
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

/* Coherence warnings (2+) break out into a scannable list. */
.verdict-coherence-warnings summary {
  color: var(--warning-text);
}

.verdict-coherence-warnings-lede {
  margin: var(--space-2) 0 0;
  font-size: 12px;
  color: var(--neutral-500);
}

.coherence-warning-list {
  margin: var(--space-2) 0 0;
  font-size: 13px;
}

/* Cost-range spread callout inside the verdict panel. */
.verdict-panel .verdict-cost-spread {
  margin: 0 20px 10px;
}

.verdict-cost-spread {
  padding: 8px 12px;
  border: 1px solid var(--neutral-200);
  border-left: 3px solid var(--accent-amber);
  border-radius: 8px;
  background: var(--neutral-50);
  font-size: 13px;
}

.verdict-cost-spread-lede {
  margin: 0;
}

.cost-spread-drivers {
  margin: var(--space-2) 0;
  padding-left: 18px;
}

.cost-spread-all-drivers {
  margin-top: 2px;
}

/* Tri-state security touch flags: touched (default warn), cleared, unknown. */
.security-touch-pill--off {
  background: var(--neutral-100);
  color: var(--neutral-500);
}

.security-touch-pill--unknown {
  background: transparent;
  border: 1px dashed var(--neutral-200);
  color: var(--neutral-500);
}

/* In-flight invocation: labelled placeholders for upcoming sections. */
.invocation-pending-row {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  margin-top: var(--space-2);
}

.invocation-pending-label {
  flex: 0 0 110px;
  font-size: 12px;
  font-weight: 600;
  color: var(--neutral-500);
}

.invocation-pending-skeleton {
  flex: 1 1 auto;
  margin-bottom: 0;
}

/* Calibration track record inside the forecast section. */
.calibration-track-record {
  margin-top: var(--space-4);
  padding-top: var(--space-3);
  border-top: 1px solid var(--neutral-100);
}

.calibration-track-record-title {
  margin: 0 0 var(--space-2);
}

.calibration-track-record-subtitle {
  margin: var(--space-3) 0 var(--space-2);
}

.calibration-delta {
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.calibration-delta-low {
  color: var(--success-text);
}

.calibration-delta-medium {
  color: var(--warning-text);
}

.calibration-delta-high {
  color: var(--danger);
}

/* Conflict-risk internals collapsed into a details block on preflight runs. */
.invocation-conflict-details-body {
  padding: var(--space-3) var(--space-4) var(--space-4);
  border: 1px solid var(--neutral-200);
  border-top: 0;
  border-radius: 0 0 8px 8px;
  background: var(--neutral-0);
}

.invocation-conflict-details[open] .invocation-conflict-details-body {
  margin-top: -1px;
}

.invocation-conflict-details-body .section {
  margin-top: 0;
}

/* Likely files grouped by top-level directory when the list is long. */
.likely-files-groups {
  margin: var(--space-2) 0 0;
  padding-left: 0;
  list-style: none;
}

.likely-files-group {
  margin-top: var(--space-2);
}

.likely-files-group-dir code {
  font-weight: 600;
}

.likely-files-group .likely-files-list {
  margin: var(--space-1, 4px) 0 0;
}

/* --------------------------------------------------------------------------
   Meta issue editor modal (issue-editor.mjs)
   Two-pane layout: editable title/body on the left, preflight recommendations
   + AI draft preview on the right. The dialog widens beyond the default modal
   width only when it hosts the editor layout.
   -------------------------------------------------------------------------- */

dialog.modal:has(.issue-editor-layout) {
  width: min(980px, calc(100vw - 32px));
}

dialog.modal:has(.issue-editor-layout) .modal-body {
  overflow: visible;
}

.issue-editor-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr);
  gap: var(--space-5);
  align-items: start;
}

.issue-editor-main {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.issue-editor-label {
  font-size: var(--fs-xs);
  font-weight: var(--fw-semibold);
  color: var(--neutral-600);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin: var(--space-3) 0 var(--space-1);
}

.issue-editor-main .issue-editor-label:first-child {
  margin-top: 0;
}

.issue-editor-main input[type="text"],
.issue-editor-main textarea {
  width: 100%;
  border: 1px solid var(--neutral-300);
  border-radius: var(--radius-md);
  background: var(--neutral-0);
  color: var(--neutral-800);
  padding: var(--space-2) var(--space-3);
  font-size: var(--fs-sm);
}

.issue-editor-main input[type="text"]:focus,
.issue-editor-main textarea:focus {
  outline: 2px solid var(--brand-primary);
  outline-offset: -1px;
}

.issue-editor-main textarea {
  font-family: var(--font-mono);
  line-height: 1.55;
  resize: vertical;
  min-height: 340px;
}

.issue-editor-provider-note {
  margin: var(--space-2) 0 0;
}

.issue-editor-error {
  background: var(--danger-bg);
  color: var(--danger-text);
  border-radius: var(--radius-md);
  padding: var(--space-2) var(--space-3);
  font-size: var(--fs-sm);
  margin-bottom: var(--space-3);
}

.issue-editor-recs {
  background: var(--neutral-50);
  border: 1px solid var(--neutral-200);
  border-radius: var(--radius-md);
  padding: var(--space-3) var(--space-4);
  min-width: 0;
}

.issue-editor-recs-title {
  margin: 0 0 var(--space-2);
  font-size: var(--fs-sm);
  font-weight: var(--fw-semibold);
  color: var(--neutral-900);
}

.issue-editor-rec-section {
  padding-bottom: var(--space-3);
  margin-bottom: var(--space-3);
  border-bottom: 1px dashed var(--neutral-200);
}

.issue-editor-rec-list {
  list-style: none;
  margin: 0 0 var(--space-2);
  padding: 0;
}

.issue-editor-rec-item {
  display: flex;
  gap: var(--space-2);
  align-items: flex-start;
  padding: var(--space-1) 0;
  font-size: var(--fs-sm);
  color: var(--neutral-700);
}

.issue-editor-rec-item .btn {
  flex: 0 0 auto;
  line-height: 1.2;
}

.issue-editor-ai {
  margin-top: var(--space-2);
}

.issue-editor-draft-preview {
  margin-top: var(--space-3);
  border: 1px solid var(--neutral-200);
  border-radius: var(--radius-md);
  background: var(--neutral-0);
}

.issue-editor-draft-preview > summary {
  padding: var(--space-2) var(--space-3);
  font-size: var(--fs-sm);
  font-weight: var(--fw-semibold);
  color: var(--neutral-600);
  cursor: pointer;
}

.issue-editor-draft-body {
  display: block;
  width: calc(100% - 2 * var(--space-3));
  margin: 0 var(--space-3);
  font-family: var(--font-mono);
  font-size: var(--fs-xs);
  line-height: 1.5;
  border: 1px solid var(--neutral-200);
  border-radius: var(--radius-sm);
  background: var(--neutral-25);
  color: var(--neutral-700);
  padding: var(--space-2);
  resize: vertical;
}

.issue-editor-draft-meta {
  padding: var(--space-2) var(--space-3) 0;
}

.issue-editor-draft-actions {
  display: flex;
  gap: var(--space-2);
  padding: var(--space-2) var(--space-3) var(--space-3);
}

@media (max-width: 860px) {
  .issue-editor-layout {
    grid-template-columns: 1fr;
  }
}

/* Roles — permission badges in the table */
.perm-badges {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 0.25rem;
  align-items: center;
}

.badge-more {
  font-style: italic;
  cursor: default;
}

/* Audit log — structured Details column */
.audit-details-cell {
  max-width: 340px;
  min-width: 0;
}

.audit-details {
  font-size: var(--fs-sm);
}

.audit-details-summary {
  cursor: pointer;
  list-style: none;
  line-height: 1.4;
}

.audit-details-summary::-webkit-details-marker {
  display: none;
}

.audit-details[open] .audit-details-summary::before {
  content: "▾ ";
  color: var(--neutral-400);
}

.audit-details:not([open]) .audit-details-summary::before {
  content: "▸ ";
  color: var(--neutral-400);
}

.audit-raw-json {
  margin: var(--space-1) 0 0;
  padding: var(--space-2) var(--space-3);
  background: var(--neutral-50, #f8fafc);
  border: 1px solid var(--neutral-200, #e2e8f0);
  border-radius: 4px;
  font-size: 0.75em;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  max-height: 180px;
  overflow-y: auto;
}

/* Blocked issues section (#2162) */
.blocked-issues-section {
  margin-top: var(--space-4);
  border: 1px solid var(--neutral-200, #e2e8f0);
  border-radius: 6px;
  background: var(--neutral-50, #f8fafc);
}

.blocked-issues-summary {
  padding: var(--space-3) var(--space-4);
  cursor: pointer;
  list-style: none;
  font-size: var(--fs-sm);
  font-weight: 500;
  color: var(--neutral-600, #475569);
  user-select: none;
}

.blocked-issues-summary::-webkit-details-marker {
  display: none;
}

.blocked-issues-section[open] .blocked-issues-summary::before {
  content: "▾ ";
  color: var(--neutral-400);
}

.blocked-issues-section:not([open]) .blocked-issues-summary::before {
  content: "▸ ";
  color: var(--neutral-400);
}

.blocked-issues-list {
  padding: 0 var(--space-4) var(--space-3);
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

.blocked-issue-row {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: var(--space-2);
  font-size: var(--fs-sm);
}

.blocked-issue-link {
  color: var(--neutral-700, #334155);
  text-decoration: none;
}

.blocked-issue-link:hover {
  text-decoration: underline;
}

.blocked-by-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.125rem 0.5rem;
  background: var(--warning-50, #fffbeb);
  border: 1px solid var(--warning-200, #fde68a);
  border-radius: 99px;
  font-size: 0.75em;
  color: var(--warning-700, #b45309);
  white-space: nowrap;
}

.blocker-link {
  color: inherit;
  font-weight: 500;
  text-decoration: none;
}

.blocker-link:hover {
  text-decoration: underline;
}

/* Global active runs — tray, sidebar badge, /runs page --------------------- */

.runs-nav-badge {
  display: inline-flex;
  align-items: center;
  margin-left: 0.35rem;
}

.runs-nav-badge-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 1.125rem;
  height: 1.125rem;
  padding: 0 0.3rem;
  border-radius: 999px;
  background: var(--accent-emerald, #059669);
  color: var(--neutral-0);
  font-size: 0.65rem;
  font-weight: 600;
  line-height: 1;
}

.topbar-alerts {
  position: relative;
  border: 1px solid var(--neutral-200);
  border-radius: var(--radius-md);
  background: var(--neutral-50);
  overflow: visible;
}

.active-runs-tray-bar {
  display: flex;
  align-items: stretch;
  min-height: 0;
}

.active-runs-tray-runs {
  flex: 1 1 auto;
  min-width: 0;
}

.active-runs-tray-divider {
  width: 1px;
  align-self: stretch;
  margin: 0.35rem 0;
  background: var(--neutral-200);
  flex-shrink: 0;
}

.active-runs-tray-toggle {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  width: 100%;
  padding: 0.35rem 0.65rem;
  border: 0;
  background: transparent;
  font: inherit;
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--neutral-800);
  cursor: pointer;
  border-radius: var(--radius-md) 0 0 var(--radius-md);
}

.topbar-alerts--bell-only .active-runs-tray-bar {
  justify-content: center;
}

.active-runs-tray-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent-emerald, #059669);
  flex-shrink: 0;
}

@media (prefers-reduced-motion: no-preference) {
  .active-runs-tray-dot {
    animation: status-dot-pulse 1.8s ease-in-out infinite;
  }
}

.active-runs-tray-chevron {
  margin-left: auto;
  transition: transform 0.15s ease;
}

.active-runs-tray.is-expanded .active-runs-tray-chevron {
  transform: rotate(180deg);
}

.active-runs-tray-panel {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  right: 0;
  z-index: 900;
  padding: 0.35rem 0.5rem 0.5rem;
  background: var(--neutral-0);
  border: 1px solid var(--neutral-200);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-md);
  overflow: hidden;
}

.active-runs-tray-panel[hidden] {
  display: none;
}

.active-runs-tray-list {
  list-style: none;
  margin: 0;
  padding: 0;
  max-height: 220px;
  overflow: auto;
}

.active-runs-tray-row-link {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) auto minmax(0, 1fr) auto;
  gap: 0.35rem 0.5rem;
  align-items: center;
  padding: 0.35rem 0.25rem;
  border-radius: var(--radius-sm);
  color: inherit;
  text-decoration: none;
  font-size: 0.8125rem;
}

.active-runs-tray-row-link:hover {
  background: var(--neutral-100);
}

.active-runs-tray-row-elapsed {
  color: var(--neutral-500);
  font-size: 0.75rem;
  white-space: nowrap;
}

.active-runs-tray-view-all {
  display: inline-block;
  margin-top: 0.35rem;
  font-size: 0.8125rem;
}

.view-tabs.global-runs-tabs {
  display: flex;
  gap: 0.35rem;
  margin-bottom: var(--space-3);
}

.view-tab {
  display: inline-flex;
  align-items: center;
  padding: 0.35rem 0.75rem;
  border-radius: var(--radius-md);
  border: 1px solid var(--neutral-200);
  background: var(--neutral-0);
  color: var(--neutral-700);
  text-decoration: none;
  font-size: 0.8125rem;
  font-weight: 500;
}

.view-tab.is-active,
.view-tab[aria-current="page"] {
  border-color: var(--accent-blue, #2563eb);
  background: var(--accent-blue-50, #eff6ff);
  color: var(--accent-blue, #2563eb);
}

.global-runs-filters {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-3);
  margin-bottom: var(--space-3);
}

.global-runs-filter {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  min-width: 10rem;
}

.global-runs-filter-label {
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--neutral-600);
}
