/* ── Scripts & Automation ── */
.sc-page {
  max-width: 1320px;
  margin: 0 auto;
  padding-bottom: 40px;
}

/* Sections stack inside #sc-content (not direct .sc-page children) */
.sc-page #sc-content {
  display: flex;
  flex-direction: column;
  gap: 32px;
}

.sc-page #sc-content > .sc-hero,
.sc-page #sc-content > .sc-workspace,
.sc-page #sc-content > .sc-history {
  margin: 0;
}

/* Hero */
.sc-hero {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 32px;
  flex-wrap: wrap;
  padding: 28px 32px;
  border-radius: var(--ds-radius-xl, 16px);
  background:
    radial-gradient(ellipse 80% 120% at 100% 0%, rgba(91, 141, 239, 0.14), transparent 55%),
    linear-gradient(145deg, var(--ds-surface) 0%, rgba(26, 30, 38, 0.95) 100%);
  border: 1px solid var(--ds-border-subtle);
}

.sc-hero__eyebrow {
  margin: 0 0 6px;
  font-family: var(--ds-mono);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ds-primary);
}

.sc-hero h1 {
  margin: 0 0 10px;
  font-size: clamp(1.5rem, 2.5vw, 1.85rem);
  font-weight: 700;
  letter-spacing: -0.025em;
  line-height: 1.15;
}

.sc-hero__lead {
  margin: 0;
  max-width: 520px;
  font-size: var(--ds-text-sm);
  color: var(--ds-text-secondary);
  line-height: 1.55;
}

.sc-hero__metrics {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.sc-metric {
  display: flex;
  flex-direction: column;
  align-items: center;
  min-width: 88px;
  padding: 14px 18px;
  background: rgba(0, 0, 0, 0.22);
  border: 1px solid var(--ds-border-subtle);
  border-radius: var(--ds-radius-lg);
}

.sc-metric--accent {
  border-color: rgba(91, 141, 239, 0.35);
  background: rgba(91, 141, 239, 0.08);
}

.sc-metric__value {
  font-size: 1.35rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1;
}

.sc-metric__label {
  margin-top: 6px;
  font-size: 11px;
  color: var(--ds-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

/* Workspace layout */
.sc-workspace {
  display: grid;
  grid-template-columns: 220px 1fr;
  gap: 24px;
  align-items: start;
}

@media (max-width: 900px) {
  .sc-workspace { grid-template-columns: 1fr; }
  .sc-rail { position: static !important; }
}

.sc-rail {
  position: sticky;
  top: 84px;
  padding: 16px;
  background: var(--ds-surface);
  border: 1px solid var(--ds-border-subtle);
  border-radius: var(--ds-radius-lg);
}

.sc-rail__label {
  margin: 0 0 10px 4px;
  font-family: var(--ds-mono);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ds-text-muted);
}

.sc-rail__nav {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.sc-rail__item {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 9px 10px;
  border: none;
  border-radius: var(--ds-radius);
  background: transparent;
  color: var(--ds-text-secondary);
  font-size: var(--ds-text-sm);
  text-align: left;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}

.sc-rail__item .material-symbols-outlined {
  font-size: 18px;
  opacity: 0.8;
}

.sc-rail__item em {
  margin-left: auto;
  font-style: normal;
  font-family: var(--ds-mono);
  font-size: 10px;
  color: var(--ds-text-muted);
}

.sc-rail__item:hover {
  background: var(--ds-surface-high);
  color: var(--ds-text);
}

.sc-rail__item.is-active {
  background: rgba(91, 141, 239, 0.12);
  color: var(--ds-primary);
}

.sc-rail__admin {
  display: flex;
  gap: 10px;
  margin-top: 16px;
  padding: 12px;
  background: rgba(91, 141, 239, 0.06);
  border: 1px solid rgba(91, 141, 239, 0.15);
  border-radius: var(--ds-radius);
  font-size: 11px;
  color: var(--ds-text-secondary);
  line-height: 1.45;
}

.sc-rail__admin .material-symbols-outlined {
  font-size: 18px;
  color: var(--ds-primary);
  flex-shrink: 0;
}

.sc-rail__admin p { margin: 0; }
.sc-rail__admin code {
  font-family: var(--ds-mono);
  font-size: 10px;
  color: var(--ds-primary);
}

.sc-rail__quick {
  margin-top: 18px;
  padding-top: 16px;
  border-top: 1px solid var(--ds-border-subtle);
}

.sc-rail__quick-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 6px;
}

.sc-rail__quick-count {
  font-family: var(--ds-mono);
  font-size: 10px;
  font-weight: 700;
  color: var(--ds-primary);
}

.sc-rail__quick-note {
  margin: 0 0 10px;
  font-size: 11px;
  line-height: 1.45;
  color: var(--ds-text-muted);
}

.sc-rail__quick-empty {
  margin: 0;
  font-size: 11px;
  color: var(--ds-text-muted);
}

.sc-rail__quick-list {
  display: flex;
  flex-direction: column;
  gap: 4px;
  max-height: 240px;
  overflow-y: auto;
  margin-bottom: 10px;
}

.sc-rail__quick-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px;
  border-radius: var(--ds-radius);
  border: 1px solid var(--ds-border-subtle);
  background: var(--ds-surface);
  cursor: pointer;
}

.sc-rail__quick-item:hover:not(.is-locked) {
  border-color: rgba(91, 141, 239, 0.35);
}

.sc-rail__quick-item.is-selected {
  border-color: rgba(91, 141, 239, 0.45);
  background: rgba(91, 141, 239, 0.08);
}

.sc-rail__quick-item.is-locked {
  opacity: 0.55;
  cursor: not-allowed;
}

.sc-rail__quick-item input[type="checkbox"] {
  width: 14px;
  height: 14px;
  accent-color: var(--ds-primary-strong);
  flex-shrink: 0;
}

.sc-rail__quick-item__body {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
  flex: 1;
}

.sc-rail__quick-item__body strong {
  font-size: 11px;
  font-weight: 600;
  color: var(--ds-text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sc-rail__quick-item__body span {
  font-size: 10px;
  color: var(--ds-text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sc-rail__quick-item__slot {
  flex-shrink: 0;
  min-width: 1.25rem;
  text-align: center;
  font-size: 10px;
  font-weight: 700;
  color: var(--ds-primary);
}

.sc-rail__quick-actions {
  display: flex;
  gap: 8px;
}

.sc-btn--sm {
  min-height: 32px;
  padding: 0 10px;
  font-size: 11px;
}

.sc-btn--sm .material-symbols-outlined {
  font-size: 16px;
}

/* Main panel */
.sc-panel {
  min-width: 0;
}

.sc-panel__toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
  margin-bottom: 24px;
}

.sc-search {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 1;
  min-width: 200px;
  max-width: 360px;
  height: 40px;
  padding: 0 14px;
  background: var(--ds-surface);
  border: 1px solid var(--ds-border-subtle);
  border-radius: var(--ds-radius);
}

.sc-search .material-symbols-outlined {
  font-size: 18px;
  color: var(--ds-text-muted);
}

.sc-search input {
  flex: 1;
  border: none;
  background: transparent;
  color: var(--ds-text);
  font-size: var(--ds-text-sm);
  outline: none;
}

.sc-filters {
  display: flex;
  padding: 3px;
  background: var(--ds-surface);
  border: 1px solid var(--ds-border-subtle);
  border-radius: var(--ds-radius);
}

.sc-filter {
  padding: 6px 14px;
  border: none;
  border-radius: calc(var(--ds-radius) - 2px);
  background: transparent;
  color: var(--ds-text-muted);
  font-size: var(--ds-text-sm);
  font-weight: 500;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}

.sc-filter.is-active {
  background: var(--ds-surface-high);
  color: var(--ds-primary);
}

.sc-panel__toolbar .sc-btn--primary {
  margin-left: auto;
}

@media (max-width: 640px) {
  .sc-panel__toolbar .sc-btn--primary { margin-left: 0; width: 100%; justify-content: center; }
}

/* Script grid */
.sc-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(272px, 1fr));
  gap: 16px;
}

.sc-card {
  display: flex;
  flex-direction: column;
  min-height: 220px;
  background: var(--ds-surface);
  border: 1px solid var(--ds-border-subtle);
  border-radius: var(--ds-radius-lg);
  overflow: hidden;
  transition: border-color 0.2s, transform 0.15s, box-shadow 0.2s;
}

.sc-card:hover {
  border-color: rgba(91, 141, 239, 0.35);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.22);
  transform: translateY(-2px);
}

.sc-card--disabled {
  opacity: 0.72;
}

.sc-card--unassigned {
  opacity: 0.88;
}

.sc-card--disabled:hover {
  transform: none;
  box-shadow: none;
  border-color: var(--ds-border-subtle);
}

.sc-card__top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  padding: 18px 18px 0;
}

.sc-card__icon {
  width: 42px;
  height: 42px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 10px;
  background: color-mix(in srgb, var(--sc-accent, #60a5fa) 14%, transparent);
  color: var(--sc-accent, #60a5fa);
}

.sc-card__icon .material-symbols-outlined { font-size: 22px; }

.sc-card__badges {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 4px;
}

.sc-tag {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 8px;
  border-radius: 999px;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.sc-tag--system {
  color: var(--ds-primary);
  background: rgba(91, 141, 239, 0.1);
}

.sc-tag--key {
  color: #fbbf24;
  background: rgba(251, 191, 36, 0.1);
}

.sc-tag--key .material-symbols-outlined { font-size: 12px; }

.sc-tag--off {
  color: var(--ds-text-muted);
  background: var(--ds-surface-high);
}

.sc-tag--unassigned {
  color: #94a3b8;
  background: rgba(148, 163, 184, 0.12);
}

.sc-tag--hidden {
  color: #c4b5fd;
  background: rgba(196, 181, 253, 0.12);
}

.sc-card__body {
  flex: 1;
  padding: 14px 18px 12px;
}

.sc-card__title-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 6px;
}

.sc-card__title-row h3 {
  margin: 0;
  font-size: var(--ds-text-md);
  font-weight: 600;
  letter-spacing: -0.01em;
}

.sc-card__ver {
  font-family: var(--ds-mono);
  font-size: 10px;
  color: var(--ds-text-muted);
  white-space: nowrap;
}

.sc-card__desc {
  margin: 0 0 12px;
  font-size: var(--ds-text-sm);
  color: var(--ds-text-secondary);
  line-height: 1.45;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.sc-card__meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.sc-lang {
  font-family: var(--ds-mono);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.sc-lang--blue { color: #60a5fa; }
.sc-lang--slate { color: #94a3b8; }
.sc-lang--amber { color: #fbbf24; }

.sc-card__runs {
  font-size: 11px;
  color: var(--ds-text-muted);
}

.sc-card__foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 12px 18px 16px;
  border-top: 1px solid var(--ds-border-subtle);
  flex-wrap: wrap;
}

.sc-settings-summary {
  padding: 14px 16px;
  border-radius: var(--ds-radius-lg);
  border: 1px solid var(--ds-border-subtle);
  background: rgba(0, 0, 0, 0.18);
}

.sc-settings-summary strong {
  display: block;
  margin-bottom: 6px;
  font-size: var(--ds-text-base);
}

.sc-settings-summary p {
  margin: 0 0 10px;
  color: var(--ds-text-secondary);
  font-size: var(--ds-text-sm);
  line-height: 1.5;
}

.sc-content-hidden {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 180px;
  padding: 24px;
  border-radius: var(--ds-radius-lg);
  border: 1px dashed var(--ds-border-subtle);
  background: rgba(0, 0, 0, 0.2);
  color: var(--ds-text-muted);
  text-align: center;
}

.sc-content-hidden .material-symbols-outlined {
  font-size: 32px;
  opacity: 0.7;
}

.sc-content-hidden p {
  margin: 0;
  max-width: 280px;
  font-size: var(--ds-text-sm);
  line-height: 1.5;
}

.sc-disable-btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 6px 10px;
  border-radius: 999px;
  border: 1px solid var(--ds-border-subtle);
  background: rgba(0, 0, 0, 0.15);
  color: var(--ds-text-secondary);
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  transition: border-color 0.15s, color 0.15s, background 0.15s;
}

.sc-disable-btn .material-symbols-outlined {
  font-size: 16px;
}

.sc-disable-btn:hover {
  border-color: rgba(248, 113, 113, 0.45);
  color: #fca5a5;
  background: rgba(248, 113, 113, 0.08);
}

.sc-disable-btn.is-active {
  border-color: rgba(52, 211, 153, 0.45);
  color: #6ee7b7;
  background: rgba(52, 211, 153, 0.08);
}

.sc-disable-btn.is-active:hover {
  border-color: rgba(52, 211, 153, 0.55);
  color: #a7f3d0;
}

.sc-card__actions {
  display: flex;
  align-items: center;
  gap: 4px;
}

/* Form */
.sc-form {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.sc-form__section {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.sc-form__section-label {
  margin: 0;
  font-family: var(--ds-mono);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ds-text-muted);
}

.sc-form__row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

@media (max-width: 520px) {
  .sc-form__row { grid-template-columns: 1fr; }
}

.sc-form__field {
  display: flex;
  flex-direction: column;
  gap: 7px;
}

.sc-form__field > span {
  font-size: var(--ds-text-xs);
  font-weight: 500;
  color: var(--ds-text-secondary);
}

.sc-form__field input,
.sc-form__field select,
.sc-form__field textarea {
  width: 100%;
  padding: 11px 13px;
  background: var(--ds-surface-high);
  border: 1px solid var(--ds-border-subtle);
  border-radius: var(--ds-radius);
  color: var(--ds-text);
  font-size: var(--ds-text-sm);
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
  box-sizing: border-box;
}

.sc-form__field input:focus,
.sc-form__field select:focus,
.sc-form__field textarea:focus {
  border-color: rgba(91, 141, 239, 0.5);
  box-shadow: 0 0 0 3px rgba(91, 141, 239, 0.12);
}

.sc-form__field input::placeholder,
.sc-form__field textarea::placeholder {
  color: var(--ds-text-muted);
}

.sc-form__section--code {
  gap: 10px;
}

.sc-code-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.sc-code-head__hint {
  font-size: 11px;
  color: var(--ds-text-muted);
}

.sc-code-head__hint code {
  font-family: var(--ds-mono);
  font-size: 10px;
  color: var(--ds-primary);
  background: rgba(91, 141, 239, 0.1);
  padding: 2px 6px;
  border-radius: 4px;
}

.sc-form__field--code textarea {
  font-family: var(--ds-mono);
  font-size: 12px;
  line-height: 1.6;
  min-height: 220px;
  resize: vertical;
  background: #0a0c10;
  border-color: #1e2430;
  color: #d1d5db;
  padding: 14px 16px;
  border-radius: var(--ds-radius-lg);
}

.sc-form__field--code textarea:focus {
  border-color: rgba(91, 141, 239, 0.45);
  box-shadow: 0 0 0 3px rgba(91, 141, 239, 0.1);
}

/* Settings panel (editor toggles) */
.sc-settings-panel {
  display: flex;
  flex-direction: column;
  border: 1px solid var(--ds-border-subtle);
  border-radius: var(--ds-radius-lg);
  overflow: hidden;
  background: var(--ds-surface-high);
}

.sc-setting-row {
  display: grid;
  grid-template-columns: 36px 1fr auto;
  align-items: center;
  gap: 14px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--ds-border-subtle);
}

.sc-setting-row:last-child {
  border-bottom: none;
}

.sc-setting-row__icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: var(--ds-radius);
  background: rgba(91, 141, 239, 0.1);
  color: var(--ds-primary);
}

.sc-setting-row__icon .material-symbols-outlined {
  font-size: 18px;
}

.sc-setting-row__text {
  min-width: 0;
}

.sc-setting-row__text strong {
  display: block;
  font-size: var(--ds-text-sm);
  font-weight: 500;
  color: var(--ds-text);
  margin-bottom: 3px;
}

.sc-setting-row__text p {
  margin: 0;
  font-size: var(--ds-text-xs);
  color: var(--ds-text-muted);
  line-height: 1.45;
}

.sc-setting-row__text code {
  font-family: var(--ds-mono);
  font-size: 10px;
  color: var(--ds-primary);
  background: rgba(91, 141, 239, 0.1);
  padding: 1px 5px;
  border-radius: 3px;
}

/* Toggle — card + form variants */
.sc-toggle {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  user-select: none;
  flex-shrink: 0;
}

.sc-toggle input {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.sc-toggle__track {
  position: relative;
  display: block;
  width: 40px;
  height: 22px;
  background: var(--ds-surface);
  border: 1px solid var(--ds-border-subtle);
  border-radius: 999px;
  transition: background 0.2s, border-color 0.2s;
}

.sc-toggle__thumb {
  position: absolute;
  top: 2px;
  left: 2px;
  width: 16px;
  height: 16px;
  background: var(--ds-text-muted);
  border-radius: 50%;
  transition: transform 0.2s ease, background 0.2s;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.25);
}

.sc-toggle input:checked + .sc-toggle__track {
  background: rgba(91, 141, 239, 0.35);
  border-color: rgba(91, 141, 239, 0.55);
}

.sc-toggle input:checked + .sc-toggle__track .sc-toggle__thumb {
  transform: translateX(18px);
  background: var(--ds-primary);
}

.sc-toggle input:focus-visible + .sc-toggle__track {
  box-shadow: 0 0 0 3px rgba(91, 141, 239, 0.2);
}

.sc-toggle__label {
  font-size: 11px;
  color: var(--ds-text-muted);
}

/* Buttons */
.sc-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 38px;
  padding: 0 16px;
  border: 1px solid transparent;
  border-radius: var(--ds-radius);
  font-size: var(--ds-text-sm);
  font-weight: 500;
  cursor: pointer;
  transition: filter 0.15s, transform 0.1s, background 0.15s;
}

.sc-btn .material-symbols-outlined { font-size: 18px; }

.sc-btn--primary {
  background: var(--ds-primary);
  color: #0a1628;
  box-shadow: 0 4px 14px rgba(91, 141, 239, 0.28);
}

.sc-btn--primary:hover { filter: brightness(1.06); }
.sc-btn--primary:active { transform: scale(0.98); }

.sc-btn--ghost {
  background: transparent;
  border-color: var(--ds-border-subtle);
  color: var(--ds-text-secondary);
}

.sc-btn--ghost:hover { background: var(--ds-surface-high); color: var(--ds-text); }

.sc-icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  padding: 0;
  border: none;
  border-radius: var(--ds-radius);
  background: transparent;
  color: var(--ds-text-muted);
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}

.sc-icon-btn:hover { background: var(--ds-surface-high); color: var(--ds-text); }
.sc-icon-btn--danger:hover { color: #f87171; background: rgba(248, 113, 113, 0.1); }

.sc-run-btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  height: 32px;
  padding: 0 12px;
  border: 1px solid var(--ds-border-subtle);
  border-radius: var(--ds-radius);
  background: var(--ds-surface-high);
  color: var(--ds-text);
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s, color 0.15s;
}

.sc-run-btn .material-symbols-outlined { font-size: 16px; }

.sc-run-btn:hover:not(:disabled) {
  background: var(--ds-primary);
  border-color: var(--ds-primary);
  color: #0a1628;
}

.sc-run-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

/* History */
.sc-history {
  padding: 24px 28px;
  background: var(--ds-surface);
  border: 1px solid var(--ds-border-subtle);
  border-radius: var(--ds-radius-lg);
}

.sc-history__head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 16px;
}

.sc-history__head h2 {
  margin: 0;
  font-size: var(--ds-text-md);
  font-weight: 600;
}

.sc-history__head span {
  font-size: var(--ds-text-xs);
  color: var(--ds-text-muted);
}

.sc-runs-list {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.sc-run-row {
  display: grid;
  grid-template-columns: 36px 1fr auto 36px;
  align-items: center;
  gap: 12px;
  padding: 12px 8px;
  border-radius: var(--ds-radius);
  transition: background 0.15s;
}

.sc-run-row:hover { background: var(--ds-surface-high); }

.sc-run-row__icon {
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--ds-primary);
}

.sc-run-row__main {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.sc-run-row__main strong {
  font-size: var(--ds-text-sm);
  font-weight: 500;
}

.sc-run-row__main span {
  font-size: var(--ds-text-xs);
  color: var(--ds-text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Pills */
.sc-pill {
  display: inline-block;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.sc-pill--ok { color: #34d399; background: rgba(52, 211, 153, 0.12); }
.sc-pill--err { color: #f87171; background: rgba(248, 113, 113, 0.12); }
.sc-pill--pending { color: #fbbf24; background: rgba(251, 191, 36, 0.12); }

.sc-empty {
  margin: 0;
  padding: 32px 16px;
  text-align: center;
  color: var(--ds-text-muted);
  font-size: var(--ds-text-sm);
}

.sc-empty--grid { grid-column: 1 / -1; }

/* Modals */
.sc-overlay {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(10px);
  animation: sc-in 0.18s ease;
}

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

.sc-dialog {
  width: 100%;
  max-width: 480px;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  background: var(--ds-surface);
  border: 1px solid var(--ds-border-subtle);
  border-radius: var(--ds-radius-xl, 16px);
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.5);
  animation: sc-up 0.22s ease;
  overflow: hidden;
}

.sc-dialog--lg { max-width: 680px; }

.sc-dialog--run { max-width: 440px; }

.sc-dialog--editor {
  max-width: 640px;
  max-height: min(92vh, 860px);
}

.sc-dialog__form {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
}

.sc-dialog__scroll {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 20px 24px 8px;
}

.sc-dialog--editor .sc-dialog__head {
  padding: 24px 24px 0;
  border-bottom: 1px solid var(--ds-border-subtle);
  padding-bottom: 18px;
}

.sc-dialog--editor .sc-dialog__foot {
  padding: 16px 24px 20px;
  background: var(--ds-surface);
  border-top: 1px solid var(--ds-border-subtle);
}

@keyframes sc-up {
  from { opacity: 0; transform: translateY(16px) scale(0.98); }
  to { opacity: 1; transform: none; }
}

.sc-dialog__head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding: 22px 24px 0;
}

.sc-dialog__eyebrow {
  margin: 0 0 4px;
  font-family: var(--ds-mono);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ds-primary);
}

.sc-dialog__head h2 {
  margin: 0;
  font-size: 1.15rem;
  font-weight: 600;
}

.sc-dialog__body {
  padding: 18px 24px;
  overflow-y: auto;
}

.sc-dialog__hint,
.sc-dialog__note {
  margin: 0 0 14px;
  font-size: var(--ds-text-sm);
  color: var(--ds-text-secondary);
  line-height: 1.45;
}

.sc-dialog__note {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  padding: 10px 12px;
  background: rgba(251, 191, 36, 0.08);
  border: 1px solid rgba(251, 191, 36, 0.2);
  border-radius: var(--ds-radius);
  color: #fcd34d;
}

.sc-dialog__note .material-symbols-outlined { font-size: 18px; flex-shrink: 0; }
.sc-dialog__note code { font-family: var(--ds-mono); font-size: 11px; }

.sc-dialog__foot {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  padding: 16px 24px 22px;
  border-top: 1px solid var(--ds-border-subtle);
}

.sc-modal-empty {
  margin: 0;
  padding: 20px;
  text-align: center;
  color: var(--ds-text-muted);
  font-size: var(--ds-text-sm);
}

/* Run modal */
.sc-run-modal__head {
  padding-bottom: 6px;
}

.sc-run-modal__title h2 {
  letter-spacing: -0.02em;
}

.sc-run-modal__body {
  padding-top: 12px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.sc-run-modal__hint {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0;
  padding: 10px 12px;
  font-size: var(--ds-text-xs);
  color: var(--ds-text-muted);
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--ds-border-subtle);
  border-radius: var(--ds-radius);
  line-height: 1.4;
}

.sc-run-modal__hint .material-symbols-outlined {
  font-size: 16px;
  opacity: 0.65;
  flex-shrink: 0;
}

.sc-run-banner {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 12px 14px;
  background: rgba(251, 191, 36, 0.06);
  border: 1px solid rgba(251, 191, 36, 0.18);
  border-radius: var(--ds-radius);
  color: #d4a574;
  font-size: var(--ds-text-xs);
  line-height: 1.45;
}

.sc-run-banner p { margin: 0; }
.sc-run-banner .material-symbols-outlined { font-size: 18px; flex-shrink: 0; margin-top: 1px; }
.sc-run-banner code { font-family: var(--ds-mono); font-size: 10px; }

.sc-run-picker {
  border: 1px solid var(--ds-border-subtle);
  border-radius: var(--ds-radius-lg);
  background: rgba(0, 0, 0, 0.18);
  overflow: hidden;
}

.sc-run-picker__bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 12px;
  background: rgba(255, 255, 255, 0.025);
  border-bottom: 1px solid var(--ds-border-subtle);
}

.sc-run-picker__badge {
  flex-shrink: 0;
  padding: 3px 8px;
  font-family: var(--ds-mono);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--ds-primary);
  background: rgba(91, 141, 239, 0.1);
  border: 1px solid rgba(91, 141, 239, 0.22);
  border-radius: 999px;
}

.sc-run-picker__search {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0;
  padding: 8px 12px;
  border-bottom: 1px solid var(--ds-border-subtle);
  background: rgba(255, 255, 255, 0.015);
}

.sc-run-picker__search .material-symbols-outlined {
  font-size: 18px;
  color: var(--ds-text-muted);
  flex-shrink: 0;
}

.sc-run-picker__search input {
  flex: 1;
  min-width: 0;
  border: none;
  background: transparent;
  color: var(--ds-text);
  font-size: var(--ds-text-sm);
  outline: none;
}

.sc-run-picker__search input::placeholder { color: var(--ds-text-muted); }

.sc-run-list {
  list-style: none;
  margin: 0;
  padding: 6px;
  max-height: 280px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.sc-run-item {
  border-radius: var(--ds-radius);
  transition: background 0.12s;
}

.sc-run-item.is-online:hover { background: var(--ds-surface-high); }
.sc-run-item.is-offline { opacity: 0.48; }
.sc-run-item.is-offline .sc-run-check { cursor: not-allowed; }

.sc-run-check {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  cursor: pointer;
  user-select: none;
  width: 100%;
}

.sc-run-check--all { padding: 0; }

.sc-run-check input {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.sc-run-check__box {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  border: 1.5px solid rgba(255, 255, 255, 0.22);
  border-radius: 5px;
  background: rgba(0, 0, 0, 0.25);
  transition: background 0.15s, border-color 0.15s, box-shadow 0.15s;
}

.sc-run-check__box .material-symbols-outlined {
  font-size: 14px;
  color: #fff;
  opacity: 0;
  transform: scale(0.6);
  transition: opacity 0.15s, transform 0.15s;
}

.sc-run-check input:checked + .sc-run-check__box {
  background: var(--ds-primary);
  border-color: var(--ds-primary);
}

.sc-run-check input:checked + .sc-run-check__box .material-symbols-outlined {
  opacity: 1;
  transform: scale(1);
}

.sc-run-check.is-indeterminate .sc-run-check__box {
  background: rgba(91, 141, 239, 0.4);
  border-color: var(--ds-primary);
}

.sc-run-check.is-indeterminate .sc-run-check__box .material-symbols-outlined { display: none; }

.sc-run-check.is-indeterminate .sc-run-check__box::after {
  content: '';
  width: 8px;
  height: 2px;
  background: #fff;
  border-radius: 1px;
}

.sc-run-check input:focus-visible + .sc-run-check__box {
  box-shadow: 0 0 0 3px rgba(91, 141, 239, 0.25);
}

.sc-run-check input:disabled + .sc-run-check__box { opacity: 0.35; }

.sc-run-check__label {
  font-size: var(--ds-text-sm);
  font-weight: 500;
  color: var(--ds-text);
}

.sc-run-item__icon {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: var(--ds-radius);
  background: var(--ds-surface-high);
  border: 1px solid var(--ds-border-subtle);
}

.sc-run-item__icon .material-symbols-outlined {
  font-size: 18px;
  color: var(--ds-text-muted);
}

.sc-run-item.is-online .sc-run-item__icon {
  background: rgba(52, 211, 153, 0.08);
  border-color: rgba(52, 211, 153, 0.22);
}

.sc-run-item.is-online .sc-run-item__icon .material-symbols-outlined { color: #34d399; }

.sc-run-item__body {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.sc-run-item__name {
  font-size: var(--ds-text-sm);
  font-weight: 500;
  color: var(--ds-text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sc-run-item__status {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 11px;
  color: var(--ds-text-muted);
}

.sc-run-item__dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--ds-text-muted);
}

.sc-run-item.is-online .sc-run-item__dot {
  background: #34d399;
  box-shadow: 0 0 6px rgba(52, 211, 153, 0.45);
}

.sc-run-empty {
  padding: 32px 20px;
  text-align: center;
  border: 1px dashed var(--ds-border-subtle);
  border-radius: var(--ds-radius-lg);
}

.sc-run-empty .material-symbols-outlined {
  display: block;
  font-size: 32px;
  color: var(--ds-text-muted);
  opacity: 0.45;
  margin-bottom: 8px;
}

.sc-run-empty p {
  margin: 0 0 4px;
  font-size: var(--ds-text-sm);
  color: var(--ds-text-secondary);
}

.sc-run-empty small {
  font-size: var(--ds-text-xs);
  color: var(--ds-text-muted);
}

.sc-run-empty--filter {
  margin: 8px;
  padding: 20px 16px;
  border-style: solid;
  border-color: var(--ds-border-subtle);
  background: rgba(255, 255, 255, 0.02);
}

.sc-run-modal__foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.sc-run-modal__selection {
  margin: 0;
  font-size: var(--ds-text-xs);
  color: var(--ds-text-muted);
  transition: color 0.15s;
}

.sc-run-modal__selection.has-selection {
  color: var(--ds-primary);
  font-weight: 500;
}

.sc-run-modal__actions {
  display: flex;
  gap: 10px;
  flex-shrink: 0;
}

@media (max-width: 480px) {
  .sc-run-modal__foot {
    flex-direction: column;
    align-items: stretch;
  }

  .sc-run-modal__actions { justify-content: flex-end; }
}

/* Output */
.sc-output-meta {
  margin-bottom: 12px;
  font-size: var(--ds-text-sm);
  color: var(--ds-text-secondary);
}

.sc-output {
  margin: 0;
  padding: 16px;
  max-height: 400px;
  overflow: auto;
  background: #080a0e;
  border: 1px solid var(--ds-border-subtle);
  border-radius: var(--ds-radius);
  font-family: var(--ds-mono);
  font-size: 12px;
  line-height: 1.55;
  color: #c9d1d9;
  white-space: pre-wrap;
  word-break: break-word;
}
