/* Lot 9.6: the main fiche only. Never inherit Studio font/color/color-scheme
   from the page, settings panel, or its body: three historical editors live
   below the general fields. Their roots, controls, nodes, cells and templates
   are deliberately absent from every control selector below. */
:where(html[data-ps-theme="studio"][data-ps-window="hub"][data-ps-screen="app"]) #productionTrackerRoot > [data-ps-tracker-view="details"] {
  background: var(--ps-bg);
  /* Prevent Chromium anchoring the scroll to a field whose font just changed. */
  overflow-anchor: none;
}

:where(html[data-ps-theme="studio"][data-ps-window="hub"][data-ps-screen="app"]) #productionTrackerRoot > [data-ps-tracker-view="details"] > .pt-detail-header {
  background: var(--ps-bg-soft);
  border-color: var(--ps-line);
  box-shadow: var(--ps-shell-reflection);
}

:where(html[data-ps-theme="studio"][data-ps-window="hub"][data-ps-screen="app"]) #productionTrackerRoot > [data-ps-tracker-view="details"] > .projects-panel {
  background: var(--ps-bg-soft);
  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"] > .projects-panel > .projects-panel-header {
  background: var(--ps-surface-solid);
  border-color: var(--ps-line);
}

/* Apply typography only at owned leaves/branches, never across an editor. */
:where(html[data-ps-theme="studio"][data-ps-window="hub"][data-ps-screen="app"]) #productionTrackerRoot > [data-ps-tracker-view="details"] :is(.pt-detail-header, .pt-detail-grid, .pt-detail-text-grid, .pt-notes-sheet-notes),
:where(html[data-ps-theme="studio"][data-ps-window="hub"][data-ps-screen="app"]) #productionTrackerRoot > [data-ps-tracker-view="details"] > .projects-panel > .projects-panel-header {
  font-family: var(--ps-font-ui);
  color: var(--ps-text);
}

:where(html[data-ps-theme="studio"][data-ps-window="hub"][data-ps-screen="app"]) #productionTrackerRoot > [data-ps-tracker-view="details"] :is(.pt-detail-header h2, .pt-attachments-header h3),
:where(html[data-ps-theme="studio"][data-ps-window="hub"][data-ps-screen="app"]) #productionTrackerRoot > [data-ps-tracker-view="details"] > .projects-panel > .projects-panel-header > div > .projects-panel-title {
  color: var(--ps-ink);
  font-weight: 600;
}

:where(html[data-ps-theme="studio"][data-ps-window="hub"][data-ps-screen="app"]) #productionTrackerRoot > [data-ps-tracker-view="details"] .pt-detail-header > div:first-child {
  min-width: 0;
}

:where(html[data-ps-theme="studio"][data-ps-window="hub"][data-ps-screen="app"]) #productionTrackerRoot > [data-ps-tracker-view="details"] .pt-detail-header h2 {
  overflow-wrap: anywhere;
}

:where(html[data-ps-theme="studio"][data-ps-window="hub"][data-ps-screen="app"]) #productionTrackerRoot > [data-ps-tracker-view="details"] :is(.pt-detail-header, .pt-detail-text-grid) .muted,
:where(html[data-ps-theme="studio"][data-ps-window="hub"][data-ps-screen="app"]) #productionTrackerRoot > [data-ps-tracker-view="details"] > .projects-panel > .projects-panel-header .muted,
:where(html[data-ps-theme="studio"][data-ps-window="hub"][data-ps-screen="app"]) #productionTrackerRoot > [data-ps-tracker-view="details"] :is(.pt-detail-grid, .pt-detail-text-grid, .pt-notes-sheet-notes) .pt-field {
  color: var(--ps-muted);
}

:where(html[data-ps-theme="studio"][data-ps-window="hub"][data-ps-screen="app"]) #productionTrackerRoot > [data-ps-tracker-view="details"] > .projects-panel > .projects-panel-header > .projects-panel-icon {
  background: var(--ps-bg-soft);
  color: var(--ps-gold-light);
}

:where(html[data-ps-theme="studio"][data-ps-window="hub"][data-ps-screen="app"]) #productionTrackerRoot > [data-ps-tracker-view="details"] :is(.pt-detail-grid, .pt-detail-text-grid, .pt-notes-sheet-notes) :is(input:not([type="color"]):not([type="file"]), select, textarea) {
  background: var(--ps-surface-soft);
  color: var(--ps-text);
  border-color: var(--ps-line-strong);
  font-family: var(--ps-font-ui);
  color-scheme: dark;
  box-shadow: none;
}

:where(html[data-ps-theme="studio"][data-ps-window="hub"][data-ps-screen="app"]) #productionTrackerRoot > [data-ps-tracker-view="details"] :is(.pt-detail-grid, .pt-detail-text-grid, .pt-notes-sheet-notes) :is(input:not([type="color"]):not([type="file"]), select, textarea):hover:not(:disabled) {
  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"] :is(.pt-detail-grid, .pt-detail-text-grid, .pt-notes-sheet-notes) :is(input:not([type="color"]):not([type="file"]), select, textarea):focus {
  background: var(--ps-bg-soft);
  border-color: var(--ps-focus);
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--ps-focus) 24%, transparent);
}

:where(html[data-ps-theme="studio"][data-ps-window="hub"][data-ps-screen="app"]) #productionTrackerRoot > [data-ps-tracker-view="details"] :is(.pt-detail-grid, .pt-detail-text-grid, .pt-notes-sheet-notes) :is(input, textarea)::placeholder {
  color: var(--ps-muted);
  opacity: .7;
}

/* Native multiple selection remains native; no derived member/status colors. */
:where(html[data-ps-theme="studio"][data-ps-window="hub"][data-ps-screen="app"]) #productionTrackerRoot > [data-ps-tracker-view="details"] .pt-detail-grid select option {
  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-detail-grid select[multiple] option:checked {
  background: var(--ps-surface-solid);
  color: var(--ps-gold-light);
}

:where(html[data-ps-theme="studio"][data-ps-window="hub"][data-ps-screen="app"]) #productionTrackerRoot > [data-ps-tracker-view="details"] :is(.pt-detail-header, .pt-attachment-actions, .pt-attachments-header) button {
  background: var(--ps-bg-soft);
  color: var(--ps-text);
  border-color: var(--ps-line-strong);
  font-family: var(--ps-font-ui);
  font-weight: 600;
  box-shadow: none;
}

:where(html[data-ps-theme="studio"][data-ps-window="hub"][data-ps-screen="app"]) #productionTrackerRoot > [data-ps-tracker-view="details"] :is(.pt-detail-header, .pt-attachment-actions, .pt-attachments-header) button:hover:not(:disabled) {
  background: var(--ps-surface-solid);
  border-color: var(--ps-gold);
  color: var(--ps-ink);
  box-shadow: var(--ps-shell-reflection);
}

:where(html[data-ps-theme="studio"][data-ps-window="hub"][data-ps-screen="app"]) #productionTrackerRoot > [data-ps-tracker-view="details"] .pt-attachments-header > .pt-attachment-button {
  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"][data-ps-window="hub"][data-ps-screen="app"]) #productionTrackerRoot > [data-ps-tracker-view="details"] .pt-attachments-header > .pt-attachment-button:hover:not(:disabled) {
  background: var(--ps-button-hover);
  color: var(--ps-button-text);
  border-color: var(--ps-button-border);
}

:where(html[data-ps-theme="studio"][data-ps-window="hub"][data-ps-screen="app"]) #productionTrackerRoot > [data-ps-tracker-view="details"] :is(.pt-detail-header, .pt-attachment-actions) .btn-danger {
  background: color-mix(in srgb, #dc2626 14%, var(--ps-bg));
  color: #fca5a5;
  border-color: #a34b49;
}

:where(html[data-ps-theme="studio"][data-ps-window="hub"][data-ps-screen="app"]) #productionTrackerRoot > [data-ps-tracker-view="details"] :is(.pt-detail-header, .pt-attachment-actions) .btn-danger:hover:not(:disabled) {
  background: color-mix(in srgb, #dc2626 26%, var(--ps-bg));
  color: #fecaca;
  border-color: #f87171;
}

/* Swatch/preset backgrounds are business data. Change their interface edge only. */
:where(html[data-ps-theme="studio"][data-ps-window="hub"][data-ps-screen="app"]) #productionTrackerRoot > [data-ps-tracker-view="details"] .pt-detail-grid :is(.pt-color-swatch, .pt-color-preset) {
  border-color: var(--ps-line-strong);
  box-shadow: inset 0 0 0 1px #fff3;
}

:where(html[data-ps-theme="studio"][data-ps-window="hub"][data-ps-screen="app"]) #productionTrackerRoot > [data-ps-tracker-view="details"] .pt-detail-grid :is(.pt-color-swatch, .pt-color-preset):hover:not(:disabled) {
  border-color: var(--ps-focus);
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--ps-focus) 24%, transparent);
}

:where(html[data-ps-theme="studio"][data-ps-window="hub"][data-ps-screen="app"]) #productionTrackerRoot > [data-ps-tracker-view="details"] :is(.pt-detail-header, .pt-detail-grid, .pt-detail-text-grid) 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"] :is(.pt-detail-header, .pt-detail-grid, .pt-detail-text-grid) button:disabled {
  opacity: .55;
  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-attachments-panel {
  background: var(--ps-surface-solid);
  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"] :is(.pt-attachment-row, .pt-attachments-empty) {
  background: var(--ps-bg-soft);
  border-color: var(--ps-line);
  color: var(--ps-muted);
}

:where(html[data-ps-theme="studio"][data-ps-window="hub"][data-ps-screen="app"]) #productionTrackerRoot > [data-ps-tracker-view="details"] .pt-attachment-main strong {
  color: var(--ps-text);
  font-weight: 600;
}

:where(html[data-ps-theme="studio"][data-ps-window="hub"][data-ps-screen="app"]) #productionTrackerRoot > [data-ps-tracker-view="details"] .pt-attachment-main > div {
  min-width: 0;
}

/* Long filenames otherwise impose their min-content width on both nested
   grids, pushing action buttons outside the panel. Keep the existing tracks
   and dimensions; let these owned grid items actually shrink and ellipsize. */
:where(html[data-ps-theme="studio"][data-ps-window="hub"][data-ps-screen="app"]) #productionTrackerRoot > [data-ps-tracker-view="details"] :is(.pt-detail-text-grid > .pt-field, .pt-attachments-panel, .pt-attachments-list, .pt-attachment-row) {
  min-width: 0;
}

:where(html[data-ps-theme="studio"][data-ps-window="hub"][data-ps-screen="app"]) #productionTrackerRoot > [data-ps-tracker-view="details"] .pt-attachment-icon {
  background: var(--ps-surface-soft);
}

/* Notes are main-fiche content; the sheet on their right remains an opaque,
   historical white editor. No typography or color-scheme on the shared split. */
:where(html[data-ps-theme="studio"][data-ps-window="hub"][data-ps-screen="app"]) #productionTrackerRoot > [data-ps-tracker-view="details"] .pt-notes-sheet-split {
  background: var(--ps-surface-soft);
  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-notes-sheet-notes {
  background: var(--ps-bg-soft);
}

/* These two split handles belong to the main notes/sheet layout, outside the
   sheet editor root. Preserve their sizes, pointer handlers and persisted split. */
:where(html[data-ps-theme="studio"][data-ps-window="hub"][data-ps-screen="app"]) #productionTrackerRoot > [data-ps-tracker-view="details"] :is(.pt-notes-sheet-resizer, .pt-notes-sheet-height-resizer) {
  background: var(--ps-surface-soft);
  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"] :is(.pt-notes-sheet-resizer, .pt-notes-sheet-height-resizer) span {
  background: var(--ps-line-strong);
}

:where(html[data-ps-theme="studio"][data-ps-window="hub"][data-ps-screen="app"]) #productionTrackerRoot > [data-ps-tracker-view="details"] :is(.pt-notes-sheet-resizer, .pt-notes-sheet-height-resizer):hover {
  background: var(--ps-surface-solid);
}

:where(html[data-ps-theme="studio"][data-ps-window="hub"][data-ps-screen="app"]) #productionTrackerRoot > [data-ps-tracker-view="details"] :is(.pt-notes-sheet-resizer, .pt-notes-sheet-height-resizer):hover span {
  background: var(--ps-gold);
}

/* Isolation backing for the excluded translucent checklist. These are the
   unchanged historical parent-panel gradient values from index.html. Keep a
   light backing here rather than letting the new dark parent bleed through.
   The three editor roots, their own chrome and templates remain untouched. */
:where(html[data-ps-theme="studio"][data-ps-window="hub"][data-ps-screen="app"]) #productionTrackerRoot > [data-ps-tracker-view="details"] .pt-detail-subtasks-diagram-wrapper {
  background: linear-gradient(180deg, #eef4ff 0%, #e6f0ff 100%);
}

@media (max-width: 700px) {
  :where(html[data-ps-theme="studio"][data-ps-window="hub"][data-ps-screen="app"]) #productionTrackerRoot > [data-ps-tracker-view="details"] .pt-attachment-row {
    flex-wrap: wrap;
  }

  :where(html[data-ps-theme="studio"][data-ps-window="hub"][data-ps-screen="app"]) #productionTrackerRoot > [data-ps-tracker-view="details"] .pt-attachment-main {
    max-width: 100%;
  }

  :where(html[data-ps-theme="studio"][data-ps-window="hub"][data-ps-screen="app"]) #productionTrackerRoot > [data-ps-tracker-view="details"] .pt-attachment-main strong {
    max-width: 100%;
  }

  :where(html[data-ps-theme="studio"][data-ps-window="hub"][data-ps-screen="app"]) #productionTrackerRoot > [data-ps-tracker-view="details"] .pt-attachment-actions {
    max-width: 100%;
    flex-wrap: wrap;
  }
}
