/* Lot 9.8: only the actual Subtasks panel inside the authenticated HUB fiche.
   Native handlers, dimensions, grouping positions and disabled reorder stay intact.
   Level hues remain data-driven; mix them with the dark surface, not white.
   No font/color inheritance crosses into Project Sheet, Diagram or templates.
   Line boxes match the historical controls; no layout or hit-target overrides. */

:where(html[data-ps-theme="studio"][data-ps-window="hub"][data-ps-screen="app"]) #productionTrackerRoot > [data-ps-tracker-view="details"] .pt-subtasks-column > .pt-subtasks-panel {
  background: var(--ps-bg);
  color: var(--ps-text);
  font-family: var(--ps-font-ui);
  line-height: 21px;
  color-scheme: dark;
  overflow-anchor: none;
}

:where(html[data-ps-theme="studio"][data-ps-window="hub"][data-ps-screen="app"]) #productionTrackerRoot > [data-ps-tracker-view="details"] .pt-subtasks-column > .pt-subtasks-panel :is(button, input, select) {
  font-family: var(--ps-font-ui);
}

:where(html[data-ps-theme="studio"][data-ps-window="hub"][data-ps-screen="app"]) #productionTrackerRoot > [data-ps-tracker-view="details"] .pt-subtasks-column > .pt-subtasks-panel .pt-subtasks-header {
  background: var(--ps-bg);
}

:where(html[data-ps-theme="studio"][data-ps-window="hub"][data-ps-screen="app"]) #productionTrackerRoot > [data-ps-tracker-view="details"] .pt-subtasks-column > .pt-subtasks-panel h3 {
  color: var(--ps-ink);
  font-weight: 600;
  line-height: 20px;
}

:where(html[data-ps-theme="studio"][data-ps-window="hub"][data-ps-screen="app"]) #productionTrackerRoot > [data-ps-tracker-view="details"] .pt-subtasks-column > .pt-subtasks-panel .muted {
  color: var(--ps-muted);
  line-height: 17px;
}

:where(html[data-ps-theme="studio"][data-ps-window="hub"][data-ps-screen="app"]) #productionTrackerRoot > [data-ps-tracker-view="details"] .pt-subtasks-column > .pt-subtasks-panel .pt-panel-project-name {
  color: var(--ps-muted);
  font-weight: 600;
  line-height: 17px;
}

:where(html[data-ps-theme="studio"][data-ps-window="hub"][data-ps-screen="app"]) #productionTrackerRoot > [data-ps-tracker-view="details"] .pt-subtasks-column > .pt-subtasks-panel .pt-subtasks-progress {
  background: var(--ps-surface-solid);
  box-shadow: inset 0 0 0 1px var(--ps-line);
}

:where(html[data-ps-theme="studio"][data-ps-window="hub"][data-ps-screen="app"]) #productionTrackerRoot > [data-ps-tracker-view="details"] .pt-subtasks-column > .pt-subtasks-panel .pt-subtasks-progress-bar {
  background: linear-gradient(90deg, var(--ps-copper), var(--ps-gold));
}

:where(html[data-ps-theme="studio"][data-ps-window="hub"][data-ps-screen="app"]) #productionTrackerRoot > [data-ps-tracker-view="details"] .pt-subtasks-column > .pt-subtasks-panel .pt-subtask-new-button {
  background: var(--ps-button-bg);
  color: var(--ps-button-text);
  border-color: var(--ps-button-border);
  box-shadow: var(--ps-button-shadow);
  font-weight: 600;
  line-height: 19px;
}

:where(html[data-ps-theme="studio"][data-ps-window="hub"][data-ps-screen="app"]) #productionTrackerRoot > [data-ps-tracker-view="details"] .pt-subtasks-column > .pt-subtasks-panel .pt-subtask-new-button:hover:not(:disabled) {
  background: var(--ps-button-hover);
  color: var(--ps-button-text);
}

:where(html[data-ps-theme="studio"][data-ps-window="hub"][data-ps-screen="app"]) #productionTrackerRoot > [data-ps-tracker-view="details"] .pt-subtasks-column > .pt-subtasks-panel #ptSubtasksList {
  background: var(--ps-bg);
  scrollbar-color: var(--ps-line-strong) var(--ps-bg);
  overflow-anchor: none;
}

:where(html[data-ps-theme="studio"][data-ps-window="hub"][data-ps-screen="app"]) #productionTrackerRoot > [data-ps-tracker-view="details"] .pt-subtasks-column > .pt-subtasks-panel .pt-subtasks-empty {
  background: var(--ps-surface-soft);
  color: var(--ps-muted);
  border-color: var(--ps-line-strong);
}

:where(html[data-ps-theme="studio"][data-ps-window="hub"][data-ps-screen="app"]) #productionTrackerRoot > [data-ps-tracker-view="details"] .pt-subtasks-column > .pt-subtasks-panel #ptSubtasksList > .pt-subtask-row::before {
  background: color-mix(in srgb, var(--pt-level-color, #e2e8f0) 8%, var(--ps-surface-solid));
  border-color: color-mix(in srgb, var(--pt-level-color, #e2e8f0) 48%, var(--ps-line));
}

:where(html[data-ps-theme="studio"][data-ps-window="hub"][data-ps-screen="app"]) #productionTrackerRoot > [data-ps-tracker-view="details"] .pt-subtasks-column > .pt-subtasks-panel #ptSubtasksList > .pt-subtask-row:is(.pt-level-start, .pt-level-single)::after {
  background: var(--ps-surface-solid);
  color: var(--ps-ink);
  border-color: color-mix(in srgb, var(--pt-level-color, #e2e8f0) 48%, var(--ps-line));
  box-shadow: 0 2px 7px #0003;
  font-weight: 600;
}

:where(html[data-ps-theme="studio"][data-ps-window="hub"][data-ps-screen="app"]) #productionTrackerRoot > [data-ps-tracker-view="details"] .pt-subtasks-column > .pt-subtasks-panel .pt-subtask-card {
  background: var(--ps-bg-soft);
  border-color: var(--ps-line);
  box-shadow: none;
}

:where(html[data-ps-theme="studio"][data-ps-window="hub"][data-ps-screen="app"]) #productionTrackerRoot > [data-ps-tracker-view="details"] .pt-subtasks-column > .pt-subtasks-panel .pt-subtask-row.is-done > .pt-subtask-card {
  background: linear-gradient(90deg, #22c55e55, #22c55e22 8px, transparent 8px), var(--ps-surface-soft);
  border-color: #4ade8080;
  box-shadow: inset 0 0 0 1px #4ade8014;
}

:where(html[data-ps-theme="studio"][data-ps-window="hub"][data-ps-screen="app"]) #productionTrackerRoot > [data-ps-tracker-view="details"] .pt-subtasks-column > .pt-subtasks-panel .pt-subtask-row.is-diagram-selected > .pt-subtask-card {
  background-color: var(--ps-surface-solid);
  border-color: var(--ps-gold);
  box-shadow: 0 0 0 4px #c9a97729, 0 12px 24px #0003;
}

:where(html[data-ps-theme="studio"][data-ps-window="hub"][data-ps-screen="app"]) #productionTrackerRoot > [data-ps-tracker-view="details"] .pt-subtasks-column > .pt-subtasks-panel .pt-subtask-title-input {
  background: transparent;
  color: var(--ps-text);
  font-weight: 600;
  line-height: 19px;
  box-shadow: none;
}

:where(html[data-ps-theme="studio"][data-ps-window="hub"][data-ps-screen="app"]) #productionTrackerRoot > [data-ps-tracker-view="details"] .pt-subtasks-column > .pt-subtasks-panel .pt-subtask-title-input.is-done {
  color: #86efac;
  font-weight: 600;
}

:where(html[data-ps-theme="studio"][data-ps-window="hub"][data-ps-screen="app"]) #productionTrackerRoot > [data-ps-tracker-view="details"] .pt-subtasks-column > .pt-subtasks-panel .pt-subtask-title-input:focus {
  background: var(--ps-surface-solid);
  color: var(--ps-text);
  box-shadow: inset 0 0 0 2px var(--ps-focus);
}

:where(html[data-ps-theme="studio"][data-ps-window="hub"][data-ps-screen="app"]) #productionTrackerRoot > [data-ps-tracker-view="details"] .pt-subtasks-column > .pt-subtasks-panel :is(.pt-subtask-pm-select, .pt-subtask-due-date) {
  background: var(--ps-surface-soft);
  color: var(--ps-text);
  border-color: var(--ps-line-strong);
  box-shadow: none;
  font-weight: 600;
}

:where(html[data-ps-theme="studio"][data-ps-window="hub"][data-ps-screen="app"]) #productionTrackerRoot > [data-ps-tracker-view="details"] .pt-subtasks-column > .pt-subtasks-panel :is(.pt-subtask-pm-select, .pt-subtask-due-date):hover:not(:disabled) {
  background: var(--ps-surface-solid);
  border-color: var(--ps-gold);
}

:where(html[data-ps-theme="studio"][data-ps-window="hub"][data-ps-screen="app"]) #productionTrackerRoot > [data-ps-tracker-view="details"] .pt-subtasks-column > .pt-subtasks-panel :is(.pt-subtask-pm-select, .pt-subtask-due-date):focus {
  background: var(--ps-surface-solid);
  outline: 2px solid var(--ps-focus);
  outline-offset: -2px;
  box-shadow: none;
}

:where(html[data-ps-theme="studio"][data-ps-window="hub"][data-ps-screen="app"]) #productionTrackerRoot > [data-ps-tracker-view="details"] .pt-subtasks-column > .pt-subtasks-panel .pt-subtask-pm-select :is(option, optgroup) {
  background: var(--ps-surface-soft);
  color: var(--ps-text);
}

:where(html[data-ps-theme="studio"][data-ps-window="hub"][data-ps-screen="app"]) #productionTrackerRoot > [data-ps-tracker-view="details"] .pt-subtasks-column > .pt-subtasks-panel input[type="checkbox"] {
  accent-color: var(--ps-gold);
}

:where(html[data-ps-theme="studio"][data-ps-window="hub"][data-ps-screen="app"]) #productionTrackerRoot > [data-ps-tracker-view="details"] .pt-subtasks-column > .pt-subtasks-panel input[type="checkbox"]:checked {
  accent-color: #4ade80;
}

:where(html[data-ps-theme="studio"][data-ps-window="hub"][data-ps-screen="app"]) #productionTrackerRoot > [data-ps-tracker-view="details"] .pt-subtasks-column > .pt-subtasks-panel input[type="checkbox"]:focus-visible {
  outline: 2px solid var(--ps-focus);
  outline-offset: 2px;
}

:where(html[data-ps-theme="studio"][data-ps-window="hub"][data-ps-screen="app"]) #productionTrackerRoot > [data-ps-tracker-view="details"] .pt-subtasks-column > .pt-subtasks-panel .pt-subtask-delete {
  background: var(--ps-surface-soft);
  color: var(--ps-muted);
  border-color: var(--ps-line);
}

:where(html[data-ps-theme="studio"][data-ps-window="hub"][data-ps-screen="app"]) #productionTrackerRoot > [data-ps-tracker-view="details"] .pt-subtasks-column > .pt-subtasks-panel .pt-subtask-delete:hover:not(:disabled) {
  background: #351d22;
  color: #fca5a5;
  border-color: #f8717180;
  box-shadow: 0 8px 18px #0003;
}

:where(html[data-ps-theme="studio"][data-ps-window="hub"][data-ps-screen="app"]) #productionTrackerRoot > [data-ps-tracker-view="details"] .pt-subtasks-column > .pt-subtasks-panel button:focus-visible {
  outline: 2px solid var(--ps-focus);
  outline-offset: -2px;
}

:where(html[data-ps-theme="studio"][data-ps-window="hub"][data-ps-screen="app"]) #productionTrackerRoot > [data-ps-tracker-view="details"] .pt-subtasks-column > .pt-subtasks-panel :is(input, select, button):disabled {
  color: var(--ps-muted);
  opacity: .65;
  cursor: not-allowed;
  box-shadow: none;
}

:where(html[data-ps-theme="studio"][data-ps-window="hub"][data-ps-screen="app"]) #productionTrackerRoot > [data-ps-tracker-view="details"] .pt-subtasks-column > .pt-subtasks-panel input::selection {
  background: var(--ps-gold);
  color: var(--ps-button-text);
}

:where(html[data-ps-theme="studio"][data-ps-window="hub"][data-ps-screen="app"]) #productionTrackerRoot > [data-ps-tracker-view="details"] .pt-subtasks-column > .pt-subtasks-panel .pt-subtask-row.pt-subtask-highlight > .pt-subtask-card {
  animation-name: ps-subtasks-focus-studio;
}

/* Same historical timing/class; dark paint throughout the focus animation. */
@keyframes ps-subtasks-focus-studio {
  0% { box-shadow: 0 0 0 0 #c9a977f2; background-color: var(--ps-surface-solid); }
  45% { box-shadow: 0 0 0 8px #c9a9772e; background-color: var(--ps-bg-soft); }
  100% { box-shadow: 0 0 0 0 #c9a97700; background-color: var(--ps-bg-soft); }
}
