/* ==========================================================================
   GitHub Trust Profile Styles
   ========================================================================== */

/* ==========================================================================
   Scanning Progress
   ========================================================================== */

.gh-scan-container {
  max-width: 520px;
  margin: 80px auto;
  padding: 0 20px;
  text-align: center;
}

.gh-scan-header {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  margin-bottom: 40px;
}

.gh-scan-icon {
  color: var(--muted);
}

.gh-scan-name {
  font-size: 18px;
  font-weight: 600;
  font-family: var(--mono);
}

.gh-scan-status {
  font-size: 20px;
  font-weight: 600;
  margin: 0 0 32px;
  color: var(--text);
}

/* Progress timeline */
.gh-scan-timeline {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0;
  margin: 0 auto 32px;
  max-width: 300px;
}

.gh-scan-stage {
  display: flex;
  gap: 14px;
  align-items: flex-start;
  opacity: 0.35;
  transition: opacity 0.4s ease;
}

.gh-scan-stage.active {
  opacity: 1;
}

.gh-scan-stage.completed {
  opacity: 0.6;
}

.stage-indicator {
  display: flex;
  flex-direction: column;
  align-items: center;
  min-width: 16px;
}

.stage-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--border);
  transition: background 0.4s ease, box-shadow 0.4s ease;
}

.gh-scan-stage.active .stage-dot {
  background: var(--info);
  box-shadow: 0 0 8px rgba(100, 181, 255, 0.5);
}

.gh-scan-stage.completed .stage-dot {
  background: var(--good);
}

.stage-line {
  width: 2px;
  height: 24px;
  background: var(--border);
  transition: background 0.4s ease;
}

.gh-scan-stage.completed .stage-line {
  background: var(--good);
}

.stage-content {
  padding-bottom: 16px;
}

.stage-label {
  font-size: 14px;
  color: var(--muted);
  transition: color 0.3s ease;
}

.gh-scan-stage.active .stage-label {
  color: var(--text);
  font-weight: 500;
}

/* Dynamic facts */
.gh-scan-facts {
  min-height: 60px;
  margin-bottom: 24px;
}

.gh-scan-fact {
  font-size: 13px;
  color: var(--info);
  margin: 6px 0;
  font-family: var(--mono);
}

.gh-scan-fact.fade-in {
  animation: fadeIn 0.5s ease;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Subtle progress bar */
.gh-scan-progress {
  max-width: 400px;
  height: 3px;
  background: var(--border);
  border-radius: 2px;
  margin: 0 auto;
  overflow: hidden;
}

.gh-scan-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--info), var(--good));
  border-radius: 2px;
  transition: width 0.6s ease;
}

/* Slow-scan prompt */
.gh-scan-slow {
  margin-top: 32px;
  padding: 20px;
  background: rgba(255,255,255,0.03);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  animation: fadeIn 0.4s ease;
}

.gh-scan-slow-message {
  margin: 0 0 16px;
  font-size: 14px;
  color: var(--muted);
}

.gh-scan-notify-btn {
  display: inline-block;
  padding: 10px 18px;
  font: inherit;
  font-size: 14px;
  font-weight: 600;
  color: var(--bg, #0b0f17);
  background: var(--info);
  border: 0;
  border-radius: var(--radius);
  cursor: pointer;
  transition: opacity 0.15s ease;
}

.gh-scan-notify-btn:hover {
  opacity: 0.9;
}

.gh-scan-notify-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.gh-scan-notify-btn[hidden] {
  display: none;
}

.gh-scan-notify-status {
  margin: 12px 0 0;
  font-size: 13px;
  color: var(--muted);
}

/* ==========================================================================
   Error State
   ========================================================================== */

.gh-error-container {
  max-width: 520px;
  margin: 80px auto;
  padding: 0 20px;
}

.gh-error-card {
  text-align: center;
  padding: 48px 32px;
  background: rgba(255,255,255,0.03);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.gh-error-icon {
  font-size: 48px;
  font-weight: 700;
  color: var(--bad);
  margin-bottom: 16px;
}

.gh-error-card h2 {
  font-size: 18px;
  margin: 0 0 12px;
}

.gh-error-card p {
  margin: 0 0 24px;
}

.gh-error-actions {
  display: flex;
  gap: 12px;
  justify-content: center;
}

/* ==========================================================================
   Buttons
   ========================================================================== */

.gh-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 500;
  text-decoration: none;
  border: none;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease;
  font-family: var(--sans);
  white-space: nowrap;
}

.gh-btn-primary {
  background: var(--info);
  color: #0b0f19;
}

.gh-btn-primary:hover {
  background: #85c8ff;
}

.gh-btn-secondary {
  background: rgba(255,255,255,0.06);
  color: var(--text);
  border: 1px solid var(--border);
}

.gh-btn-secondary:hover {
  background: rgba(255,255,255,0.10);
  border-color: rgba(255,255,255,0.18);
}

/* ==========================================================================
   Hero / Repo Header
   ========================================================================== */

.gh-hero {
  padding: 24px 0 20px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 24px;
}

.gh-hero-main {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  flex-wrap: wrap;
}

.gh-hero-identity {
  display: flex;
  align-items: flex-start;
  gap: 16px;
}

.gh-hero-icon {
  color: var(--muted);
  margin-top: 2px;
  flex-shrink: 0;
}

.gh-hero-title {
  font-size: 24px;
  font-weight: 700;
  font-family: var(--mono);
  margin: 0;
  line-height: 1.2;
}

.gh-hero-meta {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 6px;
}

.gh-meta-item {
  font-size: 12px;
  color: var(--muted);
}

.gh-chip {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  background: rgba(255,255,255,0.06);
  color: var(--muted);
}

.gh-chip-framework {
  background: rgba(124, 92, 252, 0.12);
  color: #b49aff;
}

.gh-chip-ecosystem {
  background: rgba(57, 217, 138, 0.10);
  color: var(--good);
}

.gh-hero-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}


/* ==========================================================================
   Route Map — grouped blocks
   ========================================================================== */

.gh-route-group {
  margin-bottom: 20px;
}

.gh-route-group-exploitable {
  border-left: 3px solid var(--bad);
  padding-left: 16px;
}

.gh-route-group-label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  font-weight: 600;
  margin: 0 0 8px;
}

.gh-route-group-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}

.gh-route-group-dot.exploitable { background: var(--bad); }
.gh-route-group-dot.public { background: var(--warn); }
.gh-route-group-dot.protected { background: var(--good); }

.gh-route-group-count {
  font-size: 12px;
  font-weight: 600;
  padding: 1px 6px;
  border-radius: 10px;
  background: rgba(255,255,255,0.06);
  font-family: var(--mono);
}

.gh-route-group-desc {
  font-size: 12px;
  color: var(--muted);
  margin: 0 0 8px;
}

.gh-route-status {
  font-size: 11px;
  color: var(--good);
  margin-left: auto;
}

.gh-file-group {
  border: 1px solid var(--border);
  border-radius: 8px;
  background: rgba(255,255,255,0.02);
  margin-bottom: 10px;
  overflow: hidden;
}

.gh-file-group[open] {
  background: rgba(255,255,255,0.03);
}

.gh-file-group--route {
  border-left: 3px solid var(--bad);
  background: rgba(255,107,107,0.02);
}

.gh-file-group--route[open] {
  background: rgba(255,107,107,0.04);
}

.gh-file-group-summary .gh-route-label {
  flex-shrink: 0;
  font-size: 11px;
  color: var(--bad);
  margin: 0;
  padding: 0;
  white-space: nowrap;
}

.gh-file-group-summary {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  cursor: pointer;
  list-style: none;
  user-select: none;
}

.gh-file-group-summary::-webkit-details-marker { display: none; }
.gh-file-group-summary::marker { display: none; content: ""; }

.gh-file-group-summary:hover {
  background: rgba(255,255,255,0.04);
}

.gh-file-group-chevron {
  flex-shrink: 0;
  color: var(--muted);
  transition: transform 120ms ease;
}

.gh-file-group[open] .gh-file-group-chevron {
  transform: rotate(90deg);
}

.gh-file-group-path {
  font-family: var(--mono);
  font-size: 13px;
  color: var(--text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  min-width: 0;
  flex: 1;
}

.gh-file-group-count {
  flex-shrink: 0;
  font-size: 11px;
  font-weight: 600;
  color: var(--muted);
  font-family: var(--mono);
}

.gh-file-group-sevs {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  flex-shrink: 0;
}

.gh-sev-pip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 20px;
  height: 20px;
  padding: 0 6px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  font-family: var(--mono);
  color: #fff;
  line-height: 1;
}

.gh-sev-pip--critical { background: var(--bad); }
.gh-sev-pip--high     { background: #f97316; color: #1a0800; }
.gh-sev-pip--medium   { background: var(--warn); color: #1a1408; }
.gh-sev-pip--low      { background: var(--info); color: #06121e; }

.gh-file-group-body {
  padding: 4px 12px 12px;
  border-top: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.gh-route-block {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.gh-route-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 10px;
  border-radius: 6px;
  background: rgba(255,255,255,0.02);
  transition: background 0.1s ease;
}

.gh-route-row:hover {
  background: rgba(255,255,255,0.05);
}

.gh-route-sink {
  font-size: 11px;
  color: var(--bad);
  margin-left: auto;
}

.gh-route-issues {
  font-size: 11px;
  font-family: var(--mono);
  color: var(--warn);
  flex-shrink: 0;
}

/* Route card — route row with inline findings */
.gh-route-card {
  border-left: 3px solid var(--bad);
  margin-bottom: 10px;
  border-radius: 0 8px 8px 0;
  background: rgba(255,107,107,0.02);
}

.gh-route-summary {
  list-style: none;
  cursor: pointer;
  padding: 0 14px 10px 0;
}

.gh-route-summary::-webkit-details-marker {
  display: none;
}

/* Dataflow — visible inside details body when expanded */
.gh-route-dataflow {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--text-secondary);
  padding: 4px 0 0 14px;
}

.gh-route-impact {
  font-size: 12px;
  color: var(--muted);
  padding: 2px 0 0 14px;
}

.gh-route-learn {
  font-size: 11px;
  color: var(--link);
  text-decoration: none;
  padding: 2px 0 0 14px;
  display: inline-block;
}

.gh-route-learn:hover {
  text-decoration: underline;
}

.gh-route-chevron {
  margin-left: auto;
  color: var(--muted);
  flex-shrink: 0;
  transition: transform 0.15s ease;
}

.gh-route-card[open] > summary .gh-route-chevron {
  transform: rotate(90deg);
}

.gh-route-card[open] {
  margin-bottom: 14px;
  background: rgba(255,107,107,0.04);
  padding-bottom: 12px;
}

.gh-route-row--exploitable {
  padding-left: 8px;
}

.gh-route-label {
  font-size: 12px;
  color: var(--bad);
  margin-left: auto;
  white-space: nowrap;
}

/* Inline finding within a route card */
.gh-route-finding {
  padding: 16px 18px;
}

.gh-route-finding + .gh-route-finding {
  border-top: 1px solid var(--border);
}

.gh-route-finding-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
}

.gh-route-finding-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
}

.gh-route-finding-count {
  font-size: 12px;
  color: var(--muted);
  margin-left: auto;
}

.gh-route-finding-code {
  font-family: var(--mono);
  font-size: 12px;
  background: rgba(0,0,0,0.3);
  border: 1px solid rgba(255,255,255,0.06);
  border-radius: 6px;
  padding: 10px 14px;
  margin: 8px 0 10px;
  overflow-x: auto;
  color: var(--text);
}

.gh-route-finding-code code {
  font-family: inherit;
}

.gh-route-finding-msg {
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.6;
  margin-bottom: 10px;
  white-space: pre-wrap;
}

/* Review finding instances list */
.gh-route-finding-instances {
  margin-top: 8px;
}
.gh-review-instance {
  padding: 10px 12px;
  background: rgba(0,0,0,0.12);
  border-radius: 6px;
  font-family: var(--mono);
  font-size: 12px;
  color: var(--text-secondary);
  line-height: 1.8;
  margin-bottom: 6px;
}
.gh-review-instance:last-child { margin-bottom: 0; }
.gh-review-instance .gh-route-finding-msg {
  font-family: inherit;
  font-size: 12px;
  margin-top: 4px;
  margin-bottom: 4px;
}
.gh-review-instance .gh-route-finding-fix {
  font-family: inherit;
  font-size: 12px;
  margin-top: 4px;
}
.gh-review-instance a { color: var(--link); text-decoration: none; }
.gh-review-instance a:hover { text-decoration: underline; }

/* Trace: endpoint handler, source, sink */
.gh-route-finding-trace {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--text-secondary);
  margin-bottom: 12px;
  line-height: 1.8;
  padding: 10px 12px;
  background: rgba(0,0,0,0.15);
  border-radius: 6px;
}

.gh-route-finding-trace-line {
  display: flex;
  align-items: baseline;
  gap: 6px;
}

.gh-trace-indent {
  padding-left: 16px;
}

.gh-trace-label {
  color: var(--muted);
  white-space: nowrap;
}

.gh-trace-arrow {
  color: var(--muted);
  flex-shrink: 0;
}

.gh-trace-value {
  color: var(--text-secondary);
}

.gh-route-finding-trace a {
  color: var(--link);
  text-decoration: none;
}

.gh-route-finding-trace a:hover {
  text-decoration: underline;
  color: var(--text);
}

/* Package reachability callout */
.gh-route-package {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 10px 14px;
  margin: 0 14px 8px;
  background: rgba(180,154,255,0.06);
  border: 1px solid rgba(180,154,255,0.15);
  border-radius: 6px;
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.5;
}

.gh-route-package-icon {
  flex-shrink: 0;
  font-size: 14px;
}

.gh-route-package-name {
  font-family: var(--mono);
  font-weight: 600;
  color: #b49aff;
}

.gh-route-package-link {
  display: inline-block;
  margin-left: 8px;
  font-size: 12px;
  color: var(--link);
  text-decoration: none;
}

.gh-route-package-advisory-count {
  color: var(--warn);
  font-weight: 600;
}

.gh-route-package-link:hover {
  text-decoration: underline;
}

.gh-route-finding-fix {
  font-size: 13px;
  color: var(--text);
  line-height: 1.5;
  margin: 4px 0 8px;
  background: rgba(57,217,138,0.06);
  border: 1px solid rgba(57,217,138,0.15);
  padding: 12px 16px;
  border-radius: 8px;
}

.gh-route-finding-fix-label {
  font-size: 11px;
  font-weight: 700;
  color: var(--good);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  display: block;
  margin-bottom: 4px;
}

/* CLI handoff — tiny footer */
.gh-cli-handoff {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 24px;
  border-top: 1px solid var(--border);
  font-size: 12px;
}

.gh-cli-handoff code {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--muted);
}

/* ==========================================================================
   Ecosystem Teaser (disabled state)
   ========================================================================== */

.gh-eco-teaser {
  padding: 20px 24px;
  background: rgba(100,181,255,0.03);
  border: 1px solid rgba(100,181,255,0.10);
  border-radius: 10px;
}

.gh-eco-teaser-title {
  font-size: 15px;
  font-weight: 600;
  margin: 0 0 6px;
  color: var(--text);
}

.gh-eco-teaser-body {
  font-size: 13px;
  color: var(--muted);
  line-height: 1.6;
  margin: 0;
}

/* ==========================================================================
   Section Layout
   ========================================================================== */

.gh-section {
  margin-bottom: 40px;
  padding-top: 8px;
}

.gh-section-title {
  font-size: 20px;
  font-weight: 700;
  margin: 0 0 4px;
}

.gh-section-desc {
  font-size: 13px;
  color: var(--muted);
  margin: 0 0 20px;
}

.gh-subsection-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--muted);
  margin: 0 0 12px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.gh-section-emphasis {
  background: rgba(255, 107, 107, 0.03);
  border: 1px solid rgba(255, 107, 107, 0.08);
  border-radius: var(--radius);
  padding: 24px;
  margin-left: -24px;
  margin-right: -24px;
}

/* ==========================================================================
   Attack Surface
   ========================================================================== */

.gh-surface-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
}

.gh-surface-panel {
  min-width: 0;
}

.gh-surface-right {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

/* Endpoint list */
.gh-endpoint-list {
  display: flex;
  flex-direction: column;
  gap: 4px;
  max-height: 400px;
  overflow-y: auto;
}

.gh-endpoint {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  border-radius: 6px;
  background: rgba(255,255,255,0.02);
  border: 1px solid transparent;
  transition: border-color 0.15s ease;
}

.gh-endpoint:hover {
  border-color: var(--border);
}

.gh-method {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 44px;
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 10px;
  font-weight: 700;
  font-family: var(--mono);
  text-transform: uppercase;
  letter-spacing: 0.3px;
}

.method-get { background: rgba(100,181,255,0.12); color: var(--info); }
.method-post { background: rgba(57,217,138,0.12); color: var(--good); }
.method-put { background: rgba(247,201,72,0.12); color: var(--warn); }
.method-delete { background: rgba(255,107,107,0.12); color: var(--bad); }
.method-patch { background: rgba(180,154,255,0.12); color: #b49aff; }
.gh-method-file { background: rgba(180,154,255,0.12); color: #b49aff; }

.gh-route {
  font-family: var(--mono);
  font-size: 13px;
  flex: 1;
}

.gh-endpoint-tag {
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  padding: 2px 6px;
  border-radius: 4px;
  background: rgba(255,255,255,0.04);
  color: var(--muted);
}

.gh-endpoint-tag.bad { background: rgba(255,107,107,0.10); color: var(--bad); }
.gh-endpoint-tag.good { background: rgba(57,217,138,0.08); color: var(--good); }

/* Execution Surfaces */
.gh-exec-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.gh-exec-chip {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  background: rgba(255,255,255,0.03);
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 13px;
}

.gh-exec-label {
  color: var(--text);
}

.gh-exec-count {
  font-family: var(--mono);
  font-weight: 700;
  color: var(--warn);
  font-size: 14px;
}

/* Authorization Reviews */
.gh-authz-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.gh-authz-item {
  padding: 10px 14px;
  background: rgba(247,201,72,0.04);
  border: 1px solid rgba(247,201,72,0.12);
  border-radius: 8px;
}

.gh-authz-endpoint {
  font-family: var(--mono);
  font-size: 13px;
  font-weight: 600;
  color: var(--warn);
  margin-bottom: 4px;
}

.gh-authz-reason {
  font-size: 13px;
  color: var(--text);
  margin-bottom: 4px;
}

.gh-authz-location {
  font-size: 12px;
  font-family: var(--mono);
  color: var(--muted);
}

/* Auth Coverage */
.gh-auth-bar-container {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 6px;
}

.gh-auth-bar {
  flex: 1;
  height: 6px;
  background: rgba(255,255,255,0.06);
  border-radius: 3px;
  overflow: hidden;
}

.gh-auth-bar-fill {
  height: 100%;
  border-radius: 3px;
  transition: width 0.6s ease;
}

.gh-auth-bar-fill.good { background: var(--good); }
.gh-auth-bar-fill.warn { background: var(--warn); }
.gh-auth-bar-fill.bad { background: var(--bad); }

.gh-auth-pct {
  font-family: var(--mono);
  font-weight: 700;
  font-size: 14px;
}

.gh-auth-detail {
  font-size: 12px;
}

/* ==========================================================================
   Findings
   ========================================================================== */

.gh-findings-group {
  margin-bottom: 28px;
}

.gh-findings-group-title {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 16px;
  font-weight: 600;
  margin: 0 0 14px;
}

.gh-findings-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}

.gh-dot-bad { background: var(--bad); }
.gh-dot-warn { background: var(--warn); }
.gh-dot-muted { background: var(--muted2); }

.gh-findings-count {
  font-size: 12px;
  font-weight: 600;
  padding: 1px 8px;
  border-radius: 10px;
  background: rgba(255,255,255,0.06);
  font-family: var(--mono);
}

.gh-findings-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

/* Finding Card */
.gh-finding-card {
  background: rgba(255,255,255,0.02);
  border: 1px solid var(--border);
  border-radius: 10px;
  overflow: hidden;
  transition: border-color 0.15s ease;
  margin-bottom: 4px;
}

.gh-finding-card:hover {
  border-color: rgba(255,255,255,0.15);
}

.gh-finding-confirmed {
  border-left: 3px solid var(--bad);
  background: rgba(255,107,107,0.02);
}

.gh-finding-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 18px;
  cursor: pointer;
  user-select: none;
}

.gh-finding-header-left {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 1;
  min-width: 0;
}

.gh-finding-header-right {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.gh-sev {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.3px;
  flex-shrink: 0;
}

.gh-sev-critical { background: rgba(255,107,107,0.15); color: var(--bad); }
.gh-sev-high { background: rgba(249,115,22,0.12); color: #f97316; }
.gh-sev-medium { background: rgba(247,201,72,0.12); color: var(--warn); }
.gh-sev-low { background: rgba(100,181,255,0.10); color: var(--info); }
.gh-sev-review { background: rgba(247,201,72,0.10); color: var(--warn); }

.gh-finding-title {
  font-size: 14px;
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.gh-finding-route {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--muted);
}

.gh-finding-toggle {
  font-size: 10px;
  color: var(--muted);
  transition: transform 0.2s ease;
}

.gh-finding-card.expanded .gh-finding-toggle {
  transform: rotate(180deg);
}

.gh-finding-preview {
  display: flex;
  gap: 12px;
  padding: 0 16px 10px;
  font-size: 12px;
}

.gh-finding-preview-endpoint {
  font-family: var(--mono);
  color: var(--muted);
}

.gh-finding-preview-loc {
  font-family: var(--mono);
  color: var(--muted2);
}

/* Finding expanded body */
.gh-finding-body {
  padding: 4px 18px 18px;
  border-top: 1px solid var(--border);
}

.gh-finding-flow {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 0;
}

.gh-finding-flow-item {
  flex: 1;
  padding: 10px 12px;
  background: rgba(255,255,255,0.03);
  border-radius: 6px;
  border: 1px solid var(--border);
}

.gh-finding-flow-label {
  display: block;
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--muted);
  margin-bottom: 4px;
}

.gh-finding-flow-item code {
  font-family: var(--mono);
  font-size: 12px;
  display: block;
  margin-bottom: 2px;
}

.gh-finding-flow-arrow {
  color: var(--bad);
  font-size: 18px;
  font-weight: 700;
  flex-shrink: 0;
}

.gh-finding-message {
  font-size: 13px;
  color: var(--muted);
  line-height: 1.6;
  margin: 10px 0;
  padding: 10px 12px;
  background: rgba(255,255,255,0.02);
  border-radius: 6px;
  white-space: pre-wrap;
  word-break: break-word;
}

.gh-finding-remediation {
  margin: 12px 0;
  padding: 12px;
  background: rgba(57,217,138,0.04);
  border: 1px solid rgba(57,217,138,0.10);
  border-radius: 8px;
}

.gh-finding-remediation-label {
  display: block;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--good);
  margin-bottom: 8px;
}

.gh-finding-remediation-text {
  font-size: 13px;
  line-height: 1.6;
  color: var(--text);
}

.gh-finding-remediation-text code {
  background: rgba(255,255,255,0.06);
  padding: 1px 5px;
  border-radius: 3px;
  font-family: var(--mono);
  font-size: 12px;
}

.gh-finding-remediation-text pre {
  margin: 8px 0;
  padding: 10px 12px;
  background: rgba(0,0,0,0.3);
  border-radius: 6px;
  overflow-x: auto;
  font-size: 12px;
}

.gh-finding-remediation-text pre code {
  background: none;
  padding: 0;
  font-size: 12px;
}

.gh-finding-meta {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  padding-top: 10px;
}

.gh-finding-cwe, .gh-finding-owasp, .gh-finding-loc-full {
  font-size: 11px;
  font-family: var(--mono);
  color: var(--muted2);
  padding: 2px 6px;
  background: rgba(255,255,255,0.03);
  border-radius: 3px;
}

/* Review cards */
.gh-review-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.gh-review-card {
  background: rgba(247,201,72,0.03);
  border: 1px solid var(--border);
  border-left: 3px solid var(--warn);
  border-radius: 10px;
  overflow: hidden;
}

.gh-review-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  cursor: pointer;
  user-select: none;
}

.gh-review-header-left {
  display: flex;
  align-items: center;
  gap: 10px;
}

.gh-review-title {
  font-size: 14px;
  font-weight: 500;
}

.gh-review-count {
  font-size: 12px;
  color: var(--muted);
}

.gh-review-body {
  padding: 0 16px 14px;
  border-top: 1px solid var(--border);
}

.gh-review-locations {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding-top: 12px;
}

.gh-review-location {
  display: flex;
  align-items: center;
  gap: 6px;
  font-family: var(--mono);
  font-size: 12px;
  color: var(--muted);
}

/* Operational Notes */
.gh-operational-list {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.gh-operational-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 8px 14px;
  border-radius: 6px;
  background: rgba(255,255,255,0.01);
  border-left: 2px solid var(--muted2);
  opacity: 0.7;
}

.gh-operational-title {
  font-size: 13px;
  color: var(--muted);
}

.gh-operational-loc {
  font-family: var(--mono);
  font-size: 12px;
  flex-shrink: 0;
}

/* Show All / Overflow */
.gh-show-all-btn {
  display: block;
  width: 100%;
  padding: 12px;
  margin-top: 8px;
  background: rgba(255,255,255,0.03);
  border: 1px dashed var(--border);
  border-radius: 8px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s ease;
  text-align: center;
  font-family: var(--sans);
}

.gh-show-all-btn:hover {
  background: rgba(255,255,255,0.06);
  color: var(--text);
  border-color: rgba(255,255,255,0.15);
}

.gh-findings-overflow {
  display: none;
  flex-direction: column;
  gap: 6px;
  margin-top: 6px;
}

.gh-findings-overflow.visible {
  display: flex;
}

.gh-findings-group-desc {
  font-size: 13px;
  color: var(--muted);
  margin: -8px 0 14px;
}

/* ==========================================================================
   Ecosystem Trust
   ========================================================================== */

.gh-packages-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(420px, 1fr));
  gap: 16px;
  margin-bottom: 20px;
}

.gh-package-card {
  padding: 16px;
  background: rgba(255,255,255,0.03);
  border: 1px solid var(--border);
  border-radius: 10px;
  transition: border-color 0.15s ease;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.gh-package-card:hover {
  border-color: rgba(255,255,255,0.15);
}

.gh-package-card[data-reachability="reachable"] {
  border-left: 3px solid var(--danger, #ff6b6b);
}

.gh-package-card[data-reachability="called"] {
  border-left: 3px solid var(--warn, #f7c948);
}

.gh-reach-badge {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.4px;
  padding: 2px 8px;
  border-radius: 4px;
  background: rgba(255,255,255,0.06);
  color: var(--text-secondary);
}

.gh-reach-badge--reachable {
  background: rgba(255,107,107,0.12);
  color: var(--danger, #ff6b6b);
}

.gh-reach-badge--called {
  background: rgba(247,201,72,0.12);
  color: var(--warn, #f7c948);
}

.gh-reach-badge--imported,
.gh-reach-badge--installed {
  background: rgba(255,255,255,0.06);
  color: var(--text-secondary);
}

.gh-reach-badge--direct {
  background: rgba(86,156,214,0.12);
  color: var(--info, #569cd6);
}

.gh-package-imports {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 6px;
  align-items: baseline;
  font-size: 12px;
  line-height: 1.5;
}

.gh-package-imports a {
  text-decoration: none;
}

.gh-package-imports code {
  font-family: var(--mono);
  font-size: 11px;
  opacity: 0.85;
  padding: 1px 5px;
  background: rgba(255,255,255,0.05);
  border-radius: 3px;
  word-break: normal;
}

.gh-package-imports a:hover code {
  background: rgba(255,255,255,0.12);
  color: var(--text-primary);
}

.gh-package-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.gh-package-identity {
  font-family: var(--mono);
  font-size: 16px;
  font-weight: 600;
  line-height: 1.3;
  overflow-wrap: anywhere;
  text-decoration: none;
  color: inherit;
  display: block;
}

a.gh-package-identity:hover .gh-package-name {
  text-decoration: underline;
}

.gh-package-name {
  color: var(--text-primary);
}

.gh-package-version {
  font-weight: 400;
  color: var(--text-secondary);
}

.gh-package-advisory-ids a {
  text-decoration: none;
}

.gh-package-advisory-ids a:hover code {
  background: rgba(255,255,255,0.12);
  color: var(--text-primary);
}

.gh-package-advisories {
  margin-left: auto;
  font-size: 11px;
  font-weight: 600;
  color: var(--warn);
  background: rgba(247,201,72,0.10);
  padding: 2px 8px;
  border-radius: 4px;
}

.gh-package-body {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.gh-package-usage {
  font-size: 13px;
  color: var(--warn);
}

.gh-package-detail {
  font-size: 12px;
  display: flex;
  gap: 6px;
  align-items: baseline;
  flex-wrap: wrap;
}

.gh-package-detail code {
  font-family: var(--mono);
  font-size: 12px;
  padding: 1px 5px;
  background: rgba(255,255,255,0.05);
  border-radius: 3px;
  word-break: break-word;
}

.gh-package-path {
  font-size: 12px;
}

.gh-package-path-link {
  color: var(--info);
  text-decoration: none;
  font-family: var(--mono);
  font-weight: 600;
}

.gh-package-path-link:hover {
  text-decoration: underline;
}

.gh-package-risk-reason {
  font-size: 12px;
  color: var(--text-secondary);
  line-height: 1.5;
}

.gh-package-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
  line-height: 1.4;
}

.gh-package-fix {
  font-size: 12px;
  color: var(--text-secondary);
  line-height: 1.5;
}

.gh-package-advisory-ids {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 6px;
  align-items: baseline;
  font-size: 12px;
  line-height: 1.5;
}

.gh-package-advisory-ids code {
  font-family: var(--mono);
  font-size: 11px;
  opacity: 0.85;
  padding: 1px 5px;
  background: rgba(255,255,255,0.05);
  border-radius: 3px;
  word-break: normal;
}

.gh-package-learn {
  font-size: 12px;
  color: var(--link);
  text-decoration: none;
}

.gh-package-learn:hover {
  text-decoration: underline;
}

/* Advisory summary */
.gh-advisory-section {
  margin-top: 20px;
}

.gh-advisory-list {
  display: flex;
  flex-direction: column;
  gap: 1px;
  background: var(--border);
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
  margin-bottom: 10px;
}

.gh-advisory-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 14px;
  background: var(--surface);
  font-size: 13px;
  text-decoration: none;
  color: var(--text);
  transition: background 0.1s;
}

.gh-advisory-row:hover {
  background: rgba(255,255,255,0.06);
}

.gh-advisory-row--in_attack_path {
  border-left: 3px solid var(--bad);
}

.gh-advisory-row--called {
  border-left: 3px solid var(--warn);
}

.gh-advisory-row--imported {
  border-left: 3px solid var(--info);
}

.gh-advisory-row--installed {
  border-left: 3px solid var(--border);
}

.gh-advisory-name {
  font-family: var(--mono);
  font-weight: 500;
  flex: 1;
}

.gh-advisory-row:hover .gh-advisory-name {
  color: var(--info);
}

.gh-advisory-count {
  font-size: 12px;
  color: var(--muted);
  white-space: nowrap;
}

.gh-advisory-badge {
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  padding: 2px 6px;
  border-radius: 3px;
  white-space: nowrap;
}

.gh-advisory-badge--attack-path {
  color: var(--bad);
  background: rgba(255,107,107,0.10);
}

.gh-advisory-badge--called {
  color: var(--warn);
  background: rgba(247,201,72,0.10);
}

.gh-advisory-badge--imported {
  color: var(--info);
  background: rgba(100,181,255,0.10);
}

.gh-advisory-badge--installed {
  color: var(--muted);
  background: rgba(128,128,128,0.08);
}


.gh-subsection-meta {
  font-size: 13px;
  font-weight: 400;
  color: var(--muted);
  margin-left: 8px;
}

/* License section */
.gh-license-section {
  margin-top: 20px;
}

.gh-license-list {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.gh-license-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 12px;
  font-size: 13px;
}

.gh-license-pkg {
  font-family: var(--mono);
  font-size: 12px;
}

.gh-eco-meta {
  font-size: 12px;
  margin-top: 16px;
}

.gh-eco-header {
  margin-bottom: 20px;
}

.gh-eco-header .gh-section-title {
  margin-bottom: 6px;
}

.gh-eco-header .gh-section-desc {
  margin: 0 0 12px;
  max-width: 72ch;
}

.gh-eco-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.gh-eco-legend .gh-reach-badge {
  cursor: pointer;
  border: 1px solid transparent;
  font-family: inherit;
  opacity: 0.7;
  transition: opacity 0.12s ease, border-color 0.12s ease;
}

.gh-eco-legend .gh-reach-badge:hover {
  opacity: 1;
}

.gh-eco-legend .gh-reach-badge[aria-pressed="true"] {
  opacity: 1;
  border-color: currentColor;
}

.gh-packages-grid[data-eco-filter] .gh-package-card {
  display: none;
}

.gh-packages-grid[data-eco-filter="reachable"] .gh-package-card[data-reachability="reachable"],
.gh-packages-grid[data-eco-filter="called"] .gh-package-card[data-reachability="called"],
.gh-packages-grid[data-eco-filter="imported"] .gh-package-card[data-reachability="imported"],
.gh-packages-grid[data-eco-filter="installed"] .gh-package-card[data-reachability="installed"] {
  display: flex;
}

.gh-eco-disabled {
  padding: 32px;
  text-align: center;
  background: rgba(100,181,255,0.03);
  border: 1px solid rgba(100,181,255,0.10);
  border-radius: 10px;
}

.gh-eco-disabled-title {
  font-size: 16px;
  font-weight: 600;
  margin: 0 0 8px;
  color: var(--text);
}

.gh-eco-disabled-body {
  font-size: 14px;
  color: var(--muted);
  line-height: 1.6;
  max-width: 480px;
  margin: 0 auto;
}

.gh-container-section {
  margin-top: 28px;
}

/* ==========================================================================
   Container Trust
   ========================================================================== */

.gh-container-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.gh-container-card {
  padding: 14px 16px;
  background: rgba(255,255,255,0.02);
  border: 1px solid var(--border);
  border-radius: 10px;
}

.gh-container-header {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 8px;
}

.gh-container-signal {
  font-weight: 600;
  font-size: 14px;
  color: var(--warn);
}

.gh-container-source {
  font-size: 12px;
}

.gh-container-image {
  font-family: var(--mono);
  font-size: 12px;
  padding: 1px 6px;
  background: rgba(255,255,255,0.04);
  border-radius: 3px;
}

.gh-container-detail {
  font-size: 13px;
  color: var(--muted);
  line-height: 1.5;
  margin-bottom: 10px;
  white-space: pre-wrap;
}

.gh-container-fix {
  display: flex;
  gap: 8px;
  font-size: 13px;
  padding: 8px 10px;
  background: rgba(57,217,138,0.04);
  border-radius: 6px;
}

.gh-container-fix-label {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--good);
  flex-shrink: 0;
  padding-top: 2px;
}

/* ==========================================================================
   Fix Plan
   ========================================================================== */

.gh-fix-group {
  margin-bottom: 24px;
}

.gh-fix-group-title {
  font-size: 15px;
  font-weight: 600;
  margin: 0 0 12px;
  padding-left: 4px;
}

.gh-fix-now { color: var(--bad); }
.gh-fix-review { color: var(--warn); }
.gh-fix-infra { color: var(--info); }


/* ==========================================================================
   Raw JSON
   ========================================================================== */

.gh-section-json {
  border-top: 1px solid var(--border);
  padding-top: 32px;
  opacity: 0.6;
  transition: opacity 0.2s ease;
}

.gh-section-json:hover,
.gh-section-json:focus-within {
  opacity: 1;
}

.gh-section-title-muted {
  font-size: 16px;
  color: var(--muted);
  display: inline;
}

.gh-json-summary {
  display: flex;
  align-items: center;
  gap: 12px;
  cursor: pointer;
  list-style: none;
  margin-bottom: 12px;
}

.gh-json-summary::-webkit-details-marker {
  display: none;
}

.gh-json-summary::before {
  content: '\25B6';
  font-size: 10px;
  color: var(--muted);
  transition: transform 0.2s ease;
}

details[open] > .gh-json-summary::before {
  transform: rotate(90deg);
}

.gh-json-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}

.gh-json-meta {
  display: flex;
  align-items: center;
  gap: 10px;
}

.gh-json-container {
  max-height: 500px;
  overflow: auto;
  border-radius: 10px;
  background: rgba(0,0,0,0.3);
  border: 1px solid var(--border);
}

.gh-json-pre {
  padding: 16px;
  margin: 0;
  font-family: var(--mono);
  font-size: 12px;
  line-height: 1.5;
  color: var(--muted);
  white-space: pre;
  tab-size: 2;
}

/* ==========================================================================
   CTA
   ========================================================================== */

   ========================================================================== */

.gh-nav {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 100;
  background: rgba(11,15,25,0.92);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-top: 1px solid var(--border);
  padding: 0;
  transform: translateY(100%);
  transition: transform 0.3s ease;
}

.gh-nav.visible {
  transform: translateY(0);
}

.gh-nav-inner {
  max-width: 1560px;
  margin: 0 auto;
  display: flex;
  justify-content: center;
  gap: 2px;
  padding: 6px 16px;
  overflow-x: auto;
}

.gh-nav-item {
  padding: 8px 16px;
  font-size: 12px;
  font-weight: 500;
  color: var(--muted);
  text-decoration: none;
  border-radius: 6px;
  transition: all 0.15s ease;
  white-space: nowrap;
}

.gh-nav-item:hover {
  color: var(--text);
  background: rgba(255,255,255,0.05);
}

.gh-nav-item.active {
  color: var(--text);
  background: rgba(255,255,255,0.08);
}

/* ==========================================================================
   Empty State
   ========================================================================== */

.gh-empty-state {
  padding: 24px;
  text-align: center;
  color: var(--muted);
  font-size: 14px;
}

/* ==========================================================================
   GitHub Entry/Landing Page
   ========================================================================== */

.gh-landing {
  max-width: 680px;
  margin: 60px auto 40px;
  text-align: center;
  padding: 0 20px;
}

.gh-landing-title {
  font-size: 32px;
  font-weight: 700;
  margin: 0 0 12px;
  line-height: 1.2;
}

.gh-landing-desc {
  font-size: 16px;
  color: var(--muted);
  margin: 0 0 32px;
  line-height: 1.6;
}

.gh-landing-form {
  display: flex;
  gap: 10px;
  max-width: 520px;
  margin: 0 auto 48px;
}

.gh-landing-input {
  flex: 1;
  padding: 14px 18px;
  background: rgba(255,255,255,0.04);
  border: 1px solid var(--border);
  border-radius: 10px;
  color: var(--text);
  font-size: 15px;
  font-family: var(--mono);
  outline: none;
  transition: border-color 0.2s ease;
}

.gh-landing-input::placeholder {
  color: var(--muted2);
}

.gh-landing-input:focus {
  border-color: var(--info);
}

.gh-landing-submit {
  padding: 14px 24px;
  background: var(--info);
  color: #0b0f19;
  border: none;
  border-radius: 10px;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s ease;
  white-space: nowrap;
}

.gh-landing-submit:hover {
  background: #85c8ff;
}

.gh-landing-examples {
  margin-top: 24px;
}

.gh-landing-examples h3 {
  font-size: 13px;
  font-weight: 600;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin: 0 0 14px;
}

.gh-landing-example-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  max-width: 360px;
  margin: 0 auto;
}

.gh-landing-example {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px;
  background: rgba(255,255,255,0.02);
  border: 1px solid var(--border);
  border-radius: 8px;
  text-decoration: none;
  transition: border-color 0.15s ease;
}

.gh-landing-example:hover {
  border-color: rgba(255,255,255,0.15);
}

.gh-landing-example-name {
  font-family: var(--mono);
  font-size: 14px;
  font-weight: 500;
}

.gh-landing-example-arrow {
  color: var(--muted);
  font-size: 14px;
}

/* ==========================================================================
   Responsive
   ========================================================================== */

@media (max-width: 768px) {
  .gh-hero-main {
    flex-direction: column;
  }

  .gh-hero-title {
    font-size: 20px;
  }

  .gh-structure-legend {
    flex-direction: column;
    gap: 8px;
  }

  .gh-section-emphasis {
    margin-left: -16px;
    margin-right: -16px;
    padding: 16px;
  }

  .gh-path-header {
    flex-wrap: wrap;
  }

  .gh-finding-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
  }

  .gh-finding-header-right {
    width: 100%;
    justify-content: space-between;
  }

  .gh-packages-grid {
    grid-template-columns: 1fr;
  }

  .gh-landing-form {
    flex-direction: column;
  }

  .gh-landing-title {
    font-size: 24px;
  }

  .gh-nav-inner {
    justify-content: flex-start;
  }
}

@media (max-width: 480px) {
  .gh-hero-actions {
    width: 100%;
  }

  .gh-hero-actions .gh-btn {
    flex: 1;
    justify-content: center;
  }
}

/* ==========================================================================
   Branches & Pull Requests (Repo Page)
   ========================================================================== */

/* Compact refs — inline chips */
.gh-refs-compact {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin: 0 0 20px;
  padding: 10px 16px;
  background: rgba(255,255,255,0.02);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.gh-refs-inline {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.gh-refs-inline-label {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--muted);
  margin-right: 2px;
}

.gh-ref-chip {
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 500;
  padding: 2px 8px;
  border-radius: 4px;
  background: rgba(255,255,255,0.06);
  color: var(--info);
  text-decoration: none;
  transition: background 0.15s ease;
}

.gh-ref-chip:hover {
  background: rgba(100,181,255,0.15);
  text-decoration: none;
}

/* ==========================================================================
   Branch View
   ========================================================================== */

.gh-chip-branch {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: rgba(100,181,255,0.12);
  color: var(--info);
  padding: 3px 10px;
  border-radius: 12px;
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 600;
}

.gh-chip-protected {
  background: rgba(57,217,138,0.12);
  color: var(--good);
  font-size: 10px;
}

/* ==========================================================================
   Pull Request View
   ========================================================================== */

.gh-hero-link {
  color: var(--text);
  text-decoration: none;
}

.gh-hero-link:hover {
  text-decoration: underline;
}

.gh-pr-number {
  color: var(--muted);
  font-weight: 400;
  margin-left: 4px;
}

.gh-pr-title {
  font-size: 18px;
  font-weight: 500;
  margin-top: 4px;
  line-height: 1.4;
}

.gh-chip-open {
  background: rgba(57,217,138,0.15);
  color: var(--good);
}

.gh-chip-closed {
  background: rgba(255,107,107,0.15);
  color: var(--bad);
}

.gh-chip-merged {
  background: rgba(163,113,247,0.15);
  color: #a371f7;
}

.gh-chip-draft {
  background: rgba(255,255,255,0.08);
  color: var(--muted);
}

.gh-chip-label {
  font-size: 11px;
  padding: 2px 8px;
  border: 1px solid;
}

.gh-chip-compare {
  background: rgba(100,181,255,0.12);
  color: var(--info);
}

/* PR Stats */
.gh-pr-stats {
  margin: 0 0 24px;
}

.gh-pr-stat-row {
  display: flex;
  gap: 24px;
  flex-wrap: wrap;
  padding: 16px 20px;
  background: rgba(255,255,255,0.02);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin-bottom: 12px;
}

.gh-pr-stat {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
}

.gh-pr-stat-value {
  font-size: 20px;
  font-weight: 700;
  font-family: var(--mono);
}

.gh-pr-stat-label {
  font-size: 11px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.3px;
}

.gh-pr-refs {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.gh-ref-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-family: var(--mono);
  font-size: 13px;
  font-weight: 500;
  padding: 6px 12px;
  background: rgba(255,255,255,0.06);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--info);
  text-decoration: none;
  transition: all 0.15s ease;
}

.gh-ref-chip:hover {
  background: rgba(255,255,255,0.10);
  border-color: rgba(255,255,255,0.15);
}

.gh-compare-refs {
  margin: 0 0 24px;
}

/* PR Body */
.gh-pr-body-section {
  margin-bottom: 24px;
}

.gh-pr-body {
  font-size: 14px;
  line-height: 1.7;
  color: var(--muted);
  white-space: pre-wrap;
  word-break: break-word;
  max-height: 300px;
  overflow-y: auto;
  padding: 16px;
  background: rgba(255,255,255,0.02);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

/* ==========================================================================
   Diff View
   ========================================================================== */

.gh-diff-add {
  color: var(--good);
}

.gh-diff-del {
  color: var(--bad);
}

/* File list */
.gh-diff-file-list {
  display: flex;
  flex-direction: column;
  gap: 2px;
  margin-bottom: 20px;
  background: rgba(255,255,255,0.02);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}

.gh-diff-file-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 14px;
  text-decoration: none;
  color: var(--text);
  transition: background 0.15s ease;
  border-bottom: 1px solid rgba(255,255,255,0.03);
}

.gh-diff-file-item:last-child {
  border-bottom: none;
}

.gh-diff-file-item:hover {
  background: rgba(255,255,255,0.04);
}

.gh-diff-file-item--active {
  background: rgba(255,107,107,0.12);
  box-shadow: inset 3px 0 0 var(--bad);
}

.gh-diff-file-item--active:hover {
  background: rgba(255,107,107,0.16);
}

.gh-diff-file-status {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.3px;
  padding: 2px 6px;
  border-radius: 4px;
  flex-shrink: 0;
}

.gh-diff-status-added { background: rgba(57,217,138,0.15); color: var(--good); }
.gh-diff-status-modified { background: rgba(247,201,72,0.12); color: var(--warn); }
.gh-diff-status-removed { background: rgba(255,107,107,0.12); color: var(--bad); }
.gh-diff-status-renamed { background: rgba(100,181,255,0.12); color: var(--info); }
.gh-diff-status-copied { background: rgba(100,181,255,0.12); color: var(--info); }

.gh-diff-file-name {
  flex: 1;
  font-family: var(--mono);
  font-size: 13px;
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.gh-diff-file-stats {
  display: flex;
  gap: 6px;
  font-family: var(--mono);
  font-size: 12px;
  flex-shrink: 0;
}

/* Diff panels */
.gh-diff-panels {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.gh-diff-panel {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}

.gh-diff-panel-header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  background: rgba(255,255,255,0.03);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 1;
}

.gh-diff-panel-filename {
  font-family: var(--mono);
  font-size: 13px;
  font-weight: 600;
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.gh-diff-panel-roles {
  flex-shrink: 0;
}

.gh-diff-renamed-from {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--muted);
}

.gh-diff-renamed-from::before {
  content: '\2190 ';
}

.gh-diff-panel-stats {
  display: flex;
  gap: 6px;
  font-family: var(--mono);
  font-size: 12px;
  flex-shrink: 0;
}

.gh-diff-content {
  overflow-x: auto;
  font-size: 0;
}

.gh-diff-panel-placeholder {
  padding: 16px;
  font-size: 12px;
  color: var(--text-secondary);
  font-style: italic;
}

.gh-diff-panel-error {
  padding: 16px;
  font-size: 12px;
  color: var(--warn);
}

.gh-diff-hunk {
  border-bottom: 1px solid rgba(255,255,255,0.04);
}

.gh-diff-hunk:last-child {
  border-bottom: none;
}

.gh-diff-hunk-header {
  padding: 6px 14px;
  font-family: var(--mono);
  font-size: 12px;
  color: var(--muted2);
  background: rgba(100,181,255,0.04);
  border-bottom: 1px solid rgba(255,255,255,0.04);
  white-space: pre;
}

.gh-diff-line {
  display: flex;
  font-family: var(--mono);
  font-size: 12px;
  line-height: 18px;
  white-space: pre;
}

.gh-diff-line-num {
  display: inline-block;
  min-width: 32px;
  padding: 0 4px;
  text-align: right;
  color: var(--muted2);
  user-select: none;
  flex-shrink: 0;
  font-size: 12px;
}

.gh-diff-line-indicator {
  display: inline-block;
  width: 14px;
  text-align: center;
  flex-shrink: 0;
  user-select: none;
}

.gh-diff-line-content {
  flex: 1;
  padding-right: 8px;
}

/* highlight.js theme ships .hljs with display:block + background; reset to
   inherit the row's flex layout while keeping token-color spans intact.
   Same pattern as `.install-pane-text.hljs` in threats-detail.css. */
.gh-diff-line-content.hljs {
  display: inline;
  background: transparent;
  padding: 0 8px 0 0;
  color: inherit;
}
.gh-diff-line .hljs-comment,
.gh-diff-line .hljs-quote { font-style: italic; }

.gh-diff-line-add {
  background: rgba(57,217,138,0.08);
}

.gh-diff-line-add .gh-diff-line-indicator {
  color: var(--good);
}

.gh-diff-line-del {
  background: rgba(255,107,107,0.08);
}

.gh-diff-line-del .gh-diff-line-indicator {
  color: var(--bad);
}

.gh-diff-line-context {
  background: transparent;
}

.gh-diff-binary {
  padding: 20px;
  text-align: center;
  color: var(--muted);
  font-size: 13px;
}

/* Commit list */
.gh-commit-list {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.gh-commit-item {
  padding: 10px 14px;
  background: rgba(255,255,255,0.02);
  border: 1px solid var(--border);
  border-radius: 8px;
}

.gh-commit-message {
  font-size: 14px;
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.gh-commit-meta {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 4px;
  font-size: 12px;
}

.gh-commit-author {
  font-weight: 500;
  color: var(--text);
}

.gh-commit-sha {
  font-family: var(--mono);
  font-size: 12px;
  padding: 1px 6px;
  background: rgba(255,255,255,0.06);
  border-radius: 4px;
  color: var(--info);
}

.gh-commit-date {
  font-size: 12px;
}

/* PR Scan CTA */
.gh-pr-scan-cta {
  margin-top: 32px;
}

.gh-pr-scan-cards {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.gh-pr-scan-card {
  display: block;
  padding: 20px;
  background: rgba(255,255,255,0.03);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  text-decoration: none;
  text-align: center;
  transition: all 0.15s ease;
  color: var(--text);
}

.gh-pr-scan-card:hover {
  border-color: var(--info);
  background: rgba(100,181,255,0.04);
}

.gh-pr-scan-card h3 {
  font-size: 16px;
  margin: 0 0 6px;
}

.gh-pr-scan-card p {
  margin: 0;
  font-size: 13px;
}

.gh-pr-scan-card code {
  font-family: var(--mono);
  font-size: 12px;
}

.gh-btn-small {
  padding: 4px 10px;
  font-size: 11px;
}

/* Responsive — diff */
@media (max-width: 768px) {
  .gh-pr-stat-row {
    gap: 16px;
  }

  .gh-pr-refs {
    flex-direction: column;
    align-items: flex-start;
  }

  .gh-diff-line-num {
    min-width: 35px;
    padding: 0 4px;
  }

  .gh-diff-panel-header {
    flex-wrap: wrap;
  }

  .gh-pr-scan-cards {
    grid-template-columns: 1fr;
  }

  .gh-refs-branches {
    flex-direction: column;
  }

  .gh-ref-branch {
    width: 100%;
  }
}

/* ==========================================================================
   PR Trust Diff — clean, scannable design
   ========================================================================== */

/* Inline branch ref in hero meta */
.gh-ref-inline {
  font-family: var(--mono);
  font-size: 12px;
  padding: 2px 6px;
  background: rgba(255,255,255,0.06);
  border-radius: 4px;
  color: var(--info);
}

/* 1. Verdict banner — the single most important element */
.gh-pr-trust {
  margin-bottom: 32px;
}

.gh-pr-verdict {
  padding: 20px 24px;
  border-radius: var(--radius);
  margin-bottom: 16px;
}

.gh-pr-verdict-good {
  background: rgba(57,217,138,0.06);
  border: 1px solid rgba(57,217,138,0.2);
}

.gh-pr-verdict-bad {
  background: rgba(255,107,107,0.06);
  border: 1px solid rgba(255,107,107,0.2);
}

.gh-pr-verdict-neutral {
  background: rgba(255,255,255,0.03);
  border: 1px solid var(--border);
}

.gh-pr-verdict-text {
  font-size: 20px;
  font-weight: 600;
  margin-bottom: 4px;
}

.gh-pr-verdict-detail {
  font-size: 14px;
  color: var(--muted);
  display: flex;
  align-items: center;
  gap: 6px;
}

.gh-pr-verdict-bad span { color: var(--bad); }
.gh-pr-verdict-good span { color: var(--good); }
.gh-pr-verdict-muted { color: var(--muted) !important; }
.gh-pr-verdict-sep { color: var(--muted2); }

/* 2. Before → After posture comparison */
.gh-pr-posture {
  display: flex;
  align-items: stretch;
  gap: 0;
  margin-bottom: 20px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}

.gh-pr-posture-col {
  flex: 1;
  padding: 16px 20px;
}

.gh-pr-posture-base {
  background: rgba(255,255,255,0.02);
}

.gh-pr-posture-head {
  background: rgba(255,255,255,0.04);
}

.gh-pr-posture-arrow {
  display: flex;
  align-items: center;
  padding: 0 12px;
  font-size: 18px;
  color: var(--muted2);
  background: rgba(255,255,255,0.03);
  border-left: 1px solid var(--border);
  border-right: 1px solid var(--border);
}

.gh-pr-posture-label {
  margin-bottom: 10px;
}

.gh-pr-posture-label code {
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 500;
  color: var(--info);
  background: rgba(100,181,255,0.08);
  padding: 2px 8px;
  border-radius: 4px;
}

.gh-pr-posture-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 14px;
}

.gh-pr-pstat {
  font-size: 13px;
  color: var(--muted);
}

.gh-pr-pstat strong {
  font-weight: 700;
  font-family: var(--mono);
  color: var(--text);
}

.gh-pr-pstat-bad strong {
  color: var(--bad);
}

/* 3. Trust break lists */
.gh-pr-breaks {
  margin-bottom: 16px;
}

.gh-pr-breaks-title {
  font-size: 13px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.4px;
  margin: 0 0 8px;
  padding: 0;
}

.gh-pr-breaks-title-new {
  color: var(--bad);
}

.gh-pr-breaks-title-resolved {
  color: var(--good);
}

.gh-pr-break {
  padding: 12px 16px;
  border-radius: var(--radius);
  margin-bottom: 6px;
}

.gh-pr-break-new {
  background: rgba(255,107,107,0.04);
  border-left: 3px solid var(--bad);
}

.gh-pr-break-resolved {
  background: rgba(57,217,138,0.04);
  border-left: 3px solid var(--good);
}

.gh-pr-break-route {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 4px;
}

.gh-pr-break-path {
  font-family: var(--mono);
  font-size: 13px;
  font-weight: 500;
}

.gh-pr-break-sink {
  font-size: 12px;
  color: var(--muted);
}

.gh-pr-break-detail {
  font-size: 13px;
  color: var(--muted);
  line-height: 1.5;
}

.gh-pr-break-loc {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--muted2);
  margin-left: 6px;
}

.gh-pr-break-fix {
  font-size: 12px;
  color: var(--info);
  margin-top: 4px;
}

/* 4. Unchanged breaks — minimal */
.gh-pr-unchanged {
  margin-bottom: 16px;
}

.gh-pr-unchanged-summary {
  font-size: 13px;
  color: var(--muted);
  cursor: pointer;
  padding: 8px 0;
}

.gh-pr-unchanged-summary:hover {
  color: var(--text);
}

.gh-pr-unchanged-list {
  padding-top: 6px;
}

.gh-pr-unchanged-item {
  font-size: 13px;
  color: var(--muted);
  padding: 4px 0;
  font-family: var(--mono);
}

/* 5. Profile links */
.gh-pr-profile-links {
  display: flex;
  gap: 16px;
  margin-top: 20px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
}

.gh-pr-profile-links a {
  font-size: 13px;
  color: var(--muted);
  text-decoration: none;
}

.gh-pr-profile-links a:hover {
  color: var(--info);
}

.gh-pr-profile-links code {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--info);
}

/* Scanning state */
.gh-pr-scanning {
  padding: 32px 24px;
  background: rgba(255,255,255,0.02);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin-bottom: 24px;
  text-align: center;
}

.gh-pr-scanning-text {
  margin-bottom: 24px;
}

.gh-pr-scanning-text h2 {
  font-size: 18px;
  margin: 0 0 4px;
}

.gh-pr-scanning-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  max-width: 420px;
  margin: 0 auto;
}

.gh-pr-scanning-branch {
  padding: 14px;
  background: rgba(255,255,255,0.03);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  text-align: left;
}

.gh-pr-scanning-branch code {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--info);
  display: block;
  margin-bottom: 6px;
}

.gh-pr-scanning-status {
  font-size: 12px;
  margin-bottom: 8px;
}

.gh-pr-scan-done { color: var(--good); font-weight: 600; }
.gh-pr-scan-progress { color: var(--warn); }
.gh-pr-scan-error { color: var(--bad); }

.gh-pr-scanning-bar {
  height: 3px;
  background: rgba(255,255,255,0.06);
  border-radius: 2px;
  overflow: hidden;
}

.gh-pr-scanning-fill {
  height: 100%;
  background: var(--info);
  border-radius: 2px;
  transition: width 0.5s ease;
}

/* CTA state */
.gh-pr-trust-status {
  padding: 24px;
  background: rgba(255,255,255,0.02);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin-bottom: 24px;
  text-align: center;
}

.gh-pr-trust-status h2 {
  font-size: 16px;
  margin: 0 0 4px;
  color: var(--muted);
}

.gh-pr-trust-status-links {
  display: flex;
  gap: 10px;
  justify-content: center;
  margin-top: 16px;
}

.gh-pr-trust-status-links code {
  font-size: 12px;
}

/* Collapsible toggle for code changes & PR body */
.gh-pr-toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  cursor: pointer;
  user-select: none;
  padding: 12px 0;
  list-style: none;
}

.gh-pr-toggle::-webkit-details-summary-icon,
.gh-pr-toggle::marker {
  display: none;
  content: '';
}

.gh-section-title-inline {
  display: inline;
  margin: 0;
}

.gh-pr-code-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: var(--mono);
  font-size: 13px;
  color: var(--muted);
}

/* Responsive */
@media (max-width: 768px) {
  .gh-pr-posture {
    flex-direction: column;
  }

  .gh-pr-posture-arrow {
    padding: 6px 20px;
    border-left: none;
    border-right: none;
    border-top: 1px solid var(--border);
    border-bottom: 1px solid var(--border);
    justify-content: center;
  }

  .gh-pr-scanning-grid {
    grid-template-columns: 1fr;
  }

  .gh-pr-trust-status-links {
    flex-direction: column;
    align-items: center;
  }

  .gh-pr-profile-links {
    flex-direction: column;
    gap: 8px;
  }
}

/* ==========================================================================
   DEVSPEC REDESIGN — Shared Component Styles
   Phase 1: Repo Scan + Phase 2: Trust Diff
   ========================================================================== */

/* ==========================================================================
   VerdictHero — shared hero component
   ========================================================================== */

.vh-hero {
  padding: 48px 32px 40px;
  text-align: center;
  border-bottom: 1px solid var(--border);
  margin-bottom: 0;
  scroll-margin-top: 80px;
}

.gh-anchor-alias {
  display: block;
  height: 0;
  overflow: hidden;
  scroll-margin-top: 80px;
}

.vh-hero-inner {
  max-width: 640px;
  margin: 0 auto;
}

.vh-hero-label {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 8px;
}

.vh-hero-level {
  font-size: 28px;
  font-weight: 800;
  letter-spacing: 0.04em;
  margin-bottom: 12px;
}

.vh-hero-repo {
  font-size: 18px;
  font-weight: 600;
  color: var(--text);
  margin: 0 0 8px;
  font-family: var(--mono);
}

.vh-hero-refs {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-bottom: 12px;
  font-family: var(--mono);
  font-size: 13px;
  color: var(--muted);
}

.vh-hero-refs code {
  background: var(--surface);
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 12px;
}

.vh-hero-arrow {
  color: var(--muted);
}

.vh-hero-headline {
  font-size: 15px;
  color: var(--text-secondary);
  line-height: 1.5;
  margin-bottom: 20px;
  max-width: 520px;
  margin-left: auto;
  margin-right: auto;
}

.vh-hero-actions {
  display: flex;
  gap: 12px;
  justify-content: center;
  flex-wrap: wrap;
}

/* Posture level colors */
.vh-hero--healthy .vh-hero-level { color: var(--good); }
.vh-hero--review .vh-hero-level { color: var(--warn); }
.vh-hero--elevated .vh-hero-level { color: var(--bad); }
.vh-hero--critical .vh-hero-level { color: var(--bad); }

.vh-hero--healthy { border-bottom-color: var(--good); }
.vh-hero--review { border-bottom-color: var(--warn); }
.vh-hero--elevated { border-bottom-color: var(--bad); }
.vh-hero--critical { border-bottom-color: var(--bad); }

/* Decision result colors (diff views) */
.vh-hero--safe .vh-hero-level { color: var(--good); }
.vh-hero--review .vh-hero-level { color: var(--warn); }
.vh-hero--block .vh-hero-level { color: var(--bad); }

.vh-hero--safe { border-bottom-color: var(--good); }
.vh-hero--block { border-bottom-color: var(--bad); }

/* ==========================================================================
   TrustFactPills — compact stat row
   ========================================================================== */

.tf-pills {
  display: flex;
  gap: 12px;
  justify-content: center;
  flex-wrap: wrap;
  padding: 16px 24px;
  border-bottom: 1px solid var(--border);
}

.tf-pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 13px;
  color: var(--text-secondary);
  padding: 4px 12px;
  background: var(--surface);
  border-radius: 100px;
  white-space: nowrap;
}

.tf-pill strong {
  color: var(--text);
  font-weight: 700;
}

.tf-pill--bad strong { color: var(--bad); }
.tf-pill--warn strong { color: var(--warn); }

/* ==========================================================================
   Scan metadata bar
   ========================================================================== */

.gh-scan-meta {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 24px;
  font-size: 13px;
  color: var(--muted);
  border-bottom: 1px solid var(--border);
  flex-wrap: wrap;
}

.gh-scan-meta .gh-meta-link {
  margin-left: auto;
  color: var(--link);
  text-decoration: none;
  font-size: 12px;
}

.gh-commit-scan-meta {
  align-items: flex-start;
}

.gh-commit-details {
  flex: 1 1 auto;
  min-width: 0;
}

.gh-commit-summary {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  cursor: pointer;
  list-style: none;
}

.gh-commit-summary::-webkit-details-marker,
.gh-commit-summary::marker {
  display: none;
  content: '';
}

.gh-commit-details-label {
  color: var(--link);
  font-size: 12px;
  font-weight: 700;
}

.gh-commit-body {
  margin-top: 12px;
}

/* ==========================================================================
   "Why this repo is risky" section
   ========================================================================== */

.gh-why-risky {
  padding: 24px 24px 16px;
  border-bottom: 1px solid var(--border);
}

.gh-why-list {
  list-style: none;
  margin: 12px 0 0;
  padding: 0;
  display: grid;
  gap: 8px;
}

.gh-why-item {
  position: relative;
  padding-left: 20px;
  font-size: 14px;
  line-height: 1.5;
  color: var(--text);
}

.gh-why-item::before {
  content: '';
  position: absolute;
  left: 0;
  top: 8px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--bad);
}

/* ==========================================================================
   FlowCard — core risk flow component
   ========================================================================== */

.fc-card {
  cursor: pointer;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 20px;
  margin-bottom: 16px;
  transition: border-color 0.15s ease;
}

.fc-card:hover {
  border-color: var(--text-secondary);
}

.fc-card--diff {
  border-left: 3px solid var(--bad);
}

.fc-card--baseline {
  border-left: 3px solid var(--warn);
}

.fc-card-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
  flex-wrap: wrap;
}

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

.fc-route-path {
  font-family: var(--mono);
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
}

.fc-flow-line {
  margin-bottom: 12px;
  overflow-x: auto;
}

.fc-flow-line code {
  font-family: var(--mono);
  font-size: 13px;
  color: var(--text-secondary);
  background: var(--bg);
  padding: 4px 10px;
  border-radius: 4px;
  display: inline-block;
}

.fc-context,
.fc-capability {
  margin-bottom: 8px;
  font-size: 14px;
  line-height: 1.5;
}

.fc-context-label,
.fc-capability-label {
  font-weight: 600;
  color: var(--text-secondary);
  margin-right: 4px;
}

.fc-context-text,
.fc-capability-text {
  color: var(--text);
}

.fc-impact {
  margin-bottom: 8px;
  font-size: 14px;
  line-height: 1.5;
}

.fc-impact-label {
  font-weight: 600;
  color: var(--bad);
  margin-right: 4px;
}

.fc-impact-text {
  color: var(--text);
}

.fc-change {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 8px;
  font-size: 13px;
}

.fc-change-label {
  font-weight: 600;
  color: var(--text-secondary);
  margin-right: 4px;
}

.fc-change-loc {
  font-family: var(--mono);
  color: var(--link);
  font-size: 12px;
}

.fc-code-snippet {
  font-family: var(--mono);
  font-size: 12px;
  line-height: 1.6;
  padding: 10px 12px;
  margin: 0 0 12px;
  overflow-x: auto;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--text-secondary);
}

.fc-anchors {
  display: grid;
  gap: 8px;
  margin-bottom: 12px;
}

.fc-anchor {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  padding: 8px 10px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.02);
}

.fc-anchor-label {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted);
}

.fc-anchor-value {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--text);
  background: var(--bg);
  padding: 2px 8px;
  border-radius: 999px;
}

.fc-anchor-location {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--link);
}

.fc-fix {
  margin-bottom: 12px;
  font-size: 13px;
}

.fc-fix-label {
  font-weight: 600;
  color: var(--good);
  margin-right: 4px;
}

.fc-fix-text {
  color: var(--text-secondary);
}

.fc-diff-hunk {
  margin: 12px 0;
  border-radius: 6px;
  overflow: hidden;
  border: 1px solid var(--border);
}

.fc-diff-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-secondary);
  padding: 8px 12px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
}

.fc-diff-code {
  font-family: var(--mono);
  font-size: 12px;
  line-height: 1.6;
  padding: 12px;
  margin: 0;
  overflow-x: auto;
  background: var(--bg);
}

.fc-card-actions {
  display: flex;
  gap: 8px;
}

.fc-inspect-btn {
  font-size: 12px;
  padding: 4px 12px;
}

.fc-card--selected {
  border-color: var(--link);
  box-shadow: 0 0 0 1px var(--link);
}

/* FlowCard title */
.fc-title {
  font-size: 13px;
  color: var(--text-secondary);
  margin-left: auto;
}

.fc-card--collapsible {
  padding: 0;
}

.fc-card-body {
  padding: 0 20px 16px;
}

.fc-card-body--bare {
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.fc-card-header--in-group {
  cursor: pointer;
  list-style: none;
  user-select: none;
  margin-bottom: 0;
  padding: 16px 20px;
}

.fc-card-header--in-group::-webkit-details-marker { display: none; }
.fc-card-header--in-group::marker { display: none; content: ""; }

.fc-card--collapsible[open] .fc-card-header--in-group {
  margin-bottom: 0;
  border-bottom: 1px solid var(--border);
}

.fc-card--collapsible:hover .fc-card-header--in-group {
  background: rgba(255,255,255,0.03);
}

.fc-card-chevron {
  flex-shrink: 0;
  color: var(--muted);
  transition: transform 120ms ease;
}

.fc-card--collapsible[open] .fc-card-chevron {
  transform: rotate(90deg);
}

.fc-card-header--in-group .fc-title {
  margin-left: 0;
  color: var(--text);
  font-weight: 600;
  font-size: 14px;
  flex: 1;
  min-width: 0;
}

.fc-line {
  flex-shrink: 0;
  font-size: 11px;
  font-weight: 600;
  color: var(--muted);
  font-family: var(--mono);
  margin-left: auto;
}

/* Diff line annotation — highlighted introduced lines */
.gh-diff-line--annotated {
  background: rgba(255,107,107,0.12);
  border-left: 2px solid var(--bad);
}

.gh-diff-line--annotated .gh-diff-line-content {
  color: var(--text);
  font-weight: 600;
}

/* Added lines in diff are clickable for reverse linking */
.gh-diff-line-add {
  cursor: pointer;
}

.gh-diff-line-add:hover {
  background: rgba(57,217,138,0.08);
}

/* ---- Perforce-style focus: dim everything, spotlight annotated lines ---- */

.gh-diff-code-pane--focused .gh-diff-panel {
  opacity: 0.15;
  transition: opacity 0.3s ease;
}

.gh-diff-code-pane--focused .gh-diff-panel--active {
  opacity: 1;
}

.gh-diff-code-pane--focused .gh-diff-panel--active .gh-diff-line {
  opacity: 0.2;
  transition: opacity 0.3s ease;
}

.gh-diff-code-pane--focused .gh-diff-panel--active .gh-diff-line--annotated {
  opacity: 1;
  background: rgba(255,107,107,0.18);
  border-left: 3px solid var(--bad);
}

.gh-diff-line--annotated-endpoint {
  background: rgba(57,217,138,0.10);
  border-left: 2px solid var(--good);
}

.gh-diff-line--annotated-endpoint .gh-diff-line-content {
  color: var(--text);
  font-weight: 600;
}

.gh-diff-code-pane--focused .gh-diff-panel--active .gh-diff-line--annotated-endpoint {
  opacity: 1;
  background: rgba(57,217,138,0.18);
  border-left: 3px solid var(--good);
}

.gh-diff-code-pane--focused .gh-diff-panel--active .gh-diff-hunk-header {
  opacity: 0.2;
}

.gh-diff-code-pane--focused .gh-diff-panel--active .gh-diff-panel-header {
  opacity: 1;
}

.gh-diff-code-pane--focused .gh-diff-file-list {
  opacity: 0.2;
}

.gh-diff-code-pane--focused .gh-diff-file-item--active {
  opacity: 1;
}

/* ==========================================================================
   FixPriority — fix-first rail
   ========================================================================== */

.fp-list {
  padding: 0;
}

.fp-title {
  font-size: 16px;
  font-weight: 700;
  margin: 0 0 16px;
  color: var(--text);
}

.fp-item {
  display: flex;
  gap: 12px;
  padding: 12px 0;
  border-bottom: 1px solid var(--border);
}

.fp-item:last-child {
  border-bottom: none;
}

.fp-item-number {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--surface);
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 700;
  color: var(--text-secondary);
  flex-shrink: 0;
}

.fp-item-body {
  flex: 1;
  min-width: 0;
}

.fp-item-action {
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 4px;
}

.fp-item-files {
  font-size: 12px;
  color: var(--muted);
  margin-bottom: 4px;
}

.fp-item-files code {
  font-family: var(--mono);
  font-size: 11px;
}

.fp-item-count {
  font-size: 12px;
  color: var(--text-secondary);
  margin-bottom: 4px;
}

.fp-item-cta {
  font-size: 12px;
  color: var(--link);
  text-decoration: none;
}

.fp-item-cta:hover {
  text-decoration: underline;
}

/* ==========================================================================
   ImproveLater — secondary concerns
   ========================================================================== */

.il-section {
  margin-top: 24px;
}

.il-summary {
  display: flex;
  align-items: center;
  gap: 12px;
  cursor: pointer;
  padding: 16px 24px;
}

.il-count {
  font-size: 12px;
  color: var(--muted);
  background: var(--surface);
  padding: 2px 8px;
  border-radius: 100px;
}

.il-groups {
  padding: 0 24px 24px;
}

.il-group {
  margin-bottom: 20px;
}

.il-group-label {
  font-size: 13px;
  font-weight: 700;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin: 0 0 8px;
}

.il-group-items {
  display: grid;
  gap: 6px;
}

.il-item {
  display: flex;
  align-items: baseline;
  gap: 12px;
  font-size: 13px;
  padding: 6px 0;
}

.il-item-title {
  color: var(--text);
}

.il-item-loc {
  font-family: var(--mono);
  font-size: 11px;
  margin-left: auto;
  flex-shrink: 0;
}

/* ==========================================================================
   TrustDeltaStrip — what changed summary
   ========================================================================== */

.td-strip {
  padding: 16px 24px;
  border-bottom: 1px solid var(--border);
  background: var(--surface);
}

.td-strip-heading {
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
  margin-bottom: 8px;
}

.td-strip-items {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 8px;
}

.td-strip-item {
  display: inline-flex;
  align-items: center;
  font-size: 13px;
  color: var(--text);
  padding: 4px 12px;
  background: rgba(255,107,107,0.08);
  border-radius: 100px;
  border: 1px solid rgba(255,107,107,0.45);
  box-shadow: inset 0 0 0 1px rgba(255,107,107,0.08);
  text-decoration: none;
  transition: background 160ms ease, border-color 160ms ease, color 160ms ease, transform 160ms ease;
}

a.td-strip-item:hover {
  background: rgba(255,107,107,0.14);
  border-color: rgba(255,107,107,0.7);
  color: var(--bad);
  transform: translateY(-1px);
}

a.td-strip-item:focus-visible {
  outline: 2px solid rgba(255,107,107,0.75);
  outline-offset: 2px;
}

.td-strip-stats {
  display: flex;
  gap: 12px;
  font-size: 13px;
}

.td-stat { color: var(--muted); }
.td-stat--bad { color: var(--bad); font-weight: 600; }
.td-stat--good { color: var(--good); font-weight: 600; }
.td-stat--muted { color: var(--muted); }

/* ==========================================================================
   Compact Header — quiet repo identity line
   ========================================================================== */

.gh-compact-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 24px;
  border-bottom: 1px solid var(--border);
  gap: 16px;
  flex-wrap: wrap;
}

.gh-compact-repo {
  font-size: 16px;
  font-weight: 700;
  font-family: var(--mono);
  margin: 0;
  color: var(--text);
}

.gh-compact-context {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: var(--muted);
  flex-wrap: wrap;
}

.gh-compact-header-right {
  display: flex;
  gap: 6px;
  flex-shrink: 0;
}

.gh-btn-sm {
  font-size: 11px;
  padding: 3px 10px;
}

.gh-meta-sep {
  width: 1px;
  height: 12px;
  background: var(--border);
}

/* ==========================================================================
   Branch / PR Switcher — GitHub-style dropdown
   ========================================================================== */

.gh-branch-switcher {
  position: relative;
}

.gh-branch-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 10px;
  font-size: 12px;
  font-family: var(--mono);
  color: var(--text);
  background: transparent;
  border: 1px solid var(--border);
  border-radius: 6px;
  cursor: pointer;
  white-space: nowrap;
  transition: border-color 0.15s;
}
.gh-branch-btn:hover {
  border-color: var(--muted2);
}
.gh-branch-caret {
  opacity: 0.6;
}

.gh-branch-dropdown {
  display: none;
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  z-index: 100;
  width: 300px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 10px;
  box-shadow: 0 8px 30px rgba(0,0,0,0.4);
  overflow: hidden;
}
.gh-branch-switcher.open .gh-branch-dropdown {
  display: block;
}

.gh-branch-dropdown-header {
  padding: 10px 14px;
  font-size: 12px;
  font-weight: 600;
  color: var(--text);
  border-bottom: 1px solid var(--border);
}

.gh-branch-search {
  display: block;
  width: calc(100% - 20px);
  margin: 10px;
  padding: 6px 10px;
  font-size: 12px;
  font-family: var(--sans);
  color: var(--text);
  background: transparent;
  border: 1px solid var(--border);
  border-radius: 6px;
  outline: none;
}
.gh-branch-search:focus {
  border-color: var(--info);
}
.gh-branch-search::placeholder {
  color: var(--muted2);
}

.gh-branch-tabs {
  display: flex;
  border-bottom: 1px solid var(--border);
}
.gh-branch-tab {
  flex: 1;
  padding: 8px 14px;
  font-size: 12px;
  font-weight: 500;
  color: var(--muted);
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  cursor: pointer;
  transition: color 0.15s;
}
.gh-branch-tab:hover {
  color: var(--text);
}
.gh-branch-tab.active {
  color: var(--text);
  border-bottom-color: var(--info);
}

.gh-branch-list {
  list-style: none;
  margin: 0;
  padding: 0;
  padding-inline-start: 0;
  max-height: 260px;
  overflow-y: auto;
}
.gh-branch-list li {
  list-style: none;
  margin: 0;
  padding: 0;
}
.gh-branch-list--hidden {
  display: none;
}
.gh-branch-list li a {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  font-size: 13px;
  color: var(--text);
  text-decoration: none;
  transition: background 0.1s;
}
.gh-branch-list li a:hover {
  background: rgba(255,255,255,0.06);
}
.gh-branch-loading,
.gh-branch-empty {
  padding: 12px 14px;
  font-size: 12px;
  color: var(--muted2);
  text-align: center;
}
.gh-branch-check {
  flex-shrink: 0;
  color: var(--text);
}
.gh-branch-name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-family: var(--mono);
  font-size: 12px;
}
.gh-branch-default {
  margin-left: auto;
  padding: 1px 6px;
  font-size: 10px;
  font-family: var(--sans);
  color: var(--muted);
  border: 1px solid var(--border);
  border-radius: 10px;
  flex-shrink: 0;
}
.gh-pr-number {
  flex-shrink: 0;
  font-family: var(--mono);
  font-size: 12px;
  color: var(--muted);
}

/* ==========================================================================
   Trust Summary — compact posture strip
   ========================================================================== */

.gh-trust-summary {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 16px 24px;
  border-bottom: 1px solid var(--border);
  flex-wrap: wrap;
}

.gh-trust-summary-posture {
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0.08em;
  padding: 4px 14px;
  border-radius: 4px;
  white-space: nowrap;
}

.gh-posture-healthy { background: rgba(57,217,138,0.12); color: var(--good); }
.gh-posture-review { background: rgba(247,201,72,0.12); color: var(--warn); }
.gh-posture-elevated { background: rgba(255,107,107,0.12); color: var(--bad); }
.gh-posture-critical { background: rgba(255,107,107,0.2); color: var(--bad); }

.gh-trust-summary-facts {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  align-items: center;
}

.gh-ts-fact {
  font-size: 13px;
  color: var(--text-secondary);
}

.gh-ts-fact strong {
  color: var(--text);
  font-weight: 700;
}

.gh-ts-fact--bad strong { color: var(--bad); }
.gh-ts-fact--warn strong { color: var(--warn); }

.gh-trust-summary-breaks {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-left: auto;
}

.gh-ts-break {
  font-size: 11px;
  color: var(--text-secondary);
  padding: 2px 8px;
  background: var(--surface);
  border-radius: 100px;
  white-space: nowrap;
}

/* ==========================================================================
   Route Map Layout — route map as centerpiece with fix rail
   ========================================================================== */

.gh-routemap-layout {
  display: grid;
  grid-template-columns: 1fr 280px;
  gap: 0;
  align-items: start;
}

.gh-routemap-main {
  min-width: 0;
  border-right: 1px solid var(--border);
}

/* Route Map section — larger, more prominent */
.gh-routemap {
  padding: 24px;
}

.gh-routemap-header {
  margin-bottom: 20px;
}

.gh-routemap-title {
  font-size: 20px;
  font-weight: 700;
  margin: 0 0 4px;
  color: var(--text);
}

.gh-routemap-subtitle {
  font-size: 14px;
  color: var(--text-secondary);
  margin: 0;
}

.gh-routemap-empty {
  text-align: center;
  padding: 48px 24px;
}

/* ==========================================================================
   Main Layout — legacy alias (kept for branch.hbs)
   ========================================================================== */

.gh-main-layout {
  display: grid;
  grid-template-columns: 1fr 280px;
  gap: 0;
  align-items: start;
}

.gh-main-content {
  min-width: 0;
  border-right: 1px solid var(--border);
}

.gh-fix-rail {
  position: sticky;
  top: 16px;
  padding: 24px 20px;
  max-height: calc(100vh - 32px);
  overflow-y: auto;
}

.gh-cta-compact {
  margin-top: 24px;
  padding-top: 20px;
  border-top: 1px solid var(--border);
}

.gh-cta-compact h3 {
  font-size: 14px;
  font-weight: 600;
  margin: 0 0 8px;
}

.gh-cta-install {
  display: flex;
  align-items: center;
  gap: 8px;
}

.gh-cta-install code {
  font-family: var(--mono);
  font-size: 11px;
  background: var(--surface);
  padding: 6px 10px;
  border-radius: 4px;
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* ==========================================================================
   Diff Layout — two-column: trust breaks + code pane
   ========================================================================== */

.gh-diff-layout {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0;
  align-items: start;
  position: relative;
}

.gh-diff-connector {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 2;
}

.gh-diff-connector path {
  fill: rgba(255,107,107,0.12);
  stroke: var(--bad);
  stroke-width: 1;
  stroke-opacity: 0.4;
}

.gh-diff-connector path.gh-connector-endpoint {
  fill: rgba(34,197,94,0.08);
  stroke: rgb(34,197,94);
  stroke-opacity: 0.5;
}

.fc-anchor[data-role="endpoint"] .fc-anchor-label {
  color: rgb(34,197,94);
}

.fc-anchor[data-role="endpoint"] .fc-anchor-location {
  color: rgb(34,197,94);
  opacity: 0.85;
}

/* Role badges — panel headers and file list */
.gh-panel-role-badge {
  display: inline-flex;
  align-items: center;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  padding: 2px 7px;
  border-radius: 999px;
  flex-shrink: 0;
  border: 1px solid transparent;
  line-height: 1.4;
}
.gh-panel-role-endpoint { background: rgba(34,197,94,0.12); color: rgb(34,197,94); border-color: rgba(34,197,94,0.3); }
.gh-panel-role-source   { background: rgba(100,181,255,0.12); color: var(--info, #64b5ff); border-color: rgba(100,181,255,0.3); }
.gh-panel-role-sink     { background: rgba(255,107,107,0.12); color: var(--bad); border-color: rgba(255,107,107,0.3); }
.gh-panel-role-change   { background: rgba(247,201,72,0.12); color: var(--warn); border-color: rgba(247,201,72,0.3); }

.gh-diff-panel-roles,
.gh-diff-file-role-badges { display: flex; gap: 4px; margin-left: auto; }

/* Default hint — visible before any finding is selected */
.gh-code-pane-default {
  padding: 40px 16px;
  text-align: center;
}

.gh-code-pane-default .gh-code-pane-hint {
  margin: 0;
  font-size: 14px;
}

.gh-diff-content {
  min-width: 0;
  border-right: 1px solid var(--border);
  padding: 0 0 24px;
}

.gh-diff-code-pane {
  position: sticky;
  top: 16px;
  max-height: calc(100vh - 32px);
  overflow-y: auto;
  padding: 12px;
}

.gh-diff-code-pane .gh-section-title {
  margin-top: 0;
}

.gh-code-pane-hint {
  font-size: 13px;
  padding: 0 4px;
  margin: 0 0 12px;
}

@media (max-width: 768px) {
  .gh-diff-layout {
    grid-template-columns: 1fr;
  }
  .gh-diff-content {
    border-right: none;
    border-bottom: 1px solid var(--border);
  }
  .gh-diff-code-pane {
    position: static;
    max-height: none;
  }
  .gh-diff-connector {
    display: none;
  }
}

/* ==========================================================================
   Section toggle (details/summary)
   ========================================================================== */

.gh-section-toggle {
  display: flex;
  align-items: center;
  gap: 12px;
  cursor: pointer;
  padding: 16px 24px;
  list-style: none;
}

.gh-section-toggle::-webkit-details-marker {
  display: none;
}

.gh-section-toggle::after {
  content: '\25BC';
  font-size: 10px;
  color: var(--muted);
  margin-left: auto;
  transition: transform 0.15s ease;
}

details[open] > .gh-section-toggle::after {
  transform: rotate(180deg);
}

/* Section title variant: good (resolved) */
.gh-section-title-good {
  color: var(--good);
}

/* ==========================================================================
   Flows section
   ========================================================================== */

.gh-flows {
  padding: 24px;
}

.gh-flows .gh-section-title {
  margin-top: 0;
}

.gh-flows-empty {
  text-align: center;
  padding: 48px 24px;
}

.gh-empty-state-healthy {
  background: none;
  border: none;
}

.gh-empty-title {
  font-size: 18px;
  font-weight: 600;
  color: var(--good);
  margin: 0 0 8px;
}

.gh-empty-desc {
  font-size: 14px;
  color: var(--text-secondary);
  margin: 0;
}

/* ==========================================================================
   Responsive — mobile
   ========================================================================== */

@media (max-width: 900px), (hover: none) and (pointer: coarse) {
  .gh-routemap-layout,
  .gh-main-layout {
    grid-template-columns: 1fr;
  }

  .gh-routemap-main,
  .gh-main-content {
    border-right: none;
  }

  .gh-fix-rail {
    position: static;
    max-height: none;
    padding: 24px;
    border-top: 1px solid var(--border);
  }

  .gh-diff-layout {
    grid-template-columns: 1fr;
  }

  .gh-diff-content {
    border-right: none;
  }

  .gh-diff-code-pane {
    position: static;
    max-height: none;
    border-top: 1px solid var(--border);
  }

  .gh-compact-header {
    padding: 10px 16px;
  }

  .gh-compact-header-right {
    display: none;
  }

  .gh-trust-summary {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
    padding: 12px 16px;
  }

  .gh-trust-summary-breaks {
    margin-left: 0;
  }

  .vh-hero {
    padding: 32px 20px;
  }

  .vh-hero-level {
    font-size: 22px;
  }

  .vh-hero-actions {
    flex-direction: column;
    align-items: stretch;
  }

  .vh-hero-actions .gh-btn {
    width: 100%;
    justify-content: center;
  }

  .gh-cta-install {
    flex-wrap: wrap;
    align-items: stretch;
  }

  .gh-cta-install code {
    min-width: 0;
    flex: 1 1 100%;
    white-space: normal;
    overflow-wrap: anywhere;
    text-overflow: initial;
  }

  .gh-cta-install .copy-btn {
    margin-left: auto;
  }

  .gh-route-summary {
    padding-right: 0;
  }

  .gh-route-row {
    display: grid;
    grid-template-columns: auto auto minmax(0, 1fr) auto;
    align-items: flex-start;
    gap: 8px;
  }

  .gh-route {
    grid-column: 1 / -1;
    grid-row: 2;
    white-space: normal;
    overflow-wrap: anywhere;
    word-break: break-word;
  }

  .gh-route-label {
    grid-column: 1 / -1;
    grid-row: 3;
    margin-left: 0;
    white-space: normal;
    overflow-wrap: anywhere;
    word-break: break-word;
  }

  .gh-route-chevron {
    grid-column: 4;
    grid-row: 1;
    margin-left: 0;
    justify-self: end;
    align-self: center;
  }

  .gh-routemap {
    padding: 16px;
  }

  .fc-card {
    padding: 16px;
  }

  .gh-live-header-actions { display: none; }
  .gh-live-stale { flex-direction: column; }
  .gh-pr-callout {
    margin: 16px;
    padding: 16px;
  }
  .gh-pr-callout-head,
  .gh-pr-callout-item {
    flex-direction: column;
    align-items: flex-start;
  }
  .gh-pr-callout-link,
  .gh-pr-callout-actions {
    width: 100%;
  }
  .gh-pr-callout-actions .gh-btn {
    flex: 1 1 0;
    justify-content: center;
  }
  .gh-pr-callout-item-title-row {
    flex-wrap: wrap;
  }
  .gh-view-toggle { margin-top: 8px; }
  .gh-dangerous-header { flex-direction: column; align-items: flex-start; gap: 8px; }
}

/* ==========================================================================
   Live Repo Header — commit identity + freshness
   ========================================================================== */

.gh-live-header {
  padding: 16px 24px;
  border-bottom: 1px solid var(--border);
}

.gh-live-header-repo {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 8px;
}

.gh-live-repo-name {
  font-size: 18px;
  font-weight: 700;
  font-family: var(--mono);
  margin: 0;
  color: var(--text);
  display: flex;
  align-items: center;
  gap: 8px;
}

.gh-live-gh-link {
  color: var(--muted);
  display: inline-flex;
  transition: color 0.15s;
}

.gh-live-gh-link:hover {
  color: var(--text);
}

.gh-live-header-actions {
  display: flex;
  gap: 6px;
  flex-shrink: 0;
}

.gh-live-header-commit {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  font-size: 13px;
  color: var(--muted);
}

.gh-live-branch {
  font-family: var(--mono);
  font-size: 12px;
  background: var(--surface);
  padding: 2px 8px;
  border-radius: 4px;
  color: var(--text-secondary);
}

.gh-live-sha {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--link);
  text-decoration: none;
}

.gh-live-sha:hover { text-decoration: underline; }

.gh-live-commit-link {
  color: var(--link);
  font-size: 12px;
  text-decoration: none;
}

.gh-live-commit-link:hover {
  text-decoration: underline;
}

.gh-live-msg {
  color: var(--text-secondary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 300px;
}

.gh-live-author {
  color: var(--text-secondary);
  font-size: 12px;
}

.gh-live-time, .gh-live-meta, .gh-live-scan-time {
  color: var(--muted);
  font-size: 12px;
}

.gh-live-scan-time {
  padding-left: 10px;
  border-left: 1px solid var(--border);
}

/* Freshness badge */
.gh-freshness {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.04em;
  padding: 2px 10px;
  border-radius: 100px;
  white-space: nowrap;
}

.gh-freshness--live { background: rgba(57,217,138,0.15); color: var(--good); }
.gh-freshness--behind { background: rgba(247,201,72,0.15); color: var(--warn); }
.gh-freshness--unknown { background: rgba(169,177,199,0.1); color: var(--muted); }
.gh-freshness--compare {
  background: rgba(124,92,252,0.15);
  color: var(--purple, #7c5cfc);
  text-decoration: none;
  cursor: pointer;
}
.gh-freshness--compare:hover {
  background: rgba(124,92,252,0.25);
}

/* Stale scan actions */
.gh-live-stale {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 8px;
  font-size: 12px;
  color: var(--text-secondary);
}

.gh-live-stale-info code {
  font-family: var(--mono);
  font-size: 11px;
}

.gh-live-refs {
  display: flex;
  gap: 8px;
  margin-top: 8px;
  font-size: 12px;
  flex-wrap: wrap;
}

/* Open PR callout */
.gh-pr-callout {
  margin: 18px 24px 0;
  padding: 14px 16px;
  border: 1px solid rgba(169, 177, 199, 0.14);
  border-radius: 10px;
  background: var(--surface);
}

.gh-pr-callout-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.gh-pr-callout-label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-secondary);
}

.gh-pr-callout-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 6px;
  height: 18px;
  border-radius: 999px;
  background: rgba(169, 177, 199, 0.14);
  font-size: 11px;
  font-weight: 700;
  color: var(--text-secondary);
}

.gh-pr-callout-link {
  flex-shrink: 0;
  color: var(--link);
  text-decoration: none;
  font-size: 12px;
  font-weight: 500;
}

.gh-pr-callout-link:hover {
  text-decoration: underline;
}

.gh-pr-callout-list {
  display: grid;
  gap: 10px;
}

.gh-pr-callout-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px solid rgba(169, 177, 199, 0.14);
  background: rgba(10, 14, 25, 0.28);
}

.gh-pr-callout-item--recent {
  border-color: rgba(100, 181, 255, 0.28);
  background: linear-gradient(180deg, rgba(100, 181, 255, 0.08), rgba(10, 14, 25, 0.28));
}

.gh-pr-callout-item-main {
  min-width: 0;
  flex: 1;
}

.gh-pr-callout-item-title-row {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.gh-pr-callout-item-title {
  min-width: 0;
  font-size: 14px;
  font-weight: 700;
  color: var(--text);
  text-decoration: none;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.gh-pr-callout-item-title:hover {
  color: var(--link);
}

.gh-pr-callout-item-gh {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  color: var(--muted);
  text-decoration: none;
  line-height: 0;
}

.gh-pr-callout-item-gh:hover {
  color: var(--text);
}

.gh-pr-callout-badge,
.gh-pr-callout-time {
  flex-shrink: 0;
  font-size: 11px;
  font-weight: 700;
}

.gh-pr-callout-badge {
  padding: 4px 8px;
  border-radius: 999px;
  background: rgba(100, 181, 255, 0.14);
  color: #9ad0ff;
}

.gh-pr-callout-time {
  color: var(--muted);
}

.gh-pr-callout-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 6px;
  color: var(--text-secondary);
  font-size: 12px;
}

.gh-pr-callout-meta code {
  font-family: var(--mono);
  font-size: 11px;
}

.gh-pr-callout-arrow,
.gh-pr-callout-sep {
  color: var(--muted);
}

.gh-pr-callout-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.gh-pr-callout-footer {
  margin-top: 12px;
  font-size: 13px;
}

.gh-pr-callout-footer a {
  color: var(--link);
  text-decoration: none;
}

.gh-pr-callout-footer a:hover {
  text-decoration: underline;
}

/* ==========================================================================
   Shoulder Explainer — teaches the mental model
   ========================================================================== */

.gh-explainer {
  padding: 14px 24px;
  border-bottom: 1px solid var(--border);
  background: rgba(100,181,255,0.04);
}

.gh-explainer p {
  margin: 0 0 8px;
  font-size: 13px;
  line-height: 1.6;
  color: var(--text-secondary);
  max-width: 720px;
}

.gh-explainer-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
  font-size: 12px;
  color: var(--muted);
}

.gh-explainer-list li::before {
  content: '→ ';
  color: var(--link);
}

/* Killer metric */
.gh-trust-summary-metric {
  font-size: 13px;
  color: var(--text-secondary);
  margin-top: 4px;
}

.gh-trust-summary-metric strong {
  color: var(--bad);
}

/* ==========================================================================
   Fix First — THE entry point
   ========================================================================== */

.gh-fix-first {
  padding: 24px;
  border-bottom: 1px solid var(--border);
}

.gh-fix-first-title {
  font-size: 20px;
  font-weight: 700;
  margin: 0 0 4px;
  color: var(--text);
}

.gh-fix-first-subtitle {
  font-size: 13px;
  color: var(--text-secondary);
  margin: 0 0 20px;
}

a.gh-fix-first-item,
.gh-fix-first-item {
  display: flex;
  gap: 16px;
  padding: 16px;
  margin-bottom: 8px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  text-decoration: none;
  color: inherit;
  cursor: pointer;
  transition: border-color 0.15s ease;
}

a.gh-fix-first-item:hover {
  border-color: var(--bad);
}

.gh-fix-first-num {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--bad);
  color: #0b0f19;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  font-weight: 800;
  flex-shrink: 0;
}

.gh-fix-first-body {
  flex: 1;
  min-width: 0;
}

.gh-fix-first-route {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 6px;
}

.gh-fix-first-flow {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--text-secondary);
  margin-bottom: 4px;
}

.gh-fix-first-impact {
  font-size: 13px;
  color: var(--bad);
  margin-bottom: 6px;
}

.gh-fix-first-fix {
  font-size: 13px;
  color: var(--good);
}

/* Safe routes (collapsed) */
.gh-safe-routes {
  margin-top: 16px;
}

.gh-safe-routes-summary {
  font-size: 13px;
  color: var(--muted);
  cursor: pointer;
  padding: 8px 0;
  list-style: none;
}

.gh-safe-routes-summary::-webkit-details-marker {
  display: none;
}

.gh-safe-routes-summary::before {
  content: '▸ ';
}

.gh-safe-routes[open] > .gh-safe-routes-summary::before {
  content: '▾ ';
}

/* ==========================================================================
   Trust Summary — hero strip with headline
   ========================================================================== */

.gh-trust-summary-headline {
  font-size: 14px;
  color: var(--text);
  line-height: 1.4;
  max-width: 600px;
}

/* ==========================================================================
   Dangerous Routes — replaces Route Map
   ========================================================================== */

.gh-dangerous {
  padding: 24px;
}

.gh-dangerous-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 20px;
}

.gh-dangerous-title {
  font-size: 20px;
  font-weight: 700;
  margin: 0 0 4px;
  color: var(--text);
}

.gh-dangerous-subtitle {
  font-size: 14px;
  color: var(--text-secondary);
  margin: 0;
}

/* View toggle: by route / by fix */
.gh-view-toggle {
  display: flex;
  border: 1px solid var(--border);
  border-radius: 6px;
  overflow: hidden;
  flex-shrink: 0;
}

.gh-toggle-btn {
  background: none;
  border: none;
  padding: 6px 14px;
  font-size: 12px;
  color: var(--muted);
  cursor: pointer;
  font-family: var(--sans);
  transition: background 0.1s, color 0.1s;
}

.gh-toggle-btn:hover { color: var(--text); }
.gh-toggle-btn--active {
  background: var(--surface);
  color: var(--text);
  font-weight: 600;
}

.gh-dangerous-view--hidden { display: none; }

/* Fix cards (by-fix view) */
.gh-fix-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 16px;
  margin-bottom: 12px;
}

.gh-fix-card-action {
  font-size: 15px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 6px;
}

.gh-fix-card-files {
  font-size: 12px;
  color: var(--muted);
  margin-bottom: 4px;
}

.gh-fix-card-files code {
  font-family: var(--mono);
  font-size: 11px;
}

.gh-fix-card-count {
  font-size: 12px;
  color: var(--text-secondary);
}

/* =============================================================================
   COMPARISON TAB — curated tool comparison for showcase repos
   ============================================================================= */

.gh-comparison-page {
  max-width: 900px;
  margin: 0 auto;
  padding: 40px 20px;
}

.gh-comparison-header {
  margin-bottom: 32px;
}

.gh-comparison-back {
  font-size: 13px;
  color: var(--muted);
  text-decoration: none;
  display: inline-block;
  margin-bottom: 12px;
}

.gh-comparison-back:hover {
  color: var(--text);
}

.gh-comparison-title {
  font-size: 24px;
  font-weight: 700;
  margin: 0 0 8px;
}

.gh-comparison-lead {
  font-size: 15px;
  color: var(--muted);
  margin: 0;
}

.gh-comparison-cta {
  display: flex;
  gap: 12px;
  margin-top: 32px;
}

.gh-comparison {
  margin-top: 48px;
}

.comp-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
  margin-bottom: 32px;
}

.comp-table th {
  text-align: left;
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  padding: 8px 12px;
  border-bottom: 1px solid var(--border);
}

.comp-table td {
  padding: 10px 12px;
  border-bottom: 1px solid rgba(255,255,255,0.04);
}

.comp-tool-name {
  font-weight: 600;
}

.comp-tool-version {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--muted);
}

.comparison-detail-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-bottom: 24px;
}

@media (max-width: 768px) {
  .comparison-detail-grid {
    grid-template-columns: 1fr;
  }
}

.comp-detail-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 16px;
}

.comp-detail-card h3 {
  font-size: 14px;
  font-weight: 600;
  margin: 0 0 12px;
  color: var(--text);
}

.comp-finding-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.comp-finding-list li {
  font-size: 13px;
  padding: 6px 0;
  border-bottom: 1px solid rgba(255,255,255,0.03);
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: baseline;
}

.comp-finding-list li:last-child {
  border-bottom: none;
}

.comp-finding-name {
  font-weight: 500;
}

.comp-finding-note {
  font-size: 12px;
  color: var(--muted);
  display: block;
  width: 100%;
}

.comp-severity {
  font-size: 11px;
  font-weight: 600;
  padding: 1px 6px;
  border-radius: 3px;
  text-transform: uppercase;
  letter-spacing: 0.3px;
}

.comp-sev-critical {
  background: rgba(255, 71, 71, 0.12);
  color: #ff4747;
}

.comp-sev-high {
  background: rgba(255, 159, 67, 0.12);
  color: #ff9f43;
}

.comp-sev-medium {
  background: rgba(255, 214, 0, 0.12);
  color: #ffd600;
}

.comp-sev-low {
  background: rgba(169, 177, 199, 0.12);
  color: #a9b1c7;
}

.comp-quality {
  font-size: 11px;
  font-weight: 600;
  padding: 1px 6px;
  border-radius: 3px;
  text-transform: uppercase;
  letter-spacing: 0.3px;
}

.comp-quality-valid {
  background: rgba(57, 217, 138, 0.12);
  color: #39d98a;
}

.comp-quality-false-positive {
  background: rgba(255, 71, 71, 0.12);
  color: #ff4747;
}

.comp-quality-noise {
  background: rgba(169, 177, 199, 0.12);
  color: #a9b1c7;
}

.comparison-takeaway {
  font-size: 14px;
  color: var(--muted);
  font-style: italic;
  padding: 16px;
  border-left: 3px solid var(--purple, #7c5cfc);
  background: rgba(124, 92, 252, 0.04);
  border-radius: 0 6px 6px 0;
}

.gh-feedback-prompt {
  max-width: 880px;
  margin: 32px auto 0;
  padding: 14px 18px;
  background: rgba(57, 217, 138, 0.04);
  border: 1px solid rgba(57, 217, 138, 0.20);
  border-radius: 10px;
  font-size: 14px;
  color: var(--muted);
}

.gh-feedback-prompt p {
  margin: 0;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}

.gh-feedback-prompt a {
  color: var(--good);
  font-weight: 600;
  text-decoration: none;
  margin-left: auto;
}

.gh-feedback-prompt a:hover {
  text-decoration: underline;
}

.gh-feedback-pill {
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.08em;
  padding: 2px 8px;
  border-radius: 4px;
  background: rgba(57, 217, 138, 0.10);
  border: 1px solid rgba(57, 217, 138, 0.30);
  color: var(--good);
}
