@import url("https://fonts.googleapis.com/css2?family=IBM+Plex+Sans:wght@400;500;600&family=JetBrains+Mono:wght@400;500;600;700&display=swap");

/* ═══════════════════════════════════════════════════════════
   GOAT Flow Dashboard - Design Tokens & Component Styles
   ═══════════════════════════════════════════════════════════ */

/* ═══ Color Palette ═══ */
/* Every color in the dashboard defined once. Change here, changes everywhere. */
:root {
  /* Typography */
  --font-body:
    "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --font-mono:
    "Cascadia Code", "JetBrains Mono", "Fira Code", Consolas, monospace;

  /* Zinc (neutral) */
  --zinc-950: #0d0d10;
  --zinc-900: #111114;
  --zinc-850: #1a1a1e;
  --zinc-825: #1e1e22;
  --zinc-800: #27272a;
  --zinc-750: #2a2a2e;
  --zinc-700: #3f3f46;
  --zinc-600: #52525b;
  --zinc-500: #71717a;
  --zinc-400: #a1a1aa;
  --zinc-300: #d4d4d8;
  --zinc-200: #e4e4e7;
  --zinc-100: #f4f4f5;
  --zinc-50: #fafafa;

  /* Green (healthy/passing status) */
  --green-950: #0d1a0d;
  --green-900: #14532d;
  --green-800: #166534;
  --green-700: #15803d;
  --green-600: #16a34a;
  --green-500: #22c55e;
  --green-400: #4ade80;
  --green-300: #86efac;
  --green-200: #bbf7d0;
  --green-100: #dcfce7;
  --green-50: #f0fdf4;

  /* Red (danger) */
  --red-950: #450a0a;
  --red-900: #7f1d1d;
  --red-800: #991b1b;
  --red-700: #dc2626;
  --red-400: #f87171;
  --red-300: #fca5a5;
  --red-200: #fecaca;
  --red-100: #fee2e2;

  /* Amber (warning) */
  --amber-950: #422006;
  --amber-700: #b45309;
  --amber-600: #d97706;
  --amber-400: #fbbf24;
  --amber-300: #facc15;
  --amber-100: #fef9c3;
  --amber-50: #fef3c7;

  /* Orange (high severity) */
  --orange-950: #451a03;
  --orange-700: #c2410c;
  --orange-400: #fb923c;
  --orange-100: #ffedd5;

  /* Blue / Indigo / Purple */
  --blue-400: #60a5fa;
  --indigo-950: #1e3a5f;
  --indigo-700: #4338ca;
  --indigo-600: #4f46e5;
  --indigo-400: #818cf8;
  --indigo-100: #e0e7ff;
  --purple-400: #c084fc;
}

/* ═══ Semantic Tokens (dark theme = default) ═══ */
:root {
  --text-primary: #e2e8f0;
  --text-secondary: #cbd5e1;
  --text-muted: #94a3b8;
  --text-disabled: #64748b;

  --surface-deep: #0b0f14;
  --surface-base: #11161d;
  --surface-page: #0d1218;
  --surface-elevated: #1a212c;

  --border-faint: rgba(148, 163, 184, 0.08);
  --border-subtle: rgba(148, 163, 184, 0.16);
  --border-default: rgba(148, 163, 184, 0.28);

  --accent: #818cf8;
  --accent-hover: #a5b4fc;
  --accent-bg: rgba(129, 140, 248, 0.12);
  --accent-strong: #4f46e5;
  --accent-contrast: #ffffff;
  --accent-border: rgba(129, 140, 248, 0.36);

  --status-pass: var(--green-400);
  --status-pass-bg: rgba(34, 197, 94, 0.1);
  --status-pass-border: rgba(34, 197, 94, 0.28);
  --status-running: var(--accent);
  --status-running-bg: rgba(129, 140, 248, 0.12);
  --status-running-border: rgba(129, 140, 248, 0.32);
  --status-waiting: var(--amber-400);
  /* Saturated orange for partial-score signals on the Skills/Quality pages.
     Distinct from --status-waiting (amber yellow) so partial bars don't
     read as the same colour as caution-state pills. */
  --orange-warn: #f59e0b;
  --orange-warn-bg: rgba(245, 158, 11, 0.1);
  --orange-warn-border: rgba(245, 158, 11, 0.28);
  --status-recent: var(--zinc-400);
  --status-danger: var(--red-400);
  --amber-bg: rgba(245, 158, 11, 0.1);
  --amber-border: rgba(245, 158, 11, 0.3);
  --red-bg: rgba(248, 113, 113, 0.1);
  --red-border: rgba(248, 113, 113, 0.3);
  --neutral-bg: rgba(148, 163, 184, 0.08);
  --neutral-border: rgba(148, 163, 184, 0.22);
  --ui-workflow-text: #38bdf8;
  --ui-workflow-bg: rgba(14, 165, 233, 0.12);
  --ui-workflow-border: rgba(56, 189, 248, 0.4);
}

/* ═══ Light Theme Token Overrides ═══ */
:root:not(.dark) {
  --text-primary: #0f172a;
  --text-secondary: #334155;
  --text-muted: #475569;
  --text-disabled: #64748b;

  --surface-deep: #fafbfc;
  --surface-base: #ffffff;
  --surface-page: #f1f5f9;
  --surface-elevated: #e2e8f0;

  --border-faint: rgba(15, 23, 42, 0.06);
  --border-subtle: rgba(15, 23, 42, 0.08);
  --border-default: rgba(15, 23, 42, 0.18);

  --accent: #4f46e5;
  --accent-hover: #4338ca;
  --accent-bg: rgba(79, 70, 229, 0.08);
  --accent-strong: #4f46e5;
  --accent-contrast: #ffffff;
  --accent-border: rgba(79, 70, 229, 0.3);

  --status-pass: var(--green-600);
  --status-pass-bg: rgba(22, 163, 74, 0.08);
  --status-pass-border: rgba(22, 163, 74, 0.28);
  --status-running: var(--accent);
  --status-running-bg: rgba(79, 70, 229, 0.08);
  --status-running-border: rgba(79, 70, 229, 0.28);
  --status-waiting: var(--amber-600);
  --orange-warn: #d97706;
  --orange-warn-bg: rgba(217, 119, 6, 0.08);
  --orange-warn-border: rgba(217, 119, 6, 0.32);
  --status-recent: var(--zinc-500);
  --status-danger: var(--red-700);
  --amber-bg: rgba(217, 119, 6, 0.1);
  --amber-border: rgba(217, 119, 6, 0.3);
  --red-bg: rgba(220, 38, 38, 0.08);
  --red-border: rgba(220, 38, 38, 0.28);
  --neutral-bg: rgba(15, 23, 42, 0.05);
  --neutral-border: rgba(15, 23, 42, 0.14);
  --ui-workflow-text: #0369a1;
  --ui-workflow-bg: #e0f2fe;
  --ui-workflow-border: rgba(2, 132, 199, 0.28);
}

/* ═══ Global Resets ═══ */
[x-cloak] {
  display: none !important;
}
button,
select,
summary,
label,
[role="button"] {
  cursor: pointer;
}
body {
  font-family: var(--font-body);
  font-size: 14px;
  line-height: 1.5;
}
.terminal-container {
  width: 100%;
  height: 100%;
}
.terminal-container .xterm {
  height: 100%;
}
.terminal-session-shell {
  background: #0f1729;
}
.terminal-loading-overlay {
  position: absolute;
  inset: 0;
  z-index: 4;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: #0f1729;
  color: #cbd5e1;
  font-family: var(--font-mono);
}
.terminal-loading-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  max-width: min(440px, 100%);
  text-align: center;
}
.terminal-loading-row {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 22px;
  font-size: 13px;
}
.terminal-loading-spinner::before {
  display: inline-block;
  width: 1.1em;
  content: "⠋";
  animation: terminal-loading-spinner 0.8s steps(10, end) infinite;
}
.terminal-loading-hint {
  max-width: 34rem;
  margin: 0;
  color: #94a3b8;
  font-family: var(--font-body);
  font-size: 12px;
}
.terminal-loading-overlay-error {
  color: #fecaca;
}
.terminal-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.6);
  z-index: 10;
  border-radius: 0.75rem;
}
@keyframes terminal-loading-spinner {
  0% {
    content: "⠋";
  }
  10% {
    content: "⠙";
  }
  20% {
    content: "⠹";
  }
  30% {
    content: "⠸";
  }
  40% {
    content: "⠼";
  }
  50% {
    content: "⠴";
  }
  60% {
    content: "⠦";
  }
  70% {
    content: "⠧";
  }
  80% {
    content: "⠇";
  }
  90%,
  100% {
    content: "⠏";
  }
}
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}
.gf-icon-sprite {
  display: none;
}
.gf-preset-badge {
  display: inline-flex;
  align-items: center;
  height: 18px;
  padding: 1px 6px;
  border-radius: 3px;
  border: 1px solid var(--border-subtle);
  font-size: 10px;
  line-height: 1;
  color: var(--text-secondary);
  background: rgba(148, 163, 184, 0.08);
  white-space: nowrap;
}
.gf-preset-badge-good {
  color: var(--status-pass);
  border-color: var(--status-pass-border);
  background: var(--status-pass-bg);
}
.gf-preset-badge-warn {
  color: #f59e0b;
  border-color: rgba(245, 158, 11, 0.35);
  background: rgba(245, 158, 11, 0.1);
}
.gf-preset-badge-danger {
  color: #f87171;
  border-color: rgba(248, 113, 113, 0.35);
  background: rgba(248, 113, 113, 0.1);
}
.gf-preset-badge-ui {
  color: var(--ui-workflow-text);
  border-color: var(--ui-workflow-border);
  background: var(--ui-workflow-bg);
}
.gf-check-row {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 24px;
  color: var(--text-secondary);
  font-size: 12px;
}
.gf-check-row input {
  width: 13px;
  height: 13px;
  flex-shrink: 0;
}
:focus-visible {
  outline: 2px solid var(--blue-400);
  outline-offset: 3px;
  border-radius: 4px;
  box-shadow: 0 0 0 4px rgba(96, 165, 250, 0.3);
}

/* ═══ Tailwind Dark Mode Fallback ═══ */
/* Patches Tailwind utility colors for dark mode */
.dark {
  background-color: var(--zinc-850) !important;
  color: var(--zinc-200);
}
.dark .bg-white {
  background-color: var(--zinc-900) !important;
}
.dark .bg-gray-50,
.dark .bg-gray-100 {
  background-color: var(--zinc-850) !important;
}
.dark .bg-gray-800 {
  background-color: var(--zinc-900) !important;
}
.dark .bg-gray-700 {
  background-color: var(--zinc-800) !important;
}
.dark .bg-gray-900 {
  background-color: var(--zinc-850) !important;
}
.dark .border-gray-200,
.dark .border-gray-100 {
  border-color: var(--zinc-750) !important;
}
.dark .border-gray-300 {
  border-color: var(--zinc-700) !important;
}
.dark .border-gray-600 {
  border-color: var(--zinc-700) !important;
}
.dark .border-gray-700 {
  border-color: var(--zinc-750) !important;
}
.dark .text-gray-900 {
  color: var(--zinc-200) !important;
}
.dark .text-gray-700 {
  color: var(--zinc-300) !important;
}
.dark .text-gray-600 {
  color: var(--zinc-400) !important;
}
.dark .text-gray-500 {
  color: var(--zinc-400) !important;
}
.dark .text-gray-400 {
  color: var(--zinc-500) !important;
}
.dark .text-gray-300 {
  color: var(--zinc-400) !important;
}
.dark input,
.dark textarea {
  background-color: var(--zinc-850) !important;
  color: var(--zinc-200) !important;
  border-color: var(--zinc-700) !important;
}
.dark pre {
  color: var(--zinc-300) !important;
}
.dark .stroke-gray-700,
.dark path[stroke="#e5e7eb"] {
  stroke: var(--zinc-750) !important;
}
.dark .border-l-blue-400 {
  border-left-color: var(--blue-400) !important;
}
.dark .border-l-purple-400 {
  border-left-color: var(--purple-400) !important;
}
.dark .border-l-amber-400 {
  border-left-color: var(--amber-400) !important;
}
.dark .border-l-green-400 {
  border-left-color: var(--green-400) !important;
}
.dark .border-l-red-400 {
  border-left-color: var(--red-400) !important;
}
.dark .border-l-emerald-400 {
  border-left-color: #34d399 !important;
}
.dark .border-l-gray-400 {
  border-left-color: #9ca3af !important;
}

/* ═══ Print ═══ */
@media print {
  .no-print {
    display: none !important;
  }
  body {
    background: white !important;
    color: black !important;
  }
  .shadow {
    box-shadow: none !important;
    border: 1px solid var(--zinc-200);
  }
  main {
    padding: 0 !important;
  }
  * {
    break-inside: avoid;
  }
  svg path {
    stroke-width: 4 !important;
  }
  [role="tabpanel"] {
    page-break-before: auto;
  }
  h3 {
    page-break-after: avoid;
  }
  .rounded-full {
    print-color-adjust: exact;
    -webkit-print-color-adjust: exact;
  }
  span[class*="bg-"] {
    print-color-adjust: exact;
    -webkit-print-color-adjust: exact;
  }
}

/* ═══ Scrollbars ═══ */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}
::-webkit-scrollbar-track {
  background: transparent;
}
.dark ::-webkit-scrollbar-thumb {
  background: var(--zinc-700);
  border-radius: 3px;
}
.dark ::-webkit-scrollbar-thumb:hover {
  background: var(--zinc-600);
}
:root:not(.dark) ::-webkit-scrollbar-thumb {
  background: var(--zinc-300);
  border-radius: 3px;
}
:root:not(.dark) ::-webkit-scrollbar-thumb:hover {
  background: var(--zinc-400);
}
* {
  scrollbar-width: thin;
  scrollbar-color: var(--zinc-700) transparent;
}
:root:not(.dark) * {
  scrollbar-color: var(--zinc-300) transparent;
}

/* ═══════════════════════════════════════════════════════════
   GOAT Flow Components
   All classes use semantic tokens → no light mode overrides needed
   ═══════════════════════════════════════════════════════════ */

/* --- Text helpers --- */
.gf-text-primary {
  color: var(--text-primary);
}
.gf-text-secondary {
  color: var(--text-secondary);
}
.gf-text-muted {
  color: var(--text-muted);
}
.gf-text-disabled {
  color: var(--text-disabled);
}
.section-label,
.gf-section-label {
  color: var(--text-muted);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.08em;
  line-height: 1.2;
  text-transform: uppercase;
}
.gf-section-count {
  color: var(--text-disabled);
  font-family: var(--font-mono);
  font-weight: 500;
  letter-spacing: 0.04em;
}

/* --- Empty states --- */
.gf-empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 22px 16px;
  text-align: center;
  color: var(--text-muted);
}
.gf-empty-mark {
  display: inline-grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border-radius: 8px;
  color: var(--text-muted);
  background: var(--neutral-bg);
  border: 1px solid var(--neutral-border);
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 700;
}
.gf-empty-state p {
  margin: 0;
  max-width: 360px;
  color: var(--text-muted);
  font-size: 13px;
}

/* --- Status marks --- */
.gf-status-dot {
  display: inline-grid;
  place-items: center;
  width: 14px;
  height: 14px;
  border-radius: 999px;
  flex: 0 0 auto;
  font-family: var(--font-mono);
  font-size: 8px;
  font-weight: 700;
  line-height: 1;
  color: var(--surface-deep);
  background: var(--status-recent);
}
.gf-status-pass {
  background: var(--status-pass);
  box-shadow: 0 0 0 3px var(--status-pass-bg);
}
.gf-status-running {
  background: var(--status-running);
  box-shadow: 0 0 0 3px var(--status-running-bg);
}
.gf-status-waiting {
  background: var(--status-waiting);
  box-shadow: 0 0 0 3px var(--amber-bg);
}
.gf-status-recent {
  background: var(--status-recent);
  color: var(--surface-base);
  box-shadow: 0 0 0 3px var(--neutral-bg);
}
.gf-status-danger {
  background: var(--status-danger);
  box-shadow: 0 0 0 3px var(--red-bg);
}

/* --- Workspace session rail --- */
.workspace-session-rail {
  --workspace-rail-inset: 16px;
  padding: 0;
}
.workspace-session-rail.is-collapsed {
  padding: 8px 8px 12px;
  overflow: visible;
}
.workspace-session-expanded {
  display: flex;
  min-height: 0;
  flex: 1 1 auto;
  flex-direction: column;
  padding-top: 20px;
}
.workspace-session-heading,
.workspace-session-launch,
.workspace-session-footer {
  padding-right: var(--workspace-rail-inset);
  padding-left: var(--workspace-rail-inset);
}
.workspace-session-heading {
  flex: 0 0 auto;
  margin-bottom: 10px;
}
.workspace-session-list-scroll {
  display: flex;
  min-height: 0;
  flex: 1 1 auto;
  flex-direction: column;
  gap: 24px;
  overflow-y: auto;
  padding: 0 var(--workspace-rail-inset) 2px;
  scrollbar-width: none;
}
.workspace-session-list-scroll::-webkit-scrollbar {
  display: none;
}
.workspace-session-card-stack {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.workspace-session-card {
  position: relative;
  padding: 12px;
  border-left-width: 3px;
  border-left-color: transparent;
  cursor: pointer;
}
.workspace-session-card.is-active {
  border-color: var(--accent-border);
  border-left-color: var(--accent);
  background: var(--accent-bg);
}
.workspace-session-card.is-waiting:not(.is-active) {
  border-color: var(--amber-border);
  background: var(--amber-bg);
}
.workspace-session-card-body {
  display: flex;
  min-width: 0;
  flex: 1;
  flex-direction: column;
  gap: 4px;
}
.workspace-session-title-row {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 7px;
}
.workspace-session-title {
  min-width: 0;
  overflow: hidden;
  flex: 1 1 auto;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 13px;
  font-weight: 600;
}
.workspace-agent-chip {
  display: inline-flex;
  max-width: 76px;
  flex: 0 0 auto;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  padding: 1px 6px;
  border: 1px solid var(--workspace-agent-border, var(--border-subtle));
  border-radius: 999px;
  background: var(--workspace-agent-bg, var(--neutral-bg));
  color: var(--workspace-agent-color, var(--text-secondary));
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 700;
  line-height: 1.35;
}
.workspace-agent-claude {
  --workspace-agent-color: var(--purple-400);
  --workspace-agent-bg: color-mix(in srgb, var(--purple-400) 12%, transparent);
  --workspace-agent-border: color-mix(
    in srgb,
    var(--purple-400) 34%,
    transparent
  );
}
.workspace-agent-codex {
  --workspace-agent-color: var(--green-400);
  --workspace-agent-bg: var(--status-pass-bg);
  --workspace-agent-border: var(--status-pass-border);
}
.workspace-agent-antigravity {
  --workspace-agent-color: var(--blue-400);
  --workspace-agent-bg: color-mix(in srgb, var(--blue-400) 12%, transparent);
  --workspace-agent-border: color-mix(
    in srgb,
    var(--blue-400) 34%,
    transparent
  );
}
.workspace-agent-copilot {
  --workspace-agent-color: var(--ui-workflow-text);
  --workspace-agent-bg: var(--ui-workflow-bg);
  --workspace-agent-border: var(--ui-workflow-border);
}
.workspace-action-btn {
  font-size: 11px;
}
.workspace-danger-ghost {
  border-color: transparent;
  background: transparent;
  color: var(--red-400);
  font-size: 11px;
}
.workspace-danger-ghost:hover {
  border-color: var(--red-border);
  background: var(--red-bg);
  color: var(--red-400);
}
.workspace-session-confirm {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 6px;
  margin-top: 8px;
  font-size: 11px;
}
.workspace-session-empty {
  align-items: flex-start;
  justify-content: flex-start;
  padding: 10px 0 2px;
  text-align: left;
}
.workspace-session-launch {
  flex: 0 0 auto;
  margin-top: 24px;
}
.workspace-session-collapsed {
  position: relative;
  display: flex;
  min-height: 0;
  flex: 1 1 auto;
  flex-direction: column;
  align-items: center;
  overflow: visible;
  padding-top: 8px;
}
.workspace-collapsed-launch {
  width: 36px;
  height: 36px;
  padding: 0;
  justify-content: center;
  margin-bottom: 12px;
}
.workspace-collapsed-divider {
  width: 28px;
  height: 1px;
  flex: 0 0 auto;
  margin-bottom: 12px;
  background: var(--border-subtle);
}
.workspace-collapsed-stack {
  display: flex;
  width: 100%;
  min-height: 0;
  flex: 1 1 auto;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  overflow-y: auto;
  overflow-x: visible;
  padding: 4px 0;
}
.workspace-session-dot-btn {
  position: relative;
  display: inline-grid;
  place-items: center;
  width: 38px;
  height: 38px;
  padding: 0;
  border: 1px solid transparent;
  border-radius: 10px;
  background: transparent;
  color: var(--text-secondary);
}
.workspace-session-dot-btn:hover {
  background: var(--neutral-bg);
}
.workspace-session-dot-btn.is-active {
  border-color: transparent;
  box-shadow: 0 0 0 2px var(--accent);
}
.workspace-session-dot {
  position: relative;
  display: inline-block;
  width: 26px;
  height: 26px;
  border: 2px solid var(--workspace-agent-border, var(--border-default));
  border-radius: 999px;
  background: var(--workspace-agent-color, var(--text-muted));
  box-shadow: inset 0 0 0 1px
    color-mix(in srgb, var(--surface-base) 28%, transparent);
}
.workspace-session-pip {
  position: absolute;
  right: -2px;
  bottom: -2px;
  width: 9px;
  height: 9px;
  border: 2px solid var(--surface-base);
  border-radius: 999px;
  background: var(--status-recent);
}
.workspace-session-pip.is-running {
  background: var(--green-400);
  animation: workspace-session-pulse 1.6s ease-in-out infinite;
}
.workspace-session-pip.is-waiting {
  background: var(--amber-400);
}
.workspace-session-pip.is-error {
  background: var(--red-400);
}
.workspace-session-pip.is-idle {
  background: var(--status-recent);
}
.workspace-session-tooltip {
  white-space: normal;
}
.workspace-floating-dot-tooltip {
  bottom: auto;
  z-index: 60;
  opacity: 0;
  visibility: hidden;
}
.workspace-floating-dot-tooltip.is-visible {
  opacity: 1;
  visibility: visible;
  transform: translate(0, -50%);
  transition:
    opacity 0.14s ease 0.22s,
    transform 0.14s ease 0.22s,
    visibility 0s linear 0.22s;
}
.workspace-session-footer {
  flex: 0 0 auto;
  margin-top: auto;
  padding-top: 24px;
  padding-bottom: 12px;
}
.workspace-session-rail.is-collapsed .workspace-session-footer {
  padding: 12px 0 0;
}
.workspace-footer-tooltip-wrap,
.workspace-session-toggle {
  width: 100%;
}
.workspace-session-toggle {
  justify-content: flex-start;
}
.workspace-session-rail.is-collapsed .workspace-session-toggle {
  width: 40px;
  height: 36px;
  justify-content: center;
  padding: 0;
}
.workspace-session-toggle-glyph {
  display: inline-flex;
  width: 16px;
  justify-content: center;
  flex: 0 0 auto;
  font-family: var(--font-mono);
  font-size: 15px;
  font-weight: 700;
}
@keyframes workspace-session-pulse {
  0%,
  100% {
    box-shadow: 0 0 0 0 var(--status-pass-bg);
  }
  50% {
    box-shadow: 0 0 0 4px var(--status-pass-bg);
  }
}
@media (prefers-reduced-motion: reduce) {
  .workspace-session-pip.is-running {
    animation: none;
  }
}

/* --- Tags --- */
.gf-tags {
  display: flex !important;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 7px;
}
.gf-tag {
  font-size: 11px;
  padding: 2px 8px;
  border-radius: 4px;
  background: var(--surface-elevated);
  color: var(--text-secondary);
  border: none;
}

/* --- Custom prompt form --- */
.gf-custom-prompt-form {
  display: flex;
  flex-direction: column;
  gap: 16px;
  min-height: 420px;
}
.gf-custom-form-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border-subtle);
}
.gf-custom-form-head h3 {
  margin: 4px 0 0;
  font-size: 16px;
  font-weight: 600;
}
.gf-custom-form-head-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: flex-end;
  gap: 8px 10px;
  min-width: 0;
}
.gf-custom-form-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
}
.gf-custom-form-actions .gf-btn {
  white-space: nowrap;
}
.gf-start-picker {
  position: relative;
  display: flex;
  justify-content: flex-end;
}
.gf-start-picker-trigger {
  padding: 5px 8px;
  border-radius: 6px;
}
.gf-start-picker-trigger:hover {
  background: var(--neutral-bg);
}
.gf-start-picker-panel {
  position: absolute;
  right: 0;
  top: calc(100% + 6px);
  z-index: 30;
  display: grid;
  grid-template-columns: minmax(220px, 1fr) auto;
  gap: 8px;
  min-width: min(460px, calc(100vw - 48px));
  padding: 10px;
  border: 1px solid var(--border-default);
  border-radius: 8px;
  background: var(--surface-base);
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.24);
}
.gf-validation-summary {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 10px;
  padding: 10px 12px;
  border: 1px solid var(--red-border);
  border-radius: 8px;
  background: var(--red-bg);
  color: var(--red-400);
  font-size: 12px;
}
.gf-validation-title {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.gf-validation-summary a {
  color: var(--red-400);
  text-decoration: underline;
  text-underline-offset: 2px;
}
.gf-prompt-list-card {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 10px 12px;
  border-left-width: 3px;
  cursor: pointer;
  text-align: left;
}
.gf-prompt-favorite {
  margin-top: 2px;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--text-dim);
  cursor: pointer;
  line-height: 1;
}
.gf-prompt-favorite-preview {
  cursor: default;
}
.gf-prompt-card-content {
  min-width: 0;
  flex: 1;
}
.gf-prompt-card-title {
  font-size: 13px;
  font-weight: 500;
}
.gf-prompt-card-desc {
  margin: 2px 0 6px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 12px;
}
.gf-prompt-card-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
}
.gf-prompt-route-chip {
  padding: 1px 6px;
  border-radius: 3px;
  background: rgba(148, 163, 184, 0.08);
  font-family: var(--font-mono);
  font-size: 10px;
}
.gf-prompt-category-label {
  font-size: 10px;
}
.gf-prompt-placeholder {
  font-style: italic;
}
.gf-custom-form-body {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(220px, 280px);
  gap: 18px;
  align-items: start;
  min-height: 100%;
}
.gf-custom-form-main {
  min-width: 0;
}
.gf-custom-section {
  padding: 0 0 18px;
  border-bottom: 1px solid var(--border-subtle);
}
.gf-custom-section + .gf-custom-section {
  padding-top: 18px;
}
.gf-custom-section-title,
.gf-flag-group-title {
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.09em;
  line-height: 1.2;
  text-transform: uppercase;
}
.gf-custom-section-title {
  margin: 0 0 12px;
}
.gf-custom-grid-2 {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}
.gf-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
}
.gf-field + .gf-field,
.gf-custom-grid-2 + .gf-field {
  margin-top: 12px;
}
.gf-field .gf-input {
  width: 100%;
  box-sizing: border-box;
  padding: 9px 11px;
  border-radius: 6px;
  font-size: 13px;
}
.gf-field-help,
.gf-field-error,
.gf-field-warning,
.gf-count-line {
  font-size: 11px;
  line-height: 1.4;
}
.gf-field-help,
.gf-count-line {
  color: var(--text-dim);
}
.gf-field-error {
  color: var(--red-400);
}
.gf-field-warning {
  color: var(--amber-400);
}
.gf-count-line {
  align-self: flex-end;
  font-family: var(--font-mono);
}
.gf-route-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.gf-route-pill,
.gf-suggestion-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--border-default);
  border-radius: 999px;
  background: transparent;
  color: var(--text-secondary);
  cursor: pointer;
  font-size: 12px;
  font-weight: 500;
}
.gf-route-pill {
  padding: 5px 10px;
}
.gf-route-pill:hover,
.gf-suggestion-chip:hover {
  background: var(--neutral-bg);
  color: var(--text-primary);
}
.gf-route-pill.is-active {
  background: var(--accent-bg);
  color: var(--accent);
  border-color: var(--accent-border);
}
.gf-custom-prompt-textarea {
  min-height: 210px;
  resize: vertical;
  font-family: var(--font-mono);
  font-size: 12.5px !important;
  line-height: 1.55;
}
.gf-flag-groups {
  display: grid;
  gap: 14px;
}
.gf-flag-group {
  display: grid;
  gap: 8px;
}
.gf-flag-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px 12px;
}
.gf-flag-row {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 5px;
  min-width: 0;
}
.gf-flag-row .gf-check-row {
  flex: 0 1 auto;
  min-width: 0;
}
.gf-flag-default-badge {
  padding: 1px 5px;
  border: 1px solid var(--accent-border);
  border-radius: 999px;
  background: var(--accent-bg);
  color: var(--accent);
  font-size: 9px;
  font-weight: 700;
  line-height: 1.2;
  text-transform: uppercase;
}
.gf-tooltip-wrap {
  position: relative;
  display: inline-flex;
  flex: 0 0 auto;
}
.gf-info-button {
  display: inline-grid;
  place-items: center;
  width: 18px;
  height: 18px;
  border: 1px solid var(--border-default);
  border-radius: 999px;
  background: transparent;
  color: var(--text-secondary);
  cursor: help;
  font-size: 11px;
  line-height: 1;
}
.gf-tooltip {
  position: absolute;
  left: 0;
  bottom: calc(100% + 8px);
  z-index: 20;
  width: 240px;
  padding: 6px 10px;
  border: 1px solid var(--border-default);
  border-radius: 8px;
  background: var(--surface-base);
  color: var(--text-primary);
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.28);
  font-size: 12px;
  line-height: 1.4;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transform: translateY(4px);
  transition:
    opacity 0.14s ease,
    transform 0.14s ease,
    visibility 0s linear 0.14s;
}
.gf-tooltip-wrap:hover .gf-tooltip,
.gf-tooltip-wrap:focus-within .gf-tooltip {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
  transition:
    opacity 0.14s ease 0.22s,
    transform 0.14s ease 0.22s,
    visibility 0s linear 0.22s;
}
.gf-tooltip-right {
  left: calc(100% + 8px);
  top: 50%;
  bottom: auto;
  width: max-content;
  min-width: 0;
  max-width: 260px;
  transform: translate(-4px, -50%);
  white-space: nowrap;
}
.gf-tooltip-right::before {
  content: "";
  position: absolute;
  left: -5px;
  top: 50%;
  width: 8px;
  height: 8px;
  transform: translateY(-50%) rotate(45deg);
  border-left: 1px solid var(--border-default);
  border-bottom: 1px solid var(--border-default);
  background: var(--surface-base);
}
.gf-tooltip-wrap:hover .gf-tooltip-right,
.gf-tooltip-wrap:focus-within .gf-tooltip-right {
  transform: translate(0, -50%);
}
.gf-tooltip-secondary {
  display: block;
  margin-top: 2px;
  color: var(--text-muted);
  font-size: 11px;
  line-height: 1.35;
}
@media (prefers-reduced-motion: reduce) {
  .gf-tooltip,
  .gf-tooltip-wrap:hover .gf-tooltip,
  .gf-tooltip-wrap:focus-within .gf-tooltip {
    transition: none;
  }
}
.gf-tag-input {
  display: flex;
  min-height: 40px;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  padding: 6px;
  border: 0.5px solid var(--border-default);
  border-radius: 6px;
  background: var(--surface-page);
}
.gf-tag-input input {
  min-width: 110px;
  flex: 1 1 120px;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--text-secondary);
  font-size: 13px;
}
.gf-tag-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 7px;
  border: 1px solid var(--accent-border);
  border-radius: 999px;
  background: var(--accent-bg);
  color: var(--accent);
  font-size: 11px;
}
.gf-tag-chip button {
  border: 0;
  background: transparent;
  color: inherit;
  cursor: pointer;
  font-size: 12px;
  line-height: 1;
  padding: 0;
}
.gf-surface-suggestions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.gf-suggestion-chip {
  padding: 3px 8px;
}
.gf-custom-notes {
  min-height: 82px;
  resize: vertical;
}
.gf-custom-preview-pane {
  position: sticky;
  top: 12px;
  display: grid;
  gap: 8px;
  align-self: start;
}
.gf-custom-preview-card {
  cursor: default;
}
.gf-custom-preview-card:hover {
  background: var(--surface-base);
}
.gf-custom-save-secondary {
  min-width: 78px;
}
.gf-custom-run-primary {
  padding-inline: 16px;
  font-weight: 700;
  box-shadow: 0 8px 22px rgba(59, 130, 246, 0.18);
}

/* --- Surfaces --- */
.gf-surface {
  background: var(--surface-base);
  border: 0.5px solid var(--border-subtle);
}
.gf-bg-elevated {
  background: var(--surface-elevated);
}
.gf-bg-page {
  background: var(--surface-page);
}
.gf-code-inline {
  background: var(--surface-elevated);
}

/* --- Health banner --- */
.gf-banner-row {
  display: flex !important;
  flex-direction: row !important;
  align-items: center !important;
  gap: 12px;
  padding: 12px 16px;
  border-radius: 8px;
  margin-bottom: 20px;
}
.gf-banner-pass {
  background: var(--status-pass-bg);
  border: 0.5px solid var(--status-pass-border);
}
.gf-banner-pass .gf-banner-icon {
  background: var(--status-pass-border);
  color: var(--green-400);
}
.gf-banner-pass .gf-banner-title {
  color: var(--green-300);
}
.gf-banner-pass .gf-banner-sub {
  color: var(--green-200);
}
.gf-banner-pass .gf-banner-ts {
  color: var(--green-400);
}
.gf-banner-fail {
  background: var(--red-950);
  border: 0.5px solid var(--red-900);
}
.gf-banner-fail .gf-banner-icon {
  background: var(--red-900);
  color: var(--red-400);
}
.gf-banner-fail .gf-banner-title {
  color: var(--red-300);
}
.gf-banner-fail .gf-banner-sub {
  color: var(--red-200);
}
.gf-banner-fail .gf-banner-ts {
  color: var(--red-400);
}

/* --- Metric cards --- */
.gf-metric {
  border-radius: 8px;
  padding: 14px 12px;
  text-align: center;
  background: var(--surface-elevated);
  border: none;
}
.gf-metric-value {
  font-size: 22px;
  font-weight: 500;
  color: var(--text-primary);
  font-family: var(--font-mono);
}
.gf-metric-label {
  font-size: 12px;
  margin-top: 2px;
  color: var(--text-muted);
}
.gf-grade-text {
  color: var(--status-pass) !important;
}

/* --- Card --- */
.gf-card {
  background: var(--surface-base);
  border: 0.5px solid var(--border-subtle);
  border-radius: 8px;
  padding: 16px 20px;
  text-align: left;
}
.gf-card-header {
  border-bottom: 0.5px solid var(--border-subtle);
}
.gf-card:hover {
  border-color: var(--border-default);
}

/* --- Links --- */
.gf-link {
  color: var(--accent);
  font-size: 12px;
  font-weight: 500;
}
.gf-link:hover {
  opacity: 0.8;
}

/* --- Table --- */
.gf-th {
  text-align: left;
  font-size: 11px;
  font-weight: 500;
  padding: 6px 16px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  border-bottom: 0.5px solid var(--border-subtle);
}
.gf-td {
  padding: 10px 16px;
}
.gf-tr td {
  border-bottom: 0.5px solid var(--border-faint);
}
.gf-tr:last-child td {
  border-bottom: none;
}
.gf-tr-clickable {
  cursor: pointer;
}
.gf-tr-clickable:hover td {
  background: var(--surface-page);
}

/* --- Status dots --- */
.gf-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  display: inline-block;
}
.gf-dot-on {
  background: var(--accent);
}
.gf-dot-off {
  background: var(--border-default);
}

/* --- Grade badge --- */
.gf-grade {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  border-radius: 5px;
  font-size: 14px;
  font-weight: 600;
  font-family: var(--font-mono);
}
.gf-grade-a {
  background: rgba(74, 222, 128, 0.12);
  color: var(--green-400);
}
.gf-grade-b {
  background: rgba(250, 204, 21, 0.12);
  color: var(--amber-300);
}
.gf-grade-c,
.gf-grade-d,
.gf-grade-f {
  background: rgba(248, 113, 113, 0.12);
  color: var(--red-400);
}
.gf-grade-na {
  background: var(--surface-elevated);
  color: var(--text-disabled);
  font-size: 12px;
}

/* --- Tier bars --- */
.gf-tier-label {
  font-size: 9px;
  width: 8px;
  color: var(--text-muted);
}
.gf-tier-bar {
  height: 3px;
  border-radius: 2px;
  background: var(--status-pass);
}

/* --- Quick actions --- */
.gf-action-btn {
  border-radius: 8px;
  padding: 12px;
  text-align: center;
  background: var(--surface-base);
  border: 0.5px solid var(--border-subtle);
  cursor: pointer;
  transition:
    background 0.1s,
    border-color 0.1s;
}
.gf-action-btn:hover {
  background: var(--surface-page);
  border-color: var(--border-default);
}
.gf-play-icon {
  flex-shrink: 0;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 0.5px solid var(--border-default);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--text-disabled);
  transition:
    color 0.1s,
    border-color 0.1s;
}
.gf-action-btn:hover .gf-play-icon {
  color: var(--accent) !important;
  border-color: var(--accent-border) !important;
}
.gf-action-title {
  font-size: 13px;
  font-weight: 500;
  color: var(--text-primary);
}
.gf-action-desc {
  font-size: 12px;
  margin-top: 2px;
  color: var(--text-muted);
}

/* --- Footer --- */
.gf-footer {
  color: var(--text-muted);
}
.gf-footer-link {
  color: var(--accent);
  text-decoration: none;
}
.gf-footer-link:hover {
  text-decoration: underline;
}

/* --- Severity badges --- */
.gf-badge-critical {
  background: var(--red-950);
  color: var(--red-400);
}
.gf-badge-high {
  background: var(--orange-950);
  color: var(--orange-400);
}
.gf-badge-medium {
  background: var(--amber-950);
  color: var(--amber-400);
}
.gf-badge-low {
  background: var(--indigo-950);
  color: var(--indigo-400);
}
.gf-badge-ap {
  background: var(--red-950);
  color: var(--red-400);
}
.gf-badge-pass {
  background: var(--green-950);
  color: var(--green-400);
}
.gf-badge-warn {
  background: var(--amber-950);
  color: var(--amber-400);
}
.gf-badge-info {
  background: var(--indigo-950);
  color: var(--indigo-400);
}
.gf-badge-muted {
  background: var(--surface-elevated);
  color: var(--text-muted);
}

/* --- Progress bars --- */
.gf-bar-track {
  background: var(--border-default);
}
.gf-bar-fill {
  background: var(--status-pass);
}

/* --- Inputs --- */
.gf-input {
  background: var(--surface-page);
  border: 0.5px solid var(--border-default);
  color: var(--text-secondary);
}
.gf-input-btn {
  background: var(--surface-elevated);
  border: 0.5px solid var(--border-default);
  color: var(--text-secondary);
}
.gf-dropdown {
  background: var(--surface-page);
  border: 0.5px solid var(--border-default);
}
.gf-dropdown-row:hover {
  background: var(--surface-elevated);
}

/* ═══════════════════════════════════════════════════════════
   Button System - 3 sizes × 5 variants
   ═══════════════════════════════════════════════════════════ */

/* Base reset */
.gf-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  cursor: pointer;
  white-space: nowrap;
  font-family: var(--font-body);
  border: 1px solid var(--border-default);
  background: transparent;
  color: var(--text-primary);
  transition:
    background 0.15s,
    border-color 0.15s,
    color 0.15s;
}
.gf-btn:hover {
  background: rgba(148, 163, 184, 0.06);
  border-color: rgba(148, 163, 184, 0.35);
}

/* Size: Small - table inline actions */
.gf-btn-sm {
  font-size: 12px;
  font-weight: 500;
  padding: 4px 10px;
  border-radius: 6px;
}

/* Size: Medium - toolbar buttons */
.gf-btn-md {
  font-size: 13px;
  font-weight: 500;
  padding: 6px 12px;
  border-radius: 6px;
}

/* Size: Large - primary CTAs */
.gf-btn-lg {
  font-size: 14px;
  font-weight: 600;
  padding: 10px 24px;
  border-radius: 6px;
}

/* Variant: Primary (filled accent) */
.gf-btn-primary {
  background: var(--accent-strong);
  color: var(--accent-contrast);
  border-color: var(--accent-strong);
}
.gf-btn-primary:hover {
  background: var(--accent-hover);
  border-color: var(--accent-hover);
  color: var(--accent-contrast);
}
.gf-btn-primary:disabled,
.gf-btn-primary:disabled:hover {
  background: var(--surface-elevated);
  color: var(--text-muted);
  border-color: var(--border-default);
  cursor: not-allowed;
}

/* Variant: Audit/secondary accent */
.gf-btn-audit {
  border: 1px solid var(--accent-border);
  background: var(--accent-bg);
  color: var(--accent);
  transition:
    background 0.15s,
    border-color 0.15s;
}
.gf-btn-audit:hover {
  background: var(--accent-bg);
  border-color: var(--accent);
}

/* Variant: Ghost (no border, no bg) */
.gf-btn-ghost {
  background: none;
  color: var(--accent);
  border-color: transparent;
}
.gf-btn-ghost:hover {
  opacity: 0.8;
}

/* Variant: Muted (gray) */
.gf-btn-muted {
  background: var(--surface-elevated);
  color: var(--text-secondary);
  border-color: var(--border-default);
  transition:
    background 0.1s,
    color 0.1s;
}
.gf-btn-muted:hover {
  background: var(--border-default);
  color: var(--text-primary);
}

.gf-btn-secondary {
  background: transparent;
  color: var(--text-secondary);
  border-color: var(--border-default);
}
.gf-btn-secondary:hover {
  background: var(--neutral-bg);
  color: var(--text-primary);
}
.gf-btn-text {
  padding-left: 4px;
  padding-right: 4px;
  background: transparent;
  border-color: transparent;
  color: var(--text-muted);
}
.gf-btn-text:hover {
  background: transparent;
  border-color: transparent;
  color: var(--text-primary);
}
.gf-btn-icon {
  width: 30px;
  height: 30px;
  padding: 0;
  border-radius: 6px;
}

.btn-warn {
  color: var(--amber-400) !important;
  border-color: var(--amber-border) !important;
  background: var(--amber-bg) !important;
}
.btn-warn:hover {
  border-color: var(--amber-400) !important;
  background: rgba(245, 158, 11, 0.16) !important;
}

/* Variant: Danger (red ghost) */
.gf-btn-danger {
  background: var(--red-bg);
  color: var(--red-400);
  border-color: var(--red-border);
}
.gf-btn-danger:hover {
  background: rgba(248, 113, 113, 0.18);
  border-color: rgba(248, 113, 113, 0.45);
}
.gf-btn-danger-solid {
  background: var(--red-700);
  color: white;
  border-color: var(--red-700);
}
.gf-btn-danger-solid:hover {
  background: var(--red-800);
  border-color: var(--red-800);
  color: white;
}

/* Convenience: green indicator badge */
.gf-btn-green {
  background: var(--accent-bg);
  color: var(--accent);
}
.gf-check-pass {
  background: var(--accent-border);
  color: var(--accent);
}

/* Convenience: Copy button (small muted) */
.gf-btn-copy {
  font-size: 13px;
  padding: 6px 12px;
  border-radius: 6px;
  cursor: pointer;
  background: transparent;
  color: var(--text-primary);
  border: 1px solid var(--border-default);
  transition:
    background 0.15s,
    border-color 0.15s;
}
.gf-btn-copy:hover {
  background: rgba(148, 163, 184, 0.06);
  border-color: rgba(148, 163, 184, 0.35);
}

/* Convenience: Terminal button (small primary) */
.gf-btn-terminal {
  font-size: 13px;
  padding: 6px 12px;
  border-radius: 6px;
  cursor: pointer;
  background: var(--accent-bg);
  color: var(--accent);
  font-weight: 500;
  border: 1px solid var(--accent-border);
  transition:
    background 0.15s,
    border-color 0.15s;
}
.gf-btn-terminal:hover {
  background: var(--accent-bg);
  border-color: var(--accent);
}

/* Convenience: Regenerate (small ghost) */
.gf-btn-regen {
  font-size: 13px;
  padding: 6px 12px;
  border-radius: 6px;
  cursor: pointer;
  color: var(--text-primary);
  background: transparent;
  border: 1px solid var(--border-default);
}
.gf-btn-regen:hover {
  background: rgba(148, 163, 184, 0.06);
  border-color: rgba(148, 163, 184, 0.35);
}

/* Convenience: Terminal CTA (large primary) */
.gf-terminal-cta {
  background: var(--accent-bg);
  border-bottom: 1px solid var(--border-subtle);
}
.gf-btn-terminal-cta {
  padding: 10px 24px;
  background: var(--accent-strong);
  color: var(--accent-contrast);
  border: 1px solid var(--accent-strong);
  border-radius: 6px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
  transition: background 0.15s;
}
.gf-btn-terminal-cta:hover {
  background: var(--accent-hover);
  border-color: var(--accent-hover);
}

/* ═══════════════════════════════════════════════════════════
   Dashboard Shell
   ═══════════════════════════════════════════════════════════ */
.gf-app-shell {
  display: flex;
  height: 100vh;
  min-width: 1060px;
  background: var(--surface-page);
}
.gf-side-nav {
  display: flex;
  width: 204px;
  flex: 0 0 204px;
  flex-direction: column;
  gap: 16px;
  overflow-y: auto;
  padding: 14px 10px;
  background: var(--surface-base);
  border-right: 1px solid var(--border-subtle);
  transition:
    width 0.16s ease,
    flex-basis 0.16s ease,
    padding 0.16s ease;
}
.gf-side-collapsed .gf-side-nav {
  width: 64px;
  flex-basis: 64px;
  padding: 14px 8px;
  overflow: visible;
}
.gf-side-top {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
}
.gf-side-logo {
  display: flex;
  align-items: center;
  gap: 7px;
  min-width: 0;
  flex: 1 1 auto;
  padding: 4px 8px 10px;
  border: 0;
  background: transparent;
  color: var(--text-primary);
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 0;
  text-align: left;
}
.gf-side-collapsed .gf-side-logo {
  flex: 0 0 auto;
  justify-content: center;
  padding: 2px 0 8px;
}
.gf-side-logo-emoji {
  display: inline-grid;
  place-items: center;
  width: 24px;
  height: 24px;
  flex: 0 0 auto;
  font-size: 19px;
  line-height: 1;
}
.gf-side-logo-text,
.gf-side-link-label,
.gf-side-group-label {
  transition:
    opacity 0.12s ease,
    transform 0.12s ease;
}
.gf-side-collapse-btn {
  display: inline-grid;
  place-items: center;
  width: 28px;
  height: 28px;
  flex: 0 0 auto;
  border: 1px solid var(--border-subtle);
  border-radius: 6px;
  background: rgba(148, 163, 184, 0.05);
  color: var(--text-muted);
}
.gf-side-collapse-btn:hover {
  background: var(--neutral-bg);
  color: var(--text-primary);
  border-color: var(--border-default);
}
.gf-side-collapse-btn svg {
  width: 16px;
  height: 16px;
  transition: transform 0.16s ease;
}
.gf-side-collapsed .gf-side-collapse-btn svg {
  transform: rotate(180deg);
}
.gf-side-nav-groups {
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.gf-side-nav-group {
  display: grid;
  gap: 3px;
}
.gf-side-group-label {
  padding: 0 10px 5px;
  color: var(--text-disabled);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.gf-side-link {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 9px;
  min-height: 31px;
  width: 100%;
  padding: 6px 10px;
  border: 1px solid transparent;
  border-radius: 6px;
  background: transparent;
  color: var(--text-secondary);
  font-size: 13px;
  font-weight: 500;
  line-height: 1.25;
  text-align: left;
}
.gf-side-link::before {
  content: "";
  display: none;
}
.gf-side-icon {
  width: 16px;
  height: 16px;
  flex: 0 0 auto;
  color: var(--text-muted);
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
  transition:
    color 0.12s ease,
    transform 0.12s ease;
}
.gf-side-link:hover .gf-side-icon,
.gf-side-link-active .gf-side-icon {
  color: currentColor;
}
.gf-side-link .gf-status-dot {
  margin-left: auto;
}
.gf-side-link:hover {
  background: var(--neutral-bg);
  color: var(--text-primary);
}
.gf-side-link-active {
  background: var(--accent-bg);
  border-color: var(--accent-border);
  color: var(--accent);
}
.gf-side-collapsed .gf-side-top {
  flex-direction: column;
  justify-content: center;
  gap: 6px;
}
.gf-side-collapsed .gf-side-collapse-btn {
  width: 34px;
}
.gf-side-collapsed .gf-side-logo-emoji {
  width: 34px;
  height: 28px;
  font-size: 20px;
}
.gf-side-collapsed .gf-side-logo-text,
.gf-side-collapsed .gf-side-link-label,
.gf-side-collapsed .gf-side-group-label {
  display: none;
}
.gf-side-collapsed .gf-side-nav-groups {
  gap: 10px;
}
.gf-side-collapsed .gf-side-nav-group {
  gap: 5px;
}
.gf-side-collapsed .gf-side-link {
  position: relative;
  justify-content: center;
  min-height: 32px;
  padding: 6px 4px;
}
.gf-side-collapsed .gf-side-icon {
  width: 17px;
  height: 17px;
}
.gf-side-collapsed .gf-side-link .gf-status-dot {
  position: absolute;
  top: 4px;
  right: 4px;
  width: 7px;
  height: 7px;
  font-size: 0;
  box-shadow: none;
}
/* Tooltips on collapsed side-nav icons - uses aria-label for content
   so it stays in sync with the screen-reader name. */
.gf-side-collapsed .gf-side-link::after {
  content: attr(aria-label);
  position: absolute;
  left: calc(100% + 12px);
  top: 50%;
  transform: translateY(-50%) translateX(-4px);
  padding: 6px 10px;
  border-radius: 6px;
  background: var(--surface-elevated);
  border: 1px solid var(--border-default);
  color: var(--text-primary);
  font-size: 12px;
  font-weight: 500;
  line-height: 1.2;
  letter-spacing: 0.01em;
  white-space: nowrap;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.28);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  z-index: 1000;
  transition:
    opacity 0.14s ease,
    transform 0.14s ease,
    visibility 0s linear 0.14s;
}
.gf-side-collapsed .gf-side-link::before {
  content: "";
  display: block;
  position: absolute;
  left: calc(100% + 7px);
  top: 50%;
  width: 8px;
  height: 8px;
  transform: translateY(-50%) translateX(-4px) rotate(45deg);
  background: var(--surface-elevated);
  border-left: 1px solid var(--border-default);
  border-bottom: 1px solid var(--border-default);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  z-index: 1001;
  transition:
    opacity 0.14s ease,
    transform 0.14s ease,
    visibility 0s linear 0.14s;
}
.gf-side-collapsed .gf-side-link:hover::after,
.gf-side-collapsed .gf-side-link:focus-visible::after {
  opacity: 1;
  visibility: visible;
  transform: translateY(-50%) translateX(0);
  transition:
    opacity 0.14s ease 0.18s,
    transform 0.14s ease 0.18s,
    visibility 0s linear 0.18s;
}
.gf-side-collapsed .gf-side-link:hover::before,
.gf-side-collapsed .gf-side-link:focus-visible::before {
  opacity: 1;
  visibility: visible;
  transform: translateY(-50%) translateX(0) rotate(45deg);
  transition:
    opacity 0.14s ease 0.18s,
    transform 0.14s ease 0.18s,
    visibility 0s linear 0.18s;
}
@media (prefers-reduced-motion: reduce) {
  .gf-side-collapsed .gf-side-link::after,
  .gf-side-collapsed .gf-side-link::before,
  .gf-side-collapsed .gf-side-link:hover::after,
  .gf-side-collapsed .gf-side-link:hover::before,
  .gf-side-collapsed .gf-side-link:focus-visible::after,
  .gf-side-collapsed .gf-side-link:focus-visible::before {
    transition: none;
  }
}
.gf-main-shell {
  display: flex;
  min-width: 0;
  flex: 1;
  flex-direction: column;
  height: 100vh;
}
.gf-header {
  display: flex;
  align-items: center;
  padding: 14px 24px;
  gap: 12px;
  position: relative;
  background: var(--surface-base);
  border: none;
  border-bottom: 1px solid var(--border-subtle);
}
.gf-header-spacer {
  flex: 1 1 auto;
  min-width: 20px;
}
.gf-logo {
  font-weight: 500;
  font-size: 15px;
  color: var(--text-primary);
  cursor: pointer;
  border: none;
  background: none;
  padding: 0;
  display: flex;
  align-items: center;
  gap: 8px;
}
.gf-header-ver {
  font-size: 11px;
  margin-left: 2px;
  color: var(--text-disabled);
}
.gf-header-proj {
  font-size: 14px;
  font-weight: 400;
  color: var(--text-secondary);
  max-width: 320px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.gf-header-proj-edit {
  background: transparent;
  border: 1px solid var(--border-subtle, rgba(148, 163, 184, 0.3));
  border-radius: 4px;
  padding: 2px 6px;
  color: var(--text-primary);
  font: inherit;
  font-size: 14px;
  outline: none;
  min-width: 120px;
}
.gf-header-proj-edit:focus {
  border-color: var(--accent, #60a5fa);
}
.gf-header-proj-edit-btn {
  background: transparent;
  border: none;
  border-radius: 4px;
  color: var(--text-disabled, #64748b);
  cursor: pointer;
  font-size: 13px;
  padding: 2px 4px;
  line-height: 1;
}
.gf-header-proj-edit-btn:hover {
  color: var(--text-primary);
}
.gf-header-proj-edit-btn:focus-visible {
  outline: 2px solid var(--focus-ring);
  outline-offset: 2px;
}
.gf-header-tooltip-wrap {
  margin-left: -2px;
}
.gf-header-tooltip {
  top: calc(100% + 8px);
  bottom: auto;
  left: 50%;
  width: max-content;
  min-width: 0;
  max-width: 180px;
  transform: translate(-50%, -4px);
  white-space: nowrap;
}
.gf-header-tooltip-wrap:hover .gf-header-tooltip,
.gf-header-tooltip-wrap:focus-within .gf-header-tooltip {
  transform: translate(-50%, 0);
}
.gf-nav-wrap {
  flex: 1;
  display: flex;
  justify-content: center;
  min-width: 0;
  overflow-x: auto;
  overflow-y: hidden;
  scrollbar-width: none;
}
.gf-nav-wrap::-webkit-scrollbar {
  display: none;
}
.gf-nav {
  display: flex;
  min-width: max-content;
  gap: 28px;
}
.gf-nb {
  font-size: 14px;
  padding: 2px 0 5px;
  border-radius: 0;
  cursor: pointer;
  white-space: nowrap;
  font-weight: 400;
  color: var(--text-secondary);
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
}
.gf-nb:hover {
  color: var(--text-primary);
}
.gf-nb-active {
  color: var(--accent);
  font-weight: 500;
  border-bottom-color: var(--accent);
}
.gf-asel {
  display: flex;
  gap: 4px;
  overflow: hidden;
  border: none;
  min-width: 260px;
}
.gf-ab {
  font-size: 12px;
  padding: 4px 10px;
  border-radius: 4px;
  cursor: pointer;
  font-family: var(--font-mono);
  color: var(--text-secondary);
  border: 1px solid var(--border-subtle);
  background: rgba(148, 163, 184, 0.06);
}
.gf-ab:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}
.gf-ab:last-child {
  border-right: 1px solid var(--border-subtle);
}
.gf-ab:hover {
  color: var(--text-primary);
  background: rgba(148, 163, 184, 0.1);
}
.gf-ab-loading {
  opacity: 0.35;
  cursor: default !important;
  pointer-events: none;
}
.gf-ab-active {
  background: var(--accent-strong) !important;
  color: var(--accent-contrast) !important;
  font-weight: 500;
  border-color: var(--accent-strong) !important;
}
.gf-ib {
  width: 32px;
  height: 32px;
  border-radius: 6px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--text-secondary);
  background: transparent;
  border: 1px solid transparent;
  padding: 0;
  margin-left: 2px;
  transition:
    background 150ms ease,
    color 150ms ease,
    border-color 150ms ease;
}
.gf-ib:hover {
  background: rgba(148, 163, 184, 0.08);
  color: var(--text-primary);
  border-color: var(--border-subtle);
}
.gf-ib-active {
  background: var(--accent-bg) !important;
  color: var(--accent) !important;
  border-color: var(--accent-border) !important;
}

@media (max-width: 1280px) {
  .gf-header-proj {
    max-width: 210px;
  }
}

@media (max-width: 1080px) {
  .gf-runner-label {
    display: none;
  }
  .gf-ab {
    padding: 3px 8px;
  }
  .gf-asel {
    min-width: 215px;
  }
}

/* ═══════════════════════════════════════════════════════════
   Plans and Coming Soon Pages
   ═══════════════════════════════════════════════════════════ */
.gf-page-head,
.gf-tasks-page,
.gf-coming-soon-page {
  min-width: 0;
}
.gf-tasks-page {
  max-width: 1100px;
  margin: 0 auto;
  padding: 24px 28px 32px;
}
.gf-page-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 18px;
}
.gf-page-head h1 {
  margin: 4px 0 4px;
  color: var(--text-primary);
  font-size: 24px;
  font-weight: 600;
  line-height: 1.2;
}
.gf-page-head p {
  margin: 0;
  color: var(--text-muted);
  font-size: 13px;
}
.gf-page-head code {
  color: var(--text-secondary);
  font-family: var(--font-mono);
  font-size: 12px;
}
.gf-tasks-layout {
  display: grid;
  grid-template-columns: 280px minmax(0, 1fr);
  gap: 14px;
  align-items: start;
}
.gf-task-loading,
.gf-task-error,
.gf-task-empty {
  max-width: 720px;
}
.gf-task-loading {
  color: var(--text-muted);
  font-size: 13px;
}
.gf-task-error {
  border-color: var(--red-border);
  background: var(--red-bg);
}
.gf-task-error p {
  margin: 4px 0 0;
  color: var(--red-400);
  font-size: 13px;
}
.gf-task-empty {
  display: grid;
  gap: 8px;
}
.gf-task-empty h2 {
  margin: 0;
  color: var(--text-primary);
  font-size: 16px;
  font-weight: 600;
}
.gf-task-empty p {
  margin: 0;
  color: var(--text-muted);
  font-size: 13px;
}
.gf-task-empty code {
  color: var(--text-secondary);
  font-family: var(--font-mono);
  font-size: 12px;
}
.gf-task-panel-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}
.gf-task-panel-head h2 {
  margin: 3px 0 0;
  color: var(--text-primary);
  font-size: 17px;
  font-weight: 600;
  line-height: 1.25;
}
.gf-task-active-wrap {
  display: inline-flex;
  min-width: 0;
  align-items: center;
  justify-content: flex-end;
  gap: 6px;
}
.gf-task-active-help {
  width: 17px;
  height: 17px;
  font-size: 10px;
}
.gf-task-active-tooltip {
  width: 260px;
}
.gf-task-active-pill {
  max-width: 150px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  padding: 3px 7px;
  border: 1px solid var(--accent-border);
  border-radius: 999px;
  background: var(--accent-bg);
  color: var(--accent);
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 600;
}
.gf-task-plan-list {
  display: grid;
  gap: 5px;
}
.gf-task-plan-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  width: 100%;
  padding: 3px;
  border: 1px solid transparent;
  border-radius: 6px;
  background: transparent;
  color: var(--text-secondary);
}
.gf-task-plan-row:hover {
  background: var(--neutral-bg);
  color: var(--text-primary);
}
.gf-task-plan-row.is-selected {
  background: var(--accent-bg);
  border-color: var(--accent-border);
  color: var(--accent);
}
.gf-task-plan-main {
  display: block;
  min-width: 0;
  flex: 1 1 auto;
  padding: 6px 7px;
  border: 0;
  background: transparent;
  color: inherit;
  text-align: left;
}
.gf-task-plan-active-btn {
  display: inline-grid;
  place-items: center;
  width: 28px;
  height: 28px;
  flex: 0 0 auto;
  border: 1px solid transparent;
  border-radius: 5px;
  background: transparent;
  color: var(--text-disabled);
}
.gf-task-plan-active-btn svg {
  width: 14px;
  height: 14px;
}
.gf-task-plan-active-btn:hover:not(:disabled) {
  border-color: var(--accent-border);
  background: var(--accent-bg);
  color: var(--accent);
}
.gf-task-plan-active-btn.is-active {
  border-color: var(--accent-border);
  background: var(--accent-bg);
  color: var(--accent);
}
.gf-task-plan-active-btn:disabled {
  cursor: default;
  opacity: 0.82;
}
.gf-task-plan-main strong {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-family: var(--font-mono);
  font-size: 12px;
}
.gf-task-plan-main small {
  display: block;
  margin-top: 2px;
  color: var(--text-muted);
  font-size: 11px;
}
.gf-task-path {
  max-width: 360px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--text-disabled);
  font-family: var(--font-mono);
  font-size: 10px;
}
.gf-task-milestone-list {
  display: grid;
  gap: 10px;
}
.gf-task-milestone {
  padding: 13px 14px;
  border: 1px solid var(--border-subtle);
  border-radius: 8px;
  background: var(--surface-page);
}
.gf-task-milestone-main {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 132px;
  gap: 16px;
  align-items: start;
}
.gf-task-milestone-copy {
  min-width: 0;
}
.gf-task-meta-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  color: var(--text-disabled);
  font-size: 11px;
}
.gf-task-status {
  max-width: 160px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  padding: 2px 7px;
  border: 1px solid var(--neutral-border);
  border-radius: 999px;
  background: var(--neutral-bg);
  color: var(--text-secondary);
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
}
.gf-task-milestone h3 {
  margin: 7px 0 4px;
  color: var(--text-primary);
  font-size: 15px;
  font-weight: 600;
  line-height: 1.3;
}
.gf-task-milestone p {
  margin: 0 0 8px;
  color: var(--text-muted);
  font-size: 12px;
  line-height: 1.45;
}
.gf-task-milestone code {
  display: inline-block;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--text-disabled);
  font-family: var(--font-mono);
  font-size: 11px;
}
.gf-task-progress {
  display: grid;
  gap: 7px;
  justify-items: end;
  color: var(--text-secondary);
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 600;
}
.gf-task-progress-track {
  position: relative;
  width: 100%;
  height: 6px;
  overflow: hidden;
  border-radius: 999px;
  background: var(--border-default);
}
.gf-task-progress-fill {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: var(--status-pass);
}
.gf-coming-soon-page {
  display: grid;
  place-items: start center;
  padding: 72px 28px;
}
.gf-coming-soon-panel {
  width: min(620px, 100%);
  padding: 28px 0;
}
.gf-coming-soon-panel h1 {
  margin: 6px 0 8px;
  color: var(--text-primary);
  font-size: 28px;
  font-weight: 600;
  line-height: 1.2;
}
.gf-coming-soon-panel p {
  margin: 0;
  color: var(--text-muted);
  font-size: 14px;
  line-height: 1.6;
}

/* ═══════════════════════════════════════════════════════════
   Setup Page
   ═══════════════════════════════════════════════════════════ */
.gf-setup-wrap {
  display: flex !important;
  gap: 16px;
  padding: 20px 24px;
  height: calc(100% - 40px);
}
.gf-setup-left {
  width: 45%;
  display: flex;
  flex-direction: column;
  overflow-y: auto;
}
.gf-setup-right {
  width: 55%;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.gf-agent-strip {
  padding: 12px 20px;
  display: flex !important;
  gap: 8px;
  border-top: 0.5px solid var(--border-subtle);
}
.gf-agent-card {
  flex: 1;
  padding: 10px;
  border-radius: 6px;
  text-align: center;
  cursor: pointer;
  background: var(--surface-page);
  border: 0.5px solid var(--border-subtle);
  transition:
    background 0.1s,
    border-color 0.1s;
}
.gf-agent-card:hover {
  background: var(--surface-elevated);
  border-color: var(--border-default);
}
.gf-agent-card-sel {
  border-color: var(--accent) !important;
  background: rgba(20, 83, 45, 0.12);
}
.gf-detect {
  padding: 16px 20px;
  border-top: 0.5px solid var(--border-subtle);
}
.gf-detect-row {
  display: flex !important;
  align-items: center;
  gap: 12px;
  padding: 4px 0;
}
.gf-detect-label {
  font-size: 12px;
  font-weight: 500;
  width: 110px;
  flex-shrink: 0;
  color: var(--text-muted);
}
.gf-detect-val {
  font-size: 12px;
  font-family: var(--font-mono);
  color: var(--zinc-300);
}
.gf-detect-missing {
  font-style: italic;
  font-family: system-ui, sans-serif;
  color: var(--text-disabled) !important;
}
.gf-prompt-card {
  border-radius: 8px;
  display: flex;
  flex-direction: column;
  flex: 1;
  overflow: hidden;
  background: var(--surface-base);
  border: 0.5px solid var(--border-subtle);
  position: relative;
}
.gf-loader-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}
.gf-prompt-loading {
  flex: 1;
  min-height: 140px;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  gap: 8px;
  padding-top: 32px;
  background: var(--surface-deep);
}
.gf-hidden {
  display: none !important;
}
.mono {
  font-family: var(--font-mono);
}
@media (max-width: 900px) {
  .gf-about-layout {
    grid-template-columns: 1fr !important;
  }
  .gf-about-toc {
    display: none;
  }
  .gf-about-flow {
    grid-template-columns: 1fr !important;
    gap: 8px !important;
  }
  .gf-about-arrow {
    display: none !important;
  }
}
.gf-prompt-hdr {
  display: flex !important;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  border-bottom: 0.5px solid var(--border-subtle);
}
.gf-prompt-body {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
  font-family: var(--font-mono);
  font-size: 12px;
  line-height: 1.7;
  white-space: pre-wrap;
  word-wrap: break-word;
  background: var(--surface-deep);
  color: var(--text-secondary);
  margin: 0;
}

/* ═══════════════════════════════════════════════════════════
   Home Dashboard
   ═══════════════════════════════════════════════════════════ */
.home-scroll {
  height: 100%;
  overflow-y: auto;
}
.home-page {
  --font-body: "IBM Plex Sans", system-ui, sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, monospace;
  max-width: 1100px;
  margin: 0 auto;
  padding: 20px 24px 40px;
  box-sizing: border-box;
  font-family: var(--font-body);
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}
.home-empty {
  min-height: min(560px, calc(100vh - 180px));
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 48px 24px;
  text-align: center;
  background: var(--surface-base);
  border: 1px solid var(--border-subtle);
  border-radius: 8px;
}
.home-empty-mark {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: 8px;
  font-family: var(--font-mono);
  font-size: 13px;
  font-weight: 700;
  color: var(--text-muted);
  background: var(--neutral-bg);
  border: 1px solid var(--neutral-border);
}
.home-empty h2,
.rollup-name,
.next-action-title {
  margin: 0;
  color: var(--text-primary);
}
.home-empty p,
.rollup-subtitle,
.next-action-detail,
.detail-row p,
.loop-na p {
  margin: 0;
  color: var(--text-secondary);
}
.home-primary {
  color: var(--accent-contrast) !important;
  background: var(--accent-strong) !important;
  border-color: var(--accent-strong) !important;
}
.home-primary:hover {
  color: var(--accent-contrast) !important;
  background: var(--accent-hover) !important;
  border-color: var(--accent-hover) !important;
}
.sessions-strip {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 42px;
  padding: 8px 14px;
  margin-bottom: 14px;
  background: var(--surface-base);
  border: 1px solid var(--border-subtle);
  border-radius: 8px;
  font-size: 13px;
}
.sessions-strip-main {
  display: flex;
  align-items: center;
  min-width: 0;
  gap: 8px;
}
.sessions-dot,
.pill-dot {
  width: 14px;
  height: 14px;
  border-radius: 999px;
  flex: 0 0 auto;
  display: inline-grid;
  place-items: center;
  font-family: var(--font-mono);
  font-size: 8px;
  font-weight: 800;
  color: var(--surface-deep);
}
.pill-dot.ok::before {
  content: "✓";
}
.pill-dot.warn::before,
.pill-dot.bad::before {
  content: "!";
}
.pill-dot.na::before {
  content: "○";
}
.sessions-dot,
.pill-dot.ok {
  background: var(--green-500);
  box-shadow: 0 0 0 3px var(--status-pass-bg);
}
.pill-dot.warn {
  background: var(--amber-400);
  box-shadow: 0 0 0 3px var(--amber-bg);
}
.pill-dot.bad {
  background: var(--red-400);
  box-shadow: 0 0 0 3px var(--red-bg);
}
.pill-dot.na {
  background: var(--text-muted);
  box-shadow: 0 0 0 3px var(--neutral-bg);
}
.session-count {
  color: var(--text-primary);
  font-weight: 600;
  white-space: nowrap;
}
.session-meta {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--text-muted);
  font-family: var(--font-mono);
  font-size: 12px;
}
.spacer {
  flex: 1 1 auto;
}
.rollup,
.next-action,
.panel,
.agent-card {
  background: var(--surface-base);
  border: 1px solid var(--border-subtle);
  border-radius: 8px;
}
.rollup {
  display: grid;
  gap: 14px;
  padding: 18px 22px;
  margin-bottom: 12px;
  border-radius: 10px;
}
.rollup.stale {
  border-color: var(--amber-border);
}
.rollup-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.rollup-kicker,
.next-action-eyebrow {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.section-title,
.panel-title {
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
.rollup-kicker {
  margin-bottom: 4px;
  color: var(--accent);
}
.rollup-heading {
  display: flex;
  align-items: baseline;
  gap: 12px;
  min-width: 0;
}
.rollup-name {
  font-size: 17px;
  line-height: 1.25;
  font-weight: 600;
  white-space: nowrap;
}
.rollup-subtitle {
  margin-top: 4px;
  max-width: 720px;
  font-size: 13px;
}
.rollup-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 0 0 auto;
}
.rollup-meta {
  color: var(--text-muted);
  font-family: var(--font-mono);
  font-size: 12px;
  white-space: nowrap;
}
.rollup-meta.warn {
  color: var(--amber-400);
}
.pills {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}
.pill {
  min-height: 80px;
  padding: 11px 14px;
  background: var(--surface-page);
  border: 1px solid var(--border-faint);
  border-radius: 8px;
}
.pill.ok {
  border-color: var(--status-pass-border);
}
.pill.warn {
  border-color: var(--amber-border);
}
.pill.bad {
  border-color: var(--red-border);
}
.pill.na {
  border-color: var(--neutral-border);
}
.pill-head {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 4px;
  min-width: 0;
}
.pill-label {
  overflow: hidden;
  color: var(--text-muted);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.06em;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.pill-value {
  margin-top: 4px;
  font-size: 14px;
  font-weight: 500;
  line-height: 1.1;
}
.pill-value.ok,
.concern-pct.ok,
.agent-grade.ok,
.loop-status-value.ok {
  color: var(--green-400);
}
.pill-value.warn,
.concern-pct.warn,
.agent-grade.warn,
.loop-status-value.warn {
  color: var(--amber-400);
}
.pill-value.bad,
.concern-pct.bad,
.agent-grade.bad,
.loop-status-value.bad {
  color: var(--red-400);
}
.pill-value.na,
.concern-pct.na,
.agent-grade.na,
.loop-status-value.na {
  color: var(--text-muted);
}
.pill-detail {
  margin-top: 2px;
  color: var(--text-muted);
  font-family: var(--font-mono);
  font-size: 12px;
  line-height: 1.35;
}
.next-action {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 18px 22px;
  margin-bottom: 20px;
}
.next-action.priority-ok {
  background: var(--status-pass-bg);
  border-color: var(--status-pass-border);
}
.next-action.priority-warn {
  background: var(--amber-bg);
  border-color: var(--amber-border);
}
.next-action.priority-bad {
  background: var(--red-bg);
  border-color: var(--red-border);
}
.next-action-body {
  flex: 1 1 auto;
  min-width: 0;
}
.next-action-eyebrow {
  color: var(--text-muted);
}
.next-action.priority-ok .next-action-eyebrow {
  color: var(--green-400);
}
.next-action.priority-warn .next-action-eyebrow {
  color: var(--amber-400);
}
.next-action.priority-bad .next-action-eyebrow {
  color: var(--red-400);
}
.next-action-title {
  margin-top: 4px;
  font-size: 16px;
  font-weight: 700;
}
.next-action-detail {
  margin-top: 4px;
  font-size: 13px;
  max-width: 740px;
}
.next-action-cmd {
  display: inline-flex;
  max-width: 100%;
  margin-top: 10px;
  padding: 6px 8px;
  overflow: hidden;
  color: var(--text-primary);
  background: var(--surface-deep);
  border: 1px solid var(--border-subtle);
  border-radius: 6px;
  font-family: var(--font-mono);
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.next-action-cta {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 0 0 auto;
}
.section-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin: 0 0 10px;
}
.section-title {
  color: var(--text-primary);
}
.section-meta {
  font-size: 12px;
}
.section-meta {
  color: var(--text-muted);
  font-family: var(--font-mono);
  white-space: nowrap;
}
.agent-grid {
  display: grid;
  grid-template-columns: repeat(var(--agent-columns, 4), minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 22px;
}
.agent-card {
  overflow: hidden;
  transition:
    border-color 0.15s,
    background 0.15s,
    opacity 0.15s;
}
.agent-card.warn {
  border-color: var(--amber-border);
}
.agent-card.bad {
  border-color: var(--red-border);
}
.agent-card.disabled {
  opacity: 0.45;
}
.agent-card.disabled .agent-card-button {
  cursor: default;
}
.agent-card:not(.disabled):hover {
  border-color: var(--border-default);
}
.agent-card-selected {
  border-color: var(--accent-border) !important;
  background: var(--accent-bg) !important;
}
.agent-all-pass {
  width: 100%;
  margin-top: 10px;
  padding: 8px 10px;
  border: 1px solid var(--status-pass-border);
  border-radius: 6px;
  background: var(--status-pass-bg);
  color: var(--green-400);
  font-size: 12px;
  font-weight: 600;
  text-align: left;
}
.agent-all-pass:hover {
  border-color: var(--green-400);
}
.agent-card-button {
  display: block;
  width: 100%;
  padding: 14px 16px;
  text-align: left;
  color: inherit;
  background: transparent;
  border: 0;
  cursor: pointer;
}
.agent-card-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 2px;
}
.agent-name {
  color: var(--text-primary);
  font-size: 14px;
  font-weight: 500;
}
.agent-summary {
  color: var(--text-muted);
  font-size: 12px;
  margin-bottom: 10px;
}
.agent-grade {
  display: flex;
  align-items: baseline;
  gap: 4px;
}
.grade-letter {
  font-family: var(--font-mono);
  font-size: 18px;
  font-weight: 600;
}
.grade-pct {
  font-size: 12px;
  color: var(--text-muted);
}
.concern-list {
  margin-top: 10px;
}
.concern-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 5px;
}
.concern-label {
  width: 64px;
  flex-shrink: 0;
  overflow: hidden;
  color: var(--text-muted);
  font-size: 11px;
  text-align: right;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.concern-bar {
  flex: 1;
  height: 4px;
  overflow: hidden;
  background: var(--neutral-bg);
  border-radius: 999px;
}
.concern-fill {
  height: 100%;
  border-radius: inherit;
}
.concern-fill.ok {
  background: var(--green-500);
}
.concern-fill.warn {
  background: var(--amber-400);
}
.concern-fill.bad {
  background: var(--red-400);
}
.concern-fill.na {
  background: var(--neutral-border);
}
.concern-pct {
  width: 32px;
  flex-shrink: 0;
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 600;
  text-align: right;
}
.home-detail {
  padding: 18px 22px;
  margin-top: -12px;
  margin-bottom: 22px;
  background: var(--surface-base);
  border: 1px solid var(--accent-border);
  border-radius: 8px;
}
.detail-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border-subtle);
}
.detail-header-left {
  display: flex;
  align-items: baseline;
  gap: 12px;
}
.detail-close {
  width: 28px;
  height: 28px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 6px;
  border: 1px solid var(--border-subtle);
  background: transparent;
  color: var(--text-muted);
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
  transition:
    background 0.15s,
    color 0.15s;
}
.detail-close:hover {
  background: var(--neutral-bg);
  color: var(--text-primary);
}
.detail-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}
.detail-card {
  padding: 12px;
  background: var(--surface-base);
  border: 1px solid var(--border-faint);
  border-radius: 8px;
}
.detail-card h4 {
  margin: 0 0 10px;
  color: var(--text-primary);
  font-size: 13px;
}
.detail-row {
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr);
  gap: 8px;
  padding: 8px 0;
  border-top: 1px solid var(--border-faint);
}
.detail-row:first-of-type {
  border-top: 0;
  padding-top: 0;
}
.detail-row strong {
  color: var(--text-primary);
  font-size: 12px;
}
.detail-row p {
  margin-top: 2px;
  font-size: 12px;
}
.detail-row .detail-fix {
  color: var(--text-muted);
}
.detail-status {
  align-self: start;
  padding: 2px 6px;
  border-radius: 4px;
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 700;
  text-align: center;
}
.detail-status.pass {
  color: var(--green-400);
  background: var(--status-pass-bg);
}
.detail-status.fail {
  color: var(--red-400);
  background: var(--red-bg);
}
.detail-status.warn {
  color: var(--amber-400);
  background: var(--amber-bg);
}
.detail-status.info,
.detail-status.skipped {
  color: var(--text-muted);
  background: var(--neutral-bg);
}
.lower-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}
.panel {
  min-width: 0;
  padding: 16px 18px;
}
.panel-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 12px;
}
.panel-title {
  color: var(--text-primary);
}
.panel-cta {
  flex: 0 0 auto;
  padding: 0;
  color: var(--accent);
  background: transparent;
  border: 0;
  font-size: 12px;
  font-weight: 600;
}
.panel-cta:hover {
  color: var(--accent-hover);
}
.install-body {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 20px;
}
.install-checks {
  display: grid;
  gap: 9px;
}
.install-check {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 22px;
  color: var(--text-primary);
  font-size: 13px;
}
.install-check.dim {
  color: var(--text-disabled);
}
.install-check-icon {
  display: inline-grid;
  place-items: center;
  width: 16px;
  height: 16px;
  border-radius: 4px;
  flex: 0 0 auto;
  font-size: 11px;
  font-weight: 800;
  line-height: 1;
}
.install-check-icon.ok {
  color: var(--green-400);
  background: var(--status-pass-bg);
}
.install-check-icon.bad {
  color: var(--red-400);
  background: var(--red-bg);
}
.install-check-copy {
  display: grid;
  gap: 2px;
  min-width: 0;
}
.install-check-detail {
  color: var(--text-dim);
  font-size: 11px;
  line-height: 1.25;
}
.ring-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}
.ring-chart {
  position: relative;
  display: grid;
  place-items: center;
  width: 92px;
  aspect-ratio: 1;
  border-radius: 999px;
  background: conic-gradient(
    var(--ring-color) 0 var(--ring-value),
    var(--neutral-bg) var(--ring-value) 100%
  );
}
.ring-chart::before {
  content: "";
  position: absolute;
  inset: 9px;
  background: var(--surface-base);
  border-radius: inherit;
}
.ring-value {
  position: relative;
  z-index: 1;
  font-family: var(--font-mono);
  font-size: 22px;
  font-weight: 600;
  line-height: 1;
}
.ring-pct {
  font-size: 13px;
  color: var(--text-muted);
  font-weight: 500;
  margin-left: 1px;
}
.ring-label {
  color: var(--text-muted);
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.ring-breakdown {
  color: var(--text-dim);
  font-family: var(--font-mono);
  font-size: 10px;
  white-space: nowrap;
}
.loop-panel .panel-head {
  align-items: center;
}
.loop-status-row {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}
.loop-status-value {
  font-size: 14px;
  font-weight: 500;
}
.loop-status-detail {
  overflow: hidden;
  color: var(--text-muted);
  font-family: var(--font-mono);
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.loop-index-list {
  display: grid;
  gap: 6px;
  margin-top: 10px;
}
.loop-index-row {
  display: grid;
  grid-template-columns: 84px minmax(0, 1fr) 34px auto;
  align-items: center;
  gap: 10px;
}
.loop-index-bucket {
  color: var(--text-primary);
  font-size: 12px;
}
.loop-stat-bar {
  height: 5px;
  overflow: hidden;
  background: var(--neutral-bg);
  border-radius: 999px;
}
.loop-stat-fill {
  height: 100%;
  border-radius: inherit;
}
.loop-stat-fill.ok {
  background: var(--green-500);
}
.loop-stat-fill.warn {
  background: var(--amber-400);
}
.loop-stat-fill.na {
  background: var(--neutral-border);
}
.loop-index-count {
  color: var(--text-secondary);
  font-family: var(--font-mono);
  font-size: 11px;
  text-align: right;
}
.learning-index-chip {
  min-width: 0;
  max-width: 100%;
  overflow: hidden;
  padding: 2px 6px;
  border: 1px solid var(--border-faint);
  border-radius: 6px;
  color: var(--text-secondary);
  font-family: var(--font-mono);
  font-size: 10px;
  line-height: 1.35;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.learning-index-chip.is-fresh {
  border-color: var(--status-pass-border);
  color: var(--green-400);
}
.learning-index-chip.is-stale {
  border-color: var(--amber-border);
  color: var(--amber-400);
}
.learning-index-chip.is-missing {
  border-color: var(--neutral-border);
  color: var(--text-muted);
}
.loop-meta {
  margin-top: 8px;
  color: var(--text-dim);
  font-family: var(--font-mono);
  font-size: 11px;
}
.loop-error {
  margin-top: 8px;
  color: var(--red-400);
  font-family: var(--font-mono);
  font-size: 12px;
}
.loop-regen-btn:disabled,
.loop-regen-btn:disabled:hover {
  background: var(--surface-elevated);
  border-color: var(--border-default);
  color: var(--text-disabled);
  cursor: not-allowed;
}
.loop-na {
  min-height: 150px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  text-align: center;
}
.loop-na-mark {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: 8px;
  color: var(--text-muted);
  background: var(--neutral-bg);
  border: 1px solid var(--neutral-border);
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 700;
}
.home-footer {
  padding: 24px 0 8px;
  color: var(--text-muted);
  font-size: 11px;
  text-align: center;
}
@media (max-width: 900px) {
  .rollup-top,
  .next-action,
  .section-head,
  .panel-head {
    align-items: stretch;
    flex-direction: column;
  }
  .rollup-actions,
  .next-action-cta {
    justify-content: flex-start;
  }
  .agent-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .lower-row,
  .detail-grid {
    grid-template-columns: 1fr;
  }
  .gf-prompts-layout,
  .gf-custom-form-body,
  .gf-custom-grid-2,
  .gf-flag-grid {
    grid-template-columns: 1fr !important;
  }
  .gf-custom-preview-pane {
    position: static;
  }
}
@media (max-width: 600px) {
  .home-page {
    padding: 12px 14px 22px;
  }
  .sessions-strip {
    flex-wrap: wrap;
  }
  .sessions-strip-main {
    width: 100%;
  }
  .pills {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .agent-grid,
  .install-body {
    grid-template-columns: 1fr;
  }
  .next-action-cta {
    width: 100%;
    flex-direction: column;
    align-items: stretch;
  }
  .next-action-cta .gf-btn {
    width: 100%;
  }
  .section-meta {
    white-space: normal;
  }
  .gf-custom-form-head {
    align-items: stretch;
    flex-direction: column;
  }
  .gf-custom-form-head-actions,
  .gf-custom-form-actions {
    justify-content: flex-start;
  }
  .gf-start-picker {
    justify-content: flex-start;
  }
  .gf-start-picker-panel {
    position: static;
    min-width: 0;
    grid-template-columns: 1fr;
  }
  .gf-custom-form-actions .gf-btn {
    width: 100%;
  }
}
@media (max-width: 420px) {
  .pills {
    grid-template-columns: 1fr;
  }
  .concern-label {
    width: 56px;
  }
}

/* ═══════════════════════════════════════════════════════════
   Light Mode - Specialized Overrides
   Only for components where semantic tokens don't match.
   ═══════════════════════════════════════════════════════════ */

/* Banner pass */
:root:not(.dark) .gf-banner-pass .gf-banner-title {
  color: var(--green-700);
}
:root:not(.dark) .gf-banner-pass .gf-banner-sub {
  color: var(--green-800);
}
:root:not(.dark) .gf-banner-pass .gf-banner-ts {
  color: var(--green-600);
}

/* Banner fail */
:root:not(.dark) .gf-banner-fail {
  background: var(--red-100);
  border-color: var(--red-200);
}
:root:not(.dark) .gf-banner-fail .gf-banner-icon {
  background: var(--red-200);
  color: var(--red-700);
}
:root:not(.dark) .gf-banner-fail .gf-banner-title {
  color: var(--red-800);
}
:root:not(.dark) .gf-banner-fail .gf-banner-sub {
  color: var(--red-900);
}
:root:not(.dark) .gf-banner-fail .gf-banner-ts {
  color: var(--red-700);
}

/* Grade badges */
:root:not(.dark) .gf-grade-a {
  background: var(--green-100);
  color: var(--green-700);
}
:root:not(.dark) .gf-grade-b {
  background: var(--amber-100);
  color: var(--amber-600);
}
:root:not(.dark) .gf-grade-c,
:root:not(.dark) .gf-grade-d,
:root:not(.dark) .gf-grade-f {
  background: var(--red-100);
  color: var(--red-700);
}
:root:not(.dark) .gf-grade-na {
  background: var(--zinc-100);
  color: var(--zinc-300);
}

/* Severity badges */
:root:not(.dark) .gf-badge-critical {
  background: var(--red-100);
  color: var(--red-700);
}
:root:not(.dark) .gf-badge-high {
  background: var(--orange-100);
  color: var(--orange-700);
}
:root:not(.dark) .gf-badge-medium {
  background: var(--amber-50);
  color: var(--amber-700);
}
:root:not(.dark) .gf-badge-low {
  background: var(--indigo-100);
  color: var(--indigo-600);
}
:root:not(.dark) .gf-badge-ap {
  background: var(--red-100);
  color: var(--red-700);
}
:root:not(.dark) .gf-badge-pass {
  background: var(--green-100);
  color: var(--green-700);
}
:root:not(.dark) .gf-badge-warn {
  background: var(--amber-100);
  color: var(--amber-700);
}
:root:not(.dark) .gf-badge-info {
  background: var(--indigo-100);
  color: var(--indigo-600);
}
:root:not(.dark) .gf-badge-muted {
  background: var(--zinc-100);
  color: var(--zinc-500);
}

/* Buttons */
:root:not(.dark) .gf-btn-primary {
  background: var(--accent-strong);
  color: var(--accent-contrast);
  border-color: var(--accent-strong);
}
:root:not(.dark) .gf-btn-primary:hover {
  background: var(--accent-hover);
  border-color: var(--accent-hover);
}
:root:not(.dark) .gf-btn-green {
  background: var(--green-100);
  color: var(--green-600);
}
:root:not(.dark) .gf-check-pass {
  background: var(--green-100);
  color: var(--green-600);
}
:root:not(.dark) .gf-btn-copy {
  background: transparent;
  color: var(--text-primary);
  border-color: var(--zinc-200);
}
:root:not(.dark) .gf-btn-terminal {
  background: var(--accent-bg);
  color: var(--accent);
  border-color: var(--accent-border);
}
:root:not(.dark) .gf-btn-regen {
  color: var(--text-primary);
}
:root:not(.dark) .gf-terminal-cta {
  background: var(--accent-bg);
  border-bottom-color: var(--zinc-200);
}
:root:not(.dark) .gf-btn-terminal-cta {
  background: var(--accent-strong);
  color: var(--accent-contrast);
  border-color: var(--accent-strong);
}
:root:not(.dark) .gf-btn-terminal-cta:hover {
  background: var(--accent-hover);
  border-color: var(--accent-hover);
}

/* Header */
:root:not(.dark) .gf-ab-active {
  background: var(--accent-strong) !important;
  color: var(--accent-contrast) !important;
  border-right-color: var(--accent-strong) !important;
}
:root:not(.dark) .gf-ib {
  color: var(--zinc-500);
}
:root:not(.dark) .gf-ib:hover {
  background: rgba(0, 0, 0, 0.06);
  color: var(--zinc-700);
}

/* Setup */
:root:not(.dark) .gf-agent-card-sel {
  border-color: var(--green-600) !important;
  background: rgba(220, 252, 231, 0.06);
}
:root:not(.dark) .gf-detect-val {
  color: var(--zinc-700);
}
:root:not(.dark) .gf-prompt-body {
  background: #f9fafb;
  color: #4b5563;
}

/* Play icon */
:root:not(.dark) .gf-play-icon {
  color: var(--zinc-400);
  border-color: var(--zinc-300);
}
:root:not(.dark) .gf-action-btn:hover .gf-play-icon {
  color: var(--green-600) !important;
  border-color: var(--green-200) !important;
}
:root:not(.dark) .home-primary {
  color: var(--accent-contrast) !important;
  background: var(--accent-strong) !important;
  border-color: var(--accent-strong) !important;
}
:root:not(.dark) .home-primary:hover {
  background: var(--accent-hover) !important;
  border-color: var(--accent-hover) !important;
}
:root:not(.dark) .pill,
:root:not(.dark) .home-detail,
:root:not(.dark) .next-action-cmd {
  background: #f8fafc;
}
:root:not(.dark) .detail-card {
  background: white;
}
:root:not(.dark) .ring-chart::before {
  background: white;
}
:root:not(.dark) .next-action.priority-ok {
  background: rgba(22, 163, 74, 0.08);
  border-color: rgba(22, 163, 74, 0.3);
}
:root:not(.dark) .next-action.priority-warn {
  background: rgba(217, 119, 6, 0.1);
  border-color: rgba(217, 119, 6, 0.3);
}
:root:not(.dark) .next-action.priority-bad {
  background: rgba(220, 38, 38, 0.08);
  border-color: rgba(220, 38, 38, 0.28);
}

/* --- Shared evaluator/result surface styles --- */
.gf-modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.6);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
}
.gf-modal-card {
  width: 760px;
  max-width: calc(100vw - 32px);
  max-height: calc(100vh - 64px);
  overflow-y: auto;
  padding: 20px 24px;
  background: var(--surface-base);
  border: 1px solid var(--border-default);
  border-radius: 8px;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.35);
  display: flex;
  flex-direction: column;
  gap: 8px;
  /* Make the card a positioning context so the drag-drop hint overlay can
     fill it via inset:0 without escaping into the page. */
  position: relative;
}
.gf-modal-card-dragover {
  border-color: var(--accent);
}
:root:not(.dark) .gf-modal-card {
  background: var(--surface-base);
  box-shadow: 0 10px 40px rgba(15, 23, 42, 0.18);
}
.gf-modal-input {
  width: 100%;
  padding: 8px 10px;
  font-size: 12px;
  background: var(--surface-page);
  color: var(--text-primary);
  border: 1px solid var(--border-default);
  border-radius: 4px;
  font-family: inherit;
  box-sizing: border-box;
}
.gf-modal-input:focus {
  outline: none;
  border-color: var(--accent-border);
  box-shadow: 0 0 0 2px var(--accent-bg);
}
.gf-modal-error {
  margin-top: 8px;
  padding: 8px 12px;
  background: var(--red-bg);
  border: 1px solid var(--red-border);
  border-radius: 4px;
  font-size: 11px;
  color: var(--status-danger);
}
.gf-modal-result {
  margin-top: 12px;
  padding: 12px;
  border: 1px solid var(--border-subtle);
  border-radius: 4px;
  background: var(--surface-elevated);
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.gf-modal-rec-badge {
  font-size: 11px;
  font-weight: 600;
  padding: 1px 6px;
  border-radius: 3px;
  background: var(--neutral-bg);
  color: var(--text-secondary);
}
.gf-modal-rec-badge[data-rec="keep-skill"],
.gf-modal-rec-badge[data-rec="reference-playbook"] {
  background: var(--status-pass-bg);
  color: var(--status-pass);
}
.gf-modal-rec-badge[data-rec="needs-human-review"],
.gf-modal-rec-badge[data-rec="consider-reclassifying"] {
  background: var(--amber-bg);
  color: var(--status-waiting);
}
.gf-modal-rec-badge[data-rec="retire"],
.gf-modal-rec-badge[data-rec="consider-revision"] {
  background: var(--red-bg);
  color: var(--status-danger);
}

/* === Skills page + Evaluate-skill modal redesign ===
   Pattern parity with Setup/Quality: scope strip + scored sidebar +
   pill families (type/verdict/file) + grade block + summary banner.
   Modal has three explicit states (empty / files-attached / result).
*/

.gf-skill-scope-strip {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--surface-base);
  border: 1px solid var(--border-subtle);
  border-radius: 8px;
  padding: 12px 18px;
  margin-bottom: 14px;
  font-size: 13px;
}
.gf-skill-scope-strip .gf-scope-meta {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
}
.gf-skill-scope-strip .gf-scope-sep {
  color: var(--text-disabled);
}
.gf-skill-scope-strip .gf-scope-pass {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.gf-skill-scope-strip .gf-scope-check {
  color: var(--status-pass);
  font-weight: 600;
}
.gf-skill-scope-strip .gf-scope-warn {
  color: var(--status-waiting);
}
.gf-skill-scope-strip .gf-scope-dim {
  color: var(--text-muted);
}
.gf-skill-scope-strip .gf-scope-avg {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--text-muted);
}
.gf-skill-scope-strip .gf-scope-avg-val {
  color: var(--status-pass);
  font-weight: 600;
  margin-left: 4px;
}

.gf-skill-sidebar-list {
  display: flex;
  flex-direction: column;
}
.gf-skill-sidebar-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 12px;
  font-size: 13px;
  color: var(--text-muted);
  cursor: pointer;
  border: none;
  background: none;
  text-align: left;
  font-family: inherit;
  border-radius: 4px;
}
.gf-skill-sidebar-item:hover {
  background: var(--border-faint);
  color: var(--text-primary);
}
.gf-skill-sidebar-item.is-active {
  background: var(--accent-bg);
  border-left: 2px solid var(--accent);
  padding-left: 10px;
  color: var(--text-primary);
}
.gf-skill-sidebar-score {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 600;
  display: inline-flex;
  gap: 4px;
}
/* Grade letter colour escalation: A green, B paler green, C amber, D
   orange, F red. D is "in trouble but salvageable" - must not look the same
   as F ("broken"). */
.gf-skill-sidebar-score.is-a {
  color: var(--status-pass);
}
.gf-skill-sidebar-score.is-b {
  color: var(--green-300, #86efac);
}
.gf-skill-sidebar-score.is-c {
  color: var(--status-waiting);
}
.gf-skill-sidebar-score.is-d {
  color: var(--orange-warn);
}
.gf-skill-sidebar-score.is-f {
  color: var(--status-danger);
}
.gf-skill-sidebar-score.is-pending {
  color: var(--text-disabled);
}

.gf-skill-detail-toolbar {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  padding-bottom: 12px;
  margin-bottom: 14px;
  border-bottom: 1px solid var(--border-subtle);
}

.gf-skill-id {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 6px;
  flex-wrap: wrap;
}
.gf-skill-id h2 {
  font-size: 18px;
  font-weight: 600;
  margin: 0;
  font-family: var(--font-mono);
  color: var(--text-primary);
}

/* Three pill families - distinct visual style each.
   Type pill defaults to indigo (dispatcher) and varies by skill subtype so
   the eye can sort skills by shape at a glance. */
.gf-pill-type {
  background: var(--accent-bg);
  color: var(--accent-hover);
  border: 1px solid var(--accent-border);
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 10px;
  font-family: var(--font-mono);
  letter-spacing: 0.05em;
  text-transform: uppercase;
}
.gf-pill-type.is-workflow {
  background: var(--status-pass-bg);
  color: var(--status-pass);
  border-color: var(--status-pass-border);
}
.gf-pill-type.is-playbook {
  background: rgba(251, 191, 36, 0.12);
  color: var(--amber-400, #fbbf24);
  border-color: rgba(251, 191, 36, 0.32);
}
.gf-pill-type.is-report {
  background: rgba(34, 211, 238, 0.12);
  color: var(--cyan-400, #22d3ee);
  border-color: rgba(34, 211, 238, 0.32);
}
.gf-pill-type.is-index {
  background: rgba(167, 139, 250, 0.12);
  color: var(--violet-400, #a78bfa);
  border-color: rgba(167, 139, 250, 0.32);
}
.gf-pill-type.is-meta {
  background: var(--surface-elevated);
  color: var(--text-muted);
  border-color: var(--border-default);
}
.gf-pill-verdict {
  padding: 3px 9px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 600;
  font-family: var(--font-mono);
  letter-spacing: 0.02em;
}
.gf-pill-verdict.is-keep {
  background: var(--status-pass);
  color: var(--surface-deep);
}
.gf-pill-verdict.is-reference {
  background: var(--accent-strong);
  color: var(--accent-contrast);
}
.gf-pill-verdict.is-review {
  background: var(--orange-warn);
  color: var(--surface-deep);
}
.gf-pill-verdict.is-retire {
  background: var(--status-danger);
  color: var(--accent-contrast);
}
.gf-pill-file {
  background: var(--surface-elevated);
  color: var(--text-muted);
  padding: 1px 6px;
  border-radius: 3px;
  font-size: 9px;
  letter-spacing: 0.05em;
  font-family: var(--font-mono);
  text-transform: uppercase;
  min-width: 64px;
  text-align: center;
}
.gf-pill-file.is-skill {
  background: var(--accent-bg);
  color: var(--accent-hover);
}

.gf-skill-file-path {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 8px;
}
.gf-skill-file-path .gf-path-icon {
  color: var(--text-disabled);
  cursor: pointer;
  background: none;
  border: none;
  padding: 0;
  font-size: 12px;
}
.gf-skill-file-path .gf-path-icon:hover {
  color: var(--text-primary);
}

.gf-grade-block {
  text-align: right;
  flex-shrink: 0;
}
.gf-grade-row {
  display: flex;
  align-items: baseline;
  gap: 6px;
  justify-content: flex-end;
}
.gf-grade-letter {
  font-size: 30px;
  font-weight: 600;
  font-family: var(--font-mono);
  line-height: 1;
}
.gf-grade-letter.is-a {
  color: var(--status-pass);
}
.gf-grade-letter.is-b {
  color: var(--green-300, #86efac);
}
.gf-grade-letter.is-c {
  color: var(--status-waiting);
}
.gf-grade-letter.is-d {
  color: var(--orange-warn);
}
.gf-grade-letter.is-f {
  color: var(--status-danger);
}
.gf-grade-pct {
  font-size: 18px;
  color: var(--text-primary);
  font-family: var(--font-mono);
}
.gf-grade-raw {
  font-size: 11px;
  color: var(--text-muted);
  font-family: var(--font-mono);
  margin-top: 2px;
}

.gf-summary-banner {
  border-radius: 6px;
  padding: 10px 14px;
  margin-bottom: 14px;
  background: var(--orange-warn-bg);
  border: 1px solid var(--orange-warn-border);
  border-left: 3px solid var(--orange-warn);
}
.gf-summary-banner.is-pass {
  background: var(--status-pass-bg);
  border: 1px solid var(--status-pass-border);
  border-left: 3px solid var(--status-pass);
}
.gf-summary-banner.is-danger {
  background: rgba(239, 68, 68, 0.08);
  border: 1px solid rgba(239, 68, 68, 0.25);
  border-left: 3px solid var(--status-danger);
}
.gf-summary-banner .gf-summary-title {
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 2px;
  color: var(--text-primary);
}
.gf-summary-banner .gf-summary-desc {
  font-size: 12px;
  color: var(--text-muted);
}

.gf-classification-strip {
  background: var(--surface-page);
  border: 1px solid var(--border-subtle);
  border-radius: 6px;
  padding: 8px 12px;
  margin-bottom: 16px;
  display: flex;
  align-items: baseline;
  gap: 10px;
  flex-wrap: wrap;
  font-size: 13px;
}
.gf-classification-strip .gf-cs-label {
  font-size: 10px;
  color: var(--text-muted);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.gf-classification-strip .gf-cs-pct {
  font-family: var(--font-mono);
  font-weight: 600;
  color: var(--status-pass);
  margin-right: 4px;
}
.gf-classification-strip .gf-cs-pct.is-low {
  color: var(--status-waiting);
}
.gf-classification-strip .gf-cs-alt {
  font-size: 12px;
  color: var(--text-muted);
  font-family: var(--font-mono);
}

.gf-section-label {
  font-size: 10px;
  color: var(--text-muted);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-bottom: 10px;
  font-weight: 600;
}

.gf-metrics {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 4px;
}
.gf-metric-row {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 12px;
}
.gf-metric-label {
  width: 200px;
  flex-shrink: 0;
  text-align: right;
  color: var(--text-muted);
}
.gf-metric-label.is-na {
  color: var(--text-disabled);
  font-style: italic;
}
.gf-bar-track {
  flex: 1;
  height: 6px;
  background: var(--surface-elevated);
  border-radius: 3px;
  overflow: hidden;
}
.gf-bar-track.is-na {
  background: transparent;
  border: 1px dashed var(--border-default);
}
.gf-bar-fill {
  height: 100%;
  border-radius: 3px;
  transition: width 0.3s;
}
.gf-bar-fill.is-ok {
  background: var(--status-pass);
}
.gf-bar-fill.is-warn {
  background: var(--orange-warn);
}
.gf-bar-fill.is-fail {
  background: var(--status-danger);
}
.gf-metric-score {
  width: 60px;
  flex-shrink: 0;
  font-family: var(--font-mono);
  font-size: 11px;
  text-align: right;
}
.gf-metric-score.is-ok {
  color: var(--status-pass);
}
.gf-metric-score.is-warn {
  color: var(--orange-warn);
}
.gf-metric-score.is-fail {
  color: var(--status-danger);
}
.gf-metric-score.is-na {
  color: var(--text-disabled);
  font-style: italic;
}

.gf-findings {
  margin-top: 18px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.gf-finding {
  background: var(--orange-warn-bg);
  border: 1px solid var(--orange-warn-border);
  border-left: 3px solid var(--orange-warn);
  border-radius: 6px;
  padding: 10px 14px;
  display: flex;
  align-items: flex-start;
  gap: 12px;
}
.gf-finding.is-fail {
  background: rgba(239, 68, 68, 0.06);
  border: 1px solid rgba(239, 68, 68, 0.2);
  border-left: 3px solid var(--status-danger);
}
.gf-finding .gf-finding-icon {
  font-size: 14px;
  line-height: 1.3;
  color: var(--orange-warn);
}
.gf-finding.is-fail .gf-finding-icon {
  color: var(--status-danger);
}
.gf-finding .gf-finding-body {
  flex: 1;
}
.gf-finding .gf-finding-title {
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 2px;
  color: var(--text-primary);
}
.gf-finding .gf-finding-meta {
  color: var(--text-muted);
  font-weight: 400;
  font-family: var(--font-mono);
  font-size: 11px;
  margin-left: 4px;
}
.gf-finding .gf-finding-desc {
  font-size: 12px;
  color: var(--text-muted);
  line-height: 1.5;
}
.gf-finding .gf-finding-ref {
  font-family: var(--font-mono);
  color: var(--accent-hover);
  background: var(--surface-elevated);
  padding: 1px 5px;
  border-radius: 3px;
  font-size: 11px;
}

.gf-composed-from {
  background: var(--surface-page);
  border: 1px solid var(--border-subtle);
  border-radius: 6px;
  padding: 10px 12px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.gf-composed-row {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-mono);
  font-size: 11px;
}
.gf-composed-row .gf-composed-name {
  color: var(--text-primary);
}

/* === Evaluate-skill modal redesign === */

.gf-skill-evaluator-panel {
  background: var(--surface-base);
  border: 1px solid var(--border-subtle);
  border-radius: 8px;
  margin-bottom: 16px;
  overflow: hidden;
  padding: 0;
  position: relative;
}
.gf-modal-card.is-skill-evaluator {
  width: 1100px;
  padding: 0;
  gap: 0;
}
.gf-modal-card.is-skill-evaluator .gf-modal-header,
.gf-skill-evaluator-panel .gf-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 22px;
  border-bottom: 1px solid var(--border-subtle);
}
.gf-modal-card.is-skill-evaluator .gf-modal-title,
.gf-skill-evaluator-panel .gf-modal-title {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  min-width: 0;
}
.gf-modal-card.is-skill-evaluator .gf-modal-title h2,
.gf-skill-evaluator-panel .gf-modal-title h2 {
  font-size: 16px;
  font-weight: 600;
  margin: 0;
  color: var(--text-primary);
}
.gf-modal-scope-tag {
  font-size: 11px;
  color: var(--text-muted);
  background: var(--surface-page);
  padding: 2px 8px;
  border-radius: 4px;
  font-family: var(--font-mono);
  letter-spacing: 0.04em;
}
.gf-modal-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  flex-wrap: wrap;
}
.gf-copy-report-btn {
  min-width: 98px;
}
.gf-copy-report-btn.is-copied {
  background: var(--status-pass-bg);
  border-color: var(--status-pass-border);
  color: var(--status-pass);
}
.gf-modal-icon-btn {
  background: transparent;
  border: 1px solid var(--border-default);
  color: var(--text-muted);
  padding: 4px 8px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 14px;
  line-height: 1;
}
.gf-modal-icon-btn:hover {
  color: var(--text-primary);
  border-color: var(--text-muted);
}
.gf-modal-card.is-skill-evaluator .gf-modal-body,
.gf-skill-evaluator-panel .gf-modal-body {
  padding: 22px;
  position: relative;
}

.gf-dropzone {
  border: 1.5px dashed var(--border-default);
  border-radius: 10px;
  padding: 32px 20px;
  text-align: center;
  background: var(--surface-page);
  cursor: pointer;
  transition:
    border-color 0.15s,
    background 0.15s;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
}
.gf-dropzone:hover {
  border-color: var(--accent);
  background: var(--accent-bg);
}
.gf-dropzone.has-files {
  display: block;
  padding: 14px 18px;
  text-align: left;
  cursor: default;
}
.gf-dropzone.is-drag-active {
  border-color: var(--accent);
  background: var(--accent-bg);
}
.gf-dropzone-icon {
  color: var(--text-muted);
  display: flex;
}
.gf-dropzone-primary {
  font-size: 14px;
  font-weight: 500;
  color: var(--text-primary);
}
.gf-dropzone-secondary {
  font-size: 12px;
  color: var(--text-muted);
}
.gf-dropzone-secondary code {
  background: var(--surface-elevated);
  padding: 1px 4px;
  border-radius: 3px;
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-secondary);
}
.gf-dropzone-browse {
  color: var(--accent);
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 2px;
}
.gf-dropzone-browse:hover {
  color: var(--accent-hover);
}

.gf-files-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 6px;
}
.gf-files-header .gf-fh-label {
  font-size: 11px;
  color: var(--text-muted);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-weight: 600;
}
.gf-files-header .gf-fh-add {
  font-size: 12px;
  color: var(--accent);
  cursor: pointer;
  background: none;
  border: none;
  padding: 0;
  font-family: inherit;
}
.gf-files-header .gf-fh-add:hover {
  color: var(--accent-hover);
}

.gf-file-chip-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 8px;
}
.gf-file-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--surface-elevated);
  border: 1px solid var(--border-subtle);
  padding: 4px 4px 4px 10px;
  border-radius: 5px;
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-primary);
}
.gf-file-chip .gf-file-chip-x {
  color: var(--text-muted);
  cursor: pointer;
  background: none;
  border: none;
  padding: 0 4px;
  font-size: 14px;
  line-height: 1;
}
.gf-file-chip .gf-file-chip-x:hover {
  color: var(--status-danger);
}

.gf-divider-or {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--text-muted);
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin: 14px 0;
}
.gf-divider-or::before,
.gf-divider-or::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--border-subtle);
}

.gf-paste-block {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.gf-paste-block .gf-pb-label {
  font-size: 11px;
  color: var(--text-muted);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-weight: 600;
}
.gf-paste-block textarea {
  width: 100%;
  min-height: 100px;
  resize: vertical;
  background: var(--surface-page);
  border: 1px solid var(--border-default);
  border-radius: 6px;
  padding: 10px 12px;
  color: var(--text-primary);
  font-family: var(--font-mono);
  font-size: 12px;
}
.gf-paste-block textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-bg);
}

.gf-input-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 12px;
  margin-top: 4px;
}
.gf-input-footer .gf-if-hint {
  font-size: 12px;
  color: var(--text-muted);
}
.gf-input-footer .gf-if-actions {
  display: flex;
  gap: 8px;
}

/* Verdict banner - colour is deterministic by recommendation name, not by
   metric-failure count. Severity is communicated in the title text; the pill
   answers "what should I do next?" - that answer is the same regardless of
   how many metrics are failing. */
.gf-verdict-banner {
  border-radius: 8px;
  padding: 12px 16px;
  margin-bottom: 18px;
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--orange-warn-bg);
  border: 1px solid var(--orange-warn-border);
  border-left: 3px solid var(--orange-warn);
}
.gf-verdict-banner.is-keep {
  background: var(--status-pass-bg);
  border: 1px solid var(--status-pass-border);
  border-left: 3px solid var(--status-pass);
}
.gf-verdict-banner.is-reference {
  background: var(--accent-bg);
  border: 1px solid var(--accent-border);
  border-left: 3px solid var(--accent-strong);
}
.gf-verdict-banner.is-retire {
  background: rgba(239, 68, 68, 0.08);
  border: 1px solid rgba(239, 68, 68, 0.25);
  border-left: 3px solid var(--status-danger);
}
.gf-verdict-banner .gf-vb-pill {
  padding: 4px 10px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 600;
  font-family: var(--font-mono);
  flex-shrink: 0;
  background: var(--orange-warn);
  color: var(--surface-deep);
}
.gf-verdict-banner.is-keep .gf-vb-pill {
  background: var(--status-pass);
  color: var(--surface-deep);
}
.gf-verdict-banner.is-reference .gf-vb-pill {
  background: var(--accent-strong);
  color: var(--accent-contrast);
}
.gf-verdict-banner.is-retire .gf-vb-pill {
  background: var(--status-danger);
  color: var(--accent-contrast);
}
.gf-verdict-banner .gf-vb-text {
  flex: 1;
}
.gf-verdict-banner .gf-vb-title {
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 2px;
  color: var(--text-primary);
}
.gf-verdict-banner .gf-vb-desc {
  font-size: 12px;
  color: var(--text-muted);
  line-height: 1.5;
}

.gf-result-grid {
  display: grid;
  grid-template-columns: 320px 1fr;
  gap: 22px;
}

@media (max-width: 900px) {
  .gf-skill-evaluator-panel .gf-modal-header,
  .gf-input-footer {
    align-items: stretch;
    flex-direction: column;
  }
  .gf-skill-evaluator-panel .gf-modal-actions,
  .gf-input-footer .gf-if-actions {
    justify-content: flex-start;
  }
  .gf-result-grid,
  .gf-installed-skills-grid {
    grid-template-columns: 1fr !important;
  }
  .gf-installed-skills-sidebar {
    border-right: 0 !important;
    border-bottom: 1px solid var(--border-subtle);
    max-height: 220px !important;
  }
}

.gf-score-display {
  background: var(--surface-page);
  border: 1px solid var(--border-subtle);
  border-radius: 8px;
  padding: 14px 16px;
  margin-bottom: 12px;
}
.gf-score-display .gf-sd-row {
  display: flex;
  align-items: baseline;
  gap: 8px;
  margin-bottom: 4px;
}
.gf-score-display .gf-sd-grade {
  font-size: 36px;
  font-weight: 600;
  font-family: var(--font-mono);
  line-height: 1;
}
.gf-score-display .gf-sd-grade.is-a {
  color: var(--status-pass);
}
.gf-score-display .gf-sd-grade.is-b {
  color: var(--green-300, #86efac);
}
.gf-score-display .gf-sd-grade.is-c {
  color: var(--status-waiting);
}
.gf-score-display .gf-sd-grade.is-d {
  color: var(--orange-warn);
}
.gf-score-display .gf-sd-grade.is-f {
  color: var(--status-danger);
}
.gf-score-display .gf-sd-pct {
  font-size: 18px;
  color: var(--text-primary);
  font-family: var(--font-mono);
}
.gf-score-display .gf-sd-raw {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-muted);
}

.gf-meta-strip {
  background: var(--surface-page);
  border: 1px solid var(--border-subtle);
  border-radius: 6px;
  padding: 8px 12px;
  margin-bottom: 14px;
  font-size: 13px;
  display: flex;
  align-items: baseline;
  gap: 8px;
  flex-wrap: wrap;
}
.gf-meta-strip .gf-ms-label {
  font-size: 10px;
  color: var(--text-muted);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-weight: 600;
  flex-shrink: 0;
}
.gf-meta-strip .gf-ms-pct {
  font-family: var(--font-mono);
  font-weight: 600;
  color: var(--status-pass);
  margin-right: 4px;
}
.gf-meta-strip .gf-ms-pct.is-low {
  color: var(--status-waiting);
}

.gf-tips-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}
.gf-tips-header h3 {
  font-size: 14px;
  font-weight: 600;
  margin: 0;
  color: var(--text-primary);
}
.gf-tips-count {
  font-size: 11px;
  color: var(--text-muted);
  background: var(--surface-page);
  padding: 2px 8px;
  border-radius: 10px;
  font-family: var(--font-mono);
}

.gf-tip-group {
  margin-bottom: 12px;
}
.gf-tip-group-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 12px;
  background: var(--surface-page);
  border: 1px solid var(--border-subtle);
  border-radius: 6px 6px 0 0;
  font-size: 12px;
  cursor: pointer;
  user-select: none;
  width: 100%;
  font-family: inherit;
  color: var(--text-primary);
}
.gf-tip-group-header.is-collapsed {
  border-radius: 6px;
}
.gf-tip-group-header .gf-tgh-left {
  display: flex;
  align-items: center;
  gap: 8px;
}
.gf-tip-group-header .gf-tgh-name {
  font-weight: 600;
}
.gf-tip-group-header .gf-tgh-count {
  color: var(--text-muted);
  font-size: 11px;
}
.gf-tip-group-header .gf-tgh-score {
  font-family: var(--font-mono);
  font-size: 11px;
}
.gf-tip-group-header .gf-tgh-score.is-warn {
  color: var(--status-waiting);
}
.gf-tip-group-header .gf-tgh-score.is-fail {
  color: var(--status-danger);
}
.gf-tip-group-header .gf-tgh-chev {
  color: var(--text-muted);
  transition: transform 0.15s;
  display: inline-block;
}
.gf-tip-group-header.is-collapsed .gf-tgh-chev {
  transform: rotate(-90deg);
}
.gf-tip-group-body {
  border: 1px solid var(--border-subtle);
  border-top: none;
  border-radius: 0 0 6px 6px;
  background: var(--surface-base);
}
.gf-tip-row {
  padding: 9px 14px 9px 16px;
  border-bottom: 1px solid var(--border-subtle);
  display: flex;
  gap: 10px;
  font-size: 12px;
  line-height: 1.5;
}
.gf-tip-row:last-child {
  border-bottom: none;
}
.gf-tip-row .gf-tr-marker {
  color: var(--status-waiting);
  flex-shrink: 0;
  font-size: 10px;
  line-height: 1.6;
}
.gf-tip-row.is-fail .gf-tr-marker {
  color: var(--status-danger);
}
.gf-tip-row .gf-tr-body {
  flex: 1;
  color: var(--text-primary);
}
.gf-tip-row .gf-tr-body code {
  background: var(--surface-elevated);
  color: var(--accent-hover);
  padding: 1px 5px;
  border-radius: 3px;
  font-family: var(--font-mono);
  font-size: 11px;
}

/* Modal result footer - slug only.
   Save-to-drafts and Re-run-with-edits are deferred until the persistence
   route lands; the copy action lives in the header. */
.gf-modal-result-footer {
  margin-top: 22px;
  padding-top: 16px;
  border-top: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.gf-modal-result-footer .gf-mrf-meta {
  font-size: 12px;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 8px;
}
.gf-modal-result-footer .gf-mrf-slug {
  background: var(--surface-elevated);
  color: var(--accent-hover);
  padding: 1px 6px;
  border-radius: 3px;
  font-family: var(--font-mono);
  font-size: 11px;
}

/* ═══════════════════════════════════════════════════════════
   Hooks Page
   ═══════════════════════════════════════════════════════════ */
.gf-hooks-view {
  height: calc(100vh - 3.5rem);
  overflow-y: auto;
}
.gf-hooks-page {
  max-width: 1100px;
  margin: 0 auto;
  padding: 20px 28px 34px;
}
.gf-hooks-head {
  margin-bottom: 16px;
}
.gf-hooks-panel,
.gf-hooks-alert,
.gf-hooks-empty {
  border: 1px solid var(--border-subtle);
  border-radius: 8px;
  background: var(--surface-base);
  color: var(--text-muted);
}
.gf-hooks-panel {
  padding: 16px;
}
.gf-hooks-alert {
  padding: 14px 16px;
  border-color: var(--red-border);
  background: var(--red-bg);
}
.gf-hooks-alert p {
  margin: 6px 0 0;
  color: var(--text-secondary);
  font-size: 13px;
}
.gf-hooks-empty {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 22px 18px;
  text-align: center;
}
.gf-hooks-empty p {
  margin: 0;
  color: var(--text-muted);
  font-size: 13px;
}
.gf-hooks-summary {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 16px;
}
.gf-hooks-stat {
  min-width: 0;
  padding: 14px 16px;
  border: 1px solid var(--border-subtle);
  border-radius: 8px;
  background: var(--surface-base);
}
.gf-hooks-stat-label {
  display: block;
  margin-bottom: 5px;
  color: var(--text-muted);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.06em;
  line-height: 1.2;
  text-transform: uppercase;
}
.gf-hooks-stat strong {
  color: var(--text-primary);
  font-family: var(--font-mono);
  font-size: 22px;
  font-weight: 600;
  line-height: 1.1;
}
.gf-hooks-stat strong.is-success {
  color: var(--status-pass);
}
.gf-hooks-stat strong.is-warning {
  color: var(--status-waiting);
}
.gf-hooks-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--border-subtle);
  margin-bottom: 2px;
}
.gf-hooks-filter-group {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}
.gf-hooks-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 5px 11px;
  border: 1px solid transparent;
  border-radius: 999px;
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  font-family: var(--font-body);
  font-size: 12px;
  font-weight: 500;
  transition:
    background 0.12s,
    border-color 0.12s,
    color 0.12s;
}
.gf-hooks-chip:hover,
.gf-hooks-chip.is-active {
  border-color: var(--border-default);
  background: var(--surface-base);
  color: var(--text-primary);
}
.gf-hooks-chip-count {
  color: var(--text-disabled);
  font-family: var(--font-mono);
  font-size: 11px;
}
.gf-hooks-search {
  min-width: min(260px, 100%);
}
.gf-hooks-search input {
  width: 100%;
  padding: 7px 10px;
  border: 1px solid var(--border-subtle);
  border-radius: 6px;
  background: var(--surface-base);
  color: var(--text-primary);
  font-family: var(--font-body);
  font-size: 12px;
}
.gf-hooks-search input::placeholder {
  color: var(--text-disabled);
}
.gf-hooks-search input:focus {
  border-color: var(--accent);
  outline: none;
}
.gf-hooks-section {
  margin-top: 20px;
}
.gf-hooks-section-head {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 4px;
}
.gf-hooks-pip {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  flex: 0 0 auto;
}
.gf-hooks-pip-danger {
  background: var(--status-danger);
}
.gf-hooks-pip-workflow {
  background: var(--ui-workflow-text);
}
.gf-hooks-pip-warning {
  background: var(--status-waiting);
}
.gf-hooks-pip-neutral {
  background: var(--text-disabled);
}
.gf-hooks-section-title {
  color: var(--text-muted);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.08em;
  line-height: 1.2;
  text-transform: uppercase;
}
.gf-hooks-section-rule {
  height: 1px;
  flex: 1 1 auto;
  background: var(--border-subtle);
}
.gf-hooks-list {
  border-top: 1px solid var(--border-subtle);
}
.gf-hook-row {
  display: grid;
  grid-template-columns: 3px minmax(0, 1fr) auto;
  gap: 16px;
  align-items: start;
  padding: 15px 0;
  border-bottom: 1px solid var(--border-subtle);
}
.gf-hook-row.is-disabled {
  opacity: 0.74;
}
.gf-hook-row.is-saving {
  opacity: 0.82;
}
.gf-hook-rail {
  width: 3px;
  min-height: 48px;
  align-self: stretch;
  border-radius: 2px;
}
.gf-hook-rail-danger {
  background: var(--status-danger);
}
.gf-hook-rail-workflow {
  background: var(--ui-workflow-text);
}
.gf-hook-rail-warning {
  background: var(--status-waiting);
}
.gf-hook-rail-neutral {
  background: var(--border-default);
}
.gf-hook-main {
  min-width: 0;
}
.gf-hook-title-row {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 5px;
}
.gf-hook-title-row h2 {
  margin: 0;
  color: var(--text-primary);
  font-size: 15px;
  font-weight: 600;
  line-height: 1.25;
}
.gf-hook-title-row code {
  color: var(--text-disabled);
  font-family: var(--font-mono);
  font-size: 11px;
  overflow-wrap: anywhere;
}
.gf-hook-description {
  max-width: 760px;
  margin: 0;
  color: var(--text-muted);
  font-size: 13px;
  line-height: 1.45;
}
.gf-hook-pills {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  margin-top: 10px;
}
.gf-hook-pill {
  display: inline-flex;
  align-items: center;
  min-height: 21px;
  padding: 2px 8px;
  border-radius: 999px;
  background: var(--neutral-bg);
  color: var(--text-muted);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.02em;
  line-height: 1.2;
  text-transform: uppercase;
}
.gf-hook-pill.is-on {
  background: var(--status-pass-bg);
  color: var(--status-pass);
}
.gf-hook-pill.is-muted {
  background: var(--neutral-bg);
  color: var(--text-disabled);
}
.gf-hook-pill.is-danger {
  background: var(--red-bg);
  color: var(--status-danger);
}
.gf-hook-pill.is-warning {
  background: var(--amber-bg);
  color: var(--status-waiting);
}
.gf-hook-agent-row {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  margin-top: 11px;
}
.gf-hook-agent-label {
  margin-right: 2px;
  color: var(--text-disabled);
  font-size: 11px;
  font-weight: 600;
}
.gf-hook-agent {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  max-width: 100%;
  border: 1px solid var(--border-subtle);
  border-radius: 5px;
  padding: 4px 8px;
  background: var(--surface-base);
  color: var(--text-muted);
  font-family: var(--font-mono);
  font-size: 11px;
  line-height: 1.2;
}
.gf-hook-agent strong {
  color: inherit;
  font-family: var(--font-body);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.01em;
  text-transform: uppercase;
}
.gf-hook-status-ok {
  border-color: var(--status-pass-border);
  background: var(--status-pass-bg);
  color: var(--status-pass);
}
.gf-hook-status-warn {
  border-color: var(--amber-border);
  background: var(--amber-bg);
  color: var(--status-waiting);
}
.gf-hook-status-muted {
  border-style: dashed;
  color: var(--text-disabled);
}
.gf-hook-unsupported {
  display: grid;
  gap: 6px;
  max-width: 760px;
  margin-top: 10px;
}
.gf-hook-unsupported-item {
  display: grid;
  grid-template-columns: minmax(112px, auto) minmax(0, 1fr);
  gap: 10px;
  align-items: start;
  padding: 8px 10px;
  border: 1px solid var(--border-subtle);
  border-radius: 6px;
  background: var(--neutral-bg);
}
.gf-hook-unsupported-agent {
  color: var(--text-primary);
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 600;
  line-height: 1.35;
}
.gf-hook-unsupported-reason {
  min-width: 0;
  color: var(--text-muted);
  font-size: 12px;
  line-height: 1.4;
  overflow-wrap: anywhere;
}
.gf-hook-controls {
  display: flex;
  align-items: center;
  gap: 10px;
  justify-content: flex-end;
  min-width: 148px;
  padding-top: 1px;
}
.gf-hook-control-label {
  color: var(--text-disabled);
  font-size: 12px;
  font-weight: 600;
}
.gf-hook-control-label.is-on {
  color: var(--status-pass);
}
.gf-hook-control-label.is-off {
  color: var(--text-disabled);
}
.gf-hook-switch {
  position: relative;
  width: 36px;
  height: 22px;
  flex: 0 0 36px;
  border: 1px solid var(--border-default);
  border-radius: 999px;
  background: var(--surface-elevated);
  cursor: pointer;
  transition:
    background 0.15s,
    border-color 0.15s;
}
.gf-hook-switch.is-on {
  border-color: var(--status-pass-border);
  background: var(--status-pass);
}
.gf-hook-switch:disabled {
  cursor: wait;
  opacity: 0.65;
}
.gf-hook-switch-knob {
  position: absolute;
  top: 2px;
  left: 2px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #ffffff;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.28);
  transition: transform 0.15s;
}
.gf-hook-switch.is-on .gf-hook-switch-knob {
  transform: translateX(14px);
}
.gf-hooks-legend {
  display: flex;
  align-items: center;
  gap: 18px;
  flex-wrap: wrap;
  margin-top: 22px;
  padding: 10px 12px;
  border: 1px solid var(--border-subtle);
  border-radius: 8px;
  background: var(--surface-base);
  color: var(--text-muted);
  font-size: 11px;
}
.gf-hooks-legend span {
  display: inline-flex;
  align-items: center;
  gap: 7px;
}
.gf-hooks-swatch {
  width: 10px;
  height: 10px;
  border-radius: 3px;
}
.gf-hooks-swatch.is-installed {
  border: 1px solid var(--status-pass-border);
  background: var(--status-pass-bg);
}
.gf-hooks-swatch.is-available {
  border: 1px dashed var(--border-default);
  background: transparent;
}
.gf-hooks-swatch.is-drift {
  border: 1px solid var(--amber-border);
  background: var(--amber-bg);
}
@media (max-width: 860px) {
  .gf-hooks-page {
    padding: 18px 18px 30px;
  }
  .gf-hooks-summary {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .gf-hooks-toolbar {
    align-items: stretch;
    flex-direction: column;
  }
  .gf-hooks-search {
    min-width: 0;
  }
  .gf-hook-row {
    grid-template-columns: 3px minmax(0, 1fr);
  }
  .gf-hook-controls {
    grid-column: 2;
    justify-content: flex-start;
    min-width: 0;
    padding-top: 0;
  }
}
@media (max-width: 540px) {
  .gf-hooks-summary {
    grid-template-columns: 1fr;
  }
  .gf-hooks-filter-group {
    align-items: stretch;
  }
  .gf-hooks-chip {
    flex: 1 1 calc(50% - 6px);
    justify-content: center;
  }
  .gf-hook-agent {
    width: 100%;
    justify-content: space-between;
  }
  .gf-hook-unsupported-item {
    grid-template-columns: 1fr;
    gap: 4px;
  }
  .gf-hooks-legend {
    align-items: flex-start;
    flex-direction: column;
    gap: 8px;
  }
}
