/* B candidate: S1 production black/pink colors over the unchanged A geometry.
   Typography/media/business remain unchanged. The final B-shell section is the
   user-authorized navigation/header layout exception. */
html[data-ui-skin="horse"] body.sw,
html[data-ui-skin="horse"] body.director-admin {
  --bg: #080709;
  --surface: #111014;
  --surface-strong: #1b171f;
  --surface-muted: #17141a;
  --text: #f6f1f5;
  --muted: #b8afb6;
  --subtle: #a99fa8;
  --line: rgba(255, 255, 255, .14);
  --brand: #e477ba;
  --lime: #e477ba;
  --brand-strong: #f6deed;
  --brand-ink: #21131c;
  --accent: #e6b45c;
  --yellow: #e6b45c;
  --danger: #ef7180;
  --ui-success: #58c99b;
  --ui-action-fill: #efcde2;
  --ui-control-bg: #0c0a0d;
  --ui-control-line: #706374;
  --ui-selected-bg: #2d1c2b;
  --ui-hover: #27202c;
  --ui-warning-bg: #292014;
  --ui-warning-line: #856c3f;
  --ui-warning-text: #f0cc86;
  --ui-danger-bg: #2e181e;
  --ui-danger-line: #97515e;
  --ui-danger-text: #ffb3be;
  --ui-success-bg: #14251e;
  --ui-success-line: #3d8065;
  --ui-success-text: #8bddb8;
  --shadow: none;
  --radius: 8px;
  background: var(--bg);
  color: var(--text);
  scrollbar-color: #706374 var(--ui-control-bg);
}

html[data-ui-skin="horse"] body.sw *,
html[data-ui-skin="horse"] body.director-admin * {
  scrollbar-color: #706374 var(--ui-control-bg);
}

html[data-ui-skin="horse"] body.sw a,
html[data-ui-skin="horse"] body.director-admin a {
  color: var(--brand);
}

html[data-ui-skin="horse"] body.sw ::selection,
html[data-ui-skin="horse"] body.director-admin ::selection {
  background: var(--ui-action-fill);
  color: var(--brand-ink);
}

/* Shared controls. Every dimension remains owned by the original sheets. */
html[data-ui-skin="horse"] body.sw button,
html[data-ui-skin="horse"] body.sw .button,
html[data-ui-skin="horse"] body.director-admin .secondary {
  background: var(--surface-muted);
  border-color: var(--ui-control-line);
  border-radius: 6px;
  color: var(--text);
  box-shadow: none;
}

html[data-ui-skin="horse"] body.sw button:hover:not(:disabled),
html[data-ui-skin="horse"] body.sw .button:hover,
html[data-ui-skin="horse"] body.director-admin .secondary:hover:not(:disabled),
html[data-ui-skin="horse"] body.director-admin a.secondary:hover {
  background: var(--ui-hover);
  border-color: #b48aa7;
  color: var(--text);
}

html[data-ui-skin="horse"] body.sw .primary,
html[data-ui-skin="horse"] body.director-admin button:not(.secondary):not(.danger),
html[data-ui-skin="horse"] body.director-admin .button:not(.secondary):not(.danger) {
  background: var(--ui-action-fill);
  border-color: var(--ui-action-fill);
  border-radius: 6px;
  color: var(--brand-ink);
  box-shadow: none;
}

html[data-ui-skin="horse"] body.sw .primary:hover:not(:disabled),
html[data-ui-skin="horse"] body.director-admin button:not(.secondary):not(.danger):hover:not(:disabled),
html[data-ui-skin="horse"] body.director-admin .button:not(.secondary):not(.danger):hover {
  background: var(--brand-strong);
  border-color: var(--brand-strong);
  color: var(--brand-ink);
}

html[data-ui-skin="horse"] body.sw .danger,
html[data-ui-skin="horse"] body.director-admin .danger {
  background: var(--ui-danger-bg);
  border-color: var(--ui-danger-line);
  border-radius: 6px;
  color: var(--ui-danger-text);
}

html[data-ui-skin="horse"] body.sw .danger:hover:not(:disabled),
html[data-ui-skin="horse"] body.director-admin .danger:hover:not(:disabled) {
  background: #43232d;
  border-color: var(--danger);
  color: #ffd3da;
}

html[data-ui-skin="horse"] body.sw input:not([type="checkbox"]):not([type="radio"]),
html[data-ui-skin="horse"] body.sw textarea,
html[data-ui-skin="horse"] body.sw select,
html[data-ui-skin="horse"] body.director-admin input,
html[data-ui-skin="horse"] body.director-admin select {
  background: var(--ui-control-bg);
  border-color: var(--ui-control-line);
  border-radius: 6px;
  color: var(--text);
  caret-color: var(--brand);
  box-shadow: none;
}

html[data-ui-skin="horse"] body.sw input::placeholder,
html[data-ui-skin="horse"] body.sw textarea::placeholder,
html[data-ui-skin="horse"] body.director-admin input::placeholder {
  color: var(--subtle);
}

html[data-ui-skin="horse"] body.sw input:focus,
html[data-ui-skin="horse"] body.sw textarea:focus,
html[data-ui-skin="horse"] body.sw select:focus,
html[data-ui-skin="horse"] body.director-admin input:focus,
html[data-ui-skin="horse"] body.director-admin select:focus {
  border-color: var(--brand);
}

html[data-ui-skin="horse"] body.sw :focus-visible,
html[data-ui-skin="horse"] body.director-admin :focus-visible {
  outline-color: var(--brand);
}

html[data-ui-skin="horse"] body.sw input[type="checkbox"],
html[data-ui-skin="horse"] body.sw input[type="radio"] {
  accent-color: var(--brand);
}

html[data-ui-skin="horse"] body.sw button:disabled,
html[data-ui-skin="horse"] body.sw .primary:disabled,
html[data-ui-skin="horse"] body.director-admin button:disabled {
  background: #201a23;
  border-color: var(--ui-control-line);
  color: #d1c3cf;
}

html[data-ui-skin="horse"] body.sw input:disabled,
html[data-ui-skin="horse"] body.sw textarea:disabled,
html[data-ui-skin="horse"] body.sw select:disabled,
html[data-ui-skin="horse"] body.director-admin input:disabled,
html[data-ui-skin="horse"] body.director-admin select:disabled {
  background: var(--surface-muted);
  color: var(--muted);
}

/* Workbench shell, step navigation and project list. */
html[data-ui-skin="horse"] body.sw .topbar,
html[data-ui-skin="horse"] body.sw .workspace {
  background: var(--surface);
  border-color: var(--line);
  border-radius: 8px;
  box-shadow: none;
}

html[data-ui-skin="horse"] body.sw .topbar::after {
  color: transparent;
}

html[data-ui-skin="horse"] body.sw .logo {
  filter: none;
}

html[data-ui-skin="horse"] body.sw .version-badge {
  background: var(--ui-selected-bg);
  border-color: #8f577d;
  color: #f5c5e3;
}

html[data-ui-skin="horse"] body.sw .topbar .api-btn {
  background: var(--ui-action-fill);
  border-color: var(--ui-action-fill);
  color: var(--brand-ink);
  border-radius: 6px;
}

html[data-ui-skin="horse"] body.sw .topbar .api-btn[data-configured="true"] {
  background: var(--ui-success-bg);
  border-color: var(--ui-success-line);
  color: var(--ui-success-text);
}

html[data-ui-skin="horse"] body.sw .topbar .login-link {
  background: var(--surface-muted);
  border-color: var(--ui-control-line);
  color: var(--text);
}

html[data-ui-skin="horse"] body.sw .topbar .api-btn:hover:not(:disabled) {
  border-color: var(--brand);
}

html[data-ui-skin="horse"] body.sw .workspace-page-nav a {
  background: var(--surface);
  border-color: var(--ui-control-line);
  border-radius: 6px;
  color: var(--muted);
}

html[data-ui-skin="horse"] body.sw .workspace-page-nav a:hover,
html[data-ui-skin="horse"] body.sw .workspace-page-nav a:focus-visible {
  background: var(--ui-hover);
  border-color: var(--brand);
  color: var(--text);
}

html[data-ui-skin="horse"] body.sw .workspace-page-nav a[aria-current="page"] {
  background: var(--ui-selected-bg);
  border-color: var(--brand);
  color: #f5c5e3;
}

html[data-ui-skin="horse"] body.sw .steps button {
  background: transparent;
  border-color: transparent;
  border-radius: 0;
  color: var(--muted);
}

html[data-ui-skin="horse"] body.sw .steps button:hover:not(:disabled) {
  background: var(--surface-muted);
  border-color: transparent;
  color: var(--text);
}

html[data-ui-skin="horse"] body.sw .steps button[aria-current],
html[data-ui-skin="horse"] body.sw .steps button[aria-current]:hover:not(:disabled) {
  background: var(--ui-selected-bg);
  border-bottom-color: var(--brand);
  color: #f5c5e3;
}

html[data-ui-skin="horse"] body.sw :is(.project-card,.empty-state,.setting-panel,.asset-card,.job-panel,.shot-details>div) {
  background: var(--surface);
  border-color: var(--line);
  border-radius: 8px;
  box-shadow: none;
}

html[data-ui-skin="horse"] body.sw :is(.empty-state,.idea-placeholder,.asset-empty,.empty-versions) {
  border-color: var(--ui-control-line);
  color: var(--muted);
}

html[data-ui-skin="horse"] body.sw .project-card footer button {
  background: transparent;
}

html[data-ui-skin="horse"] body.sw .project-card footer button:hover:not(:disabled) {
  background: var(--ui-hover);
}

html[data-ui-skin="horse"] body.sw .project-card footer .danger {
  color: var(--ui-danger-text);
}

/* Creative choices and asset/reference media retain their original geometry. */
html[data-ui-skin="horse"] body.sw .idea-option {
  background: var(--surface) !important;
  border-color: var(--ui-control-line);
  border-radius: 8px;
}

html[data-ui-skin="horse"] body.sw .idea-option:hover:not(:disabled) {
  background: var(--ui-hover) !important;
  border-color: #b48aa7;
}

html[data-ui-skin="horse"] body.sw .idea-option[aria-pressed="true"],
html[data-ui-skin="horse"] body.sw .style-options button[aria-pressed="true"] {
  background: var(--ui-selected-bg) !important;
  border-color: var(--brand);
  color: #f5c5e3;
}

html[data-ui-skin="horse"] body.sw .product-upload.has-image span {
  background: #17141aeF;
  color: var(--text);
}

html[data-ui-skin="horse"] body.sw [data-product-drop][data-drag-over="true"] {
  background: var(--ui-selected-bg);
  border-color: var(--brand);
}

html[data-ui-skin="horse"] body.sw :is(.asset-prompt,.shot-details>div) {
  color: #d2c6d0;
}

html[data-ui-skin="horse"] body.sw :is(.asset-media,.asset-preview,.image-preview-viewport) {
  background: var(--ui-control-bg);
  border-radius: 6px;
}

html[data-ui-skin="horse"] body.sw .asset-preview:hover:not(:disabled) {
  background: var(--ui-control-bg);
}

html[data-ui-skin="horse"] body.sw .asset-candidate[data-selected="true"] .candidate-choice {
  color: #f5c5e3;
}

html[data-ui-skin="horse"] body.sw .character-placeholder {
  background: #2c2430;
  color: var(--muted);
}

html[data-ui-skin="horse"] body.sw :is(.video-frame,.empty-versions) {
  background: var(--ui-control-bg);
  border-color: var(--ui-control-line);
  border-radius: 8px;
  color: var(--muted);
}

html[data-ui-skin="horse"] body.sw .video-frame.has-video {
  background: #080709;
}

html[data-ui-skin="horse"] body.sw .skeleton {
  background: #211b25;
  border-radius: 8px;
}

/* Messages and live states keep green / amber / red meanings. */
html[data-ui-skin="horse"] body.sw .sw-notice,
html[data-ui-skin="horse"] body.director-admin .notice {
  background: #251c29;
  border-color: #8b6b85;
  border-radius: 8px;
  color: #f2dceb;
}

html[data-ui-skin="horse"] body.sw .sw-notice[data-error="true"],
html[data-ui-skin="horse"] body.director-admin .notice[data-error="true"] {
  background: var(--ui-danger-bg);
  border-color: var(--ui-danger-line);
  color: var(--ui-danger-text);
}

html[data-ui-skin="horse"] body.sw :is(.notice-inline,.fixture-notice),
html[data-ui-skin="horse"] body.director-admin .fixture-notice {
  background: var(--ui-warning-bg);
  border-color: var(--ui-warning-line);
  border-radius: 8px;
  color: var(--ui-warning-text);
}

html[data-ui-skin="horse"] body.sw :is(.retention-note,.script-access) {
  background: var(--surface-muted);
  border-color: var(--line);
  color: var(--text);
}
html[data-ui-skin="horse"] body.sw .retention-note svg {
  color: var(--brand);
}
html[data-ui-skin="horse"] body.sw .script-access>p {
  color: var(--muted);
}

html[data-ui-skin="horse"] body.sw :is(.expired,.candidate-hint.selection-needed) {
  color: var(--ui-warning-text);
}

html[data-ui-skin="horse"] body.sw .status[data-status="succeeded"] {
  color: var(--ui-success-text);
}

html[data-ui-skin="horse"] body.sw .status[data-status="failed"],
html[data-ui-skin="horse"] body.sw .error-text,
html[data-ui-skin="horse"] body.director-admin .error {
  color: var(--ui-danger-text);
}

html[data-ui-skin="horse"] body.sw :is(.status[data-status="unknown"],.status[data-status="needs_credentials"]) {
  color: var(--ui-warning-text);
}

html[data-ui-skin="horse"] body.sw .license-status {
  color: var(--muted);
}

html[data-ui-skin="horse"] body.sw .license-status::before {
  background: var(--ui-success);
}

html[data-ui-skin="horse"] body.sw .license-status[data-state="active"] {
  color: var(--ui-success-text);
}

html[data-ui-skin="horse"] body.sw .license-status[data-state="warning"] {
  color: var(--ui-warning-text);
}

html[data-ui-skin="horse"] body.sw .license-status[data-state="warning"]::before {
  background: var(--yellow);
}

html[data-ui-skin="horse"] body.sw .license-status[data-state="signed-out"]::before {
  background: var(--muted);
}

html[data-ui-skin="horse"] body.sw .script-admin-entry {
  background: var(--surface);
  color: var(--muted);
}

html[data-ui-skin="horse"] body.sw .skip-link {
  background: var(--ui-action-fill);
  color: var(--brand-ink) !important;
}

/* All dialogs, including the top-layer backdrop, remain scoped to this skin. */
html[data-ui-skin="horse"] body.sw dialog,
html[data-ui-skin="horse"] body.director-admin dialog {
  background: var(--surface-strong);
  border-color: var(--ui-control-line);
  border-radius: 8px;
  color: var(--text);
  box-shadow: none;
}

html[data-ui-skin="horse"] body.sw dialog::backdrop,
html[data-ui-skin="horse"] body.director-admin dialog::backdrop {
  background: rgba(0, 0, 0, .76);
}

/* Same admin panels and nine-column card table; no new layout system. */
html[data-ui-skin="horse"] body.director-admin .panel {
  background: var(--surface);
  border-color: var(--line);
  border-radius: 8px;
  box-shadow: none;
}

html[data-ui-skin="horse"] body.director-admin :is(label,.date-cell) {
  color: #cbc0c9;
}

html[data-ui-skin="horse"] body.director-admin :is(.route-note,small,.table-hint,.empty-cell) {
  color: var(--muted);
}

html[data-ui-skin="horse"] body.director-admin .table-wrap {
  border-color: var(--line);
  border-radius: 8px;
  scrollbar-color: #706374 var(--ui-control-bg);
}

html[data-ui-skin="horse"] body.director-admin .activation-table th {
  background: var(--ui-control-bg);
  border-color: var(--line);
  color: #d6cad3;
}

html[data-ui-skin="horse"] body.director-admin .activation-table td {
  border-color: var(--line);
}

html[data-ui-skin="horse"] body.director-admin .activation-table tbody tr:hover {
  background: #211b25;
}

html[data-ui-skin="horse"] body.director-admin .code-value {
  color: #f6e8f1;
}

html[data-ui-skin="horse"] body.director-admin .badge-unused {
  background: #29222d;
  color: #d3c6d0;
}

html[data-ui-skin="horse"] body.director-admin .badge-active {
  background: var(--ui-success-bg);
  color: var(--ui-success-text);
}

html[data-ui-skin="horse"] body.director-admin .badge-expired {
  background: var(--ui-warning-bg);
  color: var(--ui-warning-text);
}

html[data-ui-skin="horse"] body.director-admin .badge-revoked {
  background: var(--ui-danger-bg);
  color: var(--ui-danger-text);
}

/* B-shell small revision: remove only the outer navigation, not project steps. */
html[data-ui-skin="horse"] body.sw .shell {
  grid-template-columns: minmax(0, 1fr);
}
html[data-ui-skin="horse"] body.sw .workspace {
  grid-column: 1;
}
html[data-ui-skin="horse"] body.sw .workspace-page-nav,
html[data-ui-skin="horse"] body.sw #openScriptApiKey {
  display: none !important;
}
html[data-ui-skin="horse"] body.sw .brand h1,
html[data-ui-skin="horse"] body.sw .version-badge {
  color: #fff;
}
html[data-ui-skin="horse"] body.sw .brand .director-brand-accent {
  color: var(--brand);
}
/* S1 theme control, with the account group retaining the right edge. */
html[data-ui-skin="horse"] :is(body.sw,body.director-admin) .theme-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: none;
  gap: 7px;
  min-width: 80px;
  min-height: 40px;
  margin: 0;
  padding: 0 10px;
  border: 1px solid var(--ui-control-line);
  border-radius: 6px;
  background: var(--surface-muted);
  color: var(--text);
  font: 650 14px/1.6 var(--font);
  white-space: nowrap;
}
html[data-ui-skin="horse"] :is(body.sw,body.director-admin) .theme-toggle svg {
  width: 16px;
  height: 16px;
  flex: none;
}
html[data-ui-skin="horse"] :is(body.sw,body.director-admin) .theme-toggle:hover:not(:disabled) {
  background: var(--ui-hover);
  border-color: var(--brand);
}
@media (max-width: 700px) {
  html[data-ui-skin="horse"] body.sw .topbar {
    grid-template-columns: 48px minmax(0, 1fr) auto;
  }
  html[data-ui-skin="horse"] body.sw .topbar .logo-link {
    grid-row: 1;
  }
  html[data-ui-skin="horse"] body.sw .topbar .brand {
    grid-column: 2;
    grid-row: 1;
  }
  html[data-ui-skin="horse"] body.sw .license-status {
    display: flex;
    grid-column: 1 / 3;
    grid-row: 2;
    margin-left: 0;
    justify-self: end;
  }
  html[data-ui-skin="horse"] body.sw .topbar #accountLabel {
    grid-column: 3;
    grid-row: 2;
    justify-self: end;
    max-width: 100%;
  }
  html[data-ui-skin="horse"] :is(body.sw,body.director-admin) .theme-toggle {
    min-width: 44px;
    min-height: 44px;
    width: 44px;
    padding: 0;
  }
  html[data-ui-skin="horse"] :is(body.sw,body.director-admin) .theme-toggle span {
    display: none;
  }
  html[data-ui-skin="horse"] body.sw .topbar .theme-toggle {
    grid-column: 3;
    grid-row: 1;
    justify-self: end;
  }
}
