/* Shared model/aspect selectors. Page values, native change events and disabled states stay intact. */
html {--mc-accent:#0865cf;--mc-ring:#007aff25;--mc-panel:#fff;--mc-text:#29323e;--mc-muted:#6b7788;--mc-line:#dce2ea;--mc-tint:#eaf2ff;--mc-track:#eceef2;--mc-shadow:#142c5026;}
html.lg-dark {--mc-accent:#86baff;--mc-ring:#69aaff35;--mc-panel:#292e37;--mc-text:#edf0f6;--mc-muted:#a6aebb;--mc-line:#414957;--mc-tint:#283f5f;--mc-track:#323944;--mc-shadow:#00000055;}
html.lg-shell #app-view .workspace :is(.fashion-model-select,#universal-model,#video-ratio,#image-size,
    select[data-generate-field="model"],select[data-generate-field="aspect"],select[data-mm="ratio"],
    select[data-native-field="channel"],select[data-native-field="aspect_ratio"],.sr-options label:first-child select,#creative-variation-channel-trigger,#model-trigger,#main-aspect-ratio-toggle,[data-product-white-channel],[data-creative-rewrite-channel],[data-creative-channel],.provider-option,.model-option) {
  transition:background-color .18s ease,color .18s ease,border-color .18s ease,box-shadow .2s ease,scale .16s ease;
}
html.lg-shell #app-view .workspace :is(.fashion-model-select,#universal-model,#video-ratio,#image-size,
    select[data-generate-field="model"],select[data-generate-field="aspect"],select[data-mm="ratio"],
    select[data-native-field="channel"],select[data-native-field="aspect_ratio"],.sr-options label:first-child select,#creative-variation-channel-trigger,#model-trigger,#main-aspect-ratio-toggle):hover:not(:disabled) {border-color:var(--mc-accent)!important;box-shadow:0 2px 9px var(--mc-shadow)!important;translate:0 0;}
html.lg-shell #app-view .workspace :is(.fashion-model-select,#universal-model,#video-ratio,#image-size,
    select[data-generate-field="model"],select[data-generate-field="aspect"],select[data-mm="ratio"],
    select[data-native-field="channel"],select[data-native-field="aspect_ratio"],.sr-options label:first-child select,#creative-variation-channel-trigger,#model-trigger,#main-aspect-ratio-toggle):focus-visible {outline:2px solid var(--mc-accent);outline-offset:2px;box-shadow:0 0 0 4px var(--mc-ring)!important;}
html.lg-shell #app-view .workspace :is(#creative-variation-channel-trigger,#model-trigger,#main-aspect-ratio-toggle,[data-product-white-channel],[data-creative-rewrite-channel],[data-creative-channel],.provider-option,.model-option):hover:not(:disabled) {translate:0 0;}
html.lg-shell #app-view .workspace :is(#creative-variation-channel-trigger,#model-trigger,#main-aspect-ratio-toggle,[data-product-white-channel],[data-creative-rewrite-channel],[data-creative-channel],.provider-option,.model-option):active:not(:disabled) {scale:.975;translate:0 0;}
html.lg-shell #app-view .workspace :is([data-product-white-channel],[data-creative-rewrite-channel],[data-creative-channel],.provider-option,.model-option):focus-visible {outline:2px solid var(--mc-accent);outline-offset:-2px;}
/* A sliding selection surface follows the accepted radio state, including keyboard changes. */
html.lg-shell #app-view :is(#creative-rewrite-mode-switch,#product-white-channel-control .quality-speed-switch) {position:relative;isolation:isolate;min-width:0;}
html.lg-shell #app-view :is(#creative-rewrite-mode-switch,#product-white-channel-control .quality-speed-switch)::before {
  content:"";display:block;position:absolute;inset:3px auto 3px 3px;width:calc((100% - 8px)/2);
  border-radius:6px;background:var(--mc-panel);box-shadow:0 1px 4px var(--mc-shadow);pointer-events:none;
  transform:translateX(0);transition:transform .28s cubic-bezier(.2,.8,.2,1),background-color .18s ease;
}
html.lg-shell #app-view :is(#creative-rewrite-mode-switch,#product-white-channel-control .quality-speed-switch):has(>button:nth-child(2)[aria-checked="true"])::before {transform:translateX(calc(100% + 2px));}
html.lg-shell #app-view :is(#creative-rewrite-mode-switch,#product-white-channel-control .quality-speed-switch)>button,
html.lg-shell #app-view :is(#creative-rewrite-mode-switch,#product-white-channel-control .quality-speed-switch)>button:is(.active,[aria-checked="true"]) {position:relative;z-index:1;background:transparent!important;box-shadow:none!important;transform:none;}
/* Parameter menus share native pickers' fade/lift; keep their existing handlers and layouts. */
html.lg-shell #app-view :is(#creative-variation-channel-menu,#model-menu,#main-aspect-ratio-menu) {
  border:1px solid var(--mc-line);border-radius:11px;background:var(--mc-panel);color:var(--mc-text);
  box-shadow:0 12px 30px var(--mc-shadow);opacity:1;translate:0 0;scale:1;filter:none;
}
html #app-view :is(#creative-variation-channel-menu,#model-menu,#main-aspect-ratio-menu).hidden {opacity:0;translate:0 -4px;pointer-events:none;}
html #app-view :is(#creative-variation-channel-menu,#model-menu,#main-aspect-ratio-menu).is-opening {animation:mc-picker-in .22s cubic-bezier(.2,.8,.2,1) both;}
html #app-view :is(#creative-variation-channel-menu,#model-menu,#main-aspect-ratio-menu).is-closing {animation:mc-picker-out .22s cubic-bezier(.2,.8,.2,1) both;pointer-events:none;}
html #app-view :is(#creative-variation-channel-menu,#model-menu,#main-aspect-ratio-menu).is-opening > * {animation:none;}
@keyframes mc-picker-in {from {opacity:0;translate:0 -4px;} to {opacity:1;translate:0 0;}}
@keyframes mc-picker-out {from {opacity:1;translate:0 0;} to {opacity:0;translate:0 -4px;}}
html.lg-shell #app-view #model-menu>div+div {border-color:var(--mc-line);}
html.lg-shell #app-view :is(#creative-variation-channel-menu,#model-menu,#main-aspect-ratio-menu) :is(.provider-option,.model-option,[data-creative-channel],[data-main-aspect-ratio]) {
  min-height:34px;padding:8px 10px;border:0;border-radius:7px;background:transparent;color:var(--mc-text);
  font-size:12px;line-height:1.5;font-weight:400;transform:none;translate:0 0;scale:1;
}
html.lg-shell #app-view :is(#creative-variation-channel-menu,#model-menu,#main-aspect-ratio-menu) :is(.provider-option,.model-option,[data-creative-channel],[data-main-aspect-ratio]):is(:hover,:focus-visible,.active,[aria-checked="true"]) {background:var(--mc-tint);color:var(--mc-accent);}
html.lg-shell #app-view #model-menu :is(.menu-label,.menu-placeholder,.model-option span) {color:var(--mc-muted);}
html.lg-shell #app-view #main-aspect-ratio-menu {display:grid;grid-template-columns:1fr;gap:0;padding:5px;max-height:min(360px,60vh);overflow:auto;}
html.lg-shell #app-view #main-aspect-ratio-menu.hidden {display:none;}
html.lg-shell #app-view #main-aspect-ratio-menu button {text-align:left;}
/* Both kinds of selector use one surface. Native fallback keeps the platform arrow. */
html.lg-shell #app-view .workspace :is(.fashion-model-select,#universal-model,#video-ratio,#image-size,
    select[data-generate-field="model"],select[data-generate-field="aspect"],select[data-mm="ratio"],
    select[data-native-field="channel"],select[data-native-field="aspect_ratio"],.sr-options label:first-child select,#creative-variation-channel-trigger,#model-trigger,#main-aspect-ratio-toggle) {
  box-sizing:border-box;min-height:37px!important;height:37px!important;min-width:0;max-width:100%;
  padding:10px 12px!important;border:1px solid var(--mc-line)!important;border-radius:10px!important;
  background:var(--mc-panel)!important;color:var(--mc-text)!important;font-size:11px!important;line-height:15px!important;font-weight:400!important;
  text-align:left;box-shadow:none!important;cursor:pointer;
}
html.lg-shell #app-view .workspace :is(.fashion-model-select,#universal-model,#video-ratio,#image-size,
    select[data-generate-field="model"],select[data-generate-field="aspect"],select[data-mm="ratio"],
    select[data-native-field="channel"],select[data-native-field="aspect_ratio"],.sr-options label:first-child select,#creative-variation-channel-trigger,#model-trigger,#main-aspect-ratio-toggle):disabled {opacity:.6;cursor:not-allowed;}
html.lg-shell #app-view :is(#creative-variation-channel-trigger,#model-trigger,#main-aspect-ratio-toggle) {display:flex;align-items:center;justify-content:flex-start;gap:10px;}
html.lg-shell #app-view :is(#creative-variation-channel-trigger,#model-trigger,#main-aspect-ratio-toggle) :is(strong,small) {font:inherit!important;color:inherit!important;}
html.lg-shell #app-view :is(#main-aspect-ratio-toggle,#creative-variation-channel-trigger) small {color:var(--mc-muted)!important;}
html.lg-shell #app-view .mc-picker-caret {
  width:8px;height:6px;flex:0 0 8px;margin-inline-start:auto;color:var(--mc-muted);
  background:currentColor;clip-path:polygon(0 0,100% 0,50% 100%);
  transition:rotate .22s cubic-bezier(.2,.8,.2,1);pointer-events:none;
}
html.lg-shell #app-view :is(#creative-variation-channel-trigger,#model-trigger,#main-aspect-ratio-toggle)[aria-expanded="true"] .mc-picker-caret {rotate:180deg;}
/* Progressive native picker styling: older WebViews retain the standard select. */
@supports (appearance:base-select) {
  html #app-view :is(.fashion-model-select,#universal-model,#video-ratio,#image-size,
    select[data-generate-field="model"],select[data-generate-field="aspect"],select[data-mm="ratio"],
    select[data-native-field="channel"],select[data-native-field="aspect_ratio"],.sr-options label:first-child select),
  html #app-view :is(.fashion-model-select,#universal-model,#video-ratio,#image-size,
    select[data-generate-field="model"],select[data-generate-field="aspect"],select[data-mm="ratio"],
    select[data-native-field="channel"],select[data-native-field="aspect_ratio"],.sr-options label:first-child select)::picker(select) {appearance:base-select;}
  html #app-view :is(.fashion-model-select,#universal-model,#video-ratio,#image-size,
    select[data-generate-field="model"],select[data-generate-field="aspect"],select[data-mm="ratio"],
    select[data-native-field="channel"],select[data-native-field="aspect_ratio"],.sr-options label:first-child select) {align-items:center;min-width:0;text-overflow:ellipsis;column-gap:10px;}
  html #app-view :is(.fashion-model-select,#universal-model,#video-ratio,#image-size,
    select[data-generate-field="model"],select[data-generate-field="aspect"],select[data-mm="ratio"],
    select[data-native-field="channel"],select[data-native-field="aspect_ratio"],.sr-options label:first-child select)::picker-icon {content:"";width:8px;height:6px;flex-shrink:0;color:var(--mc-muted);margin-inline-start:auto;background:currentColor;clip-path:polygon(0 0,100% 0,50% 100%);transition:rotate .22s cubic-bezier(.2,.8,.2,1);}
  html #app-view :is(.fashion-model-select,#universal-model,#video-ratio,#image-size,
    select[data-generate-field="model"],select[data-generate-field="aspect"],select[data-mm="ratio"],
    select[data-native-field="channel"],select[data-native-field="aspect_ratio"],.sr-options label:first-child select):open::picker-icon {rotate:180deg;}
  html #app-view :is(.fashion-model-select,#universal-model,#video-ratio,#image-size,
    select[data-generate-field="model"],select[data-generate-field="aspect"],select[data-mm="ratio"],
    select[data-native-field="channel"],select[data-native-field="aspect_ratio"],.sr-options label:first-child select)::picker(select) {
    min-width:anchor-size(width);max-width:min(360px,calc(100vw - 24px));max-height:min(360px,60vh);overflow:auto;
    margin-block:6px;padding:5px;border:1px solid var(--mc-line);border-radius:11px;
    background:var(--mc-panel);color:var(--mc-text);box-shadow:0 12px 30px var(--mc-shadow);
    font-size:12px;line-height:1.5;opacity:0;translate:0 -4px;
    transition:opacity .22s cubic-bezier(.2,.8,.2,1),translate .22s cubic-bezier(.2,.8,.2,1),display .22s allow-discrete,overlay .22s allow-discrete;
  }
  html #app-view :is(.fashion-model-select,#universal-model,#video-ratio,#image-size,
    select[data-generate-field="model"],select[data-generate-field="aspect"],select[data-mm="ratio"],
    select[data-native-field="channel"],select[data-native-field="aspect_ratio"],.sr-options label:first-child select)::picker(select):popover-open {opacity:1;translate:0 0;}
  @starting-style {html #app-view :is(.fashion-model-select,#universal-model,#video-ratio,#image-size,
    select[data-generate-field="model"],select[data-generate-field="aspect"],select[data-mm="ratio"],
    select[data-native-field="channel"],select[data-native-field="aspect_ratio"],.sr-options label:first-child select)::picker(select):popover-open {opacity:0;translate:0 -4px;}}
  html #app-view :is(.fashion-model-select,#universal-model,#video-ratio,#image-size,
    select[data-generate-field="model"],select[data-generate-field="aspect"],select[data-mm="ratio"],
    select[data-native-field="channel"],select[data-native-field="aspect_ratio"],.sr-options label:first-child select) option {
    display:flex;align-items:center;gap:9px;min-height:34px;padding:8px 10px;border:0;border-radius:7px;
    background:transparent;color:var(--mc-text);font:inherit;white-space:normal;cursor:pointer;
    transition:background-color .15s ease,color .15s ease;
  }
  html #app-view :is(.fashion-model-select,#universal-model,#video-ratio,#image-size,
    select[data-generate-field="model"],select[data-generate-field="aspect"],select[data-mm="ratio"],
    select[data-native-field="channel"],select[data-native-field="aspect_ratio"],.sr-options label:first-child select) option:is(:hover,:focus,:checked) {background:var(--mc-tint);color:var(--mc-accent);}
  html #app-view :is(.fashion-model-select,#universal-model,#video-ratio,#image-size,
    select[data-generate-field="model"],select[data-generate-field="aspect"],select[data-mm="ratio"],
    select[data-native-field="channel"],select[data-native-field="aspect_ratio"],.sr-options label:first-child select) option:disabled {opacity:.45;cursor:not-allowed;}
  html #app-view :is(.fashion-model-select,#universal-model,#video-ratio,#image-size,
    select[data-generate-field="model"],select[data-generate-field="aspect"],select[data-mm="ratio"],
    select[data-native-field="channel"],select[data-native-field="aspect_ratio"],.sr-options label:first-child select) option::checkmark {color:var(--mc-accent);order:1;margin-inline-start:auto;}
}
@media(prefers-reduced-motion:reduce) {
  html #app-view :is(.fashion-model-select,#universal-model,#video-ratio,#image-size,
    select[data-generate-field="model"],select[data-generate-field="aspect"],select[data-mm="ratio"],
    select[data-native-field="channel"],select[data-native-field="aspect_ratio"],.sr-options label:first-child select,#creative-variation-channel-trigger,#model-trigger,#main-aspect-ratio-toggle,[data-product-white-channel],[data-creative-rewrite-channel],[data-creative-channel],.provider-option,.model-option,#creative-variation-channel-menu,#model-menu,#main-aspect-ratio-menu),
  html #app-view :is(#creative-rewrite-mode-switch,#product-white-channel-control .quality-speed-switch)::before {transition:none!important;animation:none!important;scale:1!important;translate:0 0!important;}
  html #app-view :is(.fashion-model-select,#universal-model,#video-ratio,#image-size,
    select[data-generate-field="model"],select[data-generate-field="aspect"],select[data-mm="ratio"],
    select[data-native-field="channel"],select[data-native-field="aspect_ratio"],.sr-options label:first-child select)::picker(select),
  html #app-view :is(.fashion-model-select,#universal-model,#video-ratio,#image-size,
    select[data-generate-field="model"],select[data-generate-field="aspect"],select[data-mm="ratio"],
    select[data-native-field="channel"],select[data-native-field="aspect_ratio"],.sr-options label:first-child select)::picker-icon,
  html #app-view :is(.fashion-model-select,#universal-model,#video-ratio,#image-size,
    select[data-generate-field="model"],select[data-generate-field="aspect"],select[data-mm="ratio"],
    select[data-native-field="channel"],select[data-native-field="aspect_ratio"],.sr-options label:first-child select) option,
  html #app-view .mc-picker-caret {transition:none!important;animation:none!important;}
}

html.lg-shell #app-view #chat-workspace #model-trigger {background:var(--mc-panel)!important;border:1px solid var(--mc-line);color:var(--mc-text);}

/* Unavailable ChatGPT quality choices stay legible in both themes. */
html { --quality-channel-unavailable: #c62835; --quality-channel-unavailable-bg: #d9324210; }
html.lg-dark { --quality-channel-unavailable: #ff828b; --quality-channel-unavailable-bg: #ff64751a; }
html #app-view [data-quality-channel-unavailable],
html #app-view [data-quality-channel-unavailable] *,
html.lg-shell #app-view .workspace [data-quality-channel-unavailable],
html.lg-shell #app-view .workspace [data-quality-channel-unavailable] * {
  color: var(--quality-channel-unavailable) !important;
  -webkit-text-fill-color: var(--quality-channel-unavailable) !important;
}
html #app-view select[data-quality-channel-selected-unavailable],
html.lg-shell #app-view .workspace select[data-quality-channel-selected-unavailable] {
  color: var(--quality-channel-unavailable) !important;
}
html #app-view [data-quality-channel-unavailable],
html.lg-shell #app-view .workspace [data-quality-channel-unavailable] {
  opacity: 1 !important;
  cursor: not-allowed !important;
  background: var(--quality-channel-unavailable-bg) !important;
  box-shadow: none !important;
  transform: none !important;
  translate: none !important;
  scale: 1 !important;
}
