/* ============================================================
   AIC Design System v2 — Vivid Modern
   Design direction: bold gradients, strong hierarchy, glass
   Inspired by Stripe / Framer / Linear aesthetic
   ============================================================ */

:root {
  /* Palette */
  --bg: #0a0a0f;
  --bg-elev: #12121a;
  --surface: #ffffff;
  --surface-glass: rgba(255, 255, 255, 0.72);
  --surface-dim: rgba(255, 255, 255, 0.04);
  --ink: #0f0f0f;
  --ink-2: #1a1a24;
  --text: #f5f5f7;
  --text-2: #a8a8b8;
  --text-3: #6b6b7e;
  --border: rgba(255, 255, 255, 0.1);
  --border-2: rgba(255, 255, 255, 0.06);
  --faint: rgba(255, 255, 255, 0.08);
  --charcoal: #0f0f0f;

  /* Accents — vivid */
  --violet: #7c3aed;
  --violet-2: #a855f7;
  --blue: #2563eb;
  --blue-2: #3b82f6;
  --cyan: #06b6d4;
  --emerald: #059669;
  --emerald-2: #10b981;
  --amber: #d97706;
  --amber-2: #f59e0b;
  --red: #dc2626;
  --red-2: #ef4444;
  --pink: #ec4899;

  /* Gradients */
  --grad-hero: linear-gradient(135deg, #7c3aed 0%, #2563eb 50%, #06b6d4 100%);
  --grad-violet: linear-gradient(135deg, #7c3aed, #a855f7);
  --grad-blue: linear-gradient(135deg, #2563eb, #3b82f6);
  --grad-emerald: linear-gradient(135deg, #059669, #10b981);
  --grad-amber: linear-gradient(135deg, #d97706, #f59e0b);
  --grad-text: linear-gradient(135deg, #a855f7 0%, #3b82f6 50%, #06b6d4 100%);
  --grad-card: linear-gradient(180deg, rgba(255,255,255,0.06) 0%, rgba(255,255,255,0.02) 100%);
  --grad-border: linear-gradient(180deg, rgba(255,255,255,0.14) 0%, rgba(255,255,255,0.04) 100%);

  /* Shadows */
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.3);
  --shadow: 0 8px 30px rgba(0,0,0,0.25);
  --shadow-lg: 0 30px 80px rgba(0,0,0,0.35);
  --shadow-glow: 0 0 60px rgba(124, 58, 237, 0.25);
  --shadow-glow-blue: 0 0 60px rgba(37, 99, 235, 0.2);

  /* Radius */
  --r-sm: 8px;
  --r: 12px;
  --r-lg: 16px;
  --r-xl: 24px;
  --r-full: 999px;

  /* Type */
  --font: 'Inter', ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --mono: 'SF Mono', 'Fira Code', 'Cascadia Code', Consolas, monospace;
}

* { box-sizing: border-box; }

.visually-hidden {
  position: absolute !important; width: 1px; height: 1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap;
}

html { scroll-behavior: smooth; }

body {
  margin: 0; min-height: 100vh;
  color: var(--text);
  font-family: var(--font);
  letter-spacing: -0.01em;
  background: var(--bg);
}

body.commercial-page {
  background:
    radial-gradient(ellipse 80% 50% at 50% -10%, rgba(124,58,237,0.18), transparent),
    radial-gradient(ellipse 60% 40% at 80% 30%, rgba(37,99,235,0.12), transparent),
    radial-gradient(ellipse 50% 40% at 20% 60%, rgba(6,182,212,0.08), transparent),
    var(--bg);
}

body.workbench-page {
  background:
    radial-gradient(ellipse 60% 40% at 50% -5%, rgba(124,58,237,0.12), transparent),
    radial-gradient(ellipse 40% 30% at 90% 20%, rgba(37,99,235,0.08), transparent),
    var(--bg);
}

button, input, textarea { font: inherit; }
button { cursor: pointer; border: 0; background: none; color: inherit; }
a { color: inherit; text-decoration: none; }

h1, h2, h3, p { margin: 0; }

.eyebrow {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 11px; font-weight: 700; letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--violet-2);
}

code, pre { font-family: var(--mono); }

/* ==================== Shared Header ==================== */

.global-header,
.landing-header {
  position: sticky; top: 0; z-index: 50;
  height: 64px;
  display: flex; align-items: center; justify-content: space-between;
  gap: 24px; padding: 0 32px;
  border-bottom: 1px solid var(--border);
  background: rgba(10,10,15,0.72);
  backdrop-filter: blur(20px) saturate(180%);
}

.brand {
  display: inline-flex; align-items: center; gap: 10px;
  font-size: 14px; font-weight: 700; color: var(--text);
}

.brand-mark {
  width: 32px; height: 32px;
  display: grid; place-items: center;
  border-radius: var(--r-sm);
  background: var(--grad-violet);
  color: #fff; font-size: 11px; font-weight: 800;
  box-shadow: 0 4px 12px rgba(124,58,237,0.4);
}

.landing-nav,
nav[aria-label="Product sections"] {
  display: flex; align-items: center; gap: 2px;
  border: 1px solid var(--border);
  border-radius: var(--r-full);
  padding: 4px;
  background: var(--surface-dim);
}

.landing-nav a,
.nav-link,
.nav-item {
  min-height: 30px;
  display: inline-flex; align-items: center;
  border-radius: var(--r-full);
  color: var(--text-2); padding: 0 14px;
  font-size: 13px; font-weight: 600;
  transition: color 200ms, background 200ms;
}

.landing-nav a:hover,
.nav-link:hover,
.nav-item:hover,
.nav-item.active {
  color: var(--text);
  background: var(--faint);
}

.account-summary {
  position: relative;
  display: flex; align-items: center; gap: 8px;
}

.account-summary span,
.account-summary button {
  min-height: 30px;
  display: inline-flex; align-items: center;
  border: 1px solid var(--border);
  border-radius: var(--r-full);
  background: var(--surface-dim);
  color: var(--text-2);
  padding: 0 12px; font-size: 12px; font-weight: 600;
  white-space: nowrap;
}

.account-summary button {
  color: var(--text);
  background: var(--grad-violet);
  border-color: transparent;
}

.feedback-trigger {
  position: absolute;
  left: 0;
  top: 0;
  z-index: 80;
  width: 48px;
  height: 48px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--r-full);
  border: 1px solid rgba(255,255,255,0.18);
  background: radial-gradient(circle at 35% 25%, rgba(255,255,255,0.24), rgba(168,85,247,0.18) 36%, rgba(124,58,237,0.94) 100%);
  color: var(--text);
  box-shadow: 0 18px 42px rgba(124,58,237,0.34), inset 0 1px 0 rgba(255,255,255,0.22);
  cursor: grab;
  touch-action: none;
  user-select: none;
}

.feedback-trigger:hover {
  color: var(--text);
  border-color: rgba(255,255,255,0.34);
  transform: translateY(-2px);
  box-shadow: 0 24px 54px rgba(124,58,237,0.44), inset 0 1px 0 rgba(255,255,255,0.28);
}

.feedback-trigger.is-dragging {
  cursor: grabbing;
  transform: scale(1.03);
  transition: none;
}

.feedback-trigger:focus-visible {
  outline: 3px solid rgba(168,85,247,0.32);
  outline-offset: 4px;
}

.feedback-trigger-icon {
  position: relative;
  width: 21px;
  height: 17px;
  border: 2px solid currentColor;
  border-radius: 8px;
}

.feedback-trigger-icon::after {
  content: "";
  position: absolute;
  right: 2px;
  bottom: -6px;
  width: 8px;
  height: 8px;
  border-right: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  transform: rotate(35deg);
  background: transparent;
}

.feedback-trigger-icon::before {
  content: "";
  position: absolute;
  left: 5px;
  top: 6px;
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background: currentColor;
  box-shadow: 5px 0 0 currentColor, 10px 0 0 currentColor;
}

/* ==================== Landing Page ==================== */

.landing-main {
  max-width: 1200px; margin: 0 auto;
  padding: 0 32px 80px;
  display: grid; gap: 64px;
}

/* Hero */
.landing-hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 40px; align-items: center;
  padding: 72px 0 24px;
}

.hero-visual {
  border-radius: var(--r-xl);
  overflow: hidden;
  border: 1px solid var(--border);
  background:
    radial-gradient(circle at 20% 10%, rgba(168,85,247,0.22), transparent 34%),
    radial-gradient(circle at 90% 80%, rgba(6,182,212,0.14), transparent 34%),
    rgba(255,255,255,0.04);
  box-shadow: var(--shadow-lg), var(--shadow-glow);
  aspect-ratio: 4/3;
}

.package-preview {
  color: var(--text);
  text-decoration: none;
}

.package-preview-compact {
  height: 100%;
  display: grid;
  align-content: center;
  gap: 18px;
  padding: clamp(22px, 4vw, 34px);
}

.preview-topline {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--text-2);
  font-size: 12px;
  font-weight: 750;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  height: 24px;
  padding: 0 10px;
  border-radius: var(--r-full);
  background: rgba(16,185,129,0.14);
  color: var(--emerald-2);
  border: 1px solid rgba(16,185,129,0.28);
  font-size: 11px;
  letter-spacing: 0.04em;
}

.package-preview h3 {
  margin: 0;
  font-size: clamp(24px, 3vw, 34px);
  line-height: 1.05;
  font-weight: 850;
  letter-spacing: -0.02em;
}

.package-preview p {
  margin: 0;
  color: var(--text-2);
  line-height: 1.55;
}

.preview-pipeline {
  display: grid;
  gap: 10px;
}

.preview-pipeline div {
  min-width: 0;
  display: grid;
  grid-template-columns: 32px minmax(0, 1fr);
  column-gap: 10px;
  row-gap: 2px;
  align-items: center;
  padding: 12px;
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: var(--r);
  background: rgba(10,10,15,0.48);
}

.preview-pipeline b {
  grid-row: span 2;
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--violet), var(--cyan));
  color: #fff;
  font-size: 12px;
}

.preview-pipeline strong {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 13px;
}

.preview-pipeline span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--text-2);
  font-size: 12px;
}

.preview-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.preview-chips span,
.preview-ontology-grid span {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 0 10px;
  border-radius: var(--r-full);
  border: 1px solid rgba(168,85,247,0.24);
  background: rgba(168,85,247,0.1);
  color: #d8c7ff;
  font-size: 12px;
  font-weight: 700;
}

.landing-hero-copy .eyebrow { margin-bottom: 20px; }

.landing-hero-copy h1 {
  font-size: clamp(36px, 4.5vw, 60px);
  line-height: 1.04; font-weight: 800;
  letter-spacing: -0.03em;
  background: var(--grad-text);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.landing-hero-copy > p {
  margin-top: 20px;
  max-width: 760px;
  font-size: 16px; line-height: 1.6;
  color: var(--text-2);
}

.hero-ctas {
  display: flex; gap: 12px; margin-top: 32px;
}

.primary-cta, .secondary-cta {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 44px; border-radius: var(--r-full);
  padding: 0 24px; font-size: 14px; font-weight: 700;
  transition: transform 200ms, box-shadow 200ms;
}

.primary-cta {
  background: var(--grad-violet);
  color: #fff;
  box-shadow: 0 8px 24px rgba(124,58,237,0.35);
}

.primary-cta:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 32px rgba(124,58,237,0.45);
}

.secondary-cta {
  border: 1px solid var(--border);
  background: var(--surface-dim);
  color: var(--text);
}

.secondary-cta:hover {
  border-color: rgba(255,255,255,0.2);
  background: var(--faint);
}

/* Trust strip */
.trust-strip {
  display: flex; flex-wrap: wrap; gap: 12px;
  justify-content: center;
  padding: 24px 0;
  border-top: 1px solid var(--border-2);
  border-bottom: 1px solid var(--border-2);
}

.trust-strip span {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 8px 16px;
  border-radius: var(--r-full);
  border: 1px solid var(--border);
  background: var(--surface-dim);
  font-size: 13px; font-weight: 600;
  color: var(--text-2);
}

.trust-strip span::before {
  content: '';
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--grad-emerald);
}

/* Method */
.method-head { max-width: 720px; }

.method-head h2 {
  margin-top: 12px;
  font-size: clamp(28px, 3vw, 40px);
  line-height: 1.12; font-weight: 750;
  letter-spacing: -0.02em;
}

.method-head > p {
  margin-top: 16px;
  font-size: 16px; line-height: 1.6;
  color: var(--text-2);
}

.method-row {
  display: grid;
  grid-template-columns: auto auto 1fr;
  gap: 20px; align-items: start;
  padding: 24px;
  border-radius: var(--r-lg);
  border: 1px solid var(--border);
  background: var(--grad-card);
  transition: border-color 300ms, transform 300ms;
}

.method-row:hover {
  border-color: rgba(124,58,237,0.4);
  transform: translateY(-2px);
}

.method-num {
  font-size: 28px; font-weight: 800;
  background: var(--grad-text);
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent;
  line-height: 1;
}

.method-icon {
  width: 44px; height: 44px;
  display: grid; place-items: center;
  border-radius: var(--r);
  background: var(--grad-violet);
  color: #fff; font-size: 12px; font-weight: 800;
  box-shadow: 0 4px 12px rgba(124,58,237,0.3);
}

.method-row:nth-child(2) .method-icon { background: var(--grad-blue); box-shadow: 0 4px 12px rgba(37,99,235,0.3); }
.method-row:nth-child(3) .method-icon { background: var(--grad-emerald); box-shadow: 0 4px 12px rgba(5,150,105,0.3); }
.method-row:nth-child(4) .method-icon { background: var(--grad-amber); box-shadow: 0 4px 12px rgba(217,119,6,0.3); }
.method-row:nth-child(5) .method-icon { background: linear-gradient(135deg, #ec4899, #7c3aed); box-shadow: 0 4px 12px rgba(236,72,153,0.3); }

.method-row h3 {
  font-size: 18px; font-weight: 700;
  margin-bottom: 6px;
}

.method-row p {
  font-size: 14px; line-height: 1.5;
  color: var(--text-2);
}

/* Sample */
.sample-region {
  display: grid; gap: 24px;
}

.sample-showcase {
  display: grid;
  grid-template-columns: minmax(320px, 0.82fr) minmax(0, 1.28fr);
  gap: 28px;
  align-items: center;
  padding: 28px;
  border: 1px solid rgba(168,85,247,0.28);
  border-radius: var(--r-xl);
  background:
    radial-gradient(circle at 18% 22%, rgba(168,85,247,0.2), transparent 28%),
    radial-gradient(circle at 86% 36%, rgba(37,99,235,0.16), transparent 28%),
    linear-gradient(135deg, rgba(255,255,255,0.07), rgba(255,255,255,0.025));
  box-shadow: var(--shadow-lg), 0 0 72px rgba(124,58,237,0.14);
}

.sample-copy h2 {
  font-size: clamp(24px, 2.5vw, 32px);
  font-weight: 750; letter-spacing: -0.02em;
  max-width: 680px;
}

.sample-copy p {
  margin-top: 12px;
  max-width: 620px;
  color: var(--text-2);
  font-size: 15px;
  line-height: 1.65;
}

.sample-ontology-figure {
  position: relative;
  margin: 0;
  overflow: hidden;
  border: 1px solid rgba(255,255,255,0.16);
  border-radius: var(--r-lg);
  background: rgba(10,10,15,0.78);
  box-shadow: 0 28px 70px rgba(0,0,0,0.36);
}

.sample-ontology-figure::after {
  content: '';
  position: absolute;
  inset: 0;
  pointer-events: none;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.12), inset 0 -80px 120px rgba(10,10,15,0.16);
}

.sample-ontology-figure img {
  display: block;
  width: 100%;
  height: auto;
}

.sample-frame {
  display: grid;
  gap: 18px;
  border-radius: var(--r-xl);
  overflow: hidden;
  border: 1px solid var(--border);
  box-shadow: var(--shadow-lg), 0 0 60px rgba(37,99,235,0.12);
  background:
    linear-gradient(135deg, rgba(255,255,255,0.08), rgba(255,255,255,0.025)),
    radial-gradient(circle at 78% 20%, rgba(37,99,235,0.18), transparent 28%),
    radial-gradient(circle at 20% 70%, rgba(124,58,237,0.16), transparent 30%),
    rgba(10,10,15,0.86);
  padding: 26px;
}

.sample-frame:hover {
  border-color: rgba(168,85,247,0.38);
}

.preview-wide-head {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 20px;
  padding-bottom: 18px;
  border-bottom: 1px solid var(--border);
}

.preview-score {
  min-width: 122px;
  padding: 14px;
  border-radius: var(--r);
  border: 1px solid rgba(16,185,129,0.26);
  background: rgba(16,185,129,0.09);
  text-align: right;
}

.preview-score strong {
  display: block;
  font-size: 30px;
  line-height: 1;
  color: var(--emerald-2);
}

.preview-score span {
  margin-top: 6px;
  display: block;
  color: var(--text-2);
  font-size: 11px;
  font-weight: 700;
}

.preview-wide-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(220px, 0.8fr);
  gap: 16px;
}

.preview-wide-grid section {
  min-width: 0;
  display: grid;
  gap: 10px;
  padding: 14px;
  border: 1px solid rgba(255,255,255,0.09);
  border-radius: var(--r);
  background: rgba(10,10,15,0.44);
}

.preview-wide-grid section:nth-child(3) {
  grid-column: 1 / -1;
}

.preview-wide-grid h4 {
  margin: 0;
  color: var(--text);
  font-size: 12px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.preview-pipeline-wide {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.preview-ontology-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.preview-code pre {
  margin: 0;
  overflow: auto;
  white-space: pre-wrap;
  color: #dce7ff;
  font-family: var(--mono);
  font-size: 12px;
  line-height: 1.6;
}

/* CTA */
.landing-cta {
  text-align: center;
  padding: 48px 32px;
  border-radius: var(--r-xl);
  background: var(--grad-hero);
  box-shadow: var(--shadow-lg);
}

.landing-cta h2 {
  font-size: clamp(24px, 3vw, 36px);
  font-weight: 800; letter-spacing: -0.02em;
  color: #fff;
}

.landing-cta a {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 48px; margin-top: 24px;
  padding: 0 32px; border-radius: var(--r-full);
  background: #fff; color: var(--ink);
  font-size: 15px; font-weight: 800;
  transition: transform 200ms;
}

.landing-cta a:hover { transform: scale(1.04); }

/* Footer */
.landing-footer {
  display: flex; justify-content: space-between; align-items: center;
  padding: 32px;
  border-top: 1px solid var(--border-2);
}

.landing-footer strong { font-size: 14px; font-weight: 700; }
.landing-footer p { font-size: 12px; color: var(--text-3); margin-top: 4px; }
.landing-footer a {
  font-size: 13px; font-weight: 600;
  color: var(--violet-2);
  transition: color 200ms;
}
.landing-footer a:hover { color: var(--text); }

/* Pain points section */
.pain-section {
  max-width: 960px;
}

.pain-section h2 {
  margin-top: 12px;
  font-size: clamp(28px, 3vw, 40px);
  line-height: 1.12; font-weight: 750;
  letter-spacing: -0.02em;
}

.pain-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px; margin-top: 32px;
}

.pain-card {
  display: grid; gap: 8px;
  padding: 24px;
  border-radius: var(--r-lg);
  border: 1px solid var(--border);
  background: var(--grad-card);
  transition: border-color 300ms, transform 300ms;
}

.pain-card:hover {
  border-color: rgba(124,58,237,0.3);
  transform: translateY(-2px);
}

.pain-card:nth-child(1) .pain-icon { background: var(--grad-violet); }
.pain-card:nth-child(2) .pain-icon { background: var(--grad-blue); }
.pain-card:nth-child(3) .pain-icon { background: var(--grad-emerald); }
.pain-card:nth-child(4) .pain-icon { background: var(--grad-amber); }

.pain-icon {
  width: 44px; height: 44px;
  display: grid; place-items: center;
  border-radius: var(--r);
  color: #fff;
  box-shadow: 0 4px 12px rgba(0,0,0,0.2);
}

.pain-card h3 {
  font-size: 17px; font-weight: 700;
}

.pain-card p {
  font-size: 14px; line-height: 1.5;
  color: var(--text-2);
}

.pain-card strong {
  font-size: 13px; font-weight: 700;
  color: var(--violet-2);
}

/* Sample metrics */
.sample-metrics {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  margin-top: 22px;
}

.sample-metrics article {
  display: grid; gap: 4px; place-items: center;
  padding: 20px 12px;
  border-radius: var(--r-lg);
  border: 1px solid var(--border);
  background: var(--grad-card);
  text-align: center;
}

.sample-metrics strong {
  font-size: 32px; font-weight: 800;
  background: var(--grad-text);
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent;
}

.sample-metrics span {
  font-size: 13px; font-weight: 600;
  color: var(--text-2);
}

/* Sample deliverables list */
.sample-deliverables-list {
  padding: 24px;
  border-radius: var(--r-lg);
  border: 1px solid var(--border);
  background: var(--grad-card);
}

.sample-deliverables-list h3 {
  font-size: 16px; font-weight: 700;
  margin-bottom: 16px;
}

.sample-deliverables-list ul {
  list-style: none; padding: 0; margin: 0;
  display: grid; gap: 10px;
}

.sample-deliverables-list li {
  display: flex; align-items: baseline; gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid var(--border-2);
  font-size: 14px; line-height: 1.5;
  color: var(--text-2);
}

.sample-deliverables-list li:last-child {
  border-bottom: 0;
}

.sample-deliverables-list li strong {
  flex-shrink: 0;
  font-size: 14px; font-weight: 700;
  color: var(--text);
  min-width: 80px;
}

/* ==================== Landing V3 — Value Narrative ==================== */

/* Hero footnote */
.hero-footnote {
  margin-top: 16px;
  font-size: 12px; color: var(--text-3);
}

/* --- Why section: the gap --- */
.why-section { padding: 8px 0 0; }
.why-sub {
  max-width: 640px; margin-top: 12px;
  font-size: 15px; line-height: 1.6; color: var(--text-2);
}

.gap-compare {
  display: grid; grid-template-columns: 1fr auto 1fr;
  gap: 24px; align-items: center;
  margin-top: 32px;
}

.gap-arrow {
  display: flex; align-items: center; justify-content: center;
  color: var(--violet-2);
}

.gap-card {
  border: 1px solid var(--border);
  border-radius: var(--r-xl);
  background: var(--surface-dim);
  padding: 28px;
}

.gap-raw {
  border-color: rgba(239, 68, 68, 0.25);
  background: linear-gradient(180deg, rgba(239, 68, 68, 0.06) 0%, rgba(239, 68, 68, 0.02) 100%);
}

.gap-ready {
  border-color: rgba(5, 150, 105, 0.3);
  background: linear-gradient(180deg, rgba(5, 150, 105, 0.08) 0%, rgba(5, 150, 105, 0.02) 100%);
}

.gap-label {
  font-size: 11px; font-weight: 700; letter-spacing: 0.06em;
  text-transform: uppercase; margin-bottom: 8px;
}
.gap-raw .gap-label { color: var(--red-2); }
.gap-ready .gap-label { color: var(--emerald-2); }

.gap-card h3 {
  font-size: 18px; font-weight: 700; margin-bottom: 16px;
  color: var(--text);
}

.gap-card ul {
  list-style: none; padding: 0; margin: 0;
  display: grid; gap: 10px;
}

.gap-card li {
  font-size: 13px; line-height: 1.5; color: var(--text-2);
  padding-left: 16px; position: relative;
}
.gap-card li::before {
  content: ''; position: absolute; left: 0; top: 7px;
  width: 6px; height: 6px; border-radius: 50%;
}
.gap-raw li::before { background: var(--red); }
.gap-ready li::before { background: var(--emerald); }

.gap-ready li strong {
  color: var(--emerald-2); font-weight: 600;
}

.gap-card code {
  font-size: 12px; background: var(--faint);
  padding: 2px 6px; border-radius: 4px;
  color: var(--text-2);
}

.gap-takeaway {
  margin-top: 28px; text-align: center;
  font-size: 15px; line-height: 1.6; color: var(--text-2);
}
.gap-takeaway strong { color: var(--text); }

/* --- Concept sections: Ontology & Semantic API --- */
.concept-section {
  padding: 16px 0 0;
}

.concept-card {
  display: grid; grid-template-columns: 1fr 1fr;
  gap: 40px; align-items: center;
  margin-top: 28px;
  padding: 36px;
  border: 1px solid var(--border);
  border-radius: var(--r-xl);
  background: var(--surface-dim);
}

.concept-reverse { direction: rtl; }
.concept-reverse > * { direction: ltr; }

.concept-visual {
  display: flex; align-items: center; justify-content: center;
}

.concept-explain { }
.concept-explain h3 {
  font-size: 20px; font-weight: 700; color: var(--text);
  margin-bottom: 16px;
}
.concept-explain p {
  font-size: 14px; line-height: 1.65; color: var(--text-2);
  margin-bottom: 12px;
}
.concept-explain code {
  font-size: 12px; background: var(--faint);
  padding: 2px 6px; border-radius: 4px;
  color: var(--violet-2);
}

.concept-evidence {
  display: flex; flex-wrap: wrap; gap: 8px;
  margin-top: 20px;
  padding-top: 20px;
  border-top: 1px solid var(--border-2);
}
.concept-evidence span {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 4px 12px;
  border-radius: var(--r-full);
  border: 1px solid var(--border);
  background: var(--faint);
  font-size: 12px; font-weight: 600;
  color: var(--text-2);
}
.concept-evidence span::before {
  content: '';
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--grad-emerald);
}

/* Ontology blocks visual */
.ontology-blocks {
  display: grid; gap: 12px; width: 100%;
}

.ontology-entity {
  padding: 16px 20px;
  border: 1px solid var(--border);
  border-radius: var(--r);
  background: var(--bg-elev);
  transition: border-color 200ms;
}
.ontology-entity:hover { border-color: var(--violet-2); }

.oe-label {
  font-size: 10px; font-weight: 700; letter-spacing: 0.06em;
  text-transform: uppercase; color: var(--violet-2);
  margin-bottom: 6px;
}
.oe-name {
  font-size: 16px; font-weight: 700; color: var(--text);
  margin-bottom: 10px;
}
.oe-fields {
  display: flex; flex-wrap: wrap; gap: 6px;
}
.oe-fields span {
  padding: 3px 10px;
  border-radius: var(--r-full);
  border: 1px solid rgba(168, 85, 247, 0.25);
  background: rgba(168, 85, 247, 0.08);
  font-size: 12px; font-weight: 600;
  color: var(--violet-2);
}

/* Semantic examples */
.semantic-examples {
  display: grid; gap: 8px; margin-top: 16px;
}

.sem-example {
  display: flex; align-items: center; gap: 8px;
  padding: 10px 14px;
  border: 1px solid var(--border);
  border-radius: var(--r);
  background: var(--bg-elev);
}

.sem-raw {
  font-size: 12px; color: var(--text-3);
  background: var(--faint);
  padding: 2px 8px; border-radius: 4px;
  font-family: var(--mono);
}

.sem-agent {
  font-size: 13px; font-weight: 700; color: var(--cyan);
  font-family: var(--mono);
}

.sem-tag {
  font-size: 11px; font-weight: 700; padding: 2px 8px;
  border-radius: var(--r-full);
}
.sem-tag.write {
  background: rgba(239, 68, 68, 0.15); color: var(--red-2);
}
.sem-tag.read {
  background: rgba(5, 150, 105, 0.15); color: var(--emerald-2);
}
.sem-tag.risk {
  background: rgba(217, 119, 6, 0.15); color: var(--amber-2);
}
.sem-tag.safe {
  background: rgba(5, 150, 105, 0.15); color: var(--emerald-2);
}

/* Semantic diagram */
.semantic-diagram {
  display: grid; gap: 16px; width: 100%;
}
.sd-row {
  display: flex; align-items: center; gap: 12px;
  justify-content: center;
}
.sd-box {
  padding: 14px 18px;
  border-radius: var(--r);
  font-size: 14px; font-weight: 700; text-align: center;
  min-width: 120px;
}
.sd-box small {
  display: block; font-size: 11px; font-weight: 500;
  margin-top: 4px; opacity: 0.7;
}
.sd-raw {
  border: 1px solid rgba(239, 68, 68, 0.3);
  background: rgba(239, 68, 68, 0.08);
  color: var(--red-2);
}
.sd-onto {
  border: 1px solid rgba(124, 58, 237, 0.3);
  background: rgba(124, 58, 237, 0.08);
  color: var(--violet-2);
}
.sd-sem {
  border: 1px solid rgba(6, 182, 212, 0.3);
  background: rgba(6, 182, 212, 0.08);
  color: var(--cyan);
}
.sd-agent {
  border: 1px solid rgba(5, 150, 105, 0.3);
  background: rgba(5, 150, 105, 0.08);
  color: var(--emerald-2);
}
.sd-arrow {
  font-size: 20px; color: var(--text-3); font-weight: 700;
}
.sd-footnote {
  margin-top: 12px; text-align: center;
  font-size: 12px; color: var(--text-3);
}

/* --- Value chain --- */
.chain-section { padding: 16px 0 0; }

.chain-flow {
  display: flex; align-items: flex-start; gap: 12px;
  margin-top: 28px; padding: 32px 24px;
  border: 1px solid var(--border);
  border-radius: var(--r-xl);
  background: var(--surface-dim);
  overflow-x: auto;
}

.chain-step {
  display: flex; flex-direction: column; align-items: center;
  gap: 10px; text-align: center; min-width: 140px;
  flex-shrink: 0;
}

.chain-num {
  width: 28px; height: 28px;
  display: grid; place-items: center;
  border-radius: var(--r-full);
  background: var(--grad-violet);
  color: #fff; font-size: 13px; font-weight: 800;
}

.chain-icon {
  width: 48px; height: 48px;
  display: grid; place-items: center;
  border-radius: var(--r);
  background: var(--faint);
  color: var(--violet-2);
}

.chain-step strong {
  font-size: 14px; font-weight: 700; color: var(--text);
}
.chain-step span {
  font-size: 12px; color: var(--text-3); line-height: 1.5;
}

.chain-connector {
  display: flex; align-items: center;
  padding-top: 48px;
  font-size: 18px; font-weight: 700; color: var(--text-3);
  flex-shrink: 0;
}

.chain-takeaway {
  margin-top: 28px; text-align: center;
  font-size: 15px; line-height: 1.6; color: var(--text-2);
}
.chain-takeaway strong { color: var(--text); }

/* --- What (FDE workflow) section --- */
.what-section { padding: 16px 0 0; }

.what-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px; margin-top: 28px;
}

.what-card {
  padding: 28px;
  border: 1px solid var(--border);
  border-radius: var(--r-xl);
  background: var(--surface-dim);
  transition: border-color 200ms, background 200ms;
}
.what-card:hover {
  border-color: rgba(255,255,255,0.18);
  background: var(--faint);
}

.what-icon {
  width: 44px; height: 44px;
  display: grid; place-items: center;
  border-radius: var(--r);
  margin-bottom: 16px;
  color: #fff;
}
.what-icon-purple {
  background: var(--grad-violet);
  box-shadow: 0 4px 12px rgba(124,58,237,0.35);
}
.what-icon-blue {
  background: var(--grad-blue);
  box-shadow: 0 4px 12px rgba(37,99,235,0.35);
}
.what-icon-emerald {
  background: var(--grad-emerald);
  box-shadow: 0 4px 12px rgba(5,150,105,0.3);
}
.what-icon-amber {
  background: var(--grad-amber);
  box-shadow: 0 4px 12px rgba(217,119,6,0.3);
}
.what-icon-pink {
  background: linear-gradient(135deg, #ec4899, #7c3aed);
  box-shadow: 0 4px 12px rgba(236,72,153,0.3);
}
.what-icon-cyan {
  background: linear-gradient(135deg, #06b6d4, #2563eb);
  box-shadow: 0 4px 12px rgba(6,182,212,0.3);
}

.what-card h3 {
  font-size: 15px; font-weight: 700; color: var(--text);
  margin-bottom: 8px;
}
.what-card p {
  font-size: 13px; line-height: 1.55; color: var(--text-2);
}

/* --- Responsive --- */
@media (max-width: 768px) {
  .gap-compare {
    grid-template-columns: 1fr;
  }
  .gap-arrow {
    transform: rotate(90deg);
    padding: 8px 0;
  }
  .concept-card, .concept-reverse {
    grid-template-columns: 1fr;
    gap: 24px;
    padding: 24px;
  }
  .chain-flow {
    flex-direction: column;
    align-items: center;
    gap: 4px;
  }
  .chain-connector {
    transform: rotate(90deg);
    padding: 4px 0;
    padding-top: 0;
  }
  .what-grid {
    grid-template-columns: 1fr;
  }
}


/* ==================== Global Loading Overlay ==================== */

@keyframes global-spinner {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

@keyframes global-fade-in {
  from { opacity: 0; }
  to { opacity: 1; }
}

.global-loading-overlay {
  position: fixed; inset: 0; z-index: 9999;
  display: none;
  align-items: center; justify-content: center;
  flex-direction: column; gap: 16px;
  background: rgba(0,0,0,0.55);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  animation: global-fade-in 200ms ease;
}

.global-loading-overlay.active {
  display: flex;
}

.global-loading-spinner {
  width: 40px; height: 40px;
  border: 3px solid rgba(255,255,255,0.15);
  border-top-color: var(--violet-2);
  border-radius: 50%;
  animation: global-spinner 700ms linear infinite;
}

.global-loading-text {
  font-size: 15px; font-weight: 600; color: #fff;
  text-align: center; max-width: 360px; line-height: 1.5;
}

/* Button-level loading state */
.btn-loading {
  position: relative;
  pointer-events: none;
  opacity: 0.7;
}
.btn-loading::after {
  content: '';
  position: absolute; right: 12px; top: 50%; margin-top: -8px;
  width: 16px; height: 16px;
  border: 2px solid rgba(255,255,255,0.3);
  border-top-color: #fff;
  border-radius: 50%;
  animation: global-spinner 600ms linear infinite;
}
.btn-loading.loading-left::after {
  right: auto; left: 12px;
}

/* Inline spinner for smaller contexts */
.inline-spinner {
  display: inline-block; width: 16px; height: 16px;
  border: 2px solid rgba(255,255,255,0.2);
  border-top-color: var(--violet-2);
  border-radius: 50%;
  animation: global-spinner 600ms linear infinite;
  vertical-align: middle; margin-right: 6px;
}


/* ==================== Workbench Page ==================== */

.workbench-main {
  max-width: 1280px; margin: 0 auto;
  padding: 24px 32px 48px;
  display: grid; gap: 20px;
}

.run-progress-banner[hidden] { display: none; }

.run-progress-banner {
  position: sticky; top: 76px; z-index: 40;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(180px, 260px);
  gap: 18px; align-items: center;
  width: min(1180px, 100%);
  margin: 0 auto;
  padding: 14px 16px;
  border-radius: var(--r-lg);
  border: 1px solid rgba(168, 85, 247, 0.45);
  background:
    linear-gradient(135deg, rgba(124, 58, 237, 0.24), rgba(6, 182, 212, 0.10)),
    rgba(18, 18, 26, 0.94);
  box-shadow: 0 16px 50px rgba(0, 0, 0, 0.34), 0 0 40px rgba(124, 58, 237, 0.18);
  backdrop-filter: blur(14px);
}

.run-progress-copy {
  display: grid; gap: 4px; min-width: 0;
}

.run-progress-copy span {
  width: fit-content;
  padding: 3px 9px;
  border-radius: var(--r-full);
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
  font-size: 11px; font-weight: 800;
  text-transform: uppercase; letter-spacing: 0.06em;
}

.run-progress-copy strong {
  display: block;
  color: var(--text);
  font-size: 14px; font-weight: 750;
  line-height: 1.35;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.run-progress-meter {
  display: grid; gap: 8px;
}

.run-progress-meter em {
  justify-self: end;
  color: var(--cyan);
  font-style: normal;
  font-size: 13px; font-weight: 800;
}

.run-progress-track {
  height: 9px;
  overflow: hidden;
  border-radius: var(--r-full);
  background: rgba(255, 255, 255, 0.12);
}

.run-progress-track span {
  display: block;
  width: 0%;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--violet-2), var(--cyan));
  box-shadow: 0 0 18px rgba(6, 182, 212, 0.45);
  transition: width 240ms ease;
}

.workbench-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 20px;
  width: min(1180px, 100%);
  max-width: 100%;
  margin: 0 auto;
}

.workbench-page.show-system-details .workbench-layout {
  grid-template-columns: 280px minmax(0, 1fr);
  max-width: none;
}

/* Account gate */
.account-gate {
  display: none;
  grid-template-columns: 1fr 380px;
  gap: 32px; padding: 48px;
  border-radius: var(--r-xl);
  border: 1px solid var(--border);
  background: var(--grad-card);
  align-items: center;
}

.workbench-page.account-required .account-gate { display: grid; }
.workbench-page.account-required .guided-flow { display: none; }
.workbench-page.account-required .semantic-model-visual { display: none; }

.account-gate-copy .eyebrow { margin-bottom: 16px; }

.account-gate-copy h1 {
  font-size: clamp(32px, 4vw, 48px);
  line-height: 1.04; font-weight: 800;
  letter-spacing: -0.03em;
  background: var(--grad-text);
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent;
}

.account-gate-copy p:not(.eyebrow) {
  margin-top: 16px; max-width: 420px;
  font-size: 15px; line-height: 1.55;
  color: var(--text-2);
}

.account-assurance {
  display: flex; flex-wrap: wrap; gap: 8px; margin-top: 20px;
}

.account-assurance span {
  padding: 6px 12px;
  border-radius: var(--r-full);
  border: 1px solid var(--border);
  background: var(--surface-dim);
  font-size: 12px; font-weight: 600;
  color: var(--text-2);
}

.account-form {
  display: grid; gap: 14px;
  padding: 24px;
  border-radius: var(--r-lg);
  border: 1px solid var(--border);
  background: var(--bg-elev);
}

.account-register-fields { display: grid; gap: 14px; }

.account-form label {
  display: grid; gap: 6px;
  font-size: 11px; font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.06em;
  color: var(--text-3);
}

.account-form input {
  width: 100%; height: 42px;
  border: 1px solid var(--border);
  border-radius: var(--r);
  background: var(--surface-dim);
  color: var(--text);
  padding: 0 12px; font-size: 14px;
  transition: border-color 200ms;
}

.account-form input:focus {
  outline: none;
  border-color: var(--violet);
  box-shadow: 0 0 0 3px rgba(124,58,237,0.15);
}

.account-form button[type="submit"] {
  height: 44px;
  border-radius: var(--r);
  background: var(--grad-violet);
  color: #fff; font-size: 14px; font-weight: 700;
  box-shadow: 0 4px 12px rgba(124,58,237,0.3);
  transition: transform 200ms;
}

.account-form button[type="submit"]:hover { transform: translateY(-1px); }

.account-form button.secondary {
  height: 40px;
  border-radius: var(--r);
  border: 1px solid var(--border);
  background: var(--surface-dim);
  color: var(--text-2); font-size: 13px; font-weight: 600;
}

.account-form p {
  font-size: 12px; color: var(--text-3); line-height: 1.4;
}

/* Guided flow */
.guided-flow {
  padding: 32px;
  border-radius: var(--r-xl);
  border: 1px solid var(--border);
  background: var(--grad-card);
}

.guided-topline { margin-bottom: 24px; }

.guided-topline h1 {
  font-size: clamp(32px, 3.4vw, 52px);
  line-height: 1.02; font-weight: 800;
  letter-spacing: -0.03em;
  background: var(--grad-text);
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent;
}

.guided-topline p:not(.eyebrow) {
  margin-top: 14px; max-width: 760px;
  font-size: 15px; line-height: 1.55;
  color: var(--text-2);
}

.guided-run-meta {
  display: flex; flex-wrap: wrap; gap: 8px; margin-top: 18px;
}

.guided-run-meta span {
  display: inline-grid; gap: 2px;
  padding: 6px 12px;
  border-radius: var(--r);
  border: 1px solid var(--border);
  background: var(--surface-dim);
}

.guided-run-meta em {
  font-size: 10px; font-style: normal; font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.06em;
  color: var(--text-3);
}

.guided-run-meta strong {
  font-size: 13px; color: var(--text);
}

.guided-stepper {
  display: grid; grid-template-columns: repeat(4, 1fr);
  gap: 10px; margin-bottom: 16px;
}

.guided-step {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 10px; align-items: start;
  padding: 14px;
  border-radius: var(--r);
  border: 1px solid var(--border);
  background: var(--bg-elev);
  transition: border-color 300ms;
}

.guided-step.active {
  border-color: rgba(124,58,237,0.5);
  background: linear-gradient(180deg, rgba(124,58,237,0.06), transparent);
}

.guided-step span {
  width: 28px; height: 28px;
  display: grid; place-items: center;
  border-radius: 50%;
  background: var(--faint); color: var(--text-2);
  font-size: 11px; font-weight: 800;
  transition: background 300ms;
}

.guided-step.active span {
  background: var(--grad-violet); color: #fff;
}

.guided-step.complete span {
  background: var(--grad-emerald); color: #fff;
}

.guided-step strong { font-size: 13px; }
.guided-step em {
  font-size: 12px; font-style: normal;
  color: var(--text-2); line-height: 1.35;
}

.guided-panel {
  border-radius: var(--r);
  border: 1px solid var(--border);
  background: var(--bg-elev);
  min-height: 200px;
  padding: 0;
  overflow: hidden;
}

.guide-card {
  min-height: 198px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 20px;
  align-items: start;
  padding: 24px;
}

.guide-card-copy {
  display: grid;
  gap: 8px;
  min-width: 0;
}

.guide-card-validate {
  grid-template-columns: minmax(0, 1fr);
  gap: 16px;
}

.guide-card-validate .guide-card-copy {
  max-width: none;
}

.guide-loading-card {
  align-items: stretch;
  grid-template-columns: minmax(0, 1fr);
  min-height: 180px;
}

.guide-card-copy .eyebrow {
  margin: 0;
  color: var(--violet-2);
}

.guide-card-copy h2 {
  margin: 0;
  color: var(--text);
  font-size: 26px;
  font-weight: 850;
  line-height: 1.05;
}

.guide-card-copy p {
  max-width: 760px;
  color: var(--text-2);
  font-size: 14px;
  line-height: 1.55;
}

.guide-empty-state,
.guide-mini-list,
.guide-result,
.guide-delivery {
  margin-top: 6px;
  padding: 12px 14px;
  border-radius: var(--r);
  border: 1px solid var(--border-2);
  background: var(--surface-dim);
  color: var(--text-2);
  font-size: 13px;
}

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

.guide-mini-list span,
.guide-result span,
.guide-delivery span {
  display: inline-flex;
  min-height: 26px;
  align-items: center;
  border-radius: var(--r-full);
  background: rgba(139,92,246,0.14);
  padding: 0 10px;
  color: var(--text);
  font-size: 12px;
  font-weight: 700;
}

.guide-result,
.guide-delivery {
  display: grid;
  gap: 8px;
}

.guide-card-use {
  grid-template-columns: minmax(0, 1fr) 212px;
}

.guide-platform-summary {
  margin-top: 6px;
  display: grid;
  gap: 8px;
  padding: 12px 14px;
  border-radius: var(--r);
  border: 1px solid var(--border-2);
  background: rgba(14,17,30,0.62);
  color: var(--text-2);
  font-size: 13px;
}

.guide-platform-summary span {
  display: block;
  min-width: 0;
  overflow-wrap: anywhere;
}

.guide-platform-summary span:first-child {
  color: var(--text);
  font-weight: 800;
}

.guide-platform-list {
  margin-top: 8px;
  display: grid;
  border-top: 1px solid rgba(255,255,255,0.09);
}

.guide-platform-row {
  min-height: 54px;
  display: grid;
  grid-template-columns: minmax(112px, 150px) minmax(0, 1fr);
  gap: 16px;
  align-items: center;
  padding: 12px 0;
  border-bottom: 1px solid rgba(255,255,255,0.09);
}

.guide-platform-row strong {
  color: var(--text);
  font-size: 13px;
  font-weight: 850;
}

.guide-platform-row span {
  min-width: 0;
  color: var(--text-2);
  font-size: 13px;
  line-height: 1.45;
}

.guide-loading-indicator {
  align-items: center;
  display: grid;
  grid-template-columns: auto auto minmax(0, 1fr);
  gap: 10px;
  margin-top: 10px;
  padding: 12px 14px;
  border-radius: var(--r);
  border: 1px solid rgba(139,92,246,0.28);
  background: rgba(124,58,237,0.13);
  color: var(--text);
}

.guide-loading-indicator i {
  width: 18px;
  height: 18px;
  border-radius: 999px;
  border: 2px solid rgba(255,255,255,0.22);
  border-top-color: var(--violet-2);
  animation: spin 700ms linear infinite;
}

.guide-loading-indicator strong {
  font-size: 13px;
  font-weight: 850;
}

.guide-loading-indicator span {
  min-width: 0;
  color: var(--text-2);
  font-size: 12px;
  overflow-wrap: anywhere;
}

.guide-loading-progress {
  height: 8px;
  align-self: end;
  overflow: hidden;
  border-radius: var(--r-full);
  background: rgba(255,255,255,0.08);
}

.guide-loading-progress span {
  display: block;
  height: 100%;
  min-width: 24px;
  border-radius: inherit;
  background: var(--grad-violet);
  transition: width 220ms ease;
}

.guide-inline-chat {
  display: grid;
  gap: 10px;
  margin-top: 10px;
  width: 100%;
}

.guide-chat-thread {
  width: 100%;
  max-height: 320px;
  min-height: 190px;
  overflow: auto;
  padding: 12px;
  border: 1px solid var(--border-2);
  border-radius: var(--r);
  background: rgba(4,6,15,0.32);
}

.guide-chat-message,
.guide-chat-thread .chat-message {
  margin-bottom: 10px;
  padding: 10px 12px;
  border-radius: var(--r);
  border: 1px solid rgba(255,255,255,0.09);
  background: rgba(255,255,255,0.04);
}

.guide-chat-message:last-child,
.guide-chat-thread .chat-message:last-child {
  margin-bottom: 0;
}

.guide-chat-message.user,
.guide-chat-thread .chat-message.user {
  border-color: rgba(139,92,246,0.3);
  background: rgba(124,58,237,0.14);
}

.guide-chat-message span,
.guide-chat-thread .chat-message span {
  color: var(--text-3);
  font-size: 10px;
  font-weight: 850;
  text-transform: uppercase;
}

.guide-chat-message p,
.guide-chat-thread .chat-message p {
  margin-top: 4px;
  color: var(--text);
  font-size: 13px;
  line-height: 1.45;
}

.guide-chat-message code,
.guide-chat-thread .chat-message code {
  display: inline-flex;
  margin-top: 6px;
  border-radius: var(--r-full);
  background: rgba(255,255,255,0.08);
  color: var(--text-2);
  font-size: 11px;
  padding: 5px 8px;
}

.guide-chat-form {
  width: 100%;
  margin-top: 2px;
}

.composer-shell {
  width: 100%;
  min-height: 96px;
  display: grid;
  grid-template-rows: minmax(42px, auto) 28px;
  gap: 8px;
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 18px;
  background:
    linear-gradient(180deg, rgba(255,255,255,0.055), rgba(255,255,255,0.028)),
    rgba(12,12,17,0.86);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.06), 0 18px 44px rgba(0,0,0,0.22);
  padding: 13px 13px 10px;
  transition: border-color 160ms ease, box-shadow 160ms ease, background 160ms ease;
}

.guide-chat-form:focus-within .composer-shell {
  border-color: rgba(167,139,250,0.48);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.08), 0 0 0 3px rgba(124,58,237,0.16), 0 20px 48px rgba(0,0,0,0.28);
  background:
    linear-gradient(180deg, rgba(255,255,255,0.065), rgba(255,255,255,0.03)),
    rgba(13,13,19,0.92);
}

.composer-shell textarea {
  width: 100%;
  min-width: 0;
  min-height: 42px;
  max-height: 150px;
  resize: vertical;
  border: 0;
  outline: none;
  background: transparent;
  color: var(--text);
  font-size: 14px;
  line-height: 1.5;
  padding: 0 2px;
}

.composer-shell textarea::placeholder {
  color: rgba(229,231,235,0.42);
}

.composer-footer {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
}

.composer-send {
  width: 34px;
  height: 34px;
  min-width: 34px;
  min-height: 34px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--r-full);
  background: #f8fafc;
  color: #111827;
  box-shadow: 0 10px 24px rgba(0,0,0,0.32);
  transition: transform 140ms ease, filter 140ms ease, opacity 140ms ease;
}

.composer-send:hover:not(:disabled) {
  transform: translateY(-1px);
  filter: brightness(1.04);
}

.composer-send:disabled {
  cursor: wait;
  opacity: 0.74;
}

.composer-send svg {
  width: 18px;
  height: 18px;
}

.guide-actions {
  min-width: 188px;
  display: grid;
  gap: 8px;
  justify-items: stretch;
}

.guide-card-validate .guide-actions {
  min-width: 0;
  grid-template-columns: repeat(2, minmax(140px, 180px)) minmax(0, 1fr);
  align-items: center;
}

.guide-card-validate .guide-footnote {
  align-self: center;
  justify-self: end;
  max-width: 420px;
  text-align: right;
}

.guide-actions button,
.guide-actions a {
  min-height: 38px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--r-full);
  border: 1px solid transparent;
  background: var(--grad-violet);
  color: #fff;
  padding: 0 16px;
  font-size: 13px;
  font-weight: 800;
  text-decoration: none;
}

.guide-actions button.secondary,
.guide-actions a.secondary {
  border-color: var(--border);
  background: var(--surface-dim);
  color: var(--text-2);
}

.guide-actions button:disabled,
.guide-actions a[aria-disabled="true"] {
  cursor: not-allowed;
  opacity: 0.45;
}

.guide-footnote {
  color: var(--text-3);
  font-size: 12px;
  line-height: 1.4;
}

/* Ontology Graph Panel */
.ontology-graph-panel {
  padding: 24px;
  border-radius: var(--r-xl);
  border: 1px solid rgba(255,255,255,0.11);
  background:
    radial-gradient(circle at 48% 50%, rgba(168,85,247,0.16), transparent 24%),
    radial-gradient(circle at 12% 72%, rgba(96,165,250,0.12), transparent 24%),
    radial-gradient(circle at 80% 20%, rgba(45,212,191,0.10), transparent 26%),
    linear-gradient(180deg, rgba(255,255,255,0.055), rgba(255,255,255,0.025)),
    rgba(7,9,18,0.92);
  position: relative;
  overflow: hidden;
}

.ontology-graph-panel::before {
  content: "";
  position: absolute;
  inset: -40% -20%;
  background:
    linear-gradient(115deg, transparent 42%, rgba(168,85,247,0.08) 48%, transparent 55%),
    linear-gradient(28deg, transparent 40%, rgba(96,165,250,0.06) 47%, transparent 54%);
  pointer-events: none;
  transform: rotate(-5deg);
}

.ontology-graph-panel > * {
  position: relative;
  z-index: 1;
}

.graph-header {
  display: flex; align-items: flex-start; justify-content: space-between;
  flex-wrap: wrap; gap: 12px;
  margin-bottom: 16px;
}

.graph-header h2 { font-size: 20px; font-weight: 850; }

.graph-legend {
  display: flex; flex-wrap: wrap; gap: 8px;
  font-size: 11px; color: var(--text-2);
}

.legend-item {
  display: inline-flex; align-items: center; gap: 6px;
  min-height: 28px;
  padding: 0 9px;
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: var(--r-full);
  background: rgba(255,255,255,0.04);
  font-weight: 700;
}

.legend-dot {
  display: inline-block; width: 9px; height: 9px;
  border-radius: 3px; flex-shrink: 0;
}
.legend-dot.core { background: #f8fafc; box-shadow: 0 0 12px rgba(248,250,252,0.56); }
.legend-dot.api  { background: #a855f7; }
.legend-dot.ddl  { background: #60a5fa; }
.legend-dot.op   { background: #2dd4bf; }

.legend-line {
  display: inline-block; width: 18px; height: 2px;
  border-radius: 1px; flex-shrink: 0;
}
.legend-line.fk  { background: #a855f7; }
.legend-line.ref { background: #60a5fa; opacity: 0.72; }

/* ── Graph view toggle ── */
.graph-view-toggle {
  display: flex; gap: 4px;
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: var(--r-sm); padding: 3px;
}
.view-toggle-btn {
  padding: 3px 10px; font-size: 12px; font-weight: 600;
  border: none; border-radius: 4px; cursor: pointer;
  background: transparent; color: var(--muted);
  transition: all 0.18s ease;
}
.view-toggle-btn.active {
  background: rgba(255,255,255,0.12);
  color: var(--primary-light);
}
.view-toggle-btn:hover:not(.active) { color: var(--fg); }

/* ── Vis-network flywheel fixes ── */
.ontology-graph-panel.fw-panel-active {
  overflow: hidden;
  isolation: isolate;
}
.graph-container.fw-active {
  height: clamp(560px, 62vh, 760px);
  min-height: 560px;
  overflow: hidden;
  contain: layout paint;
}
.graph-container.fw-active::before,
.graph-container.fw-active::after { display: none; }

.graph-container.fw-active .vis-network {
  position: absolute !important;
  inset: 0;
  width: 100% !important;
  height: 100% !important;
  overflow: hidden;
  z-index: 2;
}

.graph-container.fw-active canvas {
  max-width: none;
}

.graph-container {
  width: 100%; min-height: clamp(620px, 68vh, 780px);
  border-radius: var(--r-lg);
  background:
    radial-gradient(circle at 50% 50%, rgba(248,250,252,0.10), transparent 8%),
    radial-gradient(circle at 34% 70%, rgba(168,85,247,0.18), transparent 20%),
    radial-gradient(circle at 72% 30%, rgba(96,165,250,0.14), transparent 20%),
    radial-gradient(circle at 54% 80%, rgba(45,212,191,0.12), transparent 18%),
    linear-gradient(rgba(255,255,255,0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,0.035) 1px, transparent 1px),
    linear-gradient(180deg, rgba(4,6,15,0.78), rgba(4,6,15,0.96));
  background-size: auto, auto, auto, auto, 36px 36px, 36px 36px, auto;
  border: 1px solid rgba(255,255,255,0.1);
  position: relative;
  overflow: hidden;
}

.graph-container::before,
.graph-container::after {
  content: "";
  position: absolute;
  pointer-events: none;
  border-radius: 999px;
  opacity: 0.75;
}

.graph-container::before {
  width: 520px;
  height: 520px;
  left: calc(50% - 260px);
  top: calc(50% - 260px);
  border: 1px solid rgba(168,85,247,0.16);
  box-shadow:
    0 0 80px rgba(168,85,247,0.12),
    inset 0 0 80px rgba(96,165,250,0.06);
}

.graph-container::after {
  width: 760px;
  height: 760px;
  left: calc(50% - 380px);
  top: calc(50% - 380px);
  border: 1px dashed rgba(148,163,184,0.12);
}

.graph-placeholder {
  display: flex; align-items: center; justify-content: center;
  min-height: clamp(620px, 68vh, 780px);
  color: var(--text-3); font-size: 14px;
}

.graph-container canvas { display: block; }

.semantic-recommendations {
  margin-top: 16px;
}

.semantic-recommendations[hidden],
.semantic-recommendations:empty {
  display: none;
}

.semantic-suggestions-card {
  display: grid;
  gap: 14px;
  padding: 16px;
  border: 1px solid rgba(168,85,247,0.18);
  border-radius: var(--r-lg);
  background:
    linear-gradient(180deg, rgba(168,85,247,0.08), rgba(255,255,255,0.025)),
    rgba(10,13,24,0.84);
}

.semantic-suggestions-card.empty {
  border-color: rgba(255,255,255,0.10);
  background: rgba(255,255,255,0.035);
}

.semantic-suggestions-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
}

.semantic-suggestions-header span,
.semantic-suggestion-column > span {
  display: block;
  color: #c4b5fd;
  font-size: 11px;
  font-weight: 850;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.semantic-suggestions-header strong {
  display: block;
  margin-top: 4px;
  color: var(--text);
  font-size: 16px;
  font-weight: 850;
}

.semantic-suggestions-header p {
  margin-top: 6px;
  color: var(--text-2);
  font-size: 13px;
}

.semantic-suggestions-pill {
  flex: 0 0 auto;
  padding: 7px 10px;
  border: 1px solid rgba(168,85,247,0.28);
  border-radius: var(--r-full);
  background: rgba(168,85,247,0.12);
  color: #e9d5ff;
  font-size: 12px;
  font-weight: 800;
}

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

.semantic-suggestion-column {
  min-width: 0;
  padding: 12px;
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: var(--r);
  background: rgba(255,255,255,0.035);
}

.semantic-suggestion-column ul {
  display: grid;
  gap: 7px;
  margin: 9px 0 0;
  padding: 0;
  list-style: none;
}

.semantic-suggestion-column li {
  color: var(--text-2);
  font-size: 12px;
  line-height: 1.35;
  overflow-wrap: anywhere;
}

.semantic-suggestion-column li::before {
  content: "";
  display: inline-block;
  width: 5px;
  height: 5px;
  margin-right: 7px;
  border-radius: 999px;
  background: #a855f7;
  vertical-align: 2px;
}

.semantic-suggestion-column li.muted {
  color: var(--text-3);
}

.semantic-suggestion-column li.muted::before {
  background: rgba(148,163,184,0.5);
}

.graph-detail {
  position: absolute;
  top: 92px; right: 36px;
  width: min(320px, calc(100% - 72px)); max-height: calc(100% - 112px);
  background: rgba(15,18,30,0.94);
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: var(--r-lg);
  padding: 18px;
  overflow-y: auto;
  box-shadow: 0 22px 70px rgba(0,0,0,0.38);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  z-index: 20;
  font-size: 13px; line-height: 1.5;
}

.graph-detail h3 {
  color: var(--text);
  font-size: 17px; font-weight: 850; margin-bottom: 10px;
  overflow-wrap: anywhere;
}

.graph-detail .detail-meta {
  display: flex; flex-wrap: wrap; gap: 6px;
  margin-bottom: 12px;
}

.graph-detail .detail-badge {
  display: inline-block; padding: 5px 8px; border-radius: var(--r-full);
  font-size: 11px; font-weight: 750;
}
.detail-badge.api  { background: rgba(168,85,247,0.14); color: #e9d5ff; }
.detail-badge.ddl  { background: rgba(96,165,250,0.13); color: #bfdbfe; }
.detail-badge.op   { background: rgba(45,212,191,0.12); color: #99f6e4; }
.detail-badge.core { background: rgba(248,250,252,0.12); color: #ffffff; }
.detail-badge.fk   { background: rgba(168,85,247,0.14); color: #e9d5ff; }
.detail-badge.ref  { background: rgba(96,165,250,0.13); color: #bfdbfe; }
.detail-badge.conf { background: rgba(34,197,94,0.12); color: #22c55e; }

.graph-detail table {
  width: 100%; font-size: 12px; border-collapse: collapse;
  margin-top: 8px;
}
.graph-detail table th, .graph-detail table td {
  text-align: left; padding: 6px 8px;
  border-bottom: 1px solid rgba(255,255,255,0.08);
  vertical-align: top;
  overflow-wrap: anywhere;
}
.graph-detail table th { color: var(--text-3); font-weight: 500; }

.graph-detail-close {
  position: absolute; top: 12px; right: 12px;
  background: none; border: none; font-size: 18px;
  color: var(--text-3); cursor: pointer;
  line-height: 1;
}
.graph-detail-close:hover { color: var(--text-1); }

/* POC Wizard */
.poc-wizard {
  padding: 28px;
  border-radius: var(--r-xl);
  border: 1px solid var(--border);
  background: var(--grad-card);
}

.poc-wizard-header {
  display: flex; justify-content: space-between; align-items: start;
  margin-bottom: 20px;
}

.poc-wizard-header h2 {
  font-size: 22px; font-weight: 750;
  margin-top: 8px;
}

.poc-status {
  display: grid; gap: 4px; text-align: right;
}

.poc-status span { font-size: 12px; color: var(--text-3); }
.poc-status strong { font-size: 14px; }

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

.poc-step {
  display: grid;
  grid-template-rows: auto 1fr auto;
  gap: 10px;
  padding: 16px;
  border-radius: var(--r-lg);
  border: 1px solid var(--border);
  background: var(--bg-elev);
  transition: border-color 300ms, transform 300ms;
}

.poc-step:hover {
  border-color: rgba(255,255,255,0.16);
  transform: translateY(-2px);
}

.poc-step .step-index {
  width: 32px; height: 32px;
  display: grid; place-items: center;
  border-radius: 50%;
  background: var(--grad-violet);
  color: #fff; font-size: 13px; font-weight: 800;
}

.poc-step[data-step="review"] .step-index { background: var(--grad-blue); }
.poc-step[data-step="validate"] .step-index { background: var(--grad-emerald); }
.poc-step[data-step="deliver"] .step-index { background: var(--grad-amber); }

.poc-step strong { font-size: 14px; }
.poc-step p { font-size: 12px; color: var(--text-2); line-height: 1.4; }

.step-actions { display: flex; flex-wrap: wrap; gap: 6px; }

.step-actions button,
.step-actions a {
  min-height: 30px;
  display: inline-flex; align-items: center; justify-content: center;
  border-radius: var(--r-full);
  padding: 0 12px;
  border: 1px solid var(--border);
  background: var(--surface-dim);
  color: var(--text); font-size: 12px; font-weight: 600;
  text-decoration: none;
  transition: background 200ms;
}

.step-actions button:hover,
.step-actions a:hover {
  background: var(--faint);
}

.poc-deliverables {
  display: flex; flex-wrap: wrap; gap: 8px; margin-top: 20px;
}

.poc-deliverables span {
  padding: 6px 12px;
  border-radius: var(--r-full);
  border: 1px solid var(--border);
  background: var(--surface-dim);
  font-size: 12px; font-weight: 600;
  color: var(--text-2);
}

.readiness-review {
  display: grid;
  grid-template-columns: 240px 1fr;
  gap: 20px; margin-top: 20px;
  padding: 20px;
  border-radius: var(--r-lg);
  border: 1px solid var(--border);
  background: var(--bg-elev);
}

.readiness-score { text-align: center; }

.readiness-score > span { font-size: 12px; color: var(--text-3); }

.readiness-score strong {
  display: block; font-size: 32px; font-weight: 800;
  margin: 4px 0;
  background: var(--grad-text);
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent;
}

.readiness-score p { font-size: 12px; color: var(--text-2); }

.readiness-columns {
  display: grid; grid-template-columns: 1fr 1fr; gap: 20px;
}

.readiness-columns h3 { font-size: 13px; font-weight: 700; margin-bottom: 8px; }

.readiness-list {
  list-style: none; padding: 0; margin: 0;
  display: grid; gap: 6px;
}

.readiness-list li {
  font-size: 12px; color: var(--text-2);
  padding: 8px 10px;
  border-radius: var(--r-sm);
  border: 1px solid var(--border-2);
  background: var(--surface-dim);
}

.semantic-model-visual {
  padding: 18px;
  border-radius: var(--r-lg);
  border: 1px solid var(--border);
  background: linear-gradient(180deg, rgba(255,255,255,0.05), rgba(255,255,255,0.025));
}

.semantic-model-visual .section-heading {
  margin-bottom: 14px;
}

.semantic-model-visual .section-heading button {
  min-height: 32px;
  padding: 0 12px;
  border-radius: var(--r-full);
  border: 1px solid var(--border);
  background: var(--surface-dim);
  color: var(--text);
  font-size: 12px;
  font-weight: 700;
}

.semantic-model-canvas {
  display: block;
}

.semantic-graph-shell {
  display: grid;
  gap: 12px;
}

.semantic-graph-topline {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
}

.semantic-graph-stat {
  min-width: 0;
  padding: 10px 12px;
  border-radius: var(--r);
  border: 1px solid var(--border-2);
  background: rgba(255,255,255,0.04);
}

.semantic-graph-stat strong {
  display: block;
  color: var(--text);
  font-size: 20px;
  font-weight: 850;
}

.semantic-graph-stat span {
  display: block;
  margin-top: 2px;
  color: var(--text-3);
  font-size: 11px;
  font-weight: 750;
}

.semantic-graph-stat.caution {
  border-color: rgba(251,191,36,0.28);
  background: rgba(251,191,36,0.08);
}

.ontology-workbench {
  display: grid;
  grid-template-columns: 220px minmax(0, 1fr) 260px;
  grid-template-areas:
    "explorer object actions"
    "graph graph graph";
  gap: 12px;
  align-items: stretch;
}

.ontology-object-explorer {
  grid-area: explorer;
}

.ontology-object-view {
  grid-area: object;
}

.ontology-action-rail {
  grid-area: actions;
}

.ontology-object-explorer,
.ontology-object-view,
.ontology-action-rail,
.ontology-model-graph-card,
.ontology-object-card {
  min-width: 0;
  border: 1px solid var(--border-2);
  border-radius: var(--r);
  background: rgba(255,255,255,0.04);
}

.ontology-object-explorer,
.ontology-action-rail {
  padding: 12px;
}

.ontology-object-view {
  display: grid;
  gap: 12px;
  padding: 12px;
  background: rgba(4,6,15,0.28);
}

.ontology-panel-heading {
  align-items: center;
  display: flex;
  gap: 10px;
  justify-content: space-between;
  margin-bottom: 10px;
}

.ontology-panel-heading span {
  color: var(--text-3);
  font-size: 11px;
  font-weight: 850;
  text-transform: uppercase;
}

.ontology-panel-heading strong {
  color: var(--text);
  font-size: 12px;
  font-weight: 800;
  overflow-wrap: anywhere;
}

.ontology-panel-heading button {
  background: rgba(124,58,237,0.18);
  border: 1px solid rgba(168,85,247,0.5);
  border-radius: var(--r-full);
  color: #f5f3ff;
  cursor: pointer;
  font-size: 12px;
  font-weight: 800;
  min-height: 30px;
  padding: 0 10px;
}

.ontology-object-list,
.ontology-action-list {
  display: grid;
  gap: 8px;
}

.ontology-object-item {
  min-width: 0;
  padding: 11px 12px;
  border-radius: var(--r-sm);
  border: 1px solid rgba(255,255,255,0.1);
  background: rgba(255,255,255,0.035);
  color: var(--text);
  cursor: pointer;
  text-align: left;
}

.ontology-object-item:hover,
.ontology-object-item.selected {
  border-color: rgba(139,92,246,0.72);
  background: rgba(124,58,237,0.18);
}

.ontology-object-item strong,
.ontology-action-card strong {
  display: block;
  color: var(--text);
  font-size: 13px;
  font-weight: 850;
  overflow-wrap: anywhere;
}

.ontology-object-item span {
  display: block;
  margin-top: 4px;
  color: var(--text-3);
  font-size: 11px;
  font-weight: 700;
}

.ontology-object-card {
  padding: 16px;
}

.ontology-object-card-head > span,
.ontology-action-card > span {
  color: var(--text-3);
  font-size: 11px;
  font-weight: 850;
  text-transform: uppercase;
}

.ontology-object-card-head strong {
  display: block;
  margin-top: 5px;
  color: var(--text);
  font-size: 26px;
  font-weight: 900;
  line-height: 1.05;
  overflow-wrap: anywhere;
}

.ontology-object-card-head p {
  margin-top: 6px;
  color: var(--text-2);
  font-size: 13px;
}

.ontology-property-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 12px;
  margin-top: 16px;
}

.ontology-property-grid section {
  min-width: 0;
  padding: 12px;
  border-radius: var(--r-sm);
  background: rgba(255,255,255,0.04);
}

.ontology-property-grid h3 {
  color: var(--text-3);
  font-size: 11px;
  font-weight: 850;
  text-transform: uppercase;
}

.ontology-field-list,
.ontology-link-list {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin-top: 10px;
}

.ontology-field-list span,
.ontology-link-list span {
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: var(--r-full);
  background: rgba(255,255,255,0.055);
  color: var(--text);
  font-size: 12px;
  font-weight: 700;
  line-height: 1.2;
  padding: 7px 9px;
}

.ontology-link-list b {
  color: #a78bfa;
  font-weight: 850;
}

.ontology-field-list em,
.ontology-link-list em,
.ontology-empty {
  color: var(--text-3);
  font-size: 12px;
  font-style: normal;
}

.ontology-field-semantic-list {
  display: grid;
  gap: 8px;
  margin-top: 10px;
}

.ontology-field-semantic {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  gap: 8px;
  align-items: center;
  min-width: 0;
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: var(--r-sm);
  background: rgba(255,255,255,0.045);
  padding: 9px;
}

.ontology-field-semantic.needs-review {
  border-color: rgba(168,85,247,0.42);
  background: rgba(168,85,247,0.1);
}

.ontology-field-semantic div {
  min-width: 0;
}

.ontology-field-semantic strong {
  display: block;
  color: var(--text);
  font-size: 12px;
  font-weight: 850;
  line-height: 1.2;
  overflow-wrap: anywhere;
}

.ontology-field-semantic p {
  margin: 4px 0 0;
  color: var(--text-3);
  font-size: 11px;
  line-height: 1.35;
}

.ontology-field-semantic span,
.ontology-field-semantic em {
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: var(--r-full);
  background: rgba(255,255,255,0.055);
  color: var(--text-2);
  font-size: 10px;
  font-style: normal;
  font-weight: 850;
  line-height: 1;
  padding: 6px 7px;
  text-transform: uppercase;
  white-space: nowrap;
}

.ontology-field-semantic em {
  grid-column: 1 / -1;
  justify-self: start;
  color: #34d399;
}

.ontology-model-graph-card {
  grid-area: graph;
  padding: 12px;
}

.ontology-model-graph-card .semantic-graph {
  min-height: 500px;
}

.ontology-action-card {
  min-width: 0;
  padding: 12px;
  border-radius: var(--r-sm);
  border: 1px solid rgba(255,255,255,0.1);
  background: rgba(255,255,255,0.04);
}

.ontology-action-card.write {
  border-color: rgba(251,191,36,0.28);
  background: rgba(251,191,36,0.08);
}

.ontology-action-card.read {
  border-color: rgba(45,212,191,0.24);
  background: rgba(20,184,166,0.07);
}

.ontology-action-card p {
  margin-top: 6px;
  color: var(--text-2);
  font-size: 12px;
  line-height: 1.35;
  overflow-wrap: anywhere;
}

.ontology-action-card em {
  display: inline-flex;
  margin-top: 8px;
  border-radius: var(--r-full);
  background: rgba(255,255,255,0.08);
  color: var(--text);
  font-size: 11px;
  font-style: normal;
  font-weight: 800;
  line-height: 1;
  padding: 7px 9px;
}

.ontology-decision-panel {
  min-width: 0;
  padding: 12px;
  border-radius: var(--r);
  border: 1px solid rgba(255,255,255,0.1);
  background: rgba(255,255,255,0.035);
}

.ontology-decision-panel .ontology-panel-heading {
  margin-bottom: 12px;
}

.ontology-decision-list {
  display: grid;
  gap: 8px;
}

.ontology-decision-row {
  min-width: 0;
  display: grid;
  gap: 8px;
  padding: 10px;
  border-radius: var(--r-sm);
  border: 1px solid rgba(255,255,255,0.1);
  background: rgba(4,6,15,0.22);
}

.ontology-decision-row.approved {
  border-color: rgba(45,212,191,0.28);
}

.ontology-decision-row.needs_changes {
  border-color: rgba(251,191,36,0.32);
}

.ontology-decision-row.rejected {
  border-color: rgba(248,113,113,0.32);
}

.ontology-decision-row label {
  align-items: center;
  display: flex;
  gap: 8px;
  justify-content: space-between;
}

.ontology-decision-row label span {
  color: var(--text);
  font-size: 12px;
  font-weight: 850;
}

.ontology-decision-row select {
  min-height: 30px;
  max-width: 150px;
  border: 1px solid var(--border-2);
  border-radius: var(--r-sm);
  background: rgba(255,255,255,0.06);
  color: var(--text);
  font-size: 12px;
  font-weight: 800;
}

.ontology-decision-row textarea {
  width: 100%;
  min-width: 0;
  resize: vertical;
  border: 1px solid var(--border-2);
  border-radius: var(--r-sm);
  background: rgba(255,255,255,0.045);
  color: var(--text);
  font-size: 12px;
  line-height: 1.45;
  padding: 9px 10px;
}

.semantic-graph-workbench {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 240px;
  gap: 12px;
}

.semantic-graph {
  min-height: 420px;
  border-radius: var(--r);
  border: 1px solid var(--border-2);
  background:
    radial-gradient(circle at 20% 18%, rgba(139,92,246,0.15), transparent 28%),
    radial-gradient(circle at 78% 72%, rgba(20,184,166,0.13), transparent 30%),
    rgba(4,6,15,0.42);
  overflow: hidden;
}

.semantic-model-detail {
  min-width: 0;
  padding: 16px;
  border-radius: var(--r);
  border: 1px solid var(--border-2);
  background: rgba(255,255,255,0.045);
}

.semantic-model-detail > span {
  color: var(--text-3);
  font-size: 11px;
  font-weight: 850;
  text-transform: uppercase;
}

.semantic-model-detail h3 {
  margin-top: 8px;
  color: var(--text);
  font-size: 18px;
  font-weight: 850;
  line-height: 1.15;
  overflow-wrap: anywhere;
}

.semantic-model-detail p {
  margin-top: 8px;
  color: var(--text-2);
  font-size: 12px;
  line-height: 1.45;
  overflow-wrap: anywhere;
}

.semantic-model-detail dl {
  display: grid;
  gap: 8px;
  margin-top: 16px;
}

.semantic-model-detail dl div {
  display: grid;
  gap: 3px;
  padding: 9px 10px;
  border-radius: var(--r-sm);
  background: rgba(255,255,255,0.04);
}

.semantic-model-detail dt {
  color: var(--text-3);
  font-size: 10px;
  font-weight: 800;
  text-transform: uppercase;
}

.semantic-model-detail dd {
  color: var(--text);
  font-size: 12px;
  line-height: 1.35;
  overflow-wrap: anywhere;
}

.semantic-graph-legend {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.semantic-graph-legend span {
  align-items: center;
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 999px;
  color: rgba(248,250,252,0.78);
  display: inline-flex;
  font-size: 12px;
  font-weight: 700;
  gap: 7px;
  line-height: 1;
  padding: 8px 10px;
}

.semantic-graph-legend i {
  border-radius: 999px;
  display: inline-block;
  height: 9px;
  width: 9px;
}

.semantic-graph-legend i.object {
  background: #8b5cf6;
}

.semantic-graph-legend i.action {
  background: #2dd4bf;
}

.semantic-graph-legend i.write-action {
  background: #fbbf24;
}

.semantic-graph-legend button {
  background: rgba(124,58,237,0.18);
  border: 1px solid rgba(168,85,247,0.5);
  border-radius: 999px;
  color: #f5f3ff;
  cursor: pointer;
  font-size: 12px;
  font-weight: 800;
  margin-left: auto;
  padding: 8px 12px;
}

.semantic-graph-legend button:hover {
  background: rgba(124,58,237,0.32);
}

.semantic-visual-column {
  min-width: 0;
  display: grid;
  align-content: start;
  gap: 8px;
}

.semantic-visual-column > span {
  color: var(--text-3);
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
}

.semantic-node,
.semantic-link-row {
  min-width: 0;
  border: 1px solid var(--border);
  border-radius: var(--r);
  background: rgba(255,255,255,0.04);
}

.semantic-node {
  padding: 12px;
}

.semantic-node strong,
.semantic-link-row strong {
  display: block;
  overflow: hidden;
  color: var(--text);
  font-size: 13px;
  font-weight: 800;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.semantic-node p {
  margin-top: 4px;
  color: var(--text-2);
  font-size: 12px;
  line-height: 1.45;
  word-break: break-word;
}

.semantic-node div {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-top: 8px;
}

.semantic-node em {
  display: inline-flex;
  max-width: 100%;
  min-height: 22px;
  align-items: center;
  border-radius: var(--r-full);
  background: rgba(139,92,246,0.14);
  color: var(--text-2);
  padding: 0 8px;
  font-size: 11px;
  font-style: normal;
  overflow-wrap: anywhere;
}

.action-node.write-action {
  border-color: rgba(251,191,36,0.4);
  background: rgba(251,191,36,0.07);
}

.semantic-link-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 20px minmax(0, 1.2fr);
  align-items: center;
  gap: 8px;
  padding: 10px;
}

.semantic-link-row span {
  display: grid;
  place-items: center;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--grad-violet);
  color: #fff;
  font-size: 12px;
  font-weight: 800;
}

.semantic-link-row code {
  min-width: 0;
  overflow: hidden;
  color: var(--text-2);
  font-size: 11px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Pipeline */
.pipeline {
  display: flex; gap: 0; align-items: center;
  padding: 20px;
  border-radius: var(--r-lg);
  border: 1px solid var(--border);
  background: var(--grad-card);
}

.pipeline .stage {
  flex: 1;
  display: grid; gap: 6px; place-items: center; text-align: center;
  position: relative;
}

.pipeline .stage:not(:last-child)::after {
  content: '';
  position: absolute; right: -50%; top: 16px;
  width: 100%; height: 2px;
  background: var(--border);
}

.pipeline .stage span {
  width: 32px; height: 32px;
  display: grid; place-items: center;
  border-radius: 50%;
  background: var(--grad-emerald);
  color: #fff; font-size: 12px; font-weight: 800;
  z-index: 1;
}

.pipeline .stage strong { font-size: 13px; }
.pipeline .stage em { font-size: 11px; font-style: normal; color: var(--text-2); }

/* Hero workspace */
.hero-workspace {
  display: none;
  grid-template-columns: 1fr 380px;
  gap: 20px;
}

.workbench-page.show-advanced .hero-workspace { display: grid; }

.hero-copy {
  display: flex; flex-direction: column; justify-content: space-between;
  padding: 32px;
  border-radius: var(--r-xl);
  border: 1px solid var(--border);
  background: var(--grad-card);
}

.hero-copy h1 {
  font-size: clamp(28px, 3.5vw, 44px);
  line-height: 1.04; font-weight: 800;
  letter-spacing: -0.03em;
}

.hero-subtitle {
  margin-top: 16px; max-width: 500px;
  font-size: 15px; line-height: 1.55;
  color: var(--text-2);
}

.hero-runtime-badge {
  display: inline-flex; align-items: center; gap: 8px;
  margin-top: 16px;
  padding: 6px 14px;
  border-radius: var(--r-full);
  font-size: 13px; font-weight: 600;
  background: rgba(99, 102, 241, 0.06);
  border: 1px solid rgba(99, 102, 241, 0.18);
  color: var(--violet-2);
  white-space: nowrap;
  width: fit-content;
}

.runtime-dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--text-3);
  flex-shrink: 0;
}

.runtime-dot.online { background: #22c55e; box-shadow: 0 0 6px rgba(34, 197, 94, 0.4); }
.runtime-dot.offline { background: #f97316; }
.runtime-dot.error { background: #ef4444; }

.runtime-dot-small {
  display: inline-block;
  width: 7px; height: 7px;
  border-radius: 50%;
  background: var(--text-3);
  vertical-align: middle;
  margin-right: 4px;
  flex-shrink: 0;
}

.runtime-dot-small.online { background: #22c55e; box-shadow: 0 0 4px rgba(34, 197, 94, 0.4); }
.runtime-dot-small.offline { background: #f97316; }
.runtime-dot-small.error { background: #ef4444; }

.runtime-meta { display: flex; flex-direction: column; gap: 4px; }
.runtime-label { display: inline-flex; align-items: center; }

.actions {
  display: flex; flex-wrap: wrap; gap: 10px; margin-top: 24px;
}

.actions button {
  min-height: 40px; padding: 0 18px;
  border-radius: var(--r-full);
  border: 1px solid var(--border);
  background: var(--surface-dim);
  color: var(--text); font-size: 13px; font-weight: 600;
  transition: background 200ms;
}

.actions button:hover { background: var(--faint); }

.package-console {
  padding: 24px;
  border-radius: var(--r-xl);
  border: 1px solid var(--border);
  background: var(--bg-elev);
}

.console-topline {
  display: flex; justify-content: space-between; align-items: center;
  margin-bottom: 16px;
}

.console-topline span { font-size: 13px; font-weight: 600; }

.console-grid {
  display: grid; grid-template-columns: 1fr 1fr; gap: 12px;
}

.console-grid article {
  display: grid; gap: 4px;
  padding: 16px;
  border-radius: var(--r);
  border: 1px solid var(--border-2);
  background: var(--surface-dim);
}

.console-grid span { font-size: 11px; color: var(--text-3); text-transform: uppercase; }
.console-grid strong { font-size: 24px; font-weight: 800; }

/* Sidebar */
.workspace-sidebar {
  display: none;
  position: sticky; top: 80px;
  gap: 12px;
  max-height: calc(100vh - 100px);
  overflow: auto;
}

.workbench-page.show-system-details .workspace-sidebar { display: grid; }

.sidebar-panel {
  padding: 16px;
  border-radius: var(--r-lg);
  border: 1px solid var(--border);
  background: var(--grad-card);
}

.sidebar-panel h2 { font-size: 14px; font-weight: 700; }

.project-panel {
  background: linear-gradient(145deg, rgba(124,58,237,0.12), rgba(37,99,235,0.06));
  border-color: rgba(124,58,237,0.2);
}

.project-panel .eyebrow { color: var(--violet-2); }
.project-panel h2 { font-size: 20px; color: var(--text); }

.project-meta {
  display: grid; gap: 4px;
  border-top: 1px solid var(--border);
  padding-top: 10px; margin-top: 10px;
}

.project-meta span { font-size: 11px; font-weight: 700; text-transform: uppercase; color: var(--text-3); }
.project-meta strong { font-size: 13px; color: var(--text); word-break: break-word; }

.sidebar-heading {
  display: flex; justify-content: space-between; align-items: center;
  margin-bottom: 10px;
}

.sidebar-heading span, #job-state {
  padding: 2px 8px;
  border-radius: var(--r-full);
  border: 1px solid var(--border);
  background: var(--surface-dim);
  font-size: 11px; font-weight: 700;
  color: var(--text-3);
}

.sidebar-heading button {
  padding: 4px 10px;
  border-radius: var(--r-full);
  border: 1px solid var(--border);
  background: var(--surface-dim);
  font-size: 11px; font-weight: 600;
  color: var(--text-2);
}

.job-panel p { font-size: 13px; color: var(--text-2); line-height: 1.4; }

.job-progress {
  height: 6px; border-radius: var(--r-full);
  background: var(--faint); margin-top: 12px; overflow: hidden;
}

.job-progress span {
  display: block; height: 100%; width: 0;
  border-radius: inherit;
  background: var(--grad-violet);
  transition: width 200ms ease;
}

.package-list, .artifact-links, .activity-feed {
  display: grid; gap: 6px;
}

.package-item {
  display: grid; gap: 4px;
  padding: 10px;
  border-radius: var(--r);
  border: 1px solid var(--border-2);
  background: var(--surface-dim);
}

.package-item.active {
  border-color: rgba(124,58,237,0.4);
  background: rgba(124,58,237,0.06);
}

.package-item strong { font-size: 13px; }
.package-item span { font-size: 11px; font-weight: 700; color: var(--emerald-2); }
.package-item p { font-size: 11px; color: var(--text-3); }

.artifact-links a {
  display: flex; align-items: center;
  min-height: 30px; padding: 0 10px;
  border-radius: var(--r);
  border: 1px solid var(--border-2);
  background: var(--surface-dim);
  color: var(--blue-2); font-size: 12px; font-weight: 600;
}

.activity-item {
  border-left: 2px solid var(--border);
  padding: 2px 0 8px 10px;
}

.activity-item span { font-size: 10px; font-weight: 700; color: var(--text-3); }
.activity-item strong { font-size: 12px; display: block; }
.activity-item p { font-size: 11px; color: var(--text-2); }

/* Tool panels */
.tool-panel {
  padding: 24px;
  border-radius: var(--r-xl);
  border: 1px solid var(--border);
  background: var(--grad-card);
}

/* Validation loop */
.poc-wizard, .validation-loop, .main-grid, .ontology-review, .lower-grid, .skill-preview, .pipeline {
  display: none;
}

.workbench-page.show-advanced .validation-loop,
.workbench-page.show-advanced .main-grid,
.workbench-page.show-advanced .ontology-review,
.workbench-page.show-advanced .lower-grid { display: grid; }

.workbench-page.show-advanced .poc-wizard,
.workbench-page.show-advanced .skill-preview { display: block; }

.workbench-page.show-advanced .pipeline { display: flex; }

.validation-loop {
  grid-template-columns: 1fr 360px;
  gap: 20px;
}

.section-heading {
  display: flex; justify-content: space-between; align-items: center;
  margin-bottom: 16px;
}

.section-heading h2 { font-size: 18px; font-weight: 750; }
.section-heading span {
  padding: 4px 10px; border-radius: var(--r-full);
  border: 1px solid var(--border); background: var(--surface-dim);
  font-size: 11px; font-weight: 700; color: var(--text-3);
}

.chat-runtime-note {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 10px; margin-bottom: 12px;
  border-radius: var(--r-full);
  border: 1px solid rgba(255,255,255,0.08);
  background: rgba(255,255,255,0.045);
  font-size: 12px; color: var(--text-2);
}

.chat-thread {
  min-height: 180px; max-height: 400px;
  overflow: auto;
  padding: 8px 4px;
  border-radius: var(--r);
  border: 1px solid rgba(255,255,255,0.08);
  background: rgba(4,6,15,0.26);
}

.chat-message {
  display: grid;
  gap: 6px;
  margin: 0;
  padding: 14px 16px;
  border-bottom: 1px solid rgba(255,255,255,0.055);
}

.chat-message:last-child { border-bottom: 0; }

.chat-message > span {
  color: var(--text-3);
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
}

.chat-message p {
  max-width: 780px;
  color: var(--text);
  font-size: 14px;
  line-height: 1.6;
}

.chat-message.user {
  background: rgba(139,92,246,0.08);
}

.chat-message.assistant.running {
  color: var(--text-2);
  background: rgba(255,255,255,0.035);
}

.chat-message code {
  justify-self: start;
  max-width: 100%;
  border-radius: var(--r-full);
  background: rgba(255,255,255,0.06);
  color: var(--text-3);
  font-size: 11px;
  padding: 4px 8px;
  white-space: normal;
}

.prompt-chips { display: flex; flex-wrap: wrap; gap: 8px; margin: 12px 0; }

.prompt-chips button {
  padding: 6px 14px;
  border-radius: var(--r-full);
  border: 1px solid var(--border);
  background: var(--surface-dim);
  font-size: 12px; font-weight: 600;
  color: var(--text-2);
}

.scenario-suite {
  margin: 16px 0;
  padding: 16px;
  border-radius: var(--r);
  border: 1px solid var(--border-2);
  background: var(--surface-dim);
}

.scenario-suite-topline {
  display: flex; justify-content: space-between; align-items: center;
}

.scenario-suite h3 { font-size: 14px; font-weight: 700; }
.scenario-suite p { font-size: 12px; color: var(--text-3); }

#run-scenarios {
  padding: 6px 16px; border-radius: var(--r-full);
  background: var(--grad-emerald); color: #fff;
  font-size: 12px; font-weight: 700;
}

.chat-form, .modal-chat-form { display: grid; gap: 10px; margin-top: 12px; }

.chat-form label { font-size: 11px; font-weight: 700; text-transform: uppercase; color: var(--text-3); }

#chat-input, #prompt-modal-input {
  width: 100%;
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: var(--r-md);
  background: rgba(255,255,255,0.045);
  color: var(--text);
  padding: 13px 14px; font-size: 14px;
  line-height: 1.5;
  resize: vertical;
}

#chat-input:focus, #prompt-modal-input:focus {
  outline: none; border-color: var(--violet);
  box-shadow: 0 0 0 3px rgba(124,58,237,0.15);
}

.chat-form button, .modal-chat-form button {
  height: 40px; border-radius: var(--r-md);
  background: var(--grad-violet); color: #fff;
  font-size: 14px; font-weight: 700;
}

.chat-form button:disabled,
.modal-chat-form button:disabled {
  cursor: wait;
  filter: grayscale(0.2);
  opacity: 0.66;
}

/* Trace panel */
.trace-panel {
  padding: 20px;
  border-radius: var(--r-xl);
  border: 1px solid var(--border);
  background: var(--bg-elev);
}

.runtime-strip {
  display: flex; align-items: center; gap: 8px;
  padding: 10px 12px; margin-bottom: 12px;
  border-radius: var(--r);
  border: 1px solid var(--border-2);
  background: var(--surface-dim);
  font-size: 12px;
}

.runtime-strip span { color: var(--text-3); }
.runtime-strip strong { color: var(--text); }
.runtime-strip code { font-size: 11px; color: var(--cyan); }

.trace-grid {
  display: grid; grid-template-columns: 1fr 1fr; gap: 8px;
}

.trace-grid > div {
  padding: 10px;
  border-radius: var(--r);
  border: 1px solid var(--border-2);
  background: var(--surface-dim);
}

.trace-grid span { font-size: 10px; font-weight: 700; text-transform: uppercase; color: var(--text-3); }
.trace-grid strong { font-size: 13px; display: block; }
.trace-grid code { font-size: 12px; color: var(--cyan); }

#trace-payload {
  margin: 12px 0; padding: 14px;
  border-radius: var(--r);
  background: #000;
  color: #e0e0e0;
  font-size: 12px; line-height: 1.5;
  overflow: auto; max-height: 200px;
}

.validation-record {
  margin-top: 12px; padding: 16px;
  border-radius: var(--r);
  border: 1px solid var(--border-2);
  background: var(--surface-dim);
}

.validation-record-topline {
  display: flex; justify-content: space-between; align-items: center;
}

.validation-record h3 { font-size: 14px; font-weight: 700; }
.validation-record p { font-size: 12px; color: var(--text-3); }

.validation-actions { display: flex; gap: 8px; margin: 10px 0; }

.validation-actions button {
  padding: 6px 14px; border-radius: var(--r-full);
  background: var(--grad-violet); color: #fff;
  font-size: 12px; font-weight: 700;
}

.validation-actions a {
  padding: 6px 14px; border-radius: var(--r-full);
  border: 1px solid var(--border); background: var(--surface-dim);
  font-size: 12px; font-weight: 600; color: var(--text-2);
}

/* Entity browser / inspector */
.main-grid {
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}

.entity-list, .field-list, .capability-list { display: grid; gap: 8px; }

.entity-list .entity-card,
.field-list .field-item {
  padding: 12px;
  border-radius: var(--r);
  border: 1px solid var(--border-2);
  background: var(--surface-dim);
  transition: border-color 200ms;
}

.entity-list .entity-card:hover,
.entity-list .entity-card.active {
  border-color: rgba(124,58,237,0.4);
  background: rgba(124,58,237,0.04);
}

.detail-row {
  display: flex; justify-content: space-between;
  padding: 8px 0;
  border-bottom: 1px solid var(--border-2);
  font-size: 13px;
}

.detail-row span { color: var(--text-3); }
.detail-row strong { color: var(--text); }
.detail-row code { color: var(--cyan); font-size: 12px; }

/* Ontology review */
.ontology-review-summary {
  display: flex; justify-content: space-between; align-items: center;
  margin-bottom: 16px;
}

.ontology-review-summary p { font-size: 14px; color: var(--text-2); }

#save-ontology-review, #save-review-modal {
  padding: 8px 18px; border-radius: var(--r-full);
  background: var(--grad-violet); color: #fff;
  font-size: 13px; font-weight: 700;
}

.ontology-review-items { display: grid; gap: 8px; }

/* Operations table */
.table-wrap { overflow: auto; }

table {
  width: 100%; border-collapse: collapse;
  font-size: 13px;
}

th, td {
  padding: 10px 8px; text-align: left;
  border-bottom: 1px solid var(--border-2);
}

th {
  font-size: 11px; font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.04em;
  color: var(--text-3);
}

td code { color: var(--cyan); }

/* Check list */
.check-list { display: grid; gap: 6px; }

.check-list .check-item {
  display: flex; align-items: center; gap: 8px;
  padding: 10px 12px;
  border-radius: var(--r);
  border: 1px solid var(--border-2);
  background: var(--surface-dim);
  font-size: 13px;
}

/* Skill preview */
#skill-preview {
  margin: 0; padding: 16px;
  border-radius: var(--r);
  background: #000;
  color: #e0e0e0;
  font-size: 12px; line-height: 1.6;
  overflow: auto; max-height: 420px;
}

/* ==================== Modals ==================== */

.upload-modal[hidden] { display: none; }

.upload-modal {
  position: fixed; inset: 0; z-index: 100;
  display: grid; place-items: center;
  padding: 24px;
}

.upload-modal-backdrop {
  position: absolute; inset: 0;
  background: rgba(0,0,0,0.6);
  backdrop-filter: blur(4px);
}

.upload-modal-card {
  position: relative; z-index: 1;
  width: min(600px, 100%);
  max-height: 85vh;
  display: grid; gap: 16px;
  padding: 24px;
  border-radius: var(--r-xl);
  border: 1px solid var(--border);
  background: var(--bg-elev);
  box-shadow: var(--shadow-lg);
}

.upload-modal-card.wide { width: min(880px, 100%); }
.chat-modal-card {
  width: min(760px, 100%);
  gap: 12px;
}
.report-modal-card {
  width: min(1080px, 100%);
  padding-bottom: 28px;
}
.feedback-modal-card { width: min(560px, 100%); }

.upload-modal-header {
  display: flex; justify-content: space-between; align-items: start;
}

.upload-modal-header h2 { font-size: 22px; font-weight: 750; }

.modal-close, .upload-modal-footer button {
  min-height: 34px; padding: 0 14px;
  border-radius: var(--r);
  border: 1px solid var(--border);
  background: var(--surface-dim);
  color: var(--text-2); font-size: 12px; font-weight: 600;
}

.upload-modal-footer button:first-child,
.upload-modal-footer button#save-review-modal {
  background: var(--grad-violet); border-color: transparent;
  color: #fff;
}

.upload-modal-footer {
  display: flex; gap: 8px;
}

.modal-summary { font-size: 13px; color: var(--text-2); }

.feedback-field {
  display: grid;
  gap: 8px;
  color: var(--text-2);
  font-size: 12px;
  font-weight: 700;
}

.feedback-field textarea {
  width: 100%;
  resize: vertical;
  min-height: 130px;
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  background: rgba(255,255,255,0.04);
  color: var(--text);
  padding: 12px;
  font: inherit;
  line-height: 1.55;
}

.feedback-field textarea:focus {
  outline: none;
  border-color: rgba(167,139,250,0.58);
  box-shadow: 0 0 0 3px rgba(124,58,237,0.14);
}

/* Upload dropzone */
.upload-dropzone {
  display: grid; gap: 12px;
  padding: 20px;
  border: 1px dashed var(--border);
  border-radius: var(--r-lg);
  background: var(--surface-dim);
  transition: border-color 200ms, background 200ms;
}

.upload-dropzone:hover, .upload-dropzone.drag-over {
  border-color: var(--violet);
  background: rgba(124,58,237,0.04);
}

.upload-dropzone-copy, .upload-dropzone-actions, .upload-status {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
}

.upload-dropzone-copy strong { font-size: 15px; }
.upload-dropzone-copy span, .upload-status span { font-size: 12px; color: var(--text-3); }

.upload-dropzone-copy svg { flex-shrink: 0; color: var(--text-3); }

/* Dual upload layout */
.upload-dual-zone {
  display: grid; grid-template-columns: 1fr auto 1fr; gap: 0;
  align-items: stretch;
}

.upload-panel { display: flex; flex-direction: column; }

.upload-divider {
  display: flex; align-items: center; justify-content: center;
  width: 44px; flex-shrink: 0;
  position: relative;
  user-select: none;
}
.upload-divider::before {
  content: '';
  position: absolute; top: 12px; bottom: 12px; left: 50%;
  width: 1px;
  background: var(--border);
}
.upload-divider span {
  display: flex; align-items: center; justify-content: center;
  width: 28px; height: 28px;
  border-radius: 50%;
  background: var(--surface);
  border: 1px solid var(--border);
  font-size: 14px; font-weight: 700; color: var(--text-3);
  z-index: 1;
}

/* API panel (left) — document theme */
#upload-api-panel .upload-dropzone {
  border-color: rgba(124,58,237,0.18);
  background: rgba(124,58,237,0.025);
  border-style: solid; border-width: 2px;
  border-radius: var(--r-lg);
  position: relative; overflow: hidden;
}
#upload-api-panel .upload-dropzone::before {
  content: '';
  position: absolute; top: 0; left: 0; right: 0; height: 3px;
  background: var(--grad-violet);
  border-radius: var(--r-lg) var(--r-lg) 0 0;
}
#upload-api-panel .upload-dropzone:hover,
#upload-api-panel .upload-dropzone.drag-over {
  border-color: var(--violet);
  background: rgba(124,58,237,0.06);
}
#upload-api-panel .upload-dropzone-copy svg { color: var(--violet); }

/* DDL panel (right) — database theme */
#upload-ddl-panel .upload-dropzone {
  border-color: rgba(99,102,241,0.18);
  background: rgba(99,102,241,0.025);
  border-style: solid; border-width: 2px;
  border-radius: var(--r-lg);
  position: relative; overflow: hidden;
}
#upload-ddl-panel .upload-dropzone::before {
  content: '';
  position: absolute; top: 0; left: 0; right: 0; height: 3px;
  background: var(--violet-2);
  border-radius: var(--r-lg) var(--r-lg) 0 0;
}
#upload-ddl-panel .upload-dropzone:hover,
#upload-ddl-panel .upload-dropzone.drag-over {
  border-color: var(--violet-2);
  background: rgba(99,102,241,0.06);
}
#upload-ddl-panel .upload-dropzone-copy svg { color: var(--violet-2); }

/* Panel labels above drop zones */
.upload-panel-label {
  font-size: 12px; font-weight: 700; text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 8px;
  display: flex; align-items: center; gap: 8px;
}
.upload-panel-label::after {
  content: ''; flex: 1; height: 1px;
  background: var(--border);
}
#upload-api-panel .upload-panel-label { color: var(--violet); }
#upload-ddl-panel .upload-panel-label { color: var(--violet-2); }

.required-badge, .optional-badge {
  display: inline-block; font-size: 10px; font-weight: 700;
  padding: 1px 6px; border-radius: var(--r-full);
  vertical-align: middle; margin-left: 4px;
}

.required-badge { background: #ef4444; color: #fff; }
.optional-badge { background: var(--violet-2); color: #fff; }

.secondary-action {
  background: transparent; color: var(--violet-2);
  border: 1px solid var(--violet-2);
}

.clear-ddl-btn {
  position: absolute; top: 8px; right: 8px;
  background: none; border: none;
  color: var(--text-3); font-size: 12px;
  cursor: pointer; padding: 2px 8px;
  border-radius: var(--r-sm);
}
.clear-ddl-btn:hover { color: var(--danger); background: rgba(239,68,68,0.08); }

.upload-modal-hint {
  margin-top: 4px;
  font-size: 13px; line-height: 1.5; color: var(--text-2);
  max-width: 620px;
}

@media (max-width: 720px) {
  .upload-dual-zone { grid-template-columns: 1fr; }
  .upload-divider { justify-content: center; padding: 8px 0; }
}

.upload-context-section {
  margin-top: 14px;
  display: grid;
  gap: 10px;
}

.context-toggle {
  width: 100%;
  min-height: 52px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 12px 16px;
  border-radius: var(--r-lg);
  border: 1px solid var(--border);
  background: rgba(255,255,255,0.035);
  color: var(--text);
  cursor: pointer;
}

.context-toggle:hover,
.context-toggle[aria-expanded="true"] {
  border-color: rgba(45,212,191,0.45);
  background: rgba(45,212,191,0.06);
}

.context-toggle span {
  font-size: 14px;
  font-weight: 760;
}

.context-toggle small {
  color: var(--text-3);
  font-size: 12px;
  text-align: right;
}

.context-upload-panel {
  display: grid;
  gap: 10px;
}

.context-upload-panel[hidden] { display: none; }

.context-dropzone {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 82px;
  padding: 16px;
  border: 1px dashed rgba(45,212,191,0.45);
  border-radius: var(--r-lg);
  background: rgba(45,212,191,0.045);
  cursor: pointer;
}

.context-dropzone:hover,
.context-dropzone.drag-over {
  border-color: var(--accent);
  background: rgba(45,212,191,0.08);
}

.context-dropzone strong {
  display: block;
  font-size: 14px;
  font-weight: 760;
}

.context-dropzone span {
  display: block;
  margin-top: 4px;
  color: var(--text-3);
  font-size: 12px;
  line-height: 1.5;
}

.context-file-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  min-height: 0;
}

.context-file-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  max-width: 100%;
  min-height: 32px;
  padding: 6px 10px;
  border-radius: var(--r-full);
  border: 1px solid rgba(45,212,191,0.28);
  background: rgba(45,212,191,0.08);
  color: var(--text-2);
  font-size: 12px;
  font-weight: 650;
}

.context-file-chip span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: min(260px, 58vw);
}

.context-file-chip button {
  width: 20px;
  height: 20px;
  border: 0;
  border-radius: var(--r-full);
  background: rgba(255,255,255,0.08);
  color: var(--text-3);
  cursor: pointer;
}

.context-file-chip button:hover {
  color: var(--text);
  background: rgba(255,255,255,0.14);
}

.file-action {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 36px; padding: 0 16px;
  border-radius: var(--r-full);
  background: var(--grad-violet); color: #fff;
  font-size: 13px; font-weight: 700;
}

.upload-progress {
  width: 160px; height: 6px;
  border-radius: var(--r-full);
  background: var(--faint); overflow: hidden;
}

.upload-progress span {
  display: block; height: 100%; width: 0;
  border-radius: inherit;
  background: var(--grad-violet);
  transition: width 200ms;
}

/* Sample choice grid */
.sample-choice-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 12px;
}

.sample-choice-grid-single {
  grid-template-columns: minmax(0, 1fr);
}

.sample-choice-grid button {
  display: grid; gap: 6px;
  padding: 20px;
  border-radius: var(--r-lg);
  border: 1px solid var(--border);
  background: var(--surface-dim);
  text-align: left;
  transition: border-color 200ms, transform 200ms;
}

.sample-choice-grid button:hover {
  border-color: var(--violet);
  transform: translateY(-2px);
}

.sample-choice-grid button:disabled {
  cursor: wait;
  opacity: 0.68;
}

.sample-choice-grid button.loading {
  border-color: var(--violet);
  box-shadow: 0 0 0 3px rgba(124,58,237,0.16);
  position: relative;
}

.sample-choice-grid button.loading::after {
  content: "";
  width: 16px;
  height: 16px;
  border-radius: 999px;
  border: 2px solid rgba(255,255,255,0.26);
  border-top-color: var(--violet-2);
  position: absolute;
  right: 18px;
  top: 18px;
  animation: spin 700ms linear infinite;
}

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

.sample-choice-grid strong { font-size: 16px; }
.sample-choice-grid span { font-size: 13px; color: var(--text-2); }

/* Review modal */
.review-modal-body {
  display: grid; gap: 16px; overflow: auto;
}

.semantic-review-map, .semantic-review-workspace {
  padding: 16px;
  border-radius: var(--r);
  border: 1px solid var(--border-2);
  background: var(--surface-dim);
  min-height: 100px;
}

.semantic-review-relationship-graph {
  display: grid;
  gap: 12px;
  margin: 14px 0;
  padding: 12px;
  border: 1px solid var(--border-2);
  border-radius: var(--r);
  background: rgba(4,6,15,0.32);
}

.semantic-review-graph-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 240px;
  gap: 12px;
  align-items: stretch;
}

.semantic-review-relationship-graph .semantic-graph {
  min-height: 360px;
}

.semantic-review-relationship-graph .semantic-model-detail {
  min-height: 0;
}

.modal-scroll-list {
  display: grid; gap: 8px;
  max-height: 300px; overflow: auto;
}

/* Chat thread */
.chat-thread, .modal-chat-thread {
  min-height: 200px; max-height: 400px;
  overflow: auto;
  padding: 8px 4px;
  border-radius: var(--r);
  border: 1px solid rgba(255,255,255,0.08);
  background: rgba(4,6,15,0.26);
}

.modal-chat-form { display: grid; gap: 10px; }

/* Report */
.report-summary-grid {
  display: grid;
  gap: 16px;
}

.report-hero {
  display: flex;
  justify-content: space-between;
  gap: 24px;
  align-items: center;
  min-height: 128px;
  padding: 22px;
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: var(--r-lg);
  background:
    linear-gradient(135deg, rgba(168,85,247,0.16), rgba(14,165,233,0.1)),
    rgba(255,255,255,0.035);
}

.report-hero.ready {
  background:
    linear-gradient(135deg, rgba(16,185,129,0.16), rgba(14,165,233,0.1)),
    rgba(255,255,255,0.035);
}

.report-hero.blocked {
  background:
    linear-gradient(135deg, rgba(244,63,94,0.16), rgba(168,85,247,0.1)),
    rgba(255,255,255,0.035);
}

.report-hero span,
.report-metric-card span,
.report-detail-panel > span {
  display: block;
  color: #a855f7;
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0;
  text-transform: uppercase;
}

.report-hero strong {
  display: block;
  margin-top: 8px;
  color: var(--text);
  font-size: clamp(26px, 3vw, 38px);
  font-weight: 950;
  line-height: 1.05;
}

.report-hero p {
  margin: 10px 0 0;
  max-width: 620px;
  color: var(--text-2);
  font-size: 14px;
  line-height: 1.55;
}

.report-hero b {
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  width: 104px;
  height: 104px;
  border: 1px solid rgba(255,255,255,0.16);
  border-radius: 50%;
  background: rgba(4,6,15,0.42);
  box-shadow: inset 0 0 0 8px rgba(168,85,247,0.12), 0 18px 44px rgba(0,0,0,0.22);
  color: #f8fafc;
  font-size: 34px;
  font-weight: 950;
}

.report-metric-row {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.report-metric-card,
.report-detail-panel {
  min-width: 0;
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: var(--r);
  background: rgba(255,255,255,0.045);
  box-shadow: 0 14px 34px rgba(0,0,0,0.12);
}

.report-metric-card {
  min-height: 126px;
  padding: 16px;
}

.report-metric-card strong {
  display: block;
  margin-top: 12px;
  color: var(--text);
  font-size: 22px;
  font-weight: 950;
  line-height: 1.08;
  overflow-wrap: anywhere;
}

.report-metric-card p {
  margin: 8px 0 0;
  color: var(--text-3);
  font-size: 12px;
  line-height: 1.4;
}

.report-detail-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, 0.95fr);
  gap: 12px;
}

.report-detail-panel {
  padding: 16px;
}

.report-detail-panel div {
  display: grid;
  gap: 8px;
  margin-top: 12px;
}

.report-detail-panel p {
  margin: 0;
  padding: 10px 12px;
  border-radius: var(--r-sm);
  background: rgba(4,6,15,0.24);
  color: var(--text-2);
  font-size: 13px;
  line-height: 1.45;
}

.modal-report-frame {
  width: 100%; min-height: 300px;
  border: 1px solid var(--border);
  border-radius: var(--r);
  background: var(--bg);
}

/* ==================== Codex Additions — Language / Account / Profile / Trust ==================== */

/* Language switch */
.language-switch {
  display: inline-flex; gap: 2px;
  border: 1px solid var(--border);
  border-radius: var(--r-full);
  padding: 3px;
  background: var(--surface-dim);
}
.language-switch button {
  min-height: 26px; padding: 0 10px;
  border-radius: var(--r-full);
  font-size: 11px; font-weight: 700;
  color: var(--text-3);
  transition: color 200ms, background 200ms;
}
.language-switch button[aria-pressed="true"] {
  color: var(--text);
  background: var(--faint);
}

/* Account menu */
.account-menu-trigger {
  position: relative;
  min-height: 32px; padding: 0 14px;
  display: inline-flex; align-items: center; gap: 6px;
  border: 1px solid var(--border);
  border-radius: var(--r-full);
  background: var(--surface-dim);
  font-size: 12px; font-weight: 600;
  color: var(--text-2);
  transition: border-color 200ms;
}
.account-menu-trigger:hover { border-color: var(--violet); }
.account-menu-trigger::after {
  content: '▾'; font-size: 9px; color: var(--text-3);
}
.account-menu {
  position: absolute; top: calc(100% + 6px); right: 0;
  z-index: 60;
  display: grid; gap: 2px;
  min-width: 160px;
  padding: 6px;
  border-radius: var(--r);
  border: 1px solid var(--border);
  background: var(--bg-elev);
  box-shadow: var(--shadow);
}
.account-menu[hidden] { display: none; }
.account-summary:not(:hover):not(:focus-within):not(.menu-open) .account-menu {
  display: none;
}
.account-menu button {
  min-height: 32px; padding: 0 12px;
  display: flex; align-items: center;
  border-radius: var(--r-sm);
  font-size: 13px; font-weight: 500;
  color: var(--text-2);
  transition: background 150ms, color 150ms;
}
.account-menu button:hover {
  background: var(--faint);
  color: var(--text);
}

/* OAuth sign-in */
.oauth-signin-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}
.oauth-signin {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 42px;
  border-radius: var(--r);
  border: 1px solid var(--border);
  background: var(--surface-dim);
  font-size: 13px; font-weight: 600;
  color: var(--text);
  transition: border-color 200ms, background 200ms;
}
.oauth-signin:hover {
  border-color: rgba(255,255,255,0.2);
  background: var(--faint);
}
.oauth-signin span {
  width: 20px; height: 20px;
  display: grid; place-items: center;
  border-radius: 50%;
  background: #fff; color: #4285f4;
  font-size: 12px; font-weight: 800;
}
.wechat-signin span {
  background: #07c160;
  color: #fff;
}
.oauth-signin.disabled {
  opacity: 0.54;
  cursor: not-allowed;
}
.oauth-setup-hint {
  margin: -2px 0 2px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
}

/* Profile modal */
.profile-modal[hidden] { display: none; }
.profile-modal {
  position: fixed; inset: 0; z-index: 100;
  display: grid; place-items: center;
  padding: 24px;
}
.profile-shell {
  position: relative; z-index: 1;
  width: min(880px, 100%);
  max-height: 85vh;
  display: grid;
  grid-template-columns: 200px 1fr;
  gap: 0;
  border-radius: var(--r-xl);
  border: 1px solid var(--border);
  background: var(--bg-elev);
  box-shadow: var(--shadow-lg);
  overflow: hidden;
}
.profile-nav {
  display: flex; flex-direction: column; gap: 2px;
  padding: 24px 16px;
  border-right: 1px solid var(--border);
  background: var(--surface-dim);
}
.profile-brand {
  display: flex; align-items: center; gap: 8px;
  margin-bottom: 20px;
}
.profile-brand strong { font-size: 14px; font-weight: 700; }
.profile-nav button {
  min-height: 36px; padding: 0 14px;
  display: flex; align-items: center;
  border-radius: var(--r);
  font-size: 13px; font-weight: 500;
  color: var(--text-2);
  transition: background 150ms, color 150ms;
}
.profile-nav button:hover {
  background: var(--faint);
  color: var(--text);
}
.profile-nav button.active {
  background: var(--grad-violet);
  color: #fff;
  font-weight: 600;
}
.profile-content {
  display: grid; gap: 16px;
  padding: 24px;
  overflow: auto;
}
.profile-header {
  display: flex; justify-content: space-between; align-items: start;
}
.profile-header h2 { font-size: 22px; font-weight: 750; }
.profile-header p { font-size: 13px; color: var(--text-2); margin-top: 4px; }
.profile-panel {
  display: grid; gap: 12px;
}

.profile-section {
  display: grid;
  gap: 12px;
}

.profile-section h3 {
  margin: 0;
  font-size: 14px;
  font-weight: 750;
  color: var(--text);
}

.settings-card,
.settings-table,
.usage-card,
.profile-edit-card {
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: var(--r);
  background: rgba(255,255,255,0.035);
}

.profile-edit-card {
  display: grid;
}

.profile-edit-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  padding: 16px;
  border-top: 1px solid var(--border-2);
}

.profile-edit-grid label {
  display: grid;
  gap: 7px;
  min-width: 0;
  font-size: 12px;
  font-weight: 750;
  color: var(--text-2);
}

.profile-edit-grid input {
  min-width: 0;
  height: 42px;
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  background: rgba(255,255,255,0.04);
  color: var(--text);
  padding: 0 12px;
  font-size: 13px;
  font-weight: 650;
  outline: none;
}

.profile-edit-grid input:focus {
  border-color: rgba(168,85,247,0.65);
  box-shadow: 0 0 0 3px rgba(168,85,247,0.16);
}

.profile-edit-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 16px;
  border-top: 1px solid var(--border-2);
}

.profile-edit-actions p {
  margin: 0;
  color: var(--text-2);
  font-size: 12px;
  line-height: 1.4;
}

.profile-edit-actions button {
  min-height: 34px;
  padding: 0 14px;
  border: 0;
  border-radius: var(--r-sm);
  background: var(--grad-violet);
  color: #fff;
  font-size: 12px;
  font-weight: 850;
  cursor: pointer;
}

.profile-edit-actions button:disabled {
  cursor: wait;
  opacity: 0.7;
}

.settings-row {
  min-height: 58px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 18px;
  padding: 13px 16px;
  border-top: 1px solid var(--border-2);
}

.settings-row:first-child { border-top: 0; }

.settings-row > div {
  min-width: 0;
  display: grid;
  gap: 4px;
}

.settings-row strong {
  font-size: 13px;
  line-height: 1.25;
  color: var(--text);
}

.settings-row span,
.settings-row p {
  margin: 0;
  font-size: 12px;
  line-height: 1.45;
  color: var(--text-2);
}

.settings-row b {
  max-width: 260px;
  justify-self: end;
  overflow-wrap: anywhere;
  text-align: right;
  font-size: 13px;
  line-height: 1.35;
  color: var(--text);
}

.settings-row.action-row button,
.history-row button,
.history-row a {
  min-height: 32px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 12px;
  border-radius: var(--r-sm);
  border: 1px solid var(--border);
  background: var(--surface-dim);
  color: var(--text);
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
}

.settings-row.action-row button:hover,
.history-row button:hover,
.history-row a:hover {
  border-color: rgba(168,85,247,0.5);
  background: rgba(124,58,237,0.18);
}

.avatar-row {
  min-height: 74px;
}

.profile-avatar {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  overflow: hidden;
  border-radius: var(--r-sm);
  background: var(--grad-violet);
  color: #fff;
  font-size: 15px;
  font-weight: 850;
  box-shadow: 0 10px 24px rgba(124,58,237,0.28);
}

.profile-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.accent-value {
  color: var(--emerald-2) !important;
}

.usage-card {
  display: grid;
  gap: 12px;
  padding: 16px;
}

.usage-top {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
}

.usage-top strong {
  font-size: 22px;
  font-weight: 850;
}

.usage-top span,
.usage-card p {
  margin: 0;
  color: var(--text-2);
  font-size: 12px;
}

.usage-bar {
  height: 8px;
  overflow: hidden;
  border-radius: var(--r-full);
  background: rgba(255,255,255,0.08);
}

.usage-bar span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--emerald-2), var(--violet-2));
}

.settings-table {
  display: grid;
  max-height: min(360px, 42vh);
  overflow: auto;
}

.settings-table-row {
  display: grid;
  grid-template-columns: minmax(180px, 1.5fr) minmax(120px, 1fr) minmax(90px, auto);
  gap: 14px;
  align-items: center;
  min-height: 48px;
  padding: 12px 16px;
  border-top: 1px solid var(--border-2);
  font-size: 12px;
  color: var(--text-2);
}

.settings-table-row:first-child { border-top: 0; }

.settings-table-row span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.settings-table-row span:first-child {
  color: var(--text);
  font-weight: 700;
}

.history-row {
  grid-template-columns: minmax(160px, 1.2fr) minmax(220px, 1.5fr) minmax(120px, auto) auto;
}

@media (max-width: 760px) {
  .profile-edit-grid {
    grid-template-columns: 1fr;
  }

  .profile-edit-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .report-hero {
    align-items: flex-start;
    flex-direction: column;
    gap: 16px;
    padding: 18px;
  }

  .report-hero b {
    width: 82px;
    height: 82px;
    font-size: 27px;
  }

  .report-metric-row,
  .report-detail-grid {
    grid-template-columns: 1fr;
  }
}

.profile-empty {
  padding: 16px;
  border: 1px dashed var(--border);
  border-radius: var(--r);
  color: var(--text-2);
  background: rgba(255,255,255,0.025);
  font-size: 13px;
}

/* Upload trust panel */
.upload-trust-panel {
  display: grid; gap: 10px;
  padding: 16px;
  border-radius: var(--r);
  border: 1px solid var(--border-2);
  background: var(--surface-dim);
}
.upload-trust-panel[hidden] { display: none; }

/* Registry recommendations */
.registry-recommendations {
  display: grid; gap: 8px;
  padding: 16px;
  border-radius: var(--r);
  border: 1px solid var(--border-2);
  background: var(--surface-dim);
}
.registry-recommendations:empty { display: none; }

/* ==================== Codex Additions — Layout & Panels ==================== */

/* Workbench content wrapper */
.workbench-content {
  display: grid;
  gap: 20px;
}

/* Chat panel (validation-loop inner) */
.chat-panel {
  display: grid; gap: 0;
}

/* Sidebar panel variants — inherit from .sidebar-panel, add subtle distinctions */
.package-browser { border-color: var(--border-2); }
.artifact-panel { border-color: var(--border-2); }
.activity-panel { border-color: var(--border-2); }

/* Dynamic containers */
.scenario-cases { display: grid; gap: 8px; }
.validation-cases { display: grid; gap: 8px; }

/* Tool panel sub-sections — inherit .tool-panel, no overrides needed */
.entity-browser, .inspector, .operations, .verify-panel { /* styled by .tool-panel */ }

/* Pipeline done state */
.pipeline .stage.done span {
  background: var(--grad-emerald);
}
.pipeline .stage.done::after {
  background: var(--grad-emerald);
}

/* Generic secondary button — used across modals */
button.secondary,
.upload-modal-footer button.secondary {
  background: var(--surface-dim) !important;
  border: 1px solid var(--border) !important;
  color: var(--text-2) !important;
}
button.secondary:hover {
  background: var(--faint) !important;
  color: var(--text) !important;
}

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

@media (max-width: 960px) {
  .landing-hero { grid-template-columns: 1fr; }
  .sample-showcase { grid-template-columns: 1fr; }
  .poc-steps { grid-template-columns: repeat(2, 1fr); }
  .validation-loop { grid-template-columns: 1fr; }
  .main-grid { grid-template-columns: 1fr; }
  .hero-workspace { grid-template-columns: 1fr; }
  .account-gate { grid-template-columns: 1fr; }
  .readiness-review { grid-template-columns: 1fr; }
  .semantic-model-canvas { grid-template-columns: 1fr; }
  .semantic-review-graph-layout { grid-template-columns: 1fr; }
  .ontology-workbench {
    grid-template-columns: 1fr;
    grid-template-areas:
      "explorer"
      "object"
      "actions"
      "graph";
  }
  .ontology-property-grid { grid-template-columns: 1fr; }
  .semantic-graph-workbench { grid-template-columns: 1fr; }
  .semantic-graph-topline { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .workbench-page.show-system-details .workbench-layout { grid-template-columns: 1fr; }
  .profile-shell { grid-template-columns: 1fr; }
  .profile-nav { flex-direction: row; flex-wrap: wrap; border-right: 0; border-bottom: 1px solid var(--border); }
  .sample-choice-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .sample-choice-grid-single { grid-template-columns: minmax(0, 1fr); }
}

@media (max-width: 640px) {
  .landing-main, .workbench-main { padding: 0 16px 48px; }
  .landing-header, .global-header { padding: 0 16px; }
  .sample-showcase { padding: 18px; }
  .sample-metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .sample-deliverables-list li { display: grid; gap: 4px; }
  .run-progress-banner {
    top: 68px;
    grid-template-columns: 1fr;
    gap: 10px;
  }
  .run-progress-copy strong { white-space: normal; }
  .run-progress-meter em { justify-self: start; }
  .guided-stepper { grid-template-columns: 1fr 1fr; }
  .guide-card { grid-template-columns: 1fr; }
  .guide-card-use { grid-template-columns: 1fr; }
  .guide-actions { min-width: 0; }
  .guide-card-validate .guide-actions {
    grid-template-columns: 1fr;
  }
  .guide-card-validate .guide-footnote {
    justify-self: stretch;
    max-width: none;
    text-align: left;
  }
  .guide-platform-row {
    grid-template-columns: 1fr;
    gap: 5px;
  }
  .oauth-signin-row { grid-template-columns: 1fr; }
  .sample-choice-grid { grid-template-columns: 1fr; }
  .sample-choice-grid-single { grid-template-columns: minmax(0, 1fr); }
  .semantic-graph-topline { grid-template-columns: 1fr; }
  .ontology-object-card-head strong { font-size: 22px; }
  .poc-steps { grid-template-columns: 1fr; }
  .console-grid { grid-template-columns: 1fr 1fr; }
  .landing-nav, nav[aria-label="Product sections"] { display: none; }
}

/* ── LLM API Config ── */

.profile-notice {
  display: flex; align-items: flex-start; gap: 10px;
  padding: 14px 18px; margin-bottom: 18px;
  background: rgba(59, 130, 246, 0.08); border: 1px solid rgba(59, 130, 246, 0.18);
  border-radius: var(--r-md); font-size: 13px; color: var(--text-2);
  line-height: 1.6;
}
.profile-notice svg { flex-shrink: 0; margin-top: 1px; color: var(--accent); }

.llm-select {
  padding: 8px 14px; border: 1px solid var(--border); border-radius: var(--r-sm);
  background: var(--bg); color: var(--text); font-size: 14px;
  min-width: 200px;
}

.llm-provider-picker {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  width: min(520px, 100%);
}

.llm-provider-card {
  min-width: 0;
  min-height: 58px;
  padding: 10px 12px;
  border-radius: var(--r-md);
  border: 1px solid rgba(255,255,255,0.1);
  background: rgba(255,255,255,0.045);
  color: var(--text);
  cursor: pointer;
  text-align: left;
  transition: border-color 160ms ease, background 160ms ease, transform 160ms ease;
}

.llm-provider-card:hover {
  border-color: rgba(168,85,247,0.52);
  background: rgba(139,92,246,0.12);
}

.llm-provider-card.selected {
  border-color: rgba(168,85,247,0.82);
  background: linear-gradient(135deg, rgba(124,58,237,0.24), rgba(14,165,233,0.12));
  box-shadow: inset 0 0 0 1px rgba(255,255,255,0.06);
}

.llm-provider-card strong {
  display: block;
  color: var(--text);
  font-size: 13px;
  font-weight: 850;
}

.llm-provider-card span {
  display: block;
  margin-top: 4px;
  color: var(--text-3);
  font-size: 11px;
  font-weight: 650;
}

.llm-input {
  padding: 8px 14px; border: 1px solid var(--border); border-radius: var(--r-sm);
  background: var(--bg); color: var(--text); font-size: 14px;
  min-width: 280px; font-family: ui-monospace, monospace;
}

.llm-key-group {
  display: flex; align-items: center; gap: 8px;
}
.llm-key-group .btn-icon {
  display: flex; align-items: center; justify-content: center;
  width: 36px; height: 36px; border: 1px solid var(--border);
  border-radius: var(--r-sm); background: var(--bg); color: var(--text-2);
  cursor: pointer;
}
.llm-key-group .btn-icon:hover { background: var(--hover); color: var(--text); }

.llm-status { font-size: 13px; margin-left: 12px; }
.llm-status .llm-success { color: #10b981; }
.llm-status .llm-error { color: #ef4444; }

.btn-danger {
  padding: 8px 20px; border: 1px solid rgba(239, 68, 68, 0.3); border-radius: var(--r-sm);
  background: transparent; color: #ef4444; font-size: 14px; cursor: pointer;
  margin-left: 12px;
}
.btn-danger:hover { background: rgba(239, 68, 68, 0.08); }

.action-card {
  display: flex; align-items: center; padding: 16px 0;
}

/* ── Guide LLM Nudge ── */

.guide-llm-nudge {
  display: flex; flex-wrap: wrap; align-items: center; gap: 12px;
  margin-top: 14px; padding: 12px 16px;
  background: rgba(139, 92, 246, 0.06); border: 1px solid rgba(139, 92, 246, 0.15);
  border-radius: var(--r-md); font-size: 13px;
}
.llm-nudge-status { color: var(--text-2); }
.llm-nudge-status.configured { color: #10b981; font-weight: 600; }
.guide-llm-link {
  padding: 5px 14px; border: 1px solid var(--accent); border-radius: var(--r-sm);
  background: var(--accent); color: #fff; font-size: 13px; cursor: pointer;
  white-space: nowrap;
}
.guide-llm-link:hover { filter: brightness(1.1); }
.llm-nudge-encrypt {
  color: var(--text-3); font-size: 12px; margin-left: auto;
}

@media (max-width: 980px) {
  .semantic-suggestions-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 640px) {
  .semantic-suggestions-header {
    display: grid;
  }

  .semantic-suggestions-grid {
    grid-template-columns: 1fr;
  }
}
