/* ============================================================
   AI Developer Onboarding Copilot — Design System v2
   ============================================================ */

:root {
  color-scheme: light;
  --bg: #f7f8fa;
  --surface: #ffffff;
  --surface-2: #f9fafb;
  --ink: #0f172a;
  --muted: #64748b;
  --line: #e2e8f0;
  --line-strong: #cbd5e1;
  --accent: #4f46e5;
  --accent-light: #eef2ff;
  --accent-glow: rgba(79, 70, 229, 0.12);
  --accent-2: #0d9488;
  --accent-2-light: #f0fdfa;
  --warn: #d97706;
  --warn-light: #fffbeb;
  --danger: #dc2626;
  --danger-light: #fef2f2;
  --success: #16a34a;
  --success-light: #f0fdf4;
  --success-text: #15803d;
  --success-border: #bbf7d0;
  --warn-text: #92400e;
  --warn-border: #fde68a;
  --shadow-sm: 0 1px 2px rgba(15, 23, 42, 0.04);
  --shadow: 0 4px 16px rgba(15, 23, 42, 0.06), 0 1px 3px rgba(15, 23, 42, 0.04);
  --shadow-lg: 0 12px 40px rgba(15, 23, 42, 0.08), 0 4px 12px rgba(15, 23, 42, 0.04);
  --shadow-xl: 0 24px 64px rgba(15, 23, 42, 0.12);
  --radius-sm: 6px;
  --radius: 10px;
  --radius-lg: 14px;
  --radius-xl: 20px;
  --transition: 180ms cubic-bezier(0.4, 0, 0.2, 1);
}

/* ---- Reset & Base ---- */
*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  min-height: 100%;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100%;
  background: var(--bg);
  color: var(--ink);
  font-family: "Inter", ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont,
    "Segoe UI", "Helvetica Neue", Arial, "PingFang SC", "Hiragino Sans GB",
    "Microsoft YaHei UI", "Microsoft YaHei", sans-serif;
  font-size: 15px;
  line-height: 1.6;
  letter-spacing: -0.01em;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

button, input, textarea, select {
  font: inherit;
  letter-spacing: inherit;
}

button {
  cursor: pointer;
  transition: all var(--transition);
}

button:active {
  transform: scale(0.985);
}

img, svg {
  display: block;
  max-width: 100%;
}

/* ---- Typography ---- */
h1, h2, h3, h4, p { margin-top: 0; }

h1 {
  margin-bottom: 16px;
  font-size: clamp(36px, 5.5vw, 64px);
  line-height: 1.05;
  font-weight: 800;
  letter-spacing: -0.025em;
}

h2 {
  margin-bottom: 10px;
  font-size: 22px;
  font-weight: 750;
  letter-spacing: -0.015em;
}

h3 {
  margin-bottom: 8px;
  font-size: 15px;
  font-weight: 700;
  letter-spacing: -0.005em;
}

p {
  margin-bottom: 10px;
}

.eyebrow {
  margin: 0 0 8px;
  color: var(--accent);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.09em;
  text-transform: uppercase;
}

/* ---- Topbar ---- */
.topbar {
  position: sticky;
  top: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  min-height: 60px;
  padding: 10px clamp(16px, 4vw, 40px);
  border-bottom: 1px solid transparent;
  background: rgba(255, 255, 255, 0.78);
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  box-shadow: 0 1px 0 rgba(15, 23, 42, 0.04);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  border: 0;
  background: transparent;
  color: var(--ink);
  font-size: 15px;
  font-weight: 750;
  letter-spacing: -0.01em;
  transition: opacity var(--transition);
}

.brand:hover { opacity: 0.8; }

.brand-mark {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: var(--radius);
  background: linear-gradient(135deg, #4f46e5, #7c3aed);
  color: #fff;
  font-size: 12px;
  font-weight: 900;
  box-shadow: 0 2px 8px rgba(79, 70, 229, 0.3);
}

/* ---- Navigation ---- */
nav {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  justify-content: flex-end;
}

.nav-right {
  display: flex;
  align-items: center;
  gap: 10px;
}

.topbar-auth {
  display: flex;
  align-items: center;
  gap: 6px;
}

.topbar-auth input {
  width: 138px;
  min-height: 32px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface);
  padding: 0 8px;
  color: var(--ink);
  font-size: 12px;
}

.topbar-auth button {
  min-height: 32px;
  border-radius: var(--radius-sm);
  padding: 0 10px;
  font-size: 12px;
}

.nav-item {
  min-height: 36px;
  border: 1px solid transparent;
  border-radius: var(--radius);
  background: transparent;
  color: var(--muted);
  padding: 0 14px;
  font-size: 13px;
  font-weight: 600;
  transition: all var(--transition);
}

.nav-item:hover {
  background: var(--surface-2);
  color: var(--ink);
}

.nav-item.active {
  border-color: var(--accent-light);
  background: var(--accent-light);
  color: var(--accent);
  box-shadow: 0 1px 3px rgba(79, 70, 229, 0.08);
}

/* ---- Language Toggle ---- */
.language-toggle {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  min-height: 34px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface-2);
  padding: 2px;
}

.language-toggle button {
  min-height: 28px;
  border: 0;
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--muted);
  padding: 0 9px;
  font-size: 11px;
  font-weight: 700;
  transition: all var(--transition);
}

.language-toggle button:hover { color: var(--ink); }

.language-toggle button.active {
  background: #fff;
  color: var(--ink);
  box-shadow: var(--shadow-sm);
}

/* ---- Buttons ---- */
.primary {
  min-height: 42px;
  border: 1px solid transparent;
  border-radius: var(--radius);
  background: linear-gradient(135deg, #4f46e5, #6366f1);
  color: #fff;
  padding: 0 20px;
  font-weight: 700;
  font-size: 14px;
  box-shadow: 0 2px 8px rgba(79, 70, 229, 0.25), 0 1px 2px rgba(79, 70, 229, 0.15);
  transition: all var(--transition);
}

.primary:hover {
  background: linear-gradient(135deg, #4338ca, #4f46e5);
  box-shadow: 0 4px 16px rgba(79, 70, 229, 0.35), 0 2px 4px rgba(79, 70, 229, 0.2);
  transform: translateY(-1px);
}

.secondary {
  min-height: 38px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--ink);
  padding: 0 16px;
  font-weight: 600;
  font-size: 13px;
  box-shadow: var(--shadow-sm);
}

.secondary:hover {
  border-color: var(--line-strong);
  background: var(--surface-2);
  box-shadow: var(--shadow);
}

/* ---- Landing Page ---- */
.landing {
  overflow: hidden;
}

.figma-home {
  background: linear-gradient(180deg, #fafbfd 0%, #f7f8fa 30%, #ffffff 100%);
}

.figma-hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(380px, 1.1fr);
  gap: clamp(28px, 6vw, 72px);
  align-items: center;
  min-height: calc(100vh - 60px);
  padding: clamp(32px, 7vw, 80px) clamp(18px, 5vw, 64px) 40px;
}

.hero-copy {
  max-width: 600px;
}

.figma-hero h1 {
  font-size: clamp(40px, 6vw, 72px);
  line-height: 1.02;
}

.hero-text {
  color: var(--muted);
  font-size: 17px;
  line-height: 1.7;
  max-width: 520px;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 28px;
}

.hero-actions button {
  min-height: 46px;
  padding-inline: 22px;
  font-size: 14px;
}

/* ---- Command Center Preview ---- */
.figma-preview {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: #fff;
  box-shadow: var(--shadow-xl);
}

.source-pill {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  border: 1px solid #99f6e4;
  border-radius: 999px;
  background: var(--accent-2-light);
  color: var(--accent-2);
  padding: 0 10px;
  font-size: 11px;
  font-weight: 800;
}

.command-body {
  display: grid;
  grid-template-columns: 140px minmax(0, 1fr);
  min-height: 440px;
}

.preview-sidebar {
  display: grid;
  align-content: start;
  gap: 6px;
  padding: 16px;
  border-right: 1px solid rgba(255, 255, 255, 0.08);
  background: linear-gradient(180deg, #1e293b, #0f172a);
}

.preview-sidebar strong {
  display: block;
  margin-bottom: 6px;
  color: #fff;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.preview-sidebar span {
  border-radius: var(--radius-sm);
  color: #94a3b8;
  padding: 8px 10px;
  font-size: 12px;
  font-weight: 600;
  transition: all var(--transition);
}

.preview-sidebar .active {
  background: rgba(79, 70, 229, 0.2);
  color: #c7d2fe;
}

.preview-main {
  padding: 26px;
}

.preview-main h2 {
  margin-bottom: 8px;
  font-size: 22px;
}

.preview-main p:not(.eyebrow) {
  color: var(--muted);
  line-height: 1.65;
  font-size: 13.5px;
}

.mini-metrics {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin: 22px 0;
}

.mini-metrics span {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface-2);
  padding: 14px 12px;
  text-align: center;
}

.mini-metrics small {
  display: block;
  color: var(--muted);
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.mini-metrics strong {
  display: block;
  margin-top: 4px;
  font-size: 26px;
  font-weight: 800;
}

.evidence-card {
  display: grid;
  gap: 8px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface-2);
  padding: 16px;
}

.evidence-card span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.evidence-card code {
  display: block;
  border-radius: var(--radius-sm);
  background: #fff;
  padding: 8px 10px;
  font-size: 12px;
  border: 1px solid var(--line);
}

/* ---- Workflow Band ---- */
.workflow-band {
  padding: 64px clamp(18px, 5vw, 64px);
  background: linear-gradient(180deg, #0f172a, #1e293b);
  color: #fff;
}

.workflow-band .section-head {
  max-width: 700px;
  margin-bottom: 36px;
}

.workflow-band .section-head h2 {
  color: #fff;
  font-size: 28px;
}

.workflow-band .section-head p {
  color: #94a3b8;
}

.workflow-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 14px;
}

.workflow-card {
  min-height: 180px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-lg);
  background: rgba(255, 255, 255, 0.04);
  padding: 22px;
  cursor: pointer;
  transition: all var(--transition);
}

.workflow-card:hover {
  background: rgba(255, 255, 255, 0.07);
  border-color: rgba(255, 255, 255, 0.14);
  transform: translateY(-2px);
}

.workflow-card span:first-child {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  margin-bottom: 20px;
  border-radius: var(--radius);
  background: rgba(99, 102, 241, 0.25);
  color: #a5b4fc;
  font-size: 13px;
  font-weight: 900;
}

.workflow-card h3 {
  color: #fff;
  margin-bottom: 6px;
}

.workflow-card p {
  color: #94a3b8;
  line-height: 1.55;
  font-size: 13px;
}

/* ---- Three-col / Features ---- */
.band {
  padding: 56px clamp(18px, 5vw, 64px);
  background: var(--surface);
}

.compact-band {
  padding-top: 28px;
  padding-bottom: 48px;
}

.section-head {
  max-width: 720px;
  margin-bottom: 32px;
}

.section-head p {
  color: var(--muted);
  line-height: 1.7;
}

.three-col {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}

.feature {
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--surface);
  padding: 28px;
  box-shadow: var(--shadow-sm);
  transition: all var(--transition);
}

.feature:hover {
  box-shadow: var(--shadow);
  border-color: var(--line-strong);
}

.feature h3 {
  font-size: 16px;
}

.feature p {
  color: var(--muted);
  line-height: 1.6;
  font-size: 13.5px;
}

/* ---- Page Shell ---- */
.page-shell {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
  padding: 36px 0 64px;
}

.page-shell.narrow {
  width: min(720px, calc(100% - 32px));
}

.row-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px;
  max-width: none;
  margin-bottom: 24px;
}

.row-head h1 {
  font-size: clamp(30px, 4vw, 44px);
}

.header-actions {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-shrink: 0;
}

/* ---- Forms ---- */
label {
  display: grid;
  gap: 6px;
  color: var(--ink);
  font-weight: 650;
  font-size: 13px;
}

label span {
  font-size: 13px;
}

input, textarea, select {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  color: var(--ink);
  padding: 11px 14px;
  outline: none;
  transition: all var(--transition);
  font-size: 14px;
}

input:hover, textarea:hover, select:hover {
  border-color: var(--line-strong);
}

input:focus, textarea:focus, select:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-glow);
}

textarea {
  min-height: 100px;
  resize: vertical;
  line-height: 1.6;
}

/* ---- Import Page ---- */
.import-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(300px, 0.85fr);
  gap: 18px;
}

.import-box {
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--surface);
  padding: 26px;
  box-shadow: var(--shadow-sm);
}

.input-group {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: end;
}

.split-label {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 14px;
  margin: 10px 0;
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
}

.split-label::before,
.split-label::after {
  content: "";
  height: 1px;
  background: var(--line);
}

.upload-zone {
  border: 2px dashed var(--line);
  border-radius: var(--radius-lg);
  background: var(--surface-2);
  padding: 22px;
  text-align: center;
  transition: all var(--transition);
  cursor: pointer;
}

.upload-zone:hover {
  border-color: var(--accent);
  background: var(--accent-light);
}

.upload-zone small {
  display: block;
  margin-top: 8px;
  color: var(--muted);
  font-size: 12px;
}

/* ---- Pipeline ---- */
.pipeline-panel {
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--surface);
  padding: 22px;
  box-shadow: var(--shadow-sm);
}

.pipeline-panel h2 {
  margin-bottom: 18px;
}

.progress-box {
  display: grid;
  padding: 0;
  border: 0;
  background: transparent;
  box-shadow: none;
}

.progress-box.vertical {
  grid-template-columns: 1fr;
  gap: 8px;
}

.progress-step {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
}

.progress-box.vertical .progress-step {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface-2);
  padding: 14px 16px;
  transition: all var(--transition);
}

.progress-box.vertical .progress-step:hover {
  border-color: var(--line-strong);
}

.progress-step span {
  display: grid;
  place-items: center;
  flex-shrink: 0;
  width: 26px;
  height: 26px;
  border-radius: var(--radius-sm);
  border: 2px solid var(--line);
  background: #fff;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.progress-box.vertical .progress-step span {
  width: 30px;
  height: 30px;
  border-radius: var(--radius);
}

.progress-step.done span {
  border-color: var(--accent-2);
  background: var(--accent-2);
  color: #fff;
}

.progress-step.done {
  color: var(--ink);
}

.progress-step div {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.progress-step strong {
  font-size: 13px;
}

.progress-step small {
  color: var(--muted);
  font-size: 11px;
  line-height: 1.45;
}

/* ---- Capability Strip ---- */
.capability-strip {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  margin-top: 20px;
}

.capability-strip div {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface-2);
  padding: 18px;
}

.capability-strip strong {
  display: block;
  margin-bottom: 4px;
  font-size: 14px;
}

.capability-strip span {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
}

/* ---- Overview Page ---- */
.overview-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}

.panel {
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--surface);
  padding: 24px;
  box-shadow: var(--shadow-sm);
  transition: all var(--transition);
}

.panel:hover {
  box-shadow: var(--shadow);
}

.span-2 { grid-column: span 2; }
.span-3 { grid-column: span 3; }

.panel-title-row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: flex-start;
  margin-bottom: 14px;
}

.overview-summary {
  background: linear-gradient(160deg, #ffffff 0%, #fafbff 100%);
}

.stat-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 18px;
}

.stat-strip span {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 12px 16px;
  background: var(--surface);
  font-size: 13px;
}

.stat-strip.strong span strong {
  font-size: 22px;
  font-weight: 800;
}

.action-panel {
  background: linear-gradient(160deg, #1e293b, #0f172a);
  color: #fff;
  border-color: transparent;
}

.action-panel h2 { color: #fff; }

.action-list {
  display: grid;
  gap: 10px;
}

.action-list button {
  display: grid;
  gap: 4px;
  width: 100%;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.05);
  color: #fff;
  padding: 14px;
  text-align: left;
  transition: all var(--transition);
}

.action-list button:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.18);
}

.action-list button strong {
  display: block;
  font-size: 14px;
}

.action-list button span {
  display: block;
  margin-top: 4px;
  color: #94a3b8;
  font-size: 12px;
  line-height: 1.4;
}

.tag-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.tag-list span {
  border-radius: var(--radius-sm);
  background: var(--accent-light);
  color: var(--accent);
  padding: 5px 10px;
  font-size: 12px;
  font-weight: 650;
}

.tree {
  max-height: 340px;
  overflow: auto;
  margin: 0;
  border-radius: var(--radius);
  background: #0f172a;
  color: #cbd5e1;
  padding: 18px;
  line-height: 1.6;
  font-size: 13px;
  font-family: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

.file-list {
  padding-left: 20px;
  margin: 0;
}

.file-list li {
  margin-bottom: 8px;
  font-size: 13px;
}

.two-col-list {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px 16px;
}

.evidence-panel {
  background: var(--surface-2);
}

.evidence-stats {
  display: grid;
  gap: 10px;
}

.evidence-stats div {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  padding: 16px;
}

.evidence-stats strong {
  display: block;
  font-size: 28px;
  font-weight: 800;
}

.evidence-stats span {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
}

/* ---- Chat Layout ---- */
.chat-layout {
  display: grid;
  grid-template-columns: 280px minmax(0, 1fr) 260px;
  gap: 14px;
  width: min(1500px, calc(100% - 20px));
  margin: 0 auto;
  padding: 14px 0 20px;
  min-height: calc(100vh - 68px);
}

.sidebar {
  align-self: start;
  position: sticky;
  top: 76px;
  max-height: calc(100vh - 92px);
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--surface);
  padding: 20px;
  box-shadow: var(--shadow-sm);
}

.workspace {
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--surface);
  padding: 20px;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  min-height: 0;
}

.inspector {
  align-self: start;
  position: sticky;
  top: 76px;
  max-height: calc(100vh - 92px);
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--surface);
  padding: 20px;
  box-shadow: var(--shadow-sm);
}

/* ---- Workspace Card ---- */
.workspace-card {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: linear-gradient(160deg, var(--accent-light), #fafbff);
  padding: 16px;
  margin-bottom: 20px;
}

.workspace-card h2 {
  font-size: 16px;
  margin-bottom: 6px;
}

.workspace-card p {
  font-size: 12px;
  color: var(--muted);
  line-height: 1.5;
}

.sidebar-stats {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-top: 10px;
}

.sidebar-stats span {
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: #fff;
  padding: 10px;
  font-size: 11px;
  text-align: center;
}

.sidebar-stats strong {
  display: block;
  font-size: 18px;
  font-weight: 800;
}

/* ---- Sidebar Sections ---- */
.sidebar h3, .inspector h3 {
  margin-top: 20px;
  margin-bottom: 10px;
  font-size: 12px;
  font-weight: 800;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.question-list {
  display: grid;
  gap: 6px;
  margin-bottom: 18px;
}

.question-list button {
  width: 100%;
  min-height: 40px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--ink);
  padding: 10px 14px;
  text-align: left;
  font-size: 12.5px;
  font-weight: 550;
  line-height: 1.4;
  transition: all var(--transition);
}

.question-list button:hover {
  border-color: var(--accent);
  background: var(--accent-light);
}

/* ---- Rule List ---- */
.rule-list {
  display: grid;
  gap: 6px;
  margin-bottom: 18px;
}

.rule-list span {
  border-left: 3px solid var(--accent-2);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  background: var(--accent-2-light);
  color: #0f766e;
  padding: 9px 12px;
  font-size: 12px;
  font-weight: 650;
  line-height: 1.4;
}

/* ---- Compact Files ---- */
.compact-files {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}

.compact-files code,
code {
  border-radius: var(--radius-sm);
  background: #f1f5f9;
  color: #334155;
  padding: 4px 7px;
  font-family: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 11px;
  overflow-wrap: anywhere;
  border: 1px solid var(--line);
}

/* ---- Tabs ---- */
.tabs {
  display: flex;
  gap: 6px;
  margin-bottom: 16px;
  padding: 4px;
  border-radius: var(--radius);
  background: var(--surface-2);
}

.tab {
  min-height: 34px;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--muted);
  padding: 0 16px;
  font-size: 13px;
  font-weight: 600;
  transition: all var(--transition);
}

.tab:hover {
  color: var(--ink);
}

.tab.active {
  border-color: var(--line);
  background: #fff;
  color: var(--ink);
  box-shadow: var(--shadow-sm);
}

/* ---- Task Intro ---- */
.task-intro {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(200px, 0.65fr);
  gap: 16px;
  align-items: end;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--surface-2);
  padding: 18px 22px;
  margin-bottom: 14px;
}

.task-intro h2 { margin: 0; }
.task-intro p:last-child {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
}

/* ---- Workspace Topline ---- */
.workspace-topline {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 14px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--line);
}

.workspace-topline div {
  display: grid;
  gap: 2px;
}

.workspace-topline span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.workspace-topline strong {
  font-size: 18px;
  font-weight: 750;
}

.topline-right {
  display: flex;
  align-items: center;
  gap: 10px;
}

/* ---- LLM Badge ---- */
.llm-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 5px 12px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.02em;
  white-space: nowrap;
}

.llm-badge.active {
  background: var(--success-light);
  color: var(--success-text);
  border: 1px solid var(--success-border);
}

.llm-badge.fallback {
  background: var(--warn-light);
  color: var(--warn-text);
  border: 1px solid var(--warn-border);
}

.llm-source {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 10.5px;
  font-weight: 700;
}

.llm-source.ai {
  background: var(--success-light);
  color: var(--success-text);
  border: 1px solid var(--success-border);
}

.llm-source.fallback {
  background: var(--warn-light);
  color: var(--warn-text);
  border: 1px solid var(--warn-border);
}

.answer-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 12px;
}

/* ---- Agent Welcome (Chat Empty State) ---- */
.agent-welcome {
  display: grid;
  justify-items: center;
  align-content: center;
  gap: 6px;
  height: 100%;
  padding: 48px 16px;
  text-align: center;
  color: var(--muted);
}

.agent-avatar {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  margin-bottom: 6px;
  border-radius: 50%;
  background: linear-gradient(135deg, #4f46e5, #7c3aed);
  color: #fff;
  font-size: 13px;
  font-weight: 800;
}

.suggestion-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 10px;
  width: 100%;
  max-width: 640px;
  margin-top: 12px;
}

.suggestion-grid button {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--ink);
  padding: 12px 14px;
  text-align: left;
  font-size: 12.5px;
  font-weight: 550;
  line-height: 1.4;
  transition: all var(--transition);
}

.suggestion-grid button:hover {
  border-color: var(--accent);
  background: var(--accent-light);
}

/* ---- Messages ---- */
.messages {
  display: grid;
  gap: 14px;
  flex: 1;
  overflow: auto;
  align-content: start;
}

.message {
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--surface);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  transition: all var(--transition);
}

.message:hover {
  box-shadow: var(--shadow);
}

.question {
  border-bottom: 1px solid var(--line);
  background: var(--surface-2);
  padding: 16px 20px;
  color: var(--ink);
  font-weight: 700;
  font-size: 14px;
  line-height: 1.5;
}

.answer {
  padding: 22px;
}

.answer h3 {
  margin: 20px 0 8px;
  font-size: 13px;
  font-weight: 800;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.answer h3:first-child {
  margin-top: 0;
}

.answer p {
  color: var(--ink);
  line-height: 1.7;
  font-size: 14px;
}

.answer ul {
  margin: 0;
  padding-left: 20px;
}

.answer li {
  margin-bottom: 6px;
  color: var(--muted);
  line-height: 1.6;
  font-size: 13.5px;
}

/* ---- Citations ---- */
.citation-list,
.impact-list,
.trace-list,
.guardrail-list,
.plan-grid,
.feedback-log {
  display: grid;
  gap: 8px;
}

.citation-list div,
.impact-list > div,
.trace-step,
.guardrail-list > div,
.plan-day,
.feedback-log div {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface-2);
  padding: 14px;
  transition: all var(--transition);
}

.citation-list div:hover,
.impact-list > div:hover {
  border-color: var(--accent);
  background: var(--accent-light);
}

.citation-list code {
  display: inline-block;
  margin-bottom: 6px;
  background: #fff;
}

.citation-list span,
.feedback-log span {
  display: block;
  margin-top: 6px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
}

.text-button {
  margin-top: 8px;
  border: 0;
  background: transparent;
  color: var(--accent);
  font-weight: 800;
  font-size: 12px;
  cursor: pointer;
  padding: 0;
}

.text-button:hover {
  color: var(--accent-2);
}

.compact-trace {
  margin-top: 12px;
}

/* ---- Risk Badge ---- */
.risk {
  display: inline-block;
  margin-left: 8px;
  border-radius: 999px;
  padding: 3px 9px;
  font-size: 11px;
  font-weight: 700;
}

.risk.low {
  background: var(--success-light);
  color: var(--success-text);
}

.risk.medium {
  background: var(--warn-light);
  color: var(--warn-text);
}

.risk.high,
.risk.medium-high {
  background: var(--danger-light);
  color: #b91c1c;
}

/* ---- Agent Message ---- */
.agent-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  border: 1px solid #c7d2fe;
  border-radius: var(--radius);
  background: linear-gradient(160deg, var(--accent-light), #fafbff);
  padding: 18px;
}

.agent-header h3 {
  margin: 0 0 4px;
  color: var(--ink);
  font-size: 15px;
}

.agent-header p {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
}

.agent-header span {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  border-radius: 999px;
  padding: 0 10px;
  font-size: 11px;
  font-weight: 750;
  white-space: nowrap;
}

.agent-header span:last-child {
  background: var(--success-light);
  color: var(--success-text);
}

.agent-meta-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin: 16px 0;
}

.agent-meta-grid section {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface-2);
  padding: 16px;
}

.agent-meta-grid h3 {
  margin-top: 0;
}

.runtime-status,
.memory-suggestions {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin: 14px 0;
}

.runtime-status div,
.memory-suggestions > div {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  padding: 12px;
}

.runtime-status strong,
.memory-suggestions strong {
  display: block;
  margin-bottom: 4px;
  font-size: 12px;
}

.runtime-status span,
.memory-suggestions span,
.memory-suggestions p {
  display: block;
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

.memory-actions {
  display: flex;
  gap: 8px;
  margin-top: 10px;
}

.memory-actions button {
  min-height: 30px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface-2);
  padding: 0 10px;
  color: var(--ink);
  font-size: 12px;
  font-weight: 650;
}

.memory-actions button:hover {
  border-color: var(--accent);
  background: var(--accent-light);
}

.memory-state {
  width: fit-content;
  margin-top: 10px;
  border-radius: 999px;
  background: var(--surface-2);
  padding: 4px 8px;
  color: var(--muted);
  font-weight: 700;
  text-transform: uppercase;
}

.memory-manager {
  display: grid;
  gap: 12px;
}

.memory-preferences {
  display: grid;
  gap: 8px;
}

.memory-preferences > div {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface);
  padding: 8px;
}

.memory-preferences span {
  display: grid;
  gap: 2px;
  min-width: 0;
  color: var(--muted);
  font-size: 12px;
}

.memory-preferences strong {
  color: var(--ink);
  font-size: 11px;
  text-transform: uppercase;
}

.memory-preferences button,
.memory-clear {
  min-height: 30px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface-2);
  padding: 0 10px;
  color: var(--ink);
  font-size: 12px;
  font-weight: 650;
}

.memory-preferences button:hover,
.memory-clear:hover {
  border-color: var(--danger);
  color: var(--danger);
}

.memory-events {
  display: grid;
  gap: 8px;
}

.memory-events h4 {
  margin: 2px 0 0;
  color: var(--muted);
  font-size: 11px;
  letter-spacing: 0;
  text-transform: uppercase;
}

.auth-ops {
  display: grid;
  gap: 14px;
}

.auth-ops .panel-title-row,
.auth-token-row {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 12px;
}

.auth-ops .panel-title-row h2,
.auth-ops .panel-title-row p {
  margin: 0;
}

.auth-ops .panel-title-row p {
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
}

.auth-token-row label,
.auth-form label {
  display: grid;
  gap: 5px;
  min-width: 0;
  color: var(--muted);
  font-size: 11px;
  font-weight: 750;
  text-transform: uppercase;
}

.auth-token-row label {
  flex: 1;
}

.auth-token-row input,
.auth-form input {
  min-height: 38px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface);
  padding: 0 10px;
  color: var(--ink);
  font-size: 13px;
  text-transform: none;
}

.auth-token-row button,
.auth-form button {
  min-height: 38px;
}

.auth-error {
  margin: 0;
  border: 1px solid var(--danger);
  border-radius: var(--radius-sm);
  background: var(--danger-light);
  padding: 10px;
  color: var(--danger);
  font-size: 12px;
  line-height: 1.5;
}

.auth-created-token {
  display: grid;
  gap: 6px;
  border: 1px solid var(--accent);
  border-radius: var(--radius-sm);
  background: var(--accent-light);
  padding: 10px;
}

.auth-created-token strong {
  font-size: 12px;
}

.auth-created-token code {
  overflow-wrap: anywhere;
}

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

.auth-form,
.auth-list {
  display: grid;
  align-content: start;
  gap: 8px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface-2);
  padding: 14px;
}

.auth-form h3,
.auth-list h3 {
  margin: 0 0 2px;
  font-size: 13px;
}

.auth-checkbox {
  display: flex !important;
  grid-template-columns: none;
  align-items: center;
  gap: 8px;
  text-transform: none !important;
}

.auth-checkbox input {
  min-height: auto;
  width: 16px;
  height: 16px;
}

.auth-list > div {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface);
  padding: 9px;
}

.auth-list span {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.auth-list strong {
  color: var(--ink);
  font-size: 12px;
}

.auth-list small {
  color: var(--muted);
  font-size: 11px;
  line-height: 1.35;
  overflow-wrap: anywhere;
}

.danger-text {
  color: var(--danger);
}

/* ---- Trace Steps ---- */
.trace-step {
  display: grid;
  gap: 6px;
}

.trace-step strong {
  font-size: 14px;
  font-weight: 700;
}

.trace-step code {
  display: inline-block;
  width: fit-content;
}

.trace-step p,
.trace-step small {
  margin: 0;
  color: var(--muted);
  line-height: 1.5;
  font-size: 12.5px;
}

.trace-step small {
  display: block;
  border-radius: var(--radius-sm);
  background: #fff;
  padding: 10px;
  border: 1px solid var(--line);
  overflow-wrap: anywhere;
  font-size: 11px;
}

/* ---- Guardrails ---- */
.guardrail-list > div {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 6px 12px;
}

.guardrail-list strong { font-size: 13px; }

.guardrail-list span {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  border-radius: 999px;
  padding: 0 9px;
  font-size: 11px;
  font-weight: 750;
  background: var(--success-light);
  color: var(--success-text);
}

.guardrail-list p {
  grid-column: span 2;
  color: var(--muted);
  font-size: 12.5px;
  margin: 0;
}

.guardrail-list .needs_review span {
  background: var(--warn-light);
  color: var(--warn-text);
}

/* ---- Chip Row / Next Questions ---- */
.chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.chip-row button {
  min-height: 36px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  color: var(--ink);
  padding: 0 16px;
  font-size: 12px;
  font-weight: 600;
  transition: all var(--transition);
}

.chip-row button:hover {
  border-color: var(--accent);
  background: var(--accent-light);
  color: var(--accent);
}

/* ---- Feedback Bar ---- */
.feedback {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin-top: 20px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
}

.feedback button {
  min-height: 32px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  color: var(--muted);
  padding: 0 14px;
  font-size: 11px;
  font-weight: 650;
  transition: all var(--transition);
}

.feedback button:hover {
  border-color: var(--accent);
  color: var(--accent);
  background: var(--accent-light);
}

.feedback button.selected {
  border-color: var(--accent-2);
  background: var(--accent-2-light);
  color: var(--accent-2);
}

/* ---- Composer ---- */
.composer {
  display: grid;
  gap: 12px;
  margin-top: auto;
  padding-top: 14px;
  border-top: 1px solid var(--line);
}

.prompt-composer {
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--surface);
  padding: 16px;
  box-shadow: var(--shadow);
}

.prompt-composer textarea {
  border: 0;
  padding: 0;
  box-shadow: none;
  min-height: 80px;
  border-radius: 0;
}

.prompt-composer textarea:focus {
  box-shadow: none;
}

.prompt-composer .primary {
  justify-self: end;
}

/* ---- Onboarding Form ---- */
.onboarding-form {
  display: grid;
  grid-template-columns: 1fr 1fr auto;
  gap: 12px;
  align-items: end;
  margin-bottom: 16px;
}

.onboarding-form select {
  min-height: 42px;
}

/* ---- Plan Grid ---- */
.plan-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.plan-day {
  padding: 18px;
}

.plan-day h4 {
  margin: 0 0 8px;
  font-size: 11px;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 0.07em;
}

.plan-day p {
  color: var(--muted);
  font-size: 12.5px;
  line-height: 1.5;
}

.plan-day ul {
  margin: 10px 0 0;
  padding-left: 18px;
}

.plan-day li {
  margin-bottom: 5px;
  font-size: 12px;
  color: var(--muted);
}

/* ---- Contract List ---- */
.contract-list {
  display: grid;
  gap: 5px;
}

.contract-list span {
  display: block;
  border-radius: var(--radius-sm);
  background: var(--surface-2);
  padding: 8px 10px;
  font-size: 11px;
  font-weight: 600;
  color: var(--muted);
}

/* ---- Quality Meter ---- */
.quality-meter div {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 0;
  border-bottom: 1px solid var(--line);
}

.quality-meter strong {
  font-size: 20px;
  font-weight: 800;
}

.quality-meter span {
  font-size: 11px;
  font-weight: 600;
  color: var(--muted);
}

/* ---- Inspector Sections ---- */
.inspector-section {
  margin-bottom: 20px;
}

.inspector-section:last-child {
  margin-bottom: 0;
}

/* ---- Dashboard ---- */
.metrics-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 24px;
}

.metric {
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--surface);
  padding: 22px;
  box-shadow: var(--shadow-sm);
  transition: all var(--transition);
}

.metric:hover {
  box-shadow: var(--shadow);
  transform: translateY(-1px);
}

.metric span {
  display: block;
  margin-bottom: 8px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 650;
}

.metric strong {
  font-size: 36px;
  font-weight: 800;
  letter-spacing: -0.02em;
}

.failure-bar {
  display: grid;
  gap: 14px;
}

.failure-bar div {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  border: 0;
  background: transparent;
  padding: 0;
}

.failure-bar strong {
  text-transform: capitalize;
  font-size: 13px;
}

.failure-bar span {
  color: var(--muted);
  font-size: 12px;
}

.failure-bar i {
  display: block;
  height: 7px;
  overflow: hidden;
  border-radius: 999px;
  background: #e2e8f0;
  grid-column: span 2;
}

.failure-bar i::before {
  content: "";
  display: block;
  width: var(--value);
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #4f46e5, #7c3aed);
}

/* ---- Dashboard Bands ---- */
.feedback-log div {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.feedback-log span {
  margin: 0;
}

.feedback-log strong {
  font-size: 12px;
}

/* ---- Empty States ---- */
.muted {
  color: var(--muted);
}

.empty {
  min-height: calc(100vh - 60px);
  display: grid;
  place-items: center;
  align-content: center;
  text-align: center;
}

.empty h2 {
  font-size: 28px;
  margin-bottom: 12px;
}

.empty p {
  color: var(--muted);
  margin-bottom: 20px;
}

/* ---- Iteration Band ---- */
.iteration-grid {
  display: grid;
  gap: 10px;
}

.iteration-grid div {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface-2);
  padding: 16px;
}

.iteration-grid strong {
  display: block;
  margin-bottom: 4px;
  font-size: 13px;
}

.iteration-grid span {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
}

/* ---- Scrollbar ---- */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: #cbd5e1;
  border-radius: 999px;
}

::-webkit-scrollbar-thumb:hover {
  background: #94a3b8;
}

/* ---- Responsive ---- */
@media (max-width: 1100px) {
  .chat-layout {
    grid-template-columns: 240px minmax(0, 1fr) 220px;
    gap: 10px;
  }

  .figma-hero {
    grid-template-columns: 1fr;
    min-height: auto;
  }

  .command-body {
    grid-template-columns: 1fr;
  }

  .preview-sidebar {
    display: none;
  }

  .workflow-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

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

  .sidebar,
  .inspector {
    position: static;
    max-height: none;
  }

  .overview-grid,
  .three-col,
  .metrics-grid,
  .auth-grid,
  .plan-grid {
    grid-template-columns: 1fr 1fr;
  }

  .span-2,
  .span-3 {
    grid-column: span 1;
  }

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

  .workflow-grid {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 600px) {
  .topbar,
  .row-head {
    flex-direction: column;
    align-items: stretch;
  }

  .topbar {
    position: static;
  }

  nav {
    justify-content: flex-start;
  }

  .nav-right {
    flex-direction: column;
    align-items: flex-start;
  }

  h1 {
    font-size: 32px;
  }

  .overview-grid,
  .three-col,
  .metrics-grid,
  .auth-grid,
  .plan-grid,
  .onboarding-form,
  .task-intro {
    grid-template-columns: 1fr;
  }

  .panel-title-row,
  .auth-token-row {
    flex-direction: column;
    align-items: stretch;
  }

  .chat-layout {
    width: calc(100% - 16px);
  }

  .agent-meta-grid {
    grid-template-columns: 1fr;
  }

  .runtime-status,
  .memory-suggestions {
    grid-template-columns: 1fr;
  }

  .figma-hero {
    padding: 28px 16px;
  }

  .workflow-grid {
    grid-template-columns: 1fr;
  }
}

/* ── Multi-Agent UI ── */

.hitl-card {
  border: 2px solid var(--warn);
  border-radius: 8px;
  padding: 16px;
  margin: 12px 0;
  background: var(--warn-light);
}
.hitl-card.approved {
  border-color: var(--success);
  background: var(--success-light);
}
.hitl-card.rejected {
  border-color: var(--danger);
  background: var(--danger-light);
}
.hitl-card h3 { margin-top: 0; }
.hitl-actions {
  display: flex;
  gap: 10px;
  margin-top: 12px;
}
.hitl-actions button.primary { background: var(--success); color: #fff; }
.hitl-actions button.danger { background: var(--danger); color: #fff; }

.agent-roster {
  margin: 8px 0;
  padding: 10px;
  background: var(--surface-2);
  border-radius: 6px;
}
.agent-roster h3 { margin: 0 0 6px 0; font-size: 0.9em; }
.agent-roster-list { display: flex; flex-wrap: wrap; gap: 4px; }
.agent-badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 12px;
  background: var(--accent-light);
  color: var(--accent);
  font-size: 0.8em;
  font-weight: 600;
}

.agent-handoff {
  margin: 8px 0;
  padding: 8px;
  background: var(--surface-2);
  border-radius: 6px;
}
.agent-handoff h3 { margin: 0 0 4px 0; font-size: 0.9em; }
.handoff-chain { display: flex; flex-wrap: wrap; align-items: center; gap: 0; }
.handoff-item {
  padding: 3px 8px;
  font-size: 0.8em;
  font-weight: 600;
  color: var(--muted);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 4px;
  margin: 2px 0;
  cursor: default;
  display: inline-block;
  transition: border-color var(--transition);
}
.handoff-item:hover {
  border-color: var(--accent-2);
}

.agent-role-badge {
  display: inline-block;
  margin: 0 6px;
  padding: 1px 7px;
  border-radius: 10px;
  background: var(--accent-2-light);
  color: var(--accent-2);
  font-size: 0.75em;
  font-weight: 700;
  vertical-align: middle;
}

.error-banner {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 16px;
  margin: 0 16px;
  background: var(--danger-light);
  border: 1px solid var(--danger);
  border-radius: var(--radius-sm);
  font-size: 0.9em;
  color: var(--danger);
}
.error-banner span { flex: 1; }
.error-banner button {
  padding: 4px 12px;
  border-radius: 4px;
  border: 1px solid var(--danger);
  background: var(--danger);
  color: #fff;
  cursor: pointer;
  font-size: 0.85em;
}
.error-banner button[data-dismiss-error] {
  background: transparent;
  color: var(--danger);
  border-color: transparent;
}
