/* Shared selection colors match the Quick Generate model picker.
   Menu selection and workspace choice controls keep their own sizes and selected styles. */
.public-model-label { display:inline-flex; align-items:center; gap:6px; max-width:100%; vertical-align:middle; white-space:nowrap; }
.public-model-name { min-width:0; overflow:hidden; text-overflow:ellipsis; }
.public-model-tier { display:inline-flex; align-items:center; justify-content:center; flex:0 0 auto; padding:0 5px; border:1px solid color-mix(in srgb,currentColor 38%,transparent); border-radius:5px; color:inherit; background:color-mix(in srgb,currentColor 16%,transparent); font:700 10px/17px var(--sans, Arial, sans-serif); letter-spacing:.1px; }

:root {
  --supercanv-option-hover: #eeefed;
  --supercanv-option-hover-strong: #dfe1de;
  --supercanv-option-text: #202420;
  --supercanv-option-border: #d8dcda;
  --supercanv-option-selected: #05070a;
  --supercanv-select-surface: #fff;
  --supercanv-select-text: var(--supercanv-option-text);
  --supercanv-select-border: var(--supercanv-option-border);
  --supercanv-select-hover: var(--supercanv-option-hover);
  --supercanv-select-active: var(--supercanv-option-selected);
  --supercanv-select-active-text: #fff;
  --supercanv-select-focus: #68716b;
}

:is(.studio-theme-dark, .theme-dark) {
  --supercanv-select-surface: #22252a;
  --supercanv-select-text: #f1f3f2;
  --supercanv-select-border: #52575c;
  --supercanv-select-hover: #34383e;
  --supercanv-select-active: #edf0ed;
  --supercanv-select-active-text: #171a18;
  --supercanv-select-focus: #aab2ac;
}

select:where(:not([hidden], [aria-hidden="true"], [multiple], [size]:not([size="1"]))) {
  box-sizing: border-box;
  max-inline-size: 100%;
  border: 1px solid var(--supercanv-select-border);
  border-radius: 8px;
  background-color: var(--supercanv-select-surface);
  color: var(--supercanv-select-text);
  cursor: pointer;
}

select:where(:not([hidden], [aria-hidden="true"], [multiple], [size]:not([size="1"]))):focus-visible {
  outline: 2px solid var(--supercanv-select-focus);
  outline-offset: 2px;
}

select:where(:not([hidden], [aria-hidden="true"], [multiple], [size]:not([size="1"]))):disabled { cursor: not-allowed; }

@supports (appearance: base-select) and selector(select::picker(select)) {
  select:where(:not([hidden], [aria-hidden="true"], [multiple], [size]:not([size="1"]))) {
    appearance: base-select;
    align-items: center;
    gap: 8px;
  }

  select:where(:not([hidden], [aria-hidden="true"], [multiple], [size]:not([size="1"])))::picker-icon {
    content: "";
    flex: none;
    inline-size: 6px;
    block-size: 6px;
    margin-inline-start: auto;
    border-inline-end: 1.5px solid currentColor;
    border-block-end: 1.5px solid currentColor;
    opacity: .65;
    transform: translateY(-2px) rotate(45deg);
  }

  select:where(:not([hidden], [aria-hidden="true"], [multiple], [size]:not([size="1"]))):open::picker-icon {
    transform: translateY(2px) rotate(225deg);
  }

  select:where(:not([hidden], [aria-hidden="true"], [multiple], [size]:not([size="1"])))::picker(select) {
    appearance: base-select;
    box-sizing: border-box;
    min-inline-size: min(anchor-size(width), calc(100vw - 16px));
    max-inline-size: calc(100vw - 16px);
    max-block-size: min(288px, 55vh);
    margin-block: 5px;
    padding: 4px;
    overflow: auto;
    scrollbar-width: thin;
    border: 1px solid var(--supercanv-select-border);
    border-radius: 10px;
    color: var(--supercanv-select-text);
    background: var(--supercanv-select-surface);
    box-shadow: 0 12px 26px rgba(25, 31, 29, .14);
    font: inherit;
  }

  select:where(:not([hidden], [aria-hidden="true"], [multiple], [size]:not([size="1"]))) option {
    min-block-size: 32px;
    gap: 8px;
    padding: 6px 9px;
    border-radius: 6px;
    white-space: normal;
    overflow-wrap: anywhere;
  }

  select:where(:not([hidden], [aria-hidden="true"], [multiple], [size]:not([size="1"]))) option:not(:checked, :disabled):is(:hover, :focus-visible) {
    background: var(--supercanv-select-hover);
    color: var(--supercanv-select-text);
  }

  select:where(:not([hidden], [aria-hidden="true"], [multiple], [size]:not([size="1"]))) option:checked {
    background: var(--supercanv-select-active);
    color: var(--supercanv-select-active-text);
  }

  select:where(:not([hidden], [aria-hidden="true"], [multiple], [size]:not([size="1"]))) option:disabled {
    opacity: .55;
    cursor: not-allowed;
  }

  select:where(:not([hidden], [aria-hidden="true"], [multiple], [size]:not([size="1"]))) option::checkmark {
    order: 1;
    margin-inline-start: auto;
  }
}

:is(
  .option-popover > button,
  .aspect-popover > button,
  .users-custom-select-option,
  .react-canvas-picker-menu > button,
  .canvas-native-select-option,
  .prompt-ai-select-menu > button,
  .generator-rh-count-menu > button,
  .smart-popover :is(.direct-option, .duration-option, .ratio-option, .size-picker-option)
):not(:disabled):not([aria-disabled="true"]):not(.selected):not(.is-selected):not(.active):not([aria-selected="true"]):is(:hover, :focus-visible) {
  /* Override the old per-feature black fills and inset focus frames. */
  color: var(--supercanv-option-text) !important;
  background: var(--supercanv-option-hover) !important;
  border-color: var(--supercanv-option-border) !important;
  box-shadow: none !important;
  outline: none !important;
  transform: none !important;
  transition: none !important;
}

:is(
  .option-popover > button,
  .aspect-popover > button,
  .users-custom-select-option,
  .react-canvas-picker-menu > button,
  .canvas-native-select-option,
  .prompt-ai-select-menu > button,
  .generator-rh-count-menu > button,
  .smart-popover :is(.direct-option, .duration-option, .ratio-option, .size-picker-option)
):not(:disabled):not([aria-disabled="true"]):is(.selected, .is-selected, .active, [aria-selected="true"]) {
  color: #fff !important;
  background: var(--supercanv-option-selected) !important;
  border-color: var(--supercanv-option-selected) !important;
  box-shadow: none !important;
  outline: none !important;
  transform: none !important;
  transition: none !important;
}

:is(
  .option-popover > button,
  .aspect-popover > button,
  .users-custom-select-option,
  .react-canvas-picker-menu > button,
  .canvas-native-select-option,
  .prompt-ai-select-menu > button,
  .generator-rh-count-menu > button,
  .smart-popover :is(.direct-option, .duration-option, .ratio-option, .size-picker-option)
):not(:disabled):not([aria-disabled="true"]):is(.selected, .is-selected, .active, [aria-selected="true"]) :is(small, .public-model-label, .public-model-name) {
  color: inherit !important;
}
.smart-popover .direct-option.active::after { background: currentColor; }

/* Choice controls share menu hover colors; action buttons and selected states stay local.
   Keep tab underline borders and keyboard outlines, rather than replacing their geometry. */
.workspace-page :is(
  button[role="tab"],
  .choice-button-group > button,
  .aspect-card-grid > button,
  .matting-segment > button,
  .commerce-quantity-choices > button,
  .resource-library-tabs > button,
  .history-filter-group button,
  .asset-category-list > button,
  .lexicon-category-list > button,
  .composer-library-category-row > button,
  .composer-prompt-category-row > button,
  .react-canvas-aspect-grid > button,
  .react-canvas-segment > button,
  .mp-segment > button,
  .account-form-tabs > button,
  .web-provider-tabs > button,
  .admin-model-filter-tabs > button,
  .finance-tabs > button,
  .notification-tab,
  .mode-tab,
  .choice-button,
  .asset-filter,
  .archive-filter,
  .commerce-text-history nav > button,
  .canvas-usage-cards > button,
  .commerce-module-choice,
  .commerce-tool-type-grid > label
):not(:disabled):not([aria-disabled="true"]):not(.selected):not(.is-selected):not(.active):not(.is-active):not(.dragging):not([aria-selected="true"]):not([aria-pressed="true"]):not(:has(input:checked, input:disabled)):is(:hover, :focus-visible) {
  color: var(--supercanv-option-text) !important;
  background: var(--supercanv-option-hover) !important;
  box-shadow: none !important;
  transform: none !important;
  transition: none !important;
}

.workspace-page .canvas-usage-cards > button:not(.is-selected):is(:hover, :focus-visible) > span:last-child {
  color: var(--supercanv-option-text);
}

/* Pill/segment controls sit on their own light-gray track (#eee–#f6f7f6),
   where the white-background hover above is nearly invisible. Use a darker
   neutral gray for those tracks so the hover still reads as a gray block. */
.workspace-page :is(
  .ecommerce-feature-switcher > button,
  .commerce-tool-tabs > button,
  .commerce-quantity-choices > button,
  .commerce-quantity-more:not(.is-selected) > .option-trigger,
  .matting-segment > button,
  .choice-button-group > button,
  .react-canvas-segment > button,
  .mp-segment > button,
  .account-form-tabs > button,
  .web-provider-tabs > button,
  .commerce-writer-tabs > button
):not(:disabled):not([aria-disabled="true"]):not(.selected):not(.is-selected):not(.active):not(.is-active):not(.dragging):not([aria-selected="true"]):not([aria-pressed="true"]):not(:has(input:checked, input:disabled)):is(:hover, :focus-visible) {
  color: var(--supercanv-option-text) !important;
  background: var(--supercanv-option-hover-strong) !important;
  box-shadow: none !important;
  transform: none !important;
  transition: none !important;
}

/* Keep the visible thumb inside rounded menu edges without clipping panel shadows. */
:is(
  [role="listbox"],
  .option-popover,
  .aspect-popover,
  .users-custom-select-menu,
  .react-canvas-picker-menu,
  .canvas-native-select-menu,
  .prompt-ai-select-menu,
  .generator-rh-count-menu,
  .smart-popover,
  .smart-popover :is(.model-list, .direct-picker-col, .size-picker-list, .rh-config-list, .rh-param-list)
)::-webkit-scrollbar {
  width: 9px !important;
  height: 9px !important;
}

:is(
  [role="listbox"], .option-popover, .aspect-popover, .users-custom-select-menu,
  .react-canvas-picker-menu, .canvas-native-select-menu, .prompt-ai-select-menu,
  .generator-rh-count-menu, .smart-popover,
  .smart-popover :is(.model-list, .direct-picker-col, .size-picker-list, .rh-config-list, .rh-param-list)
)::-webkit-scrollbar-track:vertical {
  margin-block: 10px !important;
}

:is(
  [role="listbox"], .option-popover, .aspect-popover, .users-custom-select-menu,
  .react-canvas-picker-menu, .canvas-native-select-menu, .prompt-ai-select-menu,
  .generator-rh-count-menu, .smart-popover,
  .smart-popover :is(.model-list, .direct-picker-col, .size-picker-list, .rh-config-list, .rh-param-list)
)::-webkit-scrollbar-track:horizontal {
  margin-inline: 10px !important;
}

:is(
  [role="listbox"], .option-popover, .aspect-popover, .users-custom-select-menu,
  .react-canvas-picker-menu, .canvas-native-select-menu, .prompt-ai-select-menu,
  .generator-rh-count-menu, .smart-popover,
  .smart-popover :is(.model-list, .direct-picker-col, .size-picker-list, .rh-config-list, .rh-param-list)
)::-webkit-scrollbar-thumb {
  border: 2px solid transparent !important;
  background-clip: padding-box !important;
}
