.vcs {
  color: var(--cd-ink-heading);
  max-width: 1600px;
  margin-inline: auto;
}

.vcs [hidden] { display: none !important; }
.vcs-header, .vcs-panel-head, .vcs-block-head, .vcs-actions, .vcs-pagination {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--cd-space-3);
}
.vcs-header { margin-bottom: var(--cd-space-5); }
.vcs h1, .vcs h2, .vcs h3, .vcs p { margin: 0; }
.vcs h1 { font-size: var(--cd-text-page); letter-spacing: var(--cd-tracking-page); }
.vcs h2 { font-size: var(--cd-text-body); }
.vcs h3 { font-size: var(--cd-text-control); }
.vcs-header p, .vcs-detail-head p, .vcs-muted, .vcs-footnote, .vcs-panel-head > span {
  color: var(--cd-ink-muted);
  font-size: var(--cd-text-small);
}
.vcs-header p, .vcs-detail-head p { margin-top: var(--cd-space-1); }
.vcs .vcs-actions { justify-content: flex-start; flex-wrap: wrap; }
.vcs .vcs-actions .btn { min-height: 36px; }
.vcs-metrics {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: var(--cd-space-3);
  margin-bottom: var(--cd-space-5);
}
.vcs-metric {
  display: grid;
  gap: var(--cd-space-1);
  background: var(--cd-surface);
  border: 1px solid var(--cd-border-quiet);
  border-radius: var(--cd-radius-lg);
  padding: var(--cd-space-3) var(--cd-space-4);
  font-size: var(--cd-text-small);
}
.vcs-metric strong { font-size: var(--cd-text-metric); line-height: var(--cd-leading-tight); }
.vcs-metric span { color: var(--cd-ink-muted); }
.vcs-danger { --vcs-status-text: var(--cd-danger-ink); --vcs-status-bg: var(--cd-danger-surface); }
.vcs-warning { --vcs-status-text: var(--cd-warning-ink); --vcs-status-bg: var(--cd-warning-surface); }
.vcs-primary { --vcs-status-text: var(--cd-primary-dark); --vcs-status-bg: var(--cd-primary-surface); }
.vcs-accent { --vcs-status-text: var(--cd-accent-ink); --vcs-status-bg: var(--cd-accent-surface); }
.vcs-success { --vcs-status-text: var(--cd-success-ink); --vcs-status-bg: var(--cd-success-surface); }
.vcs-neutral { --vcs-status-text: var(--cd-ink-muted); --vcs-status-bg: var(--cd-surface-sunken); }
.vcs-metric strong { color: var(--vcs-status-text); }
.vcs-pill {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 999px;
  background: var(--vcs-status-bg);
  color: var(--vcs-status-text);
  font-size: 11px;
  font-weight: var(--cd-weight-strong);
  white-space: nowrap;
}
.vcs-workspace {
  display: grid;
  grid-template-columns: minmax(280px, .78fr) minmax(0, 1.22fr);
  align-items: start;
  gap: var(--cd-space-4);
}
.vcs-panel, .vcs-settings {
  min-width: 0;
  background: var(--cd-surface);
  border: 1px solid var(--cd-border-quiet);
  border-radius: var(--cd-radius-lg);
}
.vcs-panel { overflow: hidden; }
.vcs-panel-head, .vcs-pagination { padding: var(--cd-space-3) var(--cd-space-4); }
.vcs-panel-head { border-bottom: 1px solid var(--cd-border-quiet); }
.vcs-filters {
  display: flex;
  gap: var(--cd-space-1);
  flex-wrap: wrap;
  padding: var(--cd-space-2) var(--cd-space-3);
  border-bottom: 1px solid var(--cd-border-quiet);
}
.vcs-filters button {
  min-height: 36px;
  padding: 0 var(--cd-space-2);
  color: var(--cd-ink-muted);
  background: transparent;
  border: 1px solid transparent;
  border-radius: var(--cd-radius-sm);
  font: inherit;
  font-size: var(--cd-text-small);
  font-weight: var(--cd-weight-strong);
  cursor: pointer;
}
.vcs-filters button[aria-pressed="true"] {
  border-color: var(--cd-border-quiet);
  background: var(--cd-primary-surface);
  color: var(--cd-primary-dark);
}
.vcs-queue-row {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr) minmax(70px, auto);
  align-items: start;
  gap: var(--cd-space-3);
  width: 100%;
  border: 0;
  border-bottom: 1px solid var(--cd-border-quiet);
  padding: var(--cd-space-3) var(--cd-space-4);
  color: inherit;
  background: var(--cd-surface);
  font: inherit;
  text-align: left;
  cursor: pointer;
}
.vcs-queue-row:hover { background: var(--cd-surface-subtle); }
.vcs-queue-row[aria-pressed="true"] { background: var(--cd-primary-surface); box-shadow: inset 3px 0 var(--cd-primary); }
.vcs :is(button,summary,input,select,textarea):focus-visible { outline: 2px solid var(--cd-primary); outline-offset: -2px; }
.vcs-avatar {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 999px;
  background: var(--cd-primary-surface);
  color: var(--cd-primary-dark);
  font-weight: var(--cd-weight-strong);
  font-size: 12px;
}
.vcs-identity, .vcs-row-meta { display: grid; gap: var(--cd-space-1); min-width: 0; }
.vcs-identity strong { font-size: var(--cd-text-control); overflow-wrap: anywhere; }
.vcs-identity > span:not(.vcs-tags), .vcs-row-meta { color: var(--cd-ink-muted); font-size: 12px; overflow-wrap: anywhere; }
.vcs-row-meta { justify-items: end; text-align: right; }
.vcs-tags { display: flex; flex-wrap: wrap; gap: var(--cd-space-1); }
.vcs-timing { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--cd-space-3); margin: 0; padding: var(--cd-space-3) var(--cd-space-4); background: var(--cd-surface-subtle); }
.vcs-timing dt { color: var(--cd-ink-muted); font-size: var(--cd-text-small); }
.vcs-timing dd { margin: 3px 0 0; font-weight: var(--cd-weight-medium); overflow-wrap: anywhere; }
.vcs-block { display: grid; gap: var(--cd-space-3); padding: var(--cd-space-4); border-top: 1px solid var(--cd-border-quiet); }
.vcs-block > .btn { justify-self: start; }
.vcs-messages { display: grid; gap: var(--cd-space-2); max-height: 360px; overflow: auto; }
.vcs-message, .vcs-draft {
  display: grid;
  gap: var(--cd-space-2);
  border-radius: var(--cd-radius-md);
  padding: var(--cd-space-3);
  border: 1px solid var(--cd-border-quiet);
  background: var(--cd-surface-subtle);
  overflow-wrap: anywhere;
}
.vcs-staff-message { background: var(--cd-primary-surface); }
.vcs-message header, .vcs-draft header { display: flex; flex-wrap: wrap; align-items: center; gap: var(--cd-space-2); }
.vcs-message time, .vcs-draft small { color: var(--cd-ink-muted); font-size: 12px; }
.vcs-message p, .vcs-draft p { white-space: pre-wrap; }
.vcs-form { display: grid; gap: var(--cd-space-2); }
.vcs-form-row { display: grid; grid-template-columns: repeat(auto-fit,minmax(160px,1fr)); gap: var(--cd-space-2); }
.vcs-form label, .vcs-settings label { display: grid; gap: var(--cd-space-1); min-width: 0; font-weight: var(--cd-weight-medium); }
.vcs :is(input,select,textarea) {
  width: 100%;
  min-width: 0;
  min-height: 38px;
  background: var(--cd-surface);
  border: 1px solid var(--cd-border);
  border-radius: var(--cd-radius-sm);
  color: var(--cd-ink-strong);
  padding: var(--cd-space-2);
  font: inherit;
}
.vcs textarea { resize: vertical; }
.vcs-form > .btn { justify-self: start; }
.vcs-review-note { padding-left: var(--cd-space-3); border-left: 3px solid var(--cd-warning); }
.vcs-settings { position: relative; }
.vcs-settings summary { padding: var(--cd-space-2) var(--cd-space-3); cursor: pointer; font-weight: var(--cd-weight-strong); }
.vcs-settings form { display: grid; gap: var(--cd-space-2); padding: var(--cd-space-3); min-width: 190px; }
.vcs-error { color: var(--cd-danger-ink); }
.vcs-alert { background: var(--cd-success-surface); color: var(--cd-success-ink); padding: var(--cd-space-3) var(--cd-space-4); border-radius: var(--cd-radius-sm); margin-bottom: var(--cd-space-3); }
.vcs-alert.vcs-error { background: var(--cd-danger-surface); color: var(--cd-danger-ink); }
.vcs-empty, .vcs-footnote { padding: var(--cd-space-4); }
.vcs-empty:not(.vcs-error), .vcs-pagination { color: var(--cd-ink-muted); }

@media (max-width: 1090px) {
  .vcs-workspace { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 600px) {
  .vcs-header { align-items: flex-start; flex-direction: column; }
  .vcs-metrics { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .vcs-queue-row { grid-template-columns: 28px minmax(0,1fr) minmax(60px,auto); padding-inline: var(--cd-space-2); }
  .vcs-avatar { width: 28px; height: 28px; }
  .vcs-actions .btn, .vcs-filters button { min-height: 44px; }
  .vcs :is(input,select,textarea) { font-size: 16px; }
}
