/* Dynamic Captions peripheral paint only; native activation lives in theme.js.
   Positive owners never include #tr-stage-panel or any resize handle.
   No font, reset, layout, creative color or renderer rule crosses that boundary. */
:where(html[data-ps-theme="studio"]:is([data-ps-window="hub"][data-ps-screen="app"], [data-ps-window="workspace"][data-ps-screen="window"], [data-ps-window="monitor"][data-ps-screen="window"], [data-ps-window="assistant"][data-ps-screen="window"])) :is([data-ps-dynamic-captions="workspace"] [data-ps-dc-ui], [data-ps-dynamic-captions-portal][data-ps-dc-ui]) {
  --ps-dc-panel: var(--ps-surface-solid);
  --ps-dc-soft: var(--ps-bg-soft);
  --ps-dc-heading-bg: var(--ps-shell-header-bg);
  --ps-dc-text: var(--ps-text);
  --ps-dc-muted: var(--ps-muted);
  --ps-dc-accent: var(--ps-gold-light);
  --ps-dc-line: var(--ps-line);
  --ps-dc-shadow: 0 12px 34px #0004;
  --ps-dc-overlay: #0009;
  --ps-dc-selection: #72e6df1f;
  --ps-dc-active-bg: var(--ps-gold-mid);
  --ps-dc-active-text: var(--ps-button-text);
  --ps-dc-active-line: var(--ps-button-border);
  --ps-dc-badge-bg: #233d43;
  --ps-dc-badge-text: var(--ps-teal);
  --ps-dc-badge-line: #72e6df66;
  --ps-dc-danger: #fca5a5;
  --ps-dc-danger-bg: #451f24;
  --ps-dc-danger-line: #fca5a566;
  --ps-dc-success: #a7e2ba;
  color: var(--ps-text);
}

/* The envelope keeps its historical border widths, padding and typography. */
:where(html[data-ps-theme="studio"]:is([data-ps-window="hub"][data-ps-screen="app"], [data-ps-window="workspace"][data-ps-screen="window"], [data-ps-window="monitor"][data-ps-screen="window"], [data-ps-window="assistant"][data-ps-screen="window"]))[data-ps-dynamic-captions-active],
:where(html[data-ps-theme="studio"]:is([data-ps-window="hub"][data-ps-screen="app"], [data-ps-window="workspace"][data-ps-screen="window"], [data-ps-window="monitor"][data-ps-screen="window"], [data-ps-window="assistant"][data-ps-screen="window"]))[data-ps-dynamic-captions-active] > body {
  background: var(--ps-bg) !important;
}

:where(html[data-ps-theme="studio"]:is([data-ps-window="hub"][data-ps-screen="app"], [data-ps-window="workspace"][data-ps-screen="window"], [data-ps-window="monitor"][data-ps-screen="window"], [data-ps-window="assistant"][data-ps-screen="window"]))[data-ps-dynamic-captions-active] #section-project-detail,
:where(html[data-ps-theme="studio"]:is([data-ps-window="hub"][data-ps-screen="app"], [data-ps-window="workspace"][data-ps-screen="window"], [data-ps-window="monitor"][data-ps-screen="window"], [data-ps-window="assistant"][data-ps-screen="window"]))[data-ps-dynamic-captions-active] #projectToolsCard,
:where(html[data-ps-theme="studio"]:is([data-ps-window="hub"][data-ps-screen="app"], [data-ps-window="workspace"][data-ps-screen="window"], [data-ps-window="monitor"][data-ps-screen="window"], [data-ps-window="assistant"][data-ps-screen="window"])) [data-ps-dynamic-captions="workspace"] {
  background: var(--ps-bg);
  border-color: var(--ps-line);
  box-shadow: none;
}

:where(html[data-ps-theme="studio"]:is([data-ps-window="hub"][data-ps-screen="app"], [data-ps-window="workspace"][data-ps-screen="window"], [data-ps-window="monitor"][data-ps-screen="window"], [data-ps-window="assistant"][data-ps-screen="window"]))[data-ps-dynamic-captions-active] #detailProjectTitle {
  color: var(--ps-ink);
}

:where(html[data-ps-theme="studio"]:is([data-ps-window="hub"][data-ps-screen="app"], [data-ps-window="workspace"][data-ps-screen="window"], [data-ps-window="monitor"][data-ps-screen="window"], [data-ps-window="assistant"][data-ps-screen="window"]))[data-ps-dynamic-captions-active] #section-project-detail .admin-form-actions button {
  background: var(--ps-bg-soft);
  color: var(--ps-text);
  border-color: var(--ps-line);
}

:where(html[data-ps-theme="studio"]:is([data-ps-window="hub"][data-ps-screen="app"], [data-ps-window="workspace"][data-ps-screen="window"], [data-ps-window="monitor"][data-ps-screen="window"], [data-ps-window="assistant"][data-ps-screen="window"])) [data-ps-dynamic-captions="workspace"] [data-ps-dc-ui="header"] {
  background: var(--ps-shell-header-bg);
  border-color: var(--ps-line);
}

:where(html[data-ps-theme="studio"]:is([data-ps-window="hub"][data-ps-screen="app"], [data-ps-window="workspace"][data-ps-screen="window"], [data-ps-window="monitor"][data-ps-screen="window"], [data-ps-window="assistant"][data-ps-screen="window"])) :is([data-ps-dynamic-captions="workspace"] [data-ps-dc-ui], [data-ps-dynamic-captions-portal][data-ps-dc-ui]):is([data-ps-dc-ui="speakers"], [data-ps-dc-ui="script"], [data-ps-dc-ui="export"]) {
  background: var(--ps-bg-soft);
  border-color: var(--ps-line);
  box-shadow: 0 8px 24px #0003;
  font-family: var(--ps-font-ui);
}

:where(html[data-ps-theme="studio"]:is([data-ps-window="hub"][data-ps-screen="app"], [data-ps-window="workspace"][data-ps-screen="window"], [data-ps-window="monitor"][data-ps-screen="window"], [data-ps-window="assistant"][data-ps-screen="window"])) [data-ps-dynamic-captions-portal][data-ps-dc-ui="portal"] {
  font-family: var(--ps-font-ui);
}

:where(html[data-ps-theme="studio"]:is([data-ps-window="hub"][data-ps-screen="app"], [data-ps-window="workspace"][data-ps-screen="window"], [data-ps-window="monitor"][data-ps-screen="window"], [data-ps-window="assistant"][data-ps-screen="window"])) :is([data-ps-dynamic-captions="workspace"] [data-ps-dc-ui], [data-ps-dynamic-captions-portal][data-ps-dc-ui]) :is(.admin-subcard-icon, .admin-tab-panel-icon) {
  color: var(--ps-gold-light);
  background: var(--ps-surface-solid);
  border-color: var(--ps-line);
  box-shadow: var(--ps-shell-reflection);
}

:where(html[data-ps-theme="studio"]:is([data-ps-window="hub"][data-ps-screen="app"], [data-ps-window="workspace"][data-ps-screen="window"], [data-ps-window="monitor"][data-ps-screen="window"], [data-ps-window="assistant"][data-ps-screen="window"])) :is([data-ps-dynamic-captions="workspace"] [data-ps-dc-ui], [data-ps-dynamic-captions-portal][data-ps-dc-ui]) :is(h3, .admin-tab-panel-title, .admin-subcard-title) {
  color: var(--ps-ink);
}

:where(html[data-ps-theme="studio"]:is([data-ps-window="hub"][data-ps-screen="app"], [data-ps-window="workspace"][data-ps-screen="window"], [data-ps-window="monitor"][data-ps-screen="window"], [data-ps-window="assistant"][data-ps-screen="window"])) :is([data-ps-dynamic-captions="workspace"] [data-ps-dc-ui], [data-ps-dynamic-captions-portal][data-ps-dc-ui]) .muted {
  color: var(--ps-muted);
}

/* Explicit controls only. Native creative color pickers keep their own paint. */
:where(html[data-ps-theme="studio"]:is([data-ps-window="hub"][data-ps-screen="app"], [data-ps-window="workspace"][data-ps-screen="window"], [data-ps-window="monitor"][data-ps-screen="window"], [data-ps-window="assistant"][data-ps-screen="window"])) :is([data-ps-dynamic-captions="workspace"] [data-ps-dc-ui], [data-ps-dynamic-captions-portal][data-ps-dc-ui]) :is(input[type="text"], input[type="number"], textarea, select) {
  background: var(--ps-surface-soft);
  color: var(--ps-text);
  border-color: var(--ps-line-strong);
  caret-color: var(--ps-focus);
}

:where(html[data-ps-theme="studio"]:is([data-ps-window="hub"][data-ps-screen="app"], [data-ps-window="workspace"][data-ps-screen="window"], [data-ps-window="monitor"][data-ps-screen="window"], [data-ps-window="assistant"][data-ps-screen="window"])) :is([data-ps-dynamic-captions="workspace"] [data-ps-dc-ui], [data-ps-dynamic-captions-portal][data-ps-dc-ui]) :is(input[type="text"], input[type="number"], textarea)::placeholder {
  color: var(--ps-muted);
  opacity: .7;
}

:where(html[data-ps-theme="studio"]:is([data-ps-window="hub"][data-ps-screen="app"], [data-ps-window="workspace"][data-ps-screen="window"], [data-ps-window="monitor"][data-ps-screen="window"], [data-ps-window="assistant"][data-ps-screen="window"])) :is([data-ps-dynamic-captions="workspace"] [data-ps-dc-ui], [data-ps-dynamic-captions-portal][data-ps-dc-ui]) input:is([type="range"], [type="checkbox"]) {
  accent-color: var(--ps-gold-mid);
}

:where(html[data-ps-theme="studio"]:is([data-ps-window="hub"][data-ps-screen="app"], [data-ps-window="workspace"][data-ps-screen="window"], [data-ps-window="monitor"][data-ps-screen="window"], [data-ps-window="assistant"][data-ps-screen="window"])) :is([data-ps-dynamic-captions="workspace"] [data-ps-dc-ui], [data-ps-dynamic-captions-portal][data-ps-dc-ui]) button {
  background: var(--ps-surface-solid);
  color: var(--ps-text);
  border-color: var(--ps-line-strong);
  box-shadow: 0 2px 7px #0003;
}

:where(html[data-ps-theme="studio"]:is([data-ps-window="hub"][data-ps-screen="app"], [data-ps-window="workspace"][data-ps-screen="window"], [data-ps-window="monitor"][data-ps-screen="window"], [data-ps-window="assistant"][data-ps-screen="window"])) :is([data-ps-dynamic-captions="workspace"] [data-ps-dc-ui], [data-ps-dynamic-captions-portal][data-ps-dc-ui]) button.btn-primary {
  background: var(--ps-button-bg);
  color: var(--ps-button-text);
  border-color: var(--ps-button-border);
  box-shadow: var(--ps-button-shadow);
}

:where(html[data-ps-theme="studio"]:is([data-ps-window="hub"][data-ps-screen="app"], [data-ps-window="workspace"][data-ps-screen="window"], [data-ps-window="monitor"][data-ps-screen="window"], [data-ps-window="assistant"][data-ps-screen="window"])) :is([data-ps-dynamic-captions="workspace"] [data-ps-dc-ui], [data-ps-dynamic-captions-portal][data-ps-dc-ui]) button:hover:not(:disabled) {
  filter: brightness(1.09);
}

:where(html[data-ps-theme="studio"]:is([data-ps-window="hub"][data-ps-screen="app"], [data-ps-window="workspace"][data-ps-screen="window"], [data-ps-window="monitor"][data-ps-screen="window"], [data-ps-window="assistant"][data-ps-screen="window"])) :is([data-ps-dynamic-captions="workspace"] [data-ps-dc-ui], [data-ps-dynamic-captions-portal][data-ps-dc-ui]) :is(button, input, select, textarea):focus-visible {
  outline: 2px solid var(--ps-focus);
  outline-offset: 2px;
}

:where(html[data-ps-theme="studio"]:is([data-ps-window="hub"][data-ps-screen="app"], [data-ps-window="workspace"][data-ps-screen="window"], [data-ps-window="monitor"][data-ps-screen="window"], [data-ps-window="assistant"][data-ps-screen="window"])) :is([data-ps-dynamic-captions="workspace"] [data-ps-dc-ui], [data-ps-dynamic-captions-portal][data-ps-dc-ui]) :is(button, input, select, textarea):disabled {
  opacity: .55;
}

:where(html[data-ps-theme="studio"]:is([data-ps-window="hub"][data-ps-screen="app"], [data-ps-window="workspace"][data-ps-screen="window"], [data-ps-window="monitor"][data-ps-screen="window"], [data-ps-window="assistant"][data-ps-screen="window"])) [data-ps-dynamic-captions="workspace"] [data-ps-dc-ui="script"] th {
  background: var(--ps-surface-solid);
  color: var(--ps-gold-light);
  border-color: var(--ps-line);
}

:where(html[data-ps-theme="studio"]:is([data-ps-window="hub"][data-ps-screen="app"], [data-ps-window="workspace"][data-ps-screen="window"], [data-ps-window="monitor"][data-ps-screen="window"], [data-ps-window="assistant"][data-ps-screen="window"])) [data-ps-dynamic-captions="workspace"] [data-ps-dc-ui="script"] td {
  border-color: var(--ps-line);
}

:where(html[data-ps-theme="studio"]:is([data-ps-window="hub"][data-ps-screen="app"], [data-ps-window="workspace"][data-ps-screen="window"], [data-ps-window="monitor"][data-ps-screen="window"], [data-ps-window="assistant"][data-ps-screen="window"])) [data-ps-dynamic-captions="workspace"] [data-ps-dc-ui="export"] .projects-quota-track {
  background: var(--ps-surface-soft);
}

:where(html[data-ps-theme="studio"]:is([data-ps-window="hub"][data-ps-screen="app"], [data-ps-window="workspace"][data-ps-screen="window"], [data-ps-window="monitor"][data-ps-screen="window"], [data-ps-window="assistant"][data-ps-screen="window"])) [data-ps-dynamic-captions="workspace"] [data-ps-dc-ui="export"] .projects-quota-bar {
  background: linear-gradient(90deg, var(--ps-gold), var(--ps-teal));
}

:where(html[data-ps-theme="studio"]:is([data-ps-window="hub"][data-ps-screen="app"], [data-ps-window="workspace"][data-ps-screen="window"], [data-ps-window="monitor"][data-ps-screen="window"], [data-ps-window="assistant"][data-ps-screen="window"])) [data-ps-dynamic-captions-portal][data-ps-dc-ui="portal"] .admin-subcard {
  transform: none;
}

/* Shared markers own these two windows only. Their timeline controls are excluded. */
:where(html[data-ps-theme="studio"]:is([data-ps-window="hub"][data-ps-screen="app"], [data-ps-window="workspace"][data-ps-screen="window"], [data-ps-window="monitor"][data-ps-screen="window"], [data-ps-window="assistant"][data-ps-screen="window"])) [data-ps-dynamic-captions-portal]:is([data-ps-dynamic-captions-portal="marker-list"], [data-ps-dynamic-captions-portal="marker-editor"]) {
  background: var(--ps-surface-solid);
  color: var(--ps-text);
  border-color: var(--ps-line-strong);
  box-shadow: 0 18px 45px #0007;
}

:where(html[data-ps-theme="studio"]:is([data-ps-window="hub"][data-ps-screen="app"], [data-ps-window="workspace"][data-ps-screen="window"], [data-ps-window="monitor"][data-ps-screen="window"], [data-ps-window="assistant"][data-ps-screen="window"])) [data-ps-dynamic-captions-portal] .ps-project-marker-window-header {
  background: var(--ps-shell-header-bg);
  color: var(--ps-ink);
  border-color: var(--ps-line);
}

:where(html[data-ps-theme="studio"]:is([data-ps-window="hub"][data-ps-screen="app"], [data-ps-window="workspace"][data-ps-screen="window"], [data-ps-window="monitor"][data-ps-screen="window"], [data-ps-window="assistant"][data-ps-screen="window"])) [data-ps-dynamic-captions-portal] :is(.ps-project-marker-item, .ps-project-marker-export) {
  background: var(--ps-surface-soft);
  color: var(--ps-text);
  border-color: var(--ps-line);
}

:where(html[data-ps-theme="studio"]:is([data-ps-window="hub"][data-ps-screen="app"], [data-ps-window="workspace"][data-ps-screen="window"], [data-ps-window="monitor"][data-ps-screen="window"], [data-ps-window="assistant"][data-ps-screen="window"])) [data-ps-dynamic-captions-portal] :is(.ps-project-marker-item, .ps-project-marker-export):hover:not(:disabled) {
  background: var(--ps-bg-soft);
  border-color: var(--ps-gold);
}

:where(html[data-ps-theme="studio"]:is([data-ps-window="hub"][data-ps-screen="app"], [data-ps-window="workspace"][data-ps-screen="window"], [data-ps-window="monitor"][data-ps-screen="window"], [data-ps-window="assistant"][data-ps-screen="window"])) [data-ps-dynamic-captions-portal] :is(.ps-project-marker-field, .ps-project-marker-empty) {
  color: var(--ps-muted);
}

:where(html[data-ps-theme="studio"]:is([data-ps-window="hub"][data-ps-screen="app"], [data-ps-window="workspace"][data-ps-screen="window"], [data-ps-window="monitor"][data-ps-screen="window"], [data-ps-window="assistant"][data-ps-screen="window"])) [data-ps-dynamic-captions-portal] .ps-project-marker-item-time,
:where(html[data-ps-theme="studio"]:is([data-ps-window="hub"][data-ps-screen="app"], [data-ps-window="workspace"][data-ps-screen="window"], [data-ps-window="monitor"][data-ps-screen="window"], [data-ps-window="assistant"][data-ps-screen="window"])) [data-ps-dynamic-captions-portal] .ps-project-marker-field input[readonly] {
  color: var(--ps-gold-light);
}

:where(html[data-ps-theme="studio"]:is([data-ps-window="hub"][data-ps-screen="app"], [data-ps-window="workspace"][data-ps-screen="window"], [data-ps-window="monitor"][data-ps-screen="window"], [data-ps-window="assistant"][data-ps-screen="window"])) [data-ps-dynamic-captions-portal] .ps-project-marker-status {
  color: var(--ps-dc-danger);
}
