:root {
  --vs-bg: var(--pg-canvas);
  --vs-panel: var(--pg-surface-panel);
  --vs-panel-solid: var(--pg-surface-panel-solid);
  --vs-line: var(--pg-border);
  --vs-line-strong: var(--pg-border-accent);
  --vs-text: var(--pg-text);
  --vs-muted: var(--pg-text-secondary);
  --vs-dim: var(--pg-text-dim);
  --vs-accent: var(--brand-primary-500);
  --vs-accent-2: var(--brand-secondary-500);
  --vs-danger: var(--brand-danger);
  --vs-hold: var(--brand-warning);
  --vs-shadow: var(--pg-shadow-panel);
  --vs-radius: var(--pg-radius-lg);
  --vs-mono: var(--brand-font-mono);
  --vs-sans: var(--brand-font-body), var(--brand-font-cn);
  --vs-ease: var(--ms-ease-standard);
  --vs-duration: var(--ms-duration-base);
  --vs-duration-fast: var(--ms-duration-fast);
}

* { box-sizing: border-box; }
html { min-width: 320px; background: var(--vs-bg); overflow-x: clip; }
body {
  margin: 0;
  min-height: 100vh;
  color: var(--vs-text);
  font-family: var(--vs-sans);
  overflow-x: clip;
  max-width: 100%;
  background: var(--pg-ambient);
}

button, input, textarea, select { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
a { color: inherit; }
[hidden] { display: none !important; }
.lang-cn { display: none; }
html[data-lang="cn"] .lang-en { display: none; }
html[data-lang="cn"] .lang-cn { display: inline; }
p.lang-cn { display: none; }
html[data-lang="cn"] p.lang-cn { display: block; }

.vs-brand,
.vs-trust-chip,
.vs-lang,
.vs-back,
.vs-primary-link,
.vs-segmented label,
.vs-fact,
.vs-generate,
.vs-export-bar button,
.vs-field input,
.vs-field textarea,
.vs-field select {
  transition:
    color var(--vs-duration-fast) var(--vs-ease),
    background-color var(--vs-duration-fast) var(--vs-ease),
    border-color var(--vs-duration-fast) var(--vs-ease),
    box-shadow var(--vs-duration) var(--vs-ease),
    transform var(--vs-duration) var(--vs-ease),
    opacity var(--vs-duration) var(--vs-ease);
}

.vs-brand:focus-visible,
.vs-lang:focus-visible,
.vs-back:focus-visible,
.vs-primary-link:focus-visible,
.vs-generate:focus-visible,
.vs-export-bar button:focus-visible,
.vs-field input:focus-visible,
.vs-field textarea:focus-visible,
.vs-field select:focus-visible,
.vs-segmented label:focus-within,
.vs-fact:focus-within {
  outline: 2px solid var(--ms-accent);
  outline-offset: 2px;
}

.vs-lang:active,
.vs-back:active,
.vs-primary-link:active,
.vs-generate:active:not(:disabled),
.vs-export-bar button:active:not(:disabled) {
  transform: translateY(1px);
}

.vs-grain {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 20;
  opacity: .035;
  background-image: repeating-linear-gradient(0deg, transparent 0 2px, var(--ms-text) 3px);
  mix-blend-mode: overlay;
}

.vs-header {
  height: 76px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 0 clamp(20px, 4vw, 68px);
  border-bottom: 1px solid var(--vs-line);
  background: var(--ms-deep);
  box-shadow: var(--ms-shadow-sm);
  position: sticky;
  top: 0;
  z-index: 10;
}

.vs-brand {
  display: flex;
  align-items: center;
  gap: 13px;
  text-decoration: none;
}
.vs-brand img { filter: none; }
.vs-brand > span { display: grid; gap: 2px; }
.vs-brand strong { font-size: 14px; letter-spacing: .19em; }
.vs-brand small { color: var(--vs-muted); font-size: 12px; }
.vs-header-actions { display: flex; align-items: center; gap: 11px; }
.vs-trust-chip, .vs-lang, .vs-back {
  border: 1px solid var(--vs-line);
  border-radius: 999px;
  min-height: 38px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 0 14px;
  background: var(--ms-elevated);
  color: var(--vs-muted);
  text-decoration: none;
  font-size: 12px;
}
.vs-lang { color: var(--vs-text); cursor: pointer; }
.vs-back:hover, .vs-lang:hover { border-color: var(--vs-line-strong); color: var(--vs-text); background: var(--ms-hover); }
.vs-trust-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--vs-accent); box-shadow: 0 0 0 1px rgba(45, 224, 183, .35); }

.vs-shell { width: min(1880px, calc(100% - 40px)); margin: 0 auto; padding: 58px 0 72px; }
.vs-hero { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: end; gap: 52px; padding: 0 8px 44px; }
.vs-kicker { color: var(--vs-accent); font: 750 11px/1.4 var(--vs-mono); letter-spacing: .22em; margin: 0 0 16px; }
.vs-hero h1 { max-width: 900px; margin: 0; font-size: clamp(36px, 4.2vw, 72px); line-height: 1.02; letter-spacing: -.045em; }
.vs-hero-copy { max-width: 800px; margin: 22px 0 0; color: var(--vs-muted); font-size: 16px; line-height: 1.7; }
.vs-hero-proof { display: grid; grid-template-columns: repeat(3, minmax(110px, 1fr)); gap: 1px; padding: 1px; border: 1px solid var(--vs-line); border-radius: 18px; overflow: hidden; background: var(--vs-line); }
.vs-hero-proof div { display: grid; gap: 6px; min-height: 104px; padding: 20px; background: var(--vs-panel-solid); box-shadow: var(--ms-shadow-xs); }
.vs-hero-proof strong { color: var(--vs-accent); font: 700 20px var(--vs-mono); font-variant-numeric: tabular-nums; }
.vs-hero-proof span { color: var(--vs-muted); font-size: 11px; max-width: 110px; }

.vs-auth-card { display: flex; align-items: center; gap: 24px; max-width: 860px; padding: 28px; margin: 20px auto; border: 1px solid var(--vs-line-strong); border-radius: var(--vs-radius); background: var(--vs-panel-solid); box-shadow: var(--vs-shadow); }
.vs-lock { display: grid; place-items: center; width: 60px; height: 60px; flex: 0 0 auto; border-radius: 18px; background: var(--ms-accent-dim); color: var(--vs-accent); font-size: 28px; }
.vs-auth-card h2 { margin: 0 0 6px; }
.vs-auth-card p { margin: 0; color: var(--vs-muted); }
.vs-primary-link { margin-left: auto; padding: 12px 18px; border-radius: var(--pg-radius-md); background: var(--vs-accent); color: var(--pg-canvas); text-decoration: none; font-weight: 750; white-space: nowrap; }
.vs-primary-link:hover { background: var(--ms-accent-bright); color: var(--ms-text-inverse); }

.vs-workspace { display: grid; grid-template-columns: minmax(330px, .72fr) minmax(600px, 1.45fr) minmax(300px, .62fr); gap: 18px; align-items: start; }
.vs-panel { border: 1px solid var(--vs-line); border-radius: var(--vs-radius); background: var(--vs-panel-solid); box-shadow: var(--vs-shadow); overflow: hidden; }
.vs-controls, .vs-receipt { padding: 24px; }
.vs-panel-head { display: flex; align-items: center; gap: 13px; margin-bottom: 24px; }
.vs-panel-head h2 { font-size: 18px; margin: 0; }
.vs-panel-head p { color: var(--vs-muted); font-size: 11px; margin: 4px 0 0; }
.vs-step { display: grid; place-items: center; width: 40px; height: 40px; border-radius: 13px; border: 1px solid var(--vs-line-strong); color: var(--vs-accent); font: 700 12px var(--vs-mono); font-variant-numeric: tabular-nums; }

.vs-segmented { border: 0; padding: 0; margin: 0 0 18px; }
.vs-segmented legend, .vs-field > span, .vs-subhead { display: block; margin-bottom: 8px; color: var(--vs-muted); font: 650 10px/1.4 var(--vs-mono); letter-spacing: .09em; text-transform: uppercase; }
.vs-segmented { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.vs-segmented legend { grid-column: 1 / -1; }
.vs-segmented label { position: relative; display: flex; min-height: 74px; padding: 13px; border: 1px solid var(--vs-line); border-radius: 14px; cursor: pointer; background: var(--ms-deep); }
.vs-segmented input { position: absolute; opacity: 0; }
.vs-segmented label:has(input:checked) { border-color: var(--vs-accent); background: var(--ms-accent-muted); }
.vs-segmented label:hover { border-color: var(--vs-line-strong); background: var(--ms-hover); }
.vs-segmented label span { display: grid; gap: 6px; }
.vs-segmented b { font-size: 12px; }
.vs-segmented small { color: var(--vs-muted); font-size: 10px; }
.vs-field-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.vs-field { display: block; margin: 0 0 14px; }
.vs-field input, .vs-field textarea, .vs-field select { width: 100%; border: 1px solid var(--vs-line); border-radius: var(--pg-radius-md); background: var(--pg-surface-input); color: var(--vs-text); padding: 11px 12px; outline: 0; resize: vertical; }
.vs-field input:focus-visible, .vs-field textarea:focus-visible, .vs-field select:focus-visible { border-color: var(--vs-accent); }
.vs-field small { display: block; color: var(--vs-dim); font-size: 10px; margin-top: 6px; line-height: 1.5; }
.vs-subhead { display: flex; justify-content: space-between; align-items: center; margin-top: 4px; }
.vs-subhead small { color: var(--vs-accent); font-family: var(--vs-mono); font-variant-numeric: tabular-nums; }
.vs-fact-list { display: grid; gap: 8px; max-height: 300px; overflow: auto; padding-right: 3px; }
.vs-fact { position: relative; display: grid; grid-template-columns: auto 1fr; gap: 10px; align-items: start; padding: 11px; border: 1px solid var(--vs-line); border-radius: 13px; background: var(--ms-deep); cursor: pointer; }
.vs-fact:hover { border-color: var(--vs-line-strong); background: var(--ms-hover); }
.vs-fact:has(input:checked) { border-color: var(--pg-border-accent); background: var(--ms-accent-muted); }
.vs-fact input { margin-top: 3px; accent-color: var(--vs-accent); }
.vs-fact-copy { min-width: 0; display: grid; gap: 3px; }
.vs-fact-copy b { font-size: 11px; }
.vs-fact-copy strong { color: var(--vs-accent-2); font-size: 13px; font-variant-numeric: tabular-nums; }
.vs-fact-copy small { color: var(--vs-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-size: 9px; }
.vs-source-warning { margin-top: 9px; padding: 10px; border: 1px solid var(--ms-amber); border-radius: 11px; background: var(--ms-amber-dim); color: var(--vs-hold); font-size: 10px; line-height: 1.5; }
.vs-generate { width: 100%; display: flex; align-items: center; gap: 12px; border: 0; border-radius: 15px; padding: 15px; margin-top: 18px; color: var(--pg-canvas); background: linear-gradient(135deg, var(--brand-primary-400), var(--brand-primary-600)); cursor: pointer; text-align: left; box-shadow: var(--ms-shadow-md); }
.vs-generate:hover:not(:disabled) { filter: brightness(1.05); }
.vs-generate:disabled { cursor: wait; opacity: .58; }
.vs-generate-mark { display: grid; place-items: center; width: 36px; height: 36px; border: 1px solid var(--ms-border); border-radius: 12px; font-size: 20px; }
.vs-generate b, .vs-generate small { display: block; }
.vs-generate b { font-size: 13px; }
.vs-generate small { font-size: 9px; margin-top: 3px; opacity: .7; }
.vs-status { min-height: 18px; margin-top: 10px; color: var(--vs-muted); font-size: 11px; line-height: 1.5; }
.vs-status.is-error { color: var(--vs-danger); }
.vs-status.is-success { color: var(--vs-accent); }

.vs-stage { min-height: 680px; min-width: 0; }
.vs-stage-head { padding: 24px 24px 0; }
.vs-stage-status { display: flex; align-items: center; gap: 7px; margin-left: auto; color: var(--vs-muted); font-size: 10px; }
.vs-stage-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--vs-dim); }
.vs-stage-status.is-ready .vs-stage-dot { background: var(--vs-accent); box-shadow: 0 0 0 1px rgba(45, 224, 183, .35); }
.vs-canvas-shell { min-height: 520px; min-width: 0; display: grid; place-items: center; margin: 0 22px 18px; border: 1px solid var(--vs-line); border-radius: var(--pg-radius-lg); overflow: hidden; background: var(--pg-canvas); position: relative; }
.vs-canvas-shell::before { content: ""; position: absolute; inset: 0; opacity: .12; background: linear-gradient(var(--vs-line) 1px, transparent 1px), linear-gradient(90deg, var(--vs-line) 1px, transparent 1px); background-size: 34px 34px; }
.vs-empty { position: relative; z-index: 1; max-width: 360px; text-align: center; color: var(--vs-muted); }
.vs-empty h3 { color: var(--vs-text); margin: 18px 0 8px; }
.vs-empty p { font-size: 12px; line-height: 1.6; }
.vs-empty-orbit { width: 82px; height: 82px; margin: auto; border: 1px solid var(--vs-line-strong); border-radius: 50%; position: relative; animation: vsOrbit 8s var(--vs-ease) infinite; }
.vs-empty-orbit::before, .vs-empty-orbit::after { content: ""; position: absolute; inset: 15px; border: 1px solid var(--vs-line); transform: rotate(45deg); }
.vs-empty-orbit span { position: absolute; width: 8px; height: 8px; border-radius: 50%; background: var(--vs-accent); left: 7px; top: 12px; box-shadow: none; }
@keyframes vsOrbit { to { transform: rotate(360deg); } }
.vs-preview { position: relative; z-index: 2; width: 100%; min-width: 0; max-height: 590px; overflow: auto; padding: 18px; box-sizing: border-box; }
.vs-preview svg, .vs-preview img { display: block; width: 100%; max-width: 100%; height: auto; border-radius: 10px; box-shadow: var(--ms-shadow-lg); }
.vs-export-bar { display: flex; align-items: center; gap: 8px; padding: 0 22px 22px; }
.vs-export-format { display: grid; margin-right: auto; color: var(--vs-text); font: 650 11px var(--vs-mono); }
.vs-export-format small { color: var(--vs-muted); font-size: 9px; margin-top: 3px; }
.vs-export-bar button { min-width: 84px; border: 1px solid var(--vs-line); border-radius: 11px; padding: 10px 12px; background: var(--ms-elevated); color: var(--vs-text); cursor: pointer; }
.vs-export-bar button:not(:disabled):hover { border-color: var(--vs-accent); background: var(--ms-hover); }
.vs-export-bar button:disabled { opacity: .35; cursor: not-allowed; }

.vs-receipt { min-height: 680px; }
.vs-receipt-empty { display: grid; place-items: center; text-align: center; min-height: 260px; color: var(--vs-muted); }
.vs-receipt-empty span { display: grid; place-items: center; width: 76px; height: 76px; border: 1px dashed var(--vs-line-strong); border-radius: 22px; color: var(--vs-accent); font: 700 18px var(--vs-mono); font-variant-numeric: tabular-nums; }
.vs-receipt-empty p { font-size: 11px; }
.vs-receipt-id { padding: 14px; border: 1px solid var(--vs-line-strong); border-radius: 14px; background: var(--ms-accent-muted); }
.vs-receipt-id small { display: block; color: var(--vs-muted); font: 650 9px var(--vs-mono); margin-bottom: 5px; }
.vs-receipt-id code { color: var(--vs-accent); font: 700 12px var(--vs-mono); font-variant-numeric: tabular-nums; }
.vs-proof-list { margin: 18px 0; }
.vs-proof-list div { padding: 12px 0; border-bottom: 1px solid var(--vs-line); }
.vs-proof-list dt { color: var(--vs-muted); font-size: 10px; margin-bottom: 5px; }
.vs-proof-list dd { margin: 0; font-size: 11px; line-height: 1.45; overflow-wrap: anywhere; }
.vs-proof-list code { color: var(--vs-text); font: 10px var(--vs-mono); font-variant-numeric: tabular-nums; }
.vs-pass { color: var(--vs-accent); }
.vs-hold { color: var(--vs-hold); }
.vs-sources h3 { font-size: 11px; margin: 20px 0 10px; }
.vs-source-item { padding: 10px; margin: 0 0 7px; border: 1px solid var(--vs-line); border-radius: 10px; }
.vs-source-item b { display: block; font-size: 10px; line-height: 1.4; }
.vs-source-item code { display: block; color: var(--vs-muted); font: 8px var(--vs-mono); margin-top: 4px; overflow-wrap: anywhere; }
.vs-honesty { margin-top: 16px; padding: 13px; border-left: 2px solid var(--vs-hold); background: var(--ms-warning-dim); }
.vs-honesty b { color: var(--vs-hold); font-size: 10px; }
.vs-honesty p { color: var(--vs-muted); font-size: 9px; line-height: 1.55; margin: 6px 0 0; }

.vs-history { margin-top: 34px; padding: 30px; border: 1px solid var(--vs-line); border-radius: var(--vs-radius); background: var(--ms-deep); box-shadow: var(--ms-shadow-sm); }
.vs-history h2 { margin: 0; }
.vs-history-list { display: grid; grid-template-columns: repeat(4, minmax(0,1fr)); gap: 10px; margin-top: 20px; }
.vs-history-item { padding: 14px; border: 1px solid var(--vs-line); border-radius: 13px; background: var(--ms-elevated); box-shadow: var(--ms-shadow-xs); }
.vs-history-item b, .vs-history-item small, .vs-history-item code { display: block; }
.vs-history-item b { font-size: 11px; }
.vs-history-item small { color: var(--vs-muted); font-size: 9px; margin: 5px 0; }
.vs-history-item code { color: var(--vs-accent); font: 8px var(--vs-mono); overflow-wrap: anywhere; font-variant-numeric: tabular-nums; }
.vs-footer { display: flex; justify-content: space-between; gap: 20px; padding: 22px clamp(20px, 4vw, 68px); border-top: 1px solid var(--vs-line); color: var(--vs-dim); font: 9px var(--vs-mono); letter-spacing: .08em; }

@media (max-width: 1380px) {
  .vs-workspace { grid-template-columns: minmax(310px, .75fr) minmax(520px, 1.25fr); }
  .vs-receipt { grid-column: 1 / -1; min-height: auto; }
  #receiptContent { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
  .vs-receipt-id, .vs-proof-list { grid-column: 1; }
  .vs-sources, .vs-honesty { grid-column: 2; }
}
@media (max-width: 930px) {
  .vs-header { height: auto; min-height: 70px; padding-block: 12px; }
  .vs-trust-chip { display: none; }
  .vs-shell { width: min(100% - 24px, 760px); padding-top: 36px; }
  .vs-hero { grid-template-columns: 1fr; }
  .vs-hero-proof { width: 100%; }
  .vs-workspace { grid-template-columns: 1fr; }
  .vs-controls, .vs-receipt { padding: 20px; }
  .vs-stage { min-height: auto; }
  .vs-canvas-shell { min-height: 360px; }
  #receiptContent { display: block; }
  .vs-history-list { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 560px) {
  .vs-brand strong { font-size: 11px; }
  .vs-brand small, .vs-back { display: none; }
  .vs-header-actions { gap: 6px; }
  .vs-hero { padding-bottom: 30px; }
  .vs-hero-proof { grid-template-columns: 1fr; }
  .vs-hero-proof div { min-height: 72px; }
  .vs-auth-card { display: grid; text-align: left; }
  .vs-primary-link { margin-left: 0; text-align: center; }
  .vs-field-grid, .vs-segmented { grid-template-columns: 1fr; }
  .vs-segmented legend { grid-column: auto; }
  .vs-export-bar { flex-wrap: wrap; }
  .vs-export-format { width: 100%; }
  .vs-export-bar button { flex: 1; }
  .vs-history-list { grid-template-columns: 1fr; }
  .vs-footer { display: grid; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
    scroll-behavior: auto !important;
  }
}

/* AI studio + pipeline health — folded from recovery worktree 2026-08-03 */
.vs-ai-studio { margin-top: 42px; padding: clamp(24px, 3vw, 42px); border: 1px solid var(--vs-line); border-radius: 28px; background: linear-gradient(145deg, rgba(8, 29, 36, .92), rgba(3, 16, 21, .96)); box-shadow: var(--vs-shadow); }
.vs-ai-heading { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 30px; align-items: end; margin-bottom: 28px; }
.vs-ai-heading h2 { max-width: 980px; margin: 0; font-size: clamp(27px, 3vw, 46px); line-height: 1.08; letter-spacing: -.035em; }
.vs-ai-heading p:not(.vs-kicker) { max-width: 850px; margin: 14px 0 0; color: var(--vs-muted); font-size: 13px; line-height: 1.65; }
.vs-internal-badge { display: flex; align-items: center; gap: 12px; min-width: 260px; padding: 16px 18px; border: 1px solid rgba(243, 194, 104, .3); border-radius: 16px; background: rgba(243, 194, 104, .07); color: var(--vs-hold); }
.vs-internal-badge > span:first-child { font-size: 22px; }
.vs-internal-badge b, .vs-internal-badge small { display: block; }
.vs-internal-badge b { font-size: 11px; letter-spacing: .05em; text-transform: uppercase; }
.vs-internal-badge small { margin-top: 4px; color: var(--vs-muted); font-size: 9px; }
.vs-ai-grid { display: grid; grid-template-columns: minmax(260px, .68fr) minmax(360px, 1fr) minmax(390px, 1.08fr); gap: 14px; align-items: start; }
.vs-ai-card { min-width: 0; padding: 22px; border: 1px solid var(--vs-line); border-radius: 19px; background: rgba(4, 18, 23, .72); }
.vs-ai-card-head { display: flex; align-items: center; gap: 11px; margin-bottom: 20px; }
.vs-ai-card-head > span { display: grid; place-items: center; width: 34px; height: 34px; border: 1px solid var(--vs-line-strong); border-radius: 11px; color: var(--vs-accent); font: 700 10px var(--vs-mono); }
.vs-ai-card-head h3, .vs-ai-card-head p { margin: 0; }
.vs-ai-card-head h3 { font-size: 15px; }
.vs-ai-card-head p { margin-top: 3px; color: var(--vs-muted); font-size: 9px; }
.vs-ai-health { display: flex; gap: 11px; padding: 13px; border: 1px solid var(--vs-line); border-radius: 13px; background: rgba(3, 16, 21, .7); }
.vs-health-dot { width: 9px; height: 9px; margin-top: 3px; flex: 0 0 auto; border-radius: 50%; background: var(--vs-dim); box-shadow: 0 0 12px rgba(119, 145, 153, .25); }
.vs-ai-health[data-state="configured_unverified"] .vs-health-dot { background: var(--vs-hold); box-shadow: 0 0 12px rgba(243, 194, 104, .42); }
.vs-ai-health[data-state="not_configured"] .vs-health-dot,
.vs-ai-health[data-state="configuration_invalid"] .vs-health-dot,
.vs-ai-health[data-state="unavailable"] .vs-health-dot { background: var(--vs-danger); box-shadow: 0 0 12px rgba(255, 111, 118, .38); }
.vs-ai-health b, .vs-ai-health small { display: block; }
.vs-ai-health b { font-size: 10px; }
.vs-ai-health small { margin-top: 5px; color: var(--vs-muted); font-size: 8.5px; line-height: 1.5; }
.vs-pipeline-head { display: flex; align-items: center; gap: 10px; margin: 20px 0 9px; }
.vs-pipeline-head > div { display: grid; gap: 3px; }
.vs-pipeline-head b { font-size: 10px; text-transform: uppercase; letter-spacing: .06em; }
.vs-pipeline-head small { color: var(--vs-muted); font: 8px var(--vs-mono); }
.vs-pipeline-head button { margin-left: auto; width: 30px; height: 30px; border: 1px solid var(--vs-line); border-radius: 9px; background: rgba(11, 36, 44, .9); color: var(--vs-accent); cursor: pointer; }
.vs-pipeline-head button:disabled { opacity: .4; cursor: wait; }
.vs-pipeline-list { display: grid; gap: 6px; max-height: 420px; overflow: auto; padding-right: 2px; }
.vs-pipeline-step { display: flex; align-items: center; gap: 9px; padding: 9px 10px; border: 1px solid var(--vs-line); border-radius: 10px; background: rgba(3, 16, 21, .55); }
.vs-pipeline-step > span { display: grid; gap: 2px; min-width: 0; }
.vs-pipeline-step b { font-size: 9px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.vs-pipeline-step small { color: var(--vs-muted); font: 7.5px var(--vs-mono); }
.vs-pipeline-step em { margin-left: auto; color: var(--vs-muted); font: 700 7px var(--vs-mono); font-style: normal; letter-spacing: .06em; }
.vs-pipeline-step.is-current { border-color: rgba(67, 217, 194, .22); }
.vs-pipeline-step.is-current em { color: var(--vs-accent); }
.vs-pipeline-step.is-stale,
.vs-pipeline-step.is-failed,
.vs-pipeline-step.is-skipped,
.vs-pipeline-step.is-missing,
.vs-pipeline-step.is-invalid,
.vs-pipeline-step.is-empty { border-color: rgba(255, 111, 118, .3); background: rgba(255, 111, 118, .045); }
.vs-pipeline-step.is-stale em,
.vs-pipeline-step.is-failed em,
.vs-pipeline-step.is-skipped em,
.vs-pipeline-step.is-missing em,
.vs-pipeline-step.is-invalid em,
.vs-pipeline-step.is-empty em { color: var(--vs-danger); }
.vs-compose-block { padding: 15px; border: 1px solid var(--vs-line); border-radius: 15px; background: rgba(3, 16, 21, .48); }
.vs-compose-label { display: flex; gap: 12px; align-items: start; margin-bottom: 14px; }
.vs-compose-label > span { display: grid; gap: 3px; }
.vs-compose-label b { font-size: 11px; }
.vs-compose-label small { color: var(--vs-muted); font-size: 8.5px; }
.vs-compose-label em { margin-left: auto; padding: 4px 6px; border: 1px solid var(--vs-line-strong); border-radius: 6px; color: var(--vs-accent); font: 700 7px var(--vs-mono); font-style: normal; letter-spacing: .06em; }
.vs-compose-divider { display: flex; align-items: center; gap: 10px; margin: 10px 0; color: var(--vs-dim); font: 8px var(--vs-mono); text-transform: uppercase; }
.vs-compose-divider::before, .vs-compose-divider::after { content: ""; flex: 1; height: 1px; background: var(--vs-line); }
.vs-ai-action { width: 100%; display: flex; align-items: center; gap: 10px; padding: 12px; border: 0; border-radius: 12px; background: linear-gradient(135deg, #51e2cb, #31c2ad); color: #04201d; text-align: left; cursor: pointer; }
.vs-ai-action > span:first-child { display: grid; place-items: center; width: 31px; height: 31px; flex: 0 0 auto; border: 1px solid rgba(3, 35, 31, .22); border-radius: 9px; }
.vs-ai-action b, .vs-ai-action small { display: block; }
.vs-ai-action b { font-size: 10px; }
.vs-ai-action small { margin-top: 3px; font-size: 8px; opacity: .68; }
.vs-ai-action-secondary { border: 1px solid var(--vs-line-strong); background: rgba(67, 217, 194, .08); color: var(--vs-text); }
.vs-ai-action:disabled { opacity: .38; cursor: not-allowed; box-shadow: none; }
.vs-ai-preview-shell { position: relative; display: grid; place-items: center; min-height: 390px; overflow: hidden; border: 1px solid var(--vs-line); border-radius: 16px; background: #020e12; }
.vs-ai-preview-shell::before { content: ""; position: absolute; inset: 0; opacity: .12; background: radial-gradient(circle at 30% 20%, var(--vs-accent), transparent 38%), linear-gradient(var(--vs-line) 1px, transparent 1px), linear-gradient(90deg, var(--vs-line) 1px, transparent 1px); background-size: auto, 32px 32px, 32px 32px; }
.vs-ai-empty { position: relative; z-index: 1; max-width: 290px; padding: 30px; text-align: center; color: var(--vs-muted); }
.vs-ai-empty > span { display: grid; place-items: center; width: 62px; height: 62px; margin: auto; border: 1px solid var(--vs-line-strong); border-radius: 17px; color: var(--vs-accent); font: 700 15px var(--vs-mono); }
.vs-ai-empty h4 { margin: 15px 0 7px; color: var(--vs-text); font-size: 13px; }
.vs-ai-empty p { margin: 0; font-size: 9px; line-height: 1.6; }
.vs-ai-preview { position: relative; z-index: 2; width: 100%; padding: 10px; }
.vs-ai-preview img { display: block; width: 100%; height: auto; max-height: 580px; object-fit: contain; border-radius: 10px; }
.vs-ai-proof { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 7px; margin-top: 10px; }
.vs-ai-proof > strong { grid-column: 1 / -1; padding: 8px 10px; border: 1px solid rgba(243, 194, 104, .28); border-radius: 9px; color: var(--vs-hold); font: 700 8px var(--vs-mono); letter-spacing: .06em; }
.vs-ai-proof > div { min-width: 0; padding: 8px; border: 1px solid var(--vs-line); border-radius: 9px; }
.vs-ai-proof small, .vs-ai-proof code { display: block; }
.vs-ai-proof small { margin-bottom: 3px; color: var(--vs-muted); font: 7px var(--vs-mono); }
.vs-ai-proof code { color: var(--vs-text); font: 8px var(--vs-mono); overflow-wrap: anywhere; }
.vs-ai-proof p { grid-column: 1 / -1; margin: 0; padding: 9px; border-left: 2px solid var(--vs-accent); background: rgba(67, 217, 194, .04); }
.vs-ai-proof p b, .vs-ai-proof p span { display: block; }
.vs-ai-proof p b { color: var(--vs-accent); font: 7px var(--vs-mono); }
.vs-ai-proof p span { margin-top: 4px; font-size: 9px; line-height: 1.45; }
.vs-ai-downloads { display: flex; gap: 8px; margin-top: 10px; }
.vs-ai-downloads button { flex: 1; padding: 10px; border: 1px solid var(--vs-line); border-radius: 10px; background: rgba(11, 36, 44, .9); color: var(--vs-text); font: 700 9px var(--vs-mono); cursor: pointer; }
.vs-ai-downloads button:disabled { opacity: .32; cursor: not-allowed; }
.vs-ai-boundary { margin-top: 12px; padding: 12px; border-left: 2px solid var(--vs-hold); background: rgba(243, 194, 104, .05); }
.vs-ai-boundary b { color: var(--vs-hold); font-size: 9px; }
.vs-ai-boundary p { margin: 5px 0 0; color: var(--vs-muted); font-size: 8.5px; line-height: 1.55; }

@media (max-width: 1380px) {
  .vs-ai-grid { grid-template-columns: minmax(260px, .65fr) minmax(430px, 1fr); }
  .vs-ai-output { grid-column: 1 / -1; }
}
@media (max-width: 930px) {
  .vs-ai-heading, .vs-ai-grid { grid-template-columns: 1fr; }
  .vs-internal-badge { min-width: 0; }
  .vs-ai-output { grid-column: auto; }
}
@media (max-width: 560px) {
  .vs-ai-studio { padding: 18px; border-radius: 20px; }
  .vs-ai-card { padding: 17px; }
  .vs-ai-preview-shell { min-height: 300px; }
  .vs-ai-proof { grid-template-columns: 1fr; }
  .vs-ai-proof > strong, .vs-ai-proof p { grid-column: auto; }
}
