/* Main-only theme adapter: central Admin style tokens; no CAD geometry changes.
   Inert until /suite/appearance/ selects a shared style. */
html[data-pb-suite-style] .pb-explorer {
  --pb-main-nav-bg:var(--pb-suite-panel);
  --pb-main-on-accent:#fff;
  --pb-main-link-color:color-mix(in srgb,var(--pb-suite-accent) 75%,var(--pb-suite-text));
  --pb-main-banner-bg:color-mix(in srgb,var(--pb-suite-accent) 75%,var(--pb-suite-sidebar));
  /* Primary actions use a deliberately dark palette tone: 80% of each style's
     sidebar colour + 20% accent, with white text in every light/dark mode. */
  --pb-main-action-bg:color-mix(in srgb,var(--pb-suite-sidebar) 80%,var(--pb-suite-accent));
  --pb-main-action-text:#fff;
  --pb-ink:var(--pb-suite-text);
  --pb-navy:var(--pb-suite-sidebar);
  --pb-navy-dark:var(--pb-suite-header);
  --pb-line:var(--pb-suite-line);
  --pb-row:var(--pb-suite-soft);
  background:var(--pb-suite-bg);
  color:var(--pb-suite-text);
}
html[data-pb-suite-style="1"]:not([data-theme="light"]) .pb-explorer,
html[data-pb-suite-style][data-theme="dark"] .pb-explorer {
  --pb-main-nav-bg:var(--pb-suite-sidebar);
}
html[data-pb-suite-style="1"]:not([data-theme="light"]) .pb-explorer {
  --pb-main-on-accent:#112537;
  /* Bright icons and tree headings use navy, separate from action buttons. */
}
html[data-pb-suite-style] .pb-explorer :is(.main-area,.content) {
  background:var(--pb-suite-bg);color:var(--pb-suite-text);
}
/* Suite logo, header and navigation controls: reuse the Admin-selected style. */
html[data-pb-suite-style] .pb-explorer .topbar {
  color:var(--pb-suite-header-text);background:var(--pb-suite-header);
  border-color:var(--pb-suite-line);
}
html[data-pb-suite-style] .pb-explorer .pb-suite-header-brand,
html[data-pb-suite-style] .pb-explorer .pb-suite-header-brand strong {
  color:var(--pb-suite-header-text);
}
html[data-pb-suite-style] .pb-explorer .pb-suite-header-brand strong span {
  color:var(--pb-suite-accent);
}
html[data-pb-suite-style] .pb-explorer .pb-suite-header-mark {
  background:var(--pb-suite-accent);color:var(--pb-main-on-accent);
  border:1px solid var(--pb-suite-line);border-radius:var(--pb-suite-radius);
}
html[data-pb-suite-style] .pb-explorer .pb-navigation-header .tree-toggle {
  background:transparent;color:inherit;
}
html[data-pb-suite-style] .pb-explorer .pb-navigation-header .tree-toggle:hover {
  background:color-mix(in srgb,currentColor 12%,transparent);
}
html[data-pb-suite-style] .pb-explorer .pb-help-link {
  color:var(--pb-suite-header-text);border-color:var(--pb-suite-line);
  background:color-mix(in srgb,var(--pb-suite-header-text) 9%,transparent);
}
/* Popovers share the palette; individual application icon colours stay distinct. */
html[data-pb-suite-style] .pb-explorer :is(.pb-suite-app-panel,.pb-suite-settings-panel,.pb-account-popover) {
  color:var(--pb-suite-text);background:var(--pb-suite-panel);
  border-color:var(--pb-suite-line);border-radius:var(--pb-suite-radius);
}
html[data-pb-suite-style] .pb-explorer :is(.pb-suite-app-tile,.pb-suite-settings-panel a,.pb-suite-settings-panel button,.pb-account-popover a) {
  color:var(--pb-suite-text);
}
html[data-pb-suite-style] .pb-explorer :is(.pb-suite-app-tile,.pb-suite-settings-panel a,.pb-suite-settings-panel button,.pb-account-popover a):hover {
  background:var(--pb-suite-soft);color:var(--pb-suite-text);
  border-color:var(--pb-suite-line);
}
/* Shared profile control must match the selected header style too. */
html[data-pb-suite-style] .pb-explorer .pb-shared-account-menu > .pb-account-trigger {
  background:var(--pb-suite-soft);color:var(--pb-suite-text);
  border-color:var(--pb-suite-line);
}
html[data-pb-suite-style] .pb-explorer .pb-shared-account-menu > .pb-account-trigger:hover,
html[data-pb-suite-style] .pb-explorer .pb-shared-account-menu[open] > .pb-account-trigger {
  background:color-mix(in srgb,var(--pb-suite-soft) 80%,var(--pb-suite-accent));
}
html[data-pb-suite-style] .pb-explorer .pb-account-chevron,
html[data-pb-suite-style] .pb-explorer .pb-account-summary small {
  color:var(--pb-suite-muted);
}
html[data-pb-suite-style] .pb-explorer .pb-account-summary {
  border-color:var(--pb-suite-line);
}
html[data-pb-suite-style] .pb-explorer .pb-account-summary strong {
  color:var(--pb-suite-text);
}
html[data-pb-suite-style] .pb-explorer .pb-account-popover .pb-account-signout {
  background:transparent;color:var(--pb-suite-text);
}
html[data-pb-suite-style] .pb-explorer .pb-account-popover .pb-account-signout:hover {
  background:var(--pb-suite-soft);
}
/* Explorer tree, organisation heading, active development and folder links. */
html[data-pb-suite-style] .pb-explorer .sidebar {
  background:var(--pb-main-nav-bg);color:var(--pb-suite-text);
  border-color:var(--pb-suite-line);
}
html[data-pb-suite-style] .pb-explorer .side-label {color:var(--pb-suite-muted)}
html[data-pb-suite-style] .pb-explorer .tree-heading {
  background:var(--pb-main-banner-bg)!important;color:var(--pb-main-on-accent)!important;
}
html[data-pb-suite-style] .pb-explorer .workspace-org > summary {
  background:var(--pb-suite-soft);color:var(--pb-suite-text);
  border:1px solid var(--pb-suite-line);border-radius:var(--pb-suite-radius);
}
html[data-pb-suite-style] .pb-explorer .workspace-org > summary:hover {
  background:color-mix(in srgb,var(--pb-suite-soft) 76%,var(--pb-suite-accent));
}
html[data-pb-suite-style] .pb-explorer :is(.workspace-org > summary,.workspace-dev > summary,.tree-folder > summary)::before {
  color:var(--pb-suite-accent);
}
html[data-pb-suite-style] .pb-explorer :is(
  .workspace-dev > summary,.tree-link,.tree-folder > summary,.pb-development-link,
  .pb-plots-summary,.pb-tree-node-row > a,.pb-root-row > a,.nav-link
) {color:var(--pb-suite-text)}
html[data-pb-suite-style] .pb-explorer :is(
  .workspace-dev > summary,.tree-link,.tree-folder > summary,
  .pb-plots-summary,.pb-tree-node-row,.nav-link
):hover {background:var(--pb-suite-soft);color:var(--pb-suite-accent)}
html[data-pb-suite-style] .pb-explorer :is(
  .tree-link.is-current,.tree-folder > summary.is-current,
  .pb-tree-node-row.is-current,.pb-development-link.is-current
) {background:var(--pb-suite-soft);color:var(--pb-suite-accent)}
html[data-pb-suite-style] .pb-explorer :is(.workspace-dev-links,.tree-children,.nav) {
  border-color:var(--pb-suite-line);
}
html[data-pb-suite-style] .pb-explorer :is(
  .pb-org-actions-button,.pb-dev-actions-button,.pb-folder-menu-button,.pb-plots-actions-button
) {color:var(--pb-suite-accent)}
/* Main workspace and document registers. Legacy cell backgrounds are important,
   so the replacement has the same priority and a tighter explicit selector. */
html[data-pb-suite-style] .pb-explorer :is(.pb-location,.pb-register-search,.pb-actionbar,.pb-tab-row) {
  background:var(--pb-suite-soft);border-color:var(--pb-suite-line);
  color:var(--pb-suite-text);
}
html[data-pb-suite-style] .pb-explorer :is(
  .pb-workspace,.pb-table-scroll,.pb-security-editor,
  .pb-security-grid section,.pb-archived-developments
) {background:var(--pb-suite-panel);border-color:var(--pb-suite-line);color:var(--pb-suite-text)}
html[data-pb-suite-style] .pb-explorer :is(.pb-grid,.pb-simple-table) thead th {
  background:var(--pb-suite-soft)!important;color:var(--pb-suite-text)!important;
  border-color:var(--pb-suite-line)!important;
}
html[data-pb-suite-style] .pb-explorer :is(.pb-grid,.pb-simple-table) tbody tr:nth-child(odd) td {
  background:var(--pb-suite-panel)!important;color:var(--pb-suite-text);
}
html[data-pb-suite-style] .pb-explorer :is(.pb-grid,.pb-simple-table) tbody tr:nth-child(even) td {
  background:color-mix(in srgb,var(--pb-suite-panel) 78%,var(--pb-suite-soft))!important;
  color:var(--pb-suite-text);
}
html[data-pb-suite-style] .pb-explorer :is(.pb-grid,.pb-simple-table) tbody tr:hover td,
html[data-pb-suite-style] .pb-explorer .pb-grid tbody tr:focus-within td {
  background:var(--pb-suite-soft)!important;
}
html[data-pb-suite-style] .pb-explorer :is(.pb-grid-name,.pb-grid-open a,.pb-text-link,.pb-location a) {
  color:var(--pb-main-link-color);
}
html[data-pb-suite-style] .pb-explorer :is(.pb-overline,.pb-view-caption,.pb-listing-title span,.pb-workspace-head p) {
  color:var(--pb-suite-muted);
}
html[data-pb-suite-style] .pb-explorer :is(.pb-workspace-head h1,.pb-listing-title strong,.pb-security-page h2) {
  color:var(--pb-suite-text);
}
html[data-pb-suite-style] .pb-explorer .pb-location strong {color:var(--pb-suite-text)}
html[data-pb-suite-style] .pb-explorer .btn.primary {
  background:var(--pb-main-action-bg);
  color:var(--pb-main-action-text)!important;
  border-color:var(--pb-suite-line);
}
html[data-pb-suite-style] .pb-explorer .btn.primary:hover {
  background:color-mix(in srgb,var(--pb-main-action-bg) 88%,#000);
  color:var(--pb-main-action-text)!important;
}
html[data-pb-suite-style] .pb-explorer :is(.btn.subtle,.pb-action-primary,.pb-development-row-actions > summary) {
  background:var(--pb-suite-soft);color:var(--pb-suite-text);border-color:var(--pb-suite-line);
}
html[data-pb-suite-style] .pb-explorer :is(.pb-register-search,.field) :is(input,select,textarea) {
  color:var(--pb-suite-text);background:var(--pb-suite-panel);
  border-color:var(--pb-suite-line);
}
html[data-pb-suite-style] .pb-explorer :is(a,button,summary,input,select):focus-visible {
  outline:2px solid var(--pb-suite-accent);outline-offset:2px;
}

/* Audit fix: avoid inherited dark teal on dark archived-development controls.
   Buttons, icons and headings use legible role-appropriate foregrounds. */
html[data-pb-suite-style] .pb-explorer .pb-archived-developments > summary {
  color:var(--pb-suite-text)!important;
  border-color:var(--pb-suite-line);
}
html[data-pb-suite-style] .pb-explorer .pb-archived-developments > summary::marker {
  color:var(--pb-suite-accent);
}
html[data-pb-suite-style] .pb-explorer .pb-workspace :is(.pb-grid th,.pb-grid td) {
  border-color:var(--pb-suite-line);
}
html[data-pb-suite-style] .pb-explorer .pb-grid-name {
  color:var(--pb-main-link-color);
}
