/* Lot 9.4: Team Members only. The two owned body portals never depend on the
   tab behind them. Original, other Tracker content and My Studio are excluded.
   Member colors are data: swatch/preset/dot backgrounds stay untouched. */
:where(html[data-ps-theme="studio"][data-ps-window="hub"][data-ps-screen="app"]) :is(#productionTrackerRoot > .pt-page > .pt-team-page, #productionTrackerModal:is([data-ps-tracker-portal="member-add"], [data-ps-tracker-portal="member-edit"])) {
  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 > .pt-page > .pt-team-page {
  background: var(--ps-bg);
}

/* Match the board's native-scroll protection while changing UI font metrics. */
:where(html[data-ps-theme="studio"][data-ps-window="hub"][data-ps-screen="app"]) #section-production-tracker:not(.hidden):has(> #productionTrackerRoot > .pt-page > .pt-team-page) {
  overflow-anchor: none;
}

:where(html[data-ps-theme="studio"][data-ps-window="hub"][data-ps-screen="app"]) #productionTrackerRoot > .pt-page > .pt-team-page :is(.pt-team-add-panel, .pt-team-list-panel),
:where(html[data-ps-theme="studio"][data-ps-window="hub"][data-ps-screen="app"]) #productionTrackerModal:is([data-ps-tracker-portal="member-add"], [data-ps-tracker-portal="member-edit"]) :is(.pt-modal-body, .pt-modal-footer, .pt-modal-icon) {
  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 > .pt-page > .pt-team-page .pt-team-member-row,
:where(html[data-ps-theme="studio"][data-ps-window="hub"][data-ps-screen="app"]) #productionTrackerModal:is([data-ps-tracker-portal="member-add"], [data-ps-tracker-portal="member-edit"]) :is(.pt-modal-card, .pt-modal-header, .pt-modal-section, .pt-modal-list-row) {
  background: var(--ps-surface-solid);
  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 > .pt-page > .pt-team-page .pt-team-role-title,
:where(html[data-ps-theme="studio"][data-ps-window="hub"][data-ps-screen="app"]) #productionTrackerModal:is([data-ps-tracker-portal="member-add"], [data-ps-tracker-portal="member-edit"]) .pt-team-member-role-header {
  background: var(--ps-surface-soft);
  border-color: var(--ps-line);
  color: var(--ps-gold-light);
  font-weight: 600;
  line-height: 15px;
  overflow-wrap: anywhere;
}

:where(html[data-ps-theme="studio"][data-ps-window="hub"][data-ps-screen="app"]) :is(#productionTrackerRoot > .pt-page > .pt-team-page, #productionTrackerModal:is([data-ps-tracker-portal="member-add"], [data-ps-tracker-portal="member-edit"])) :is(h3, strong, .pt-modal-icon) {
  color: var(--ps-ink);
  font-weight: 600;
}

:where(html[data-ps-theme="studio"][data-ps-window="hub"][data-ps-screen="app"]) :is(#productionTrackerRoot > .pt-page > .pt-team-page, #productionTrackerModal:is([data-ps-tracker-portal="member-add"], [data-ps-tracker-portal="member-edit"])) :is(.muted, .pt-field, .pt-empty) {
  color: var(--ps-muted);
}

/* Match the source line boxes so font changes do not move the scroll anchor.
   These are the real Chromium metrics, not new card/grid dimensions. */
:where(html[data-ps-theme="studio"][data-ps-window="hub"][data-ps-screen="app"]) :is(#productionTrackerRoot > .pt-page > .pt-team-page, #productionTrackerModal:is([data-ps-tracker-portal="member-add"], [data-ps-tracker-portal="member-edit"])) .pt-field {
  line-height: 16px;
}

:where(html[data-ps-theme="studio"][data-ps-window="hub"][data-ps-screen="app"]) :is(#productionTrackerRoot > .pt-page > .pt-team-page, #productionTrackerModal:is([data-ps-tracker-portal="member-add"], [data-ps-tracker-portal="member-edit"])) .muted {
  line-height: 17px;
}

:where(html[data-ps-theme="studio"][data-ps-window="hub"][data-ps-screen="app"]) #productionTrackerRoot > .pt-page > .pt-team-page .pt-team-member-main > div,
:where(html[data-ps-theme="studio"][data-ps-window="hub"][data-ps-screen="app"]) #productionTrackerModal:is([data-ps-tracker-portal="member-add"], [data-ps-tracker-portal="member-edit"]) .pt-modal-list-row > div:first-child {
  line-height: 21px;
}

:where(html[data-ps-theme="studio"][data-ps-window="hub"][data-ps-screen="app"]) #productionTrackerRoot > .pt-page > .pt-team-page :is(.pt-team-add-header, .pt-team-list-header) h3 {
  line-height: 24px;
}

:where(html[data-ps-theme="studio"][data-ps-window="hub"][data-ps-screen="app"]) #productionTrackerModal:is([data-ps-tracker-portal="member-add"], [data-ps-tracker-portal="member-edit"]) .pt-modal-section h3 {
  line-height: 20px;
}

:where(html[data-ps-theme="studio"][data-ps-window="hub"][data-ps-screen="app"]) #productionTrackerRoot > .pt-page > .pt-team-page .pt-empty {
  background: var(--ps-surface-soft);
  border-color: var(--ps-line);
}

:where(html[data-ps-theme="studio"][data-ps-window="hub"][data-ps-screen="app"]) :is(#productionTrackerRoot > .pt-page > .pt-team-page, #productionTrackerModal:is([data-ps-tracker-portal="member-add"], [data-ps-tracker-portal="member-edit"])) :is(input:not([type="color"]), select) {
  background: var(--ps-surface-soft);
  border-color: var(--ps-line-strong);
  color: var(--ps-text);
  font-family: var(--ps-font-ui);
  line-height: 16px;
  color-scheme: dark;
  box-shadow: none;
}

:where(html[data-ps-theme="studio"][data-ps-window="hub"][data-ps-screen="app"]) :is(#productionTrackerRoot > .pt-page > .pt-team-page, #productionTrackerModal:is([data-ps-tracker-portal="member-add"], [data-ps-tracker-portal="member-edit"])) .pt-field select {
  height: 36px;
}

:where(html[data-ps-theme="studio"][data-ps-window="hub"][data-ps-screen="app"]) :is(#productionTrackerRoot > .pt-page > .pt-team-page, #productionTrackerModal:is([data-ps-tracker-portal="member-add"], [data-ps-tracker-portal="member-edit"])) input::placeholder {
  color: var(--ps-muted);
}

:where(html[data-ps-theme="studio"][data-ps-window="hub"][data-ps-screen="app"]) :is(#productionTrackerRoot > .pt-page > .pt-team-page, #productionTrackerModal:is([data-ps-tracker-portal="member-add"], [data-ps-tracker-portal="member-edit"])) :is(input, select):focus {
  background: var(--ps-surface-solid);
  border-color: var(--ps-gold);
  box-shadow: none;
}

:where(html[data-ps-theme="studio"][data-ps-window="hub"][data-ps-screen="app"]) :is(#productionTrackerRoot > .pt-page > .pt-team-page, #productionTrackerModal:is([data-ps-tracker-portal="member-add"], [data-ps-tracker-portal="member-edit"])) button:where(:not(.pt-color-swatch):not(.pt-color-preset)) {
  background: var(--ps-bg-soft);
  border-color: var(--ps-line-strong);
  color: var(--ps-text);
  font-family: var(--ps-font-ui);
  font-weight: 600;
  line-height: 16px;
  box-shadow: none;
}

:where(html[data-ps-theme="studio"][data-ps-window="hub"][data-ps-screen="app"]) :is(#productionTrackerRoot > .pt-page > .pt-team-page, #productionTrackerModal:is([data-ps-tracker-portal="member-add"], [data-ps-tracker-portal="member-edit"])) button:where(:not(.pt-color-swatch):not(.pt-color-preset)):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"]) :is(#productionTrackerRoot > .pt-page > .pt-team-page, #productionTrackerModal:is([data-ps-tracker-portal="member-add"], [data-ps-tracker-portal="member-edit"])) .btn-primary {
  background: var(--ps-button-bg);
  border-color: var(--ps-button-border);
  color: var(--ps-button-text);
  box-shadow: var(--ps-button-shadow);
}

:where(html[data-ps-theme="studio"][data-ps-window="hub"][data-ps-screen="app"]) :is(#productionTrackerRoot > .pt-page > .pt-team-page, #productionTrackerModal:is([data-ps-tracker-portal="member-add"], [data-ps-tracker-portal="member-edit"])) .btn-primary:hover:not(:disabled) {
  background: var(--ps-button-hover);
  border-color: var(--ps-button-border);
  color: var(--ps-button-text);
  box-shadow: var(--ps-button-shadow);
}

/* Copper identifies destructive actions; text remains readable on dark paint.
   Native validation/confirmation dialogs and their semantics remain intact. */
:where(html[data-ps-theme="studio"][data-ps-window="hub"][data-ps-screen="app"]) :is(#productionTrackerRoot > .pt-page > .pt-team-page, #productionTrackerModal:is([data-ps-tracker-portal="member-add"], [data-ps-tracker-portal="member-edit"])) .btn-danger {
  background: var(--ps-surface-soft);
  border-color: var(--ps-copper);
  color: var(--ps-gold-light);
}

:where(html[data-ps-theme="studio"][data-ps-window="hub"][data-ps-screen="app"]) :is(#productionTrackerRoot > .pt-page > .pt-team-page, #productionTrackerModal:is([data-ps-tracker-portal="member-add"], [data-ps-tracker-portal="member-edit"])) .btn-danger:hover:not(:disabled) {
  background: var(--ps-copper-dark);
  border-color: var(--ps-copper);
  color: var(--ps-ink);
}

:where(html[data-ps-theme="studio"][data-ps-window="hub"][data-ps-screen="app"]) :is(#productionTrackerRoot > .pt-page > .pt-team-page, #productionTrackerModal:is([data-ps-tracker-portal="member-add"], [data-ps-tracker-portal="member-edit"])) :is(button, input, select):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"]) :is(#productionTrackerRoot > .pt-page > .pt-team-page, #productionTrackerModal:is([data-ps-tracker-portal="member-add"], [data-ps-tracker-portal="member-edit"])) button:disabled {
  opacity: .55;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

/* Only the chrome changes, never the inline business color. */
:where(html[data-ps-theme="studio"][data-ps-window="hub"][data-ps-screen="app"]) :is(#productionTrackerRoot > .pt-page > .pt-team-page, #productionTrackerModal:is([data-ps-tracker-portal="member-add"], [data-ps-tracker-portal="member-edit"])) :is(.pt-color-swatch, .pt-color-preset, .pt-pm-color-dot) {
  border-color: var(--ps-line-strong);
  box-shadow: none;
}

:where(html[data-ps-theme="studio"][data-ps-window="hub"][data-ps-screen="app"]) #productionTrackerModal:is([data-ps-tracker-portal="member-add"], [data-ps-tracker-portal="member-edit"]) {
  background: color-mix(in srgb, var(--ps-bg) 72%, transparent);
}

:where(html[data-ps-theme="studio"][data-ps-window="hub"][data-ps-screen="app"]) #productionTrackerModal:is([data-ps-tracker-portal="member-add"], [data-ps-tracker-portal="member-edit"]) .pt-modal-body {
  overflow-anchor: none;
}

:where(html[data-ps-theme="studio"][data-ps-window="hub"][data-ps-screen="app"]) #productionTrackerModal:is([data-ps-tracker-portal="member-add"], [data-ps-tracker-portal="member-edit"]) .pt-modal-header h3 {
  line-height: 21px;
}

/* Keep original grids and density; let long identities wrap within their row. */
:where(html[data-ps-theme="studio"][data-ps-window="hub"][data-ps-screen="app"]) #productionTrackerRoot > .pt-page > .pt-team-page .pt-team-member-main > div,
:where(html[data-ps-theme="studio"][data-ps-window="hub"][data-ps-screen="app"]) #productionTrackerModal:is([data-ps-tracker-portal="member-add"], [data-ps-tracker-portal="member-edit"]) .pt-modal-list-row > div:first-child {
  min-width: 0;
  overflow-wrap: anywhere;
}

@container (max-width: 560px) {
  :where(html[data-ps-theme="studio"][data-ps-window="hub"][data-ps-screen="app"]) #productionTrackerRoot > .pt-page > .pt-team-page .pt-team-member-row {
    flex-wrap: wrap;
  }
}

@media (max-width: 560px) {
  :where(html[data-ps-theme="studio"][data-ps-window="hub"][data-ps-screen="app"]) #productionTrackerModal:is([data-ps-tracker-portal="member-add"], [data-ps-tracker-portal="member-edit"]) .pt-modal-list-row {
    flex-wrap: wrap;
  }
}
