:root {
 --text: var(--ink);
 --card: #fff;
 --surface: #edf6ee;
 --border: var(--line);
 --bg: var(--paper);
 --accent: var(--green);
 --scroll-thumb: #81958a;
}
html[data-theme="dark"] {
 --card: #131b1a;
 --surface: #1d2d27;
 --scroll-thumb: #7b978b;
}

html[data-theme="dark"] body.facebook-workbench.product-workspace {
 --ink: #e6eee9;
 --muted: #aabdb2;
 --green: #93d075;
 --lime: #acd981;
 --line: #304238;
 --paper: #101914;
 --text: var(--ink);
 --border: var(--line);
 --bg: var(--paper);
 --accent: var(--green);
}

/* Nested lists pass the wheel to the surrounding panel when they reach an edge. */
.product-workspace :is(.table-wrap, .editor-selection, .ps-group-list, .library-members,
 .wf-log-section .wf-log-list, .ts-activity-list, .ts-activity-detail, #gs-options) {
 overscroll-behavior-y: auto;
 scrollbar-color: var(--scroll-thumb) transparent;
}
.product-workspace :is(.editor-selection, .ps-group-list, .ec-group-picker, .wf-approval-list,
 .wf-template-list, .fleet-group-list, .fleet-template-list, #gs-options) {
 overflow-y: auto;
 scrollbar-gutter: stable;
}
.product-workspace :is(.editor-selection, .gd-result-scroll, #gs-options):focus-visible {
 outline: 2px solid var(--accent);
 outline-offset: -2px;
}
.product-workspace .gd-result-scroll {
 max-height: min(65dvh, 620px);
}
.product-workspace .sidebar > nav {
 scrollbar-color: var(--scroll-thumb) transparent;
}
@media (max-height: 580px) {
 .product-workspace #modal:has(.gs-editor-form) #modal-body {
  display: block;
  overflow-y: auto;
 }
 .product-workspace #gs-options {
  flex: 0 1 auto;
  max-height: 40dvh;
 }
}

html[data-theme="dark"] .product-workspace :is(.gs-editor-footer, .gs-close) {
 background: var(--card);
 color: var(--text);
 border-color: var(--border);
}
html[data-theme="dark"] .product-workspace :is(.gs-option, .editor-selection .check, .ps-group-list .check):hover {
 background: var(--surface);
}
html[data-theme="dark"] .product-workspace .primary {
 background: #a9d77d;
 border-color: #a9d77d;
 color: #172b19;
}
html[data-theme="dark"] .product-workspace .primary:hover { background: #bce795; }
html[data-theme="dark"] .product-workspace .bulk-selection {
 background: #202b3e;
 border-color: #465777;
}
html[data-theme="dark"] .product-workspace .bulk-selection :is(.bulk-master-label, button) { color: #c3d0fa; }
html[data-theme="dark"] .product-workspace .bulk-selection .bulk-count { color: #c2ccdb; }
html[data-theme="dark"] .product-workspace .side-bottom > button:where(:hover, :focus-visible) {
 background: var(--surface);
 color: var(--text);
}
