.topbar-utility-button {
  display: inline-grid;
  place-items: center;
  width: 36px;
  height: 36px;
  flex: 0 0 auto;
  padding: 0;
  color: #c5cfca;
  border: 1px solid #303936;
  border-radius: 50%;
  background: #151a18;
  cursor: pointer;
  transition: color 140ms ease, border-color 140ms ease, background 140ms ease;
}

/* Mobile topbar: icon-led account controls are circular; text-led actions stay readable. */
@media (max-width: 820px) {
  html body .topbar-actions {
    gap: var(--space-2px) !important;
  }

  html body .topbar-actions :is(
    #theme-toggle-button,
    #language-menu-button,
    #mobile-profile-entry
  ) {
    width: min(48px, 100%) !important;
    min-width: 0 !important;
    height: auto !important;
    min-height: 0 !important;
    aspect-ratio: 1 !important;
    justify-self: center !important;
    align-self: center !important;
    padding: 0 !important;
    border-radius: 50% !important;
  }

  html body .topbar-actions :is(
    #wechat-contact-button span,
    #reward-tasks-entry span,
    #referral-entry-button span,
    #topbar-recharge-button span,
    #mobile-login-entry span
  ) {
    font-size: 12px !important;
    line-height: 1.15 !important;
  }

  html body .topbar-actions #mobile-profile-entry .avatar {
    width: calc(100% - 6px) !important;
    height: calc(100% - 6px) !important;
    min-width: 0 !important;
    min-height: 0 !important;
    font-size: 16px !important;
  }
}

@media (max-width: 360px) {
  html body .topbar-actions :is(
    #wechat-contact-button span,
    #reward-tasks-entry span,
    #referral-entry-button span,
    #topbar-recharge-button span,
    #mobile-login-entry span
  ) {
    font-size: 11px !important;
  }
}
.topbar-utility-button svg { width: 16px; height: 16px; stroke-width: 1.7; }
.topbar-utility-button:hover,
.topbar-utility-button[aria-expanded="true"] { color: #fff; border-color: #536158; background: #222b25; }
.ui-language-control { position: relative; display: inline-flex; flex: 0 0 auto; }
.ui-language-menu {
  position: absolute;
  top: calc(100% + 9px);
  right: 0;
  z-index: 130;
  display: grid;
  gap: var(--space-1);
  width: 190px;
  padding: var(--space-2);
  border: 1px solid #343c37;
  border-radius: 8px;
  background: #171c19;
  box-shadow: 0 12px 32px rgba(0, 0, 0, .28);
}
.ui-language-menu[hidden] { display: none !important; }
.ui-language-menu-heading { padding: var(--space-2) var(--space-2) var(--space-1); color: #87938c; font-size: 11px; }
.ui-language-menu button {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-width: 0;
  min-height: 35px;
  padding: 0 var(--space-2);
  color: #c6d0ca;
  text-align: left;
  border: 0;
  border-radius: 5px;
  background: transparent;
  cursor: pointer;
}
.ui-language-menu button:hover,
.ui-language-menu button.active { color: #f3f6f3; background: #28312b; }
.ui-language-menu button svg { width: 14px; height: 14px; opacity: 0; }
.ui-language-menu button[aria-checked="true"] svg { opacity: 1; color: #82d5b5; }

html[data-ui-theme="light"] {
  color-scheme: light;
  --color-bg-primary: #f7f7f7;
  --color-bg-secondary: #fff;
  --color-bg-tertiary: #f3f3f3;
  --color-text-primary: #191919;
  --color-text-secondary: #707070;
  --color-border-subtle: #dedede;
  --color-brand-primary: #161616;
  --color-brand-strong: #343434;
  --bg: var(--color-bg-primary);
  --ink: var(--color-text-primary);
  --muted: var(--color-text-secondary);
  --line: var(--color-border-subtle);
  --surface: var(--color-bg-secondary);
  --surface-soft: var(--color-bg-tertiary);
  --accent: var(--color-brand-primary);
  --accent-strong: var(--color-brand-strong);
  --shadow: 0 12px var(--space-8) rgba(0, 0, 0, .08);
}
html[data-ui-theme="light"] body,
html[data-ui-theme="light"] body::before { color: var(--color-text-primary) !important; background: var(--color-bg-primary) !important; background-image: none !important; }
html[data-ui-theme="light"] body::after { color: var(--color-text-primary) !important; background: var(--color-bg-primary) !important; }
html[data-ui-theme="light"] body:not(:has(#home-panel.active))::after {
  background-image: radial-gradient(circle, rgba(54, 60, 64, 0.27) 0 1.15px, transparent 1.5px) !important;
  background-size: 17px 17px !important;
  background-position: 0 0 !important;
}
html[data-ui-theme="light"] .app-shell,
html[data-ui-theme="light"] .workspace,
html[data-ui-theme="light"] .sidebar,
html[data-ui-theme="light"] .topbar,
html[data-ui-theme="light"] .creator-surface,
html[data-ui-theme="light"] .panel-grid,
html[data-ui-theme="light"] .creator-surface > .panel,
html[data-ui-theme="light"] .result-rail,
html[data-ui-theme="light"] .result-list,
html[data-ui-theme="light"] .generation-tabs,
html[data-ui-theme="light"] .generation-action-bar {
  color: var(--color-text-primary) !important;
  border-color: var(--color-border-subtle) !important;
  background: var(--color-bg-secondary) !important;
  background-image: none !important;
  box-shadow: none !important;
}
html[data-ui-theme="light"] .app-shell::before,
html[data-ui-theme="light"] .home-background-layer,
html[data-ui-theme="light"] .home-spotlight-layer { display: none !important; }
html[data-ui-theme="light"] body:has(#home-panel.active) .home-dot-layer {
  opacity: 0.72;
  background-image: radial-gradient(circle, rgba(54, 60, 64, 0.22) 0 1.15px, transparent 1.5px);
}
html[data-ui-theme="light"] .sidebar { border-right: 1px solid var(--color-border-subtle) !important; }
html[data-ui-theme="light"] :is(.sidebar, .topbar, .generation-tabs, .panel-grid) :is(h1, h2, h3, p, span, strong, button, a, label) { color: var(--color-text-primary); }
html[data-ui-theme="light"] .eyebrow,
html[data-ui-theme="light"] .brand span { color: #777 !important; }
html[data-ui-theme="light"] .sidebar .nav-item { color: #555 !important; background: transparent !important; }
html[data-ui-theme="light"] .sidebar .nav-item.active,
html[data-ui-theme="light"] .sidebar .nav-item:hover,
html[data-ui-theme="light"] .generation-tabs button.active { color: #171717 !important; background: #f1f1f1 !important; }
html[data-ui-theme="light"] .topbar-utility-button { color: #282828; border-color: #ddd; background: #fff; }
html[data-ui-theme="light"] .topbar-utility-button:hover,
html[data-ui-theme="light"] .topbar-utility-button[aria-expanded="true"] { color: #111; border-color: #bdbdbd; background: #f3f3f3; }
html[data-ui-theme="light"] .ui-language-menu { border-color: #dedede; background: #fff; box-shadow: 0 12px 32px rgba(0, 0, 0, .12); }
html[data-ui-theme="light"] .ui-language-menu-heading { color: #777; }
html[data-ui-theme="light"] .ui-language-menu button { color: #333; }
html[data-ui-theme="light"] .ui-language-menu button:hover,
html[data-ui-theme="light"] .ui-language-menu button.active { color: #111; background: #f1f1f1; }
html[data-ui-theme="light"] :is(input:not([type="range"]), textarea, select) { color: var(--color-text-primary); border-color: var(--color-border-subtle); background: var(--color-bg-secondary); }
html[data-ui-theme="light"] :is(.result-card, .empty-state, .task-log-card, .image-tool-card, .chat-history-card, .profile-entry) { color: #252525; border-color: #e0e0e0; background: #fff; }
html[data-ui-theme="light"] :is(.action-button, .creation-form > .action-button[type="submit"]) { color: var(--color-text-inverse); border-color: var(--color-brand-primary); background: var(--color-brand-primary); box-shadow: none; }
html[data-ui-theme="light"] .secondary-button,
html[data-ui-theme="light"] .icon-button { color: #292929; border-color: #dedede; background: #fff; }
html[data-ui-theme="light"] .auth-card,
html[data-ui-theme="light"] .account-card { color: #292929; border-color: #dedede; background: #fff; }
html[data-ui-theme="light"] body:has(#music-panel.active) #music-panel .breeze-tool-form input[type="file"] { color: #444; border-color: #d4d4d4; background: #fff; }
html[data-ui-theme="light"] body:has(#music-panel.active) #music-panel .breeze-tool-form input[type="file"]::file-selector-button { color: #222; border-color: #ddd; background: #f5f5f5; }

html[data-ui-theme="dark"] body:has(#music-panel.active) #music-panel {
  --breeze-bg: #111513; --breeze-panel: #151a17; --breeze-card: #191e1b;
  --breeze-line: #2a312d; --breeze-text: #e6ece8; --breeze-muted: #8b9890;
  color: #e6ece8; color-scheme: dark; background: #111513;
}
html[data-ui-theme="dark"] body:has(#music-panel.active) .breeze-studio-layout,
html[data-ui-theme="dark"] body:has(#music-panel.active) .breeze-studio-nav,
html[data-ui-theme="dark"] body:has(#music-panel.active) .breeze-studio-main,
html[data-ui-theme="dark"] body:has(#music-panel.active) .breeze-settings-column,
html[data-ui-theme="dark"] body:has(#music-panel.active) .breeze-settings-tabs { color: #e6ece8; background: #111513; }
html[data-ui-theme="dark"] body:has(#music-panel.active) .breeze-studio-nav,
html[data-ui-theme="dark"] body:has(#music-panel.active) .breeze-settings-column { border-color: #2a312d; }
html[data-ui-theme="dark"] body:has(#music-panel.active) .breeze-studio-nav { background: #101412; }
html[data-ui-theme="dark"] body:has(#music-panel.active) .breeze-studio-brand strong,
html[data-ui-theme="dark"] body:has(#music-panel.active) .breeze-view-header h3,
html[data-ui-theme="dark"] body:has(#music-panel.active) .breeze-page-intro strong { color: #e6ece8; }
html[data-ui-theme="dark"] body:has(#music-panel.active) .breeze-studio-brand small,
html[data-ui-theme="dark"] body:has(#music-panel.active) .breeze-nav-heading,
html[data-ui-theme="dark"] body:has(#music-panel.active) .breeze-breadcrumb { color: #829089; }
html[data-ui-theme="dark"] body:has(#music-panel.active) .breeze-nav-item { color: #a8b4ac; }
html[data-ui-theme="dark"] body:has(#music-panel.active) .breeze-nav-item.active { color: #f0f6f2; background: #26342c; }
html[data-ui-theme="dark"] body:has(#music-panel.active) .breeze-settings-tabs { border-color: #2a312d; }
html[data-ui-theme="dark"] body:has(#music-panel.active) .breeze-settings-tabs button { color: #87958c; }
html[data-ui-theme="dark"] body:has(#music-panel.active) .breeze-settings-tabs button.active { color: #e6f0e9; }
html[data-ui-theme="dark"] body:has(#music-panel.active) .breeze-settings-tabs button.active::after { background: #c0dfcd; }
html[data-ui-theme="dark"] body:has(#music-panel.active) .breeze-script-card,
html[data-ui-theme="dark"] body:has(#music-panel.active) .breeze-voice-picker,
html[data-ui-theme="dark"] body:has(#music-panel.active) .breeze-model-card,
html[data-ui-theme="dark"] body:has(#music-panel.active) .breeze-history-card,
html[data-ui-theme="dark"] body:has(#music-panel.active) .breeze-latest-output { color: #e1ebe4; border-color: #303a33; background: #171c19; }
html[data-ui-theme="dark"] body:has(#music-panel.active) .breeze-model-card.active { border-color: #596e60; background: #1b241f; }
html[data-ui-theme="dark"] body:has(#music-panel.active) .breeze-model-card-heading strong,
html[data-ui-theme="dark"] body:has(#music-panel.active) .breeze-voice-picker #breeze-blue-voice-select { color: #e1ece4; }
html[data-ui-theme="dark"] body:has(#music-panel.active) .breeze-model-card-copy,
html[data-ui-theme="dark"] body:has(#music-panel.active) .breeze-playback-note,
html[data-ui-theme="dark"] body:has(#music-panel.active) .breeze-setting-group { color: #88968e; }
html[data-ui-theme="dark"] body:has(#music-panel.active) .breeze-model-languages span { color: #b7cabd; border-color: #38443b; }
html[data-ui-theme="dark"] body:has(#music-panel.active) .breeze-playback-heading strong { color: #d3e2d9; }
html[data-ui-theme="dark"] body:has(#music-panel.active) .breeze-script-card textarea,
html[data-ui-theme="dark"] body:has(#music-panel.active) .breeze-setting-group input,
html[data-ui-theme="dark"] body:has(#music-panel.active) .breeze-setting-group select,
html[data-ui-theme="dark"] body:has(#music-panel.active) .breeze-instruction-box textarea { color: #e5eee8 !important; border-color: #344238 !important; background: #1b241e !important; }
html[data-ui-theme="dark"] body:has(#music-panel.active) .breeze-instruction-box summary,
html[data-ui-theme="dark"] body:has(#music-panel.active) .breeze-text-button { color: #a3b2a8; }
html[data-ui-theme="dark"] body:has(#music-panel.active) .breeze-editor-starters { border-color: #2a312d; background: #181f1b; }
html[data-ui-theme="dark"] body:has(#music-panel.active) .breeze-editor-starters > span { color: #829188; }
html[data-ui-theme="dark"] body:has(#music-panel.active) .breeze-sample-buttons button { color: #b2c2b8; border-color: #354239; background: transparent; }
html[data-ui-theme="dark"] body:has(#music-panel.active) .breeze-sample-buttons button:hover { color: #dff2e7; background: #23332a; }
html[data-ui-theme="dark"] body:has(#music-panel.active) .breeze-slider-field,
html[data-ui-theme="dark"] body:has(#music-panel.active) .breeze-editor-meta,
html[data-ui-theme="dark"] body:has(#music-panel.active) .breeze-voice-search-disclosure summary { color: #829188; }
html[data-ui-theme="dark"] body:has(#music-panel.active) .breeze-slider-field output { color: #c2d6ca; border-color: #34493b; background: #171c19; }
html[data-ui-theme="dark"] body:has(#music-panel.active) .breeze-slider-field input[type="range"] { background: linear-gradient(to right, #9bbdaa var(--breeze-range, 33.33%), #34473b var(--breeze-range, 33.33%)); }
html[data-ui-theme="dark"] body:has(#music-panel.active) .breeze-slider-field input[type="range"]::-webkit-slider-thumb { background: #b5dfc6; }
html[data-ui-theme="dark"] body:has(#music-panel.active) .generation-action-bar .cost-preview { color: #8da294; }
html[data-ui-theme="dark"] body:has(#music-panel.active) .generation-action-bar > .action-button { color: #102a1d; border-color: #82cba3; background: #85cda7; }
html[data-ui-theme="dark"] body:has(#music-panel.active) .breeze-tool-form,
html[data-ui-theme="dark"] body:has(#music-panel.active) .breeze-library-filters,
html[data-ui-theme="dark"] body:has(#music-panel.active) .breeze-voice-row,
html[data-ui-theme="dark"] body:has(#music-panel.active) .breeze-workspace-item { color: #dde8e0; border-color: #303a33; background: #151a17; }

/* Preferences override the page-specific shell colors as well as the editor. */
html[data-ui-theme="dark"] body:not(:has(#home-panel.active)):not(:has(#chat-panel.active)):has(#music-panel.active) :is(.app-shell, .workspace, .sidebar, .topbar, .panel-grid, .creator-surface, .sidebar .module-nav) {
  color: #e8e6e0 !important;
  border-color: #2b2a26 !important;
  background: transparent !important;
  background-image: none !important;
}
html[data-ui-theme="dark"] body:not(:has(#home-panel.active)):not(:has(#chat-panel.active)):has(#music-panel.active) .sidebar .nav-item { color: #b9b8b1 !important; }
html[data-ui-theme="dark"] body:not(:has(#home-panel.active)):not(:has(#chat-panel.active)):has(#music-panel.active) .sidebar .nav-item.active { color: #f5f3ed !important; background: #292824 !important; }
html[data-ui-theme="dark"] body:not(:has(#home-panel.active)):not(:has(#chat-panel.active)):has(#music-panel.active) .topbar :is(button, a) { color: var(--button-text) !important; border-color: var(--button-border) !important; background: var(--button-soft-bg) !important; }
html[data-ui-theme="dark"] body:not(:has(#home-panel.active)):not(:has(#chat-panel.active)):has(#music-panel.active) .topbar :is(button, a):hover:not(:disabled) { background: var(--button-soft-hover) !important; }
html[data-ui-theme="dark"] body:has(#music-panel.active) .account-card,
html[data-ui-theme="dark"] body:has(#music-panel.active) .account-card .profile-entry { color: #dedbd4; border-color: #2c2c27; background: #141411; }
html[data-ui-theme="dark"] body:has(#music-panel.active) #music-panel .breeze-tool-form :is(input:not([type="range"]):not([type="checkbox"]), select, textarea) { color: #e7e4dc; border-color: #393b34; background: #1b211b; }
html[data-ui-theme="dark"] body:has(#music-panel.active) #music-panel .breeze-tool-form label,
html[data-ui-theme="dark"] body:has(#music-panel.active) #music-panel .breeze-tool-form label > span { color: #b7c4b9; }
html[data-ui-theme="dark"] body:has(#music-panel.active) #music-panel .breeze-tool-form .action-button { color: #101811; border-color: #b7c9ba; background: #c0d4c4; }
html[data-ui-theme="dark"] body:has(#music-panel.active) #music-panel :is(.breeze-tool-form, .breeze-workspace-toolbar) .secondary-button { color: #c6d2c9; border-color: #3b463d; background: #222b24; }
html[data-ui-theme="dark"] body:has(#music-panel.active) #music-panel .breeze-candidate,
html[data-ui-theme="dark"] body:has(#music-panel.active) #music-panel .breeze-blue-design-option,
html[data-ui-theme="dark"] body:has(#music-panel.active) #music-panel .breeze-empty-state { color: #b5c5b9; border-color: #3b453d; background: #171c19; }
html[data-ui-theme="dark"] body:has(#music-panel.active) #music-panel :is(.breeze-candidate, .breeze-empty-state) strong { color: #e0eae2; }
html[data-ui-theme="dark"] body:has(#music-panel.active) #music-panel .generation-action-bar { background: #141a16 !important; }
html[data-ui-theme="dark"] body:has(#music-panel.active) #music-panel .breeze-blue-controls #breeze-blue-preview { color: #b7c8bc; border-color: #39463c; background: #171e19; }
html[data-ui-theme="dark"] body:has(#music-panel.active) #music-panel :is(.breeze-voice-row-copy, .breeze-workspace-item, .breeze-history-card) strong { color: #dbe8df; }
html[data-ui-theme="dark"] body:has(#music-panel.active) #music-panel .breeze-voice-tag { color: #c3d2c8; background: #26342b; }

html[data-ui-theme="light"] body:not(:has(#home-panel.active)):not(:has(#chat-panel.active)) :is(.workspace, .sidebar, .topbar, .panel-grid, .creator-surface, .result-rail, .sidebar .module-nav),
html[data-ui-theme="light"] body:has(#home-panel.active) :is(.workspace, .sidebar, .topbar, .sidebar .module-nav),
html[data-ui-theme="light"] body:has(#chat-panel.active) :is(.workspace, .sidebar, .topbar, .creator-surface, .result-rail, .sidebar .module-nav) { color: #222 !important; border-color: #dedede !important; background: #fff !important; }
html[data-ui-theme="light"] body .topbar :is(.wechat-contact-button, .referral-entry-button, .topbar-credit-button, .mobile-login-entry) { color: #303030 !important; border-color: #dedede !important; background: #fff !important; }
html[data-ui-theme="light"] body :is(.home-launch-card, .home-assistant-feature, .music-editor-stack, .image-editor-stack, .video-editor-stack, .creation-model-switch, .creation-model-options, .modal-card) { color: #262626 !important; border-color: #dedede !important; background: #fff !important; box-shadow: none; }
html[data-ui-theme="light"] body .profile-modal-card .profile-tabs { color: #3d4742 !important; border: 1px solid #dfe5e1 !important; background: #f1f4f2 !important; }
html[data-ui-theme="light"] body .profile-modal-card .profile-tabs button { color: #5b6861 !important; border: 0 !important; background: transparent !important; box-shadow: none !important; }
html[data-ui-theme="light"] body .profile-modal-card .profile-tabs button:hover { color: #26342c !important; background: #e8eeea !important; }
html[data-ui-theme="light"] body .profile-modal-card .profile-tabs button.active { color: #20563e !important; background: #fff !important; box-shadow: inset 0 0 0 1px #d9e3dd !important; }
html[data-ui-theme="light"] body :is(.home-launch-card, .home-assistant-feature, .modal-card, .creation-model-switch) :is(strong, h3, h4, label, p) { color: #262626; }
html[data-ui-theme="light"] body :is(.home-launch-card, .home-assistant-feature) :is(small, .home-kicker) { color: #6d6d6d; }
html[data-ui-theme="light"] body #music-panel .breeze-nav-item.active { color: #171717; background: #f0f0f0; }
html[data-ui-theme="light"] body #music-panel .breeze-tool-form input[type="file"] { color: #555; border-color: #d4d4d4; background: #fafafa; }
html[data-ui-theme="light"] body #music-panel .breeze-tool-form input[type="file"]::file-selector-button { color: #292929; border-color: #ddd; background: #fff; }
html[data-ui-theme="light"] body .sidebar #auth-card { color: #292929; border-color: #dedede; background: #fff; }
html[data-ui-theme="light"] body .sidebar #auth-card :is(#login-button, #register-button) { color: #fff !important; border-color: #222 !important; background: #222 !important; }
html[data-ui-theme="dark"] body:has(#music-panel.active) .sidebar #auth-card { color: #d9dfda; border-color: #2d302a; background: #141712; }
html[data-ui-theme="light"] body .home-kinetic-svg { filter: brightness(.23); }
html[data-ui-theme="light"] body :is(#image-panel.active, #video-panel.active),
html[data-ui-theme="light"] body :is(#image-panel, #video-panel) :is(.creation-form, .field-block, .image-editor-stack, .video-editor-stack, .generation-action-bar, .control-grid, .advanced-settings, .video-advanced-settings, .video-model-control, .image-parameter-control) { color: #262626 !important; border-color: #ddd !important; background: #fff !important; }
html[data-ui-theme="light"] body :is(#image-panel, #video-panel) :is(.creation-model-trigger, .image-parameter-trigger, .video-mode-trigger, .video-reference-upload, .reference-assets-button) { color: #333 !important; border-color: #d6d6d6 !important; background: #f5f5f5 !important; }
html[data-ui-theme="light"] body :is(#image-panel, #video-panel) .creation-model-thumb:is([data-profile="openai-image"], [data-profile="apimart-gpt-image"], [data-profile="apimart-gpt-image-2.6"], [data-profile="apimart-gpt-image-2.6-ext"]) img { filter: none !important; opacity: 1 !important; }
html[data-ui-theme] body :is(#image-panel, #video-panel) .creation-model-thumb img { filter: none !important; opacity: 1 !important; mix-blend-mode: normal !important; }
html[data-ui-theme="light"] body #image-panel .image-prompt-optimize-button { color: #333; outline-color: #d6d6d6; background: #f5f5f5; }
html[data-ui-theme="light"] body #image-panel .image-prompt-optimize-button:hover:not(:disabled) { outline-color: #b9c5bf; background: #ebf0ed; }
html[data-ui-theme="light"] body .result-history-actions [data-history-action="submit-prompt"] { color: #176d54; border-color: #cfe2d5; background: #f1f8f3; }
html[data-ui-theme="light"] body .result-history-actions [data-history-action="submit-prompt"]:hover:not(:disabled) { color: #0f5d45; border-color: #a9cfb3; background: #e6f3e9; }
html[data-ui-theme="light"] body :is(#image-panel, #video-panel) .generation-action-bar > .action-button,
html[data-ui-theme="light"] body :is(#image-panel, #video-panel) .generation-action-bar > .action-button :is(span, strong, svg) { color: #fff !important; border-color: #111 !important; background: #111 !important; }
html[data-ui-theme="light"] body #image-prompt-brief-modal .image-prompt-brief-actions .action-button { color: #fff !important; border-color: #161616 !important; background: #161616 !important; }
html[data-ui-theme="light"] body #image-prompt-brief-modal .image-prompt-brief-actions .action-button :is(span, svg) { color: #fff !important; border-color: transparent !important; background: transparent !important; }

/* The floating image/video result controls need their own contrast on white canvases. */
html[data-ui-theme="light"] body:has(.panel-grid.generation-mode) .result-rail[data-layout="history"] .result-history-actions,
html[data-ui-theme="light"] body:has(.panel-grid.result-first) .result-rail[data-layout="history"] .result-history-actions {
  color: #30363a !important;
  border: 1px solid #d9dddf !important;
  border-radius: 9px !important;
  background: rgba(255, 255, 255, .94) !important;
  box-shadow: 0 2px 9px rgba(30, 38, 42, .14) !important;
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
}
html[data-ui-theme="light"] body:has(.panel-grid.generation-mode) .result-rail[data-layout="history"] .result-history-actions button,
html[data-ui-theme="light"] body:has(.panel-grid.result-first) .result-rail[data-layout="history"] .result-history-actions button {
  color: #42494e !important;
  border-color: transparent !important;
  background: transparent !important;
  box-shadow: none !important;
}
html[data-ui-theme="light"] body:has(.panel-grid.generation-mode) .result-rail[data-layout="history"] .result-history-actions button:hover:not(:disabled),
html[data-ui-theme="light"] body:has(.panel-grid.result-first) .result-rail[data-layout="history"] .result-history-actions button:hover:not(:disabled) {
  color: #181c1f !important;
  background: #eef0f1 !important;
}
html[data-ui-theme="light"] body:has(.panel-grid.generation-mode) .result-rail[data-layout="history"] .result-history-actions button:disabled,
html[data-ui-theme="light"] body:has(.panel-grid.result-first) .result-rail[data-layout="history"] .result-history-actions button:disabled { color: #959b9f !important; opacity: .65 !important; }
@media (min-width: 821px) {
  html[data-ui-theme="light"] body .result-rail[data-layout="history"] .result-history-actions button { color: #4e5b54 !important; }
  html[data-ui-theme="light"] body .result-rail[data-layout="history"] .result-history-actions button:hover:not(:disabled) { color: #243b2e !important; border-color: #dce5df !important; background: #edf2ee !important; }
  html[data-ui-theme="light"] body .result-rail[data-layout="history"] .result-history-actions button:disabled { color: #8d9891 !important; opacity: .65 !important; }
}

/* Result actions stay transparent in the light theme as well. */
html[data-ui-theme="light"] body .result-rail[data-layout="history"] .result-history-actions {
  position: static !important;
  inset: auto !important;
  border: 0 !important;
  border-radius: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
  -webkit-backdrop-filter: none !important;
  backdrop-filter: none !important;
}

html[data-ui-theme="light"] body:has(.panel-grid.generation-mode) .result-rail[data-layout="history"] .result-history-actions,
html[data-ui-theme="light"] body:has(.panel-grid.result-first) .result-rail[data-layout="history"] .result-history-actions {
  position: static !important;
  inset: auto !important;
  border: 0 !important;
  border-radius: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
  -webkit-backdrop-filter: none !important;
  backdrop-filter: none !important;
}

/* Recharge uses a deliberately dark payment surface in dark mode. */
html[data-ui-theme="light"] body .recharge-modal-card:not([hidden]) {
  color: #252a2d !important;
  border-color: #d7dcdf !important;
  background: #fff !important;
  box-shadow: 0 24px 70px rgba(25, 34, 40, .18) !important;
}
html[data-ui-theme="light"] body .recharge-modal-card .recharge-summary-panel {
  border-color: #e0e4e6 !important;
  background: #f4f6f7 !important;
}
html[data-ui-theme="light"] body .recharge-modal-card .recharge-balance strong { color: #202629 !important; }
html[data-ui-theme="light"] body .recharge-modal-card .recharge-balance span,
html[data-ui-theme="light"] body .recharge-modal-card .recharge-summary-list div,
html[data-ui-theme="light"] body .recharge-modal-card .recharge-summary-list strong { color: #606a70 !important; }
html[data-ui-theme="light"] body .recharge-modal-card .recharge-ledger-link { color: #46535a !important; }
html[data-ui-theme="light"] body .recharge-modal-card .recharge-main-panel { background: #fff !important; }
html[data-ui-theme="light"] body .recharge-modal-card .recharge-modal-head h3,
html[data-ui-theme="light"] body .recharge-modal-card .payment-selection-copy h4 { color: #252b2e !important; }
html[data-ui-theme="light"] body .recharge-modal-card .recharge-modal-head p,
html[data-ui-theme="light"] body .recharge-modal-card .payment-selection-copy p { color: #69747a !important; }
html[data-ui-theme="light"] body .recharge-modal-card .recharge-main-panel .package-card {
  color: #242a2d !important;
  border-color: #dfe3e5 !important;
  background: #f7f8f8 !important;
}
html[data-ui-theme="light"] body .recharge-modal-card .recharge-main-panel .package-card strong { color: #22282b !important; }
html[data-ui-theme="light"] body .recharge-modal-card .recharge-main-panel .package-card span,
html[data-ui-theme="light"] body .recharge-modal-card .recharge-main-panel .package-card small { color: #687278 !important; }
html[data-ui-theme="light"] body .recharge-modal-card .recharge-main-panel .package-card.selected {
  border: 2px solid #64736c !important;
  background: #edf2ef !important;
}
html[data-ui-theme="light"] body .recharge-modal-card .recharge-main-panel .package-card:not(.disabled):hover {
  border-color: #98a59e !important;
  background: #f0f3f1 !important;
}
html[data-ui-theme="light"] body .recharge-modal-card .recharge-channel {
  border-color: #d9dfe2 !important;
  background: #f0f2f3 !important;
}
html[data-ui-theme="light"] body .recharge-modal-card .recharge-channel button { color: #4f5a60 !important; }
html[data-ui-theme="light"] body .recharge-modal-card .recharge-channel button[data-channel="alipay"].active,
html[data-ui-theme="light"] body .recharge-modal-card #submit-recharge-order[data-payment-channel="alipay"] {
  color: #fff !important;
  border-color: #1677ff !important;
  background: #1677ff !important;
}
html[data-ui-theme="light"] body .recharge-modal-card .recharge-channel button[data-channel="wechat"].active,
html[data-ui-theme="light"] body .recharge-modal-card #submit-recharge-order[data-payment-channel="wechat"] {
  color: #fff !important;
  border-color: #07b85b !important;
  background: #07b85b !important;
}
html[data-ui-theme="light"] body .recharge-modal-card .recharge-cancel-order {
  color: #505b61 !important;
  border-color: #d9dfe2 !important;
  background: #fff !important;
}
html[data-ui-theme="light"] body .recharge-modal-card .recharge-step-section.card-redeem-card {
  color: #252b2e !important;
  border-color: #dce1e3 !important;
  background: #f7f8f8 !important;
}
html[data-ui-theme="light"] body .recharge-modal-card .card-redeem-card :is(h4, label) { color: #293135 !important; }
html[data-ui-theme="light"] body .recharge-modal-card .card-redeem-card p { color: #687278 !important; }
html[data-ui-theme="light"] body .recharge-modal-card .card-redeem-card input {
  color: #252b2e !important;
  border-color: #cfd6d9 !important;
  background: #fff !important;
}
html[data-ui-theme="light"] body .recharge-modal-card .card-redeem-card .secondary-button {
  color: #30383c !important;
  border-color: #d3d9dc !important;
  background: #fff !important;
}
html[data-ui-theme="light"] body .recharge-modal-card .card-redeem-card .action-button {
  color: #fff !important;
  border-color: #242a2d !important;
  background: #242a2d !important;
}
html[data-ui-theme="light"] body .recharge-modal-card .recharge-status-message { color: #3c484d !important; }

/* Keep the compact preference buttons consistent at every viewport width. */
html body .topbar-actions .topbar-utility-button {
  display: inline-grid !important;
  place-items: center;
  width: 36px !important;
  height: 36px !important;
  min-width: 36px;
  padding: 0 !important;
  border-radius: 50% !important;
  transform: none !important;
}
html body .topbar-actions .ui-language-control { position: relative; z-index: 65; }
html body .topbar-actions .ui-language-menu button {
  display: flex !important;
  width: 100%;
  min-height: 36px;
  padding: 0 var(--space-2) !important;
  color: #d9e2db !important;
  border: 0 !important;
  border-radius: 5px !important;
  background: transparent !important;
  font-size: 12px;
  transform: none !important;
}
html body .topbar-actions .ui-language-menu button:hover,
html body .topbar-actions .ui-language-menu button.active { background: #29312b !important; }
html[data-ui-theme="light"] body .topbar-actions .ui-language-menu button { color: #292929 !important; }
html[data-ui-theme="light"] body .topbar-actions .ui-language-menu button:hover,
html[data-ui-theme="light"] body .topbar-actions .ui-language-menu button.active { background: #f0f0f0 !important; }

html[data-ui-theme="light"] body:has(#prompts-panel.active) .prompt-library-search {
  color: #707070 !important;
  border-color: #d8d8d8 !important;
  background: #fff !important;
}
html[data-ui-theme="light"] body:has(#prompts-panel.active) .prompt-library-search:focus-within {
  border-color: #8bba99 !important;
}
html[data-ui-theme="light"] body:has(#prompts-panel.active) .prompt-library-search .prompt-library-search-input {
  color: #252525 !important;
  border: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
}
html[data-ui-theme="light"] body:has(#prompts-panel.active) .prompt-library-search-input::placeholder {
  color: #858585 !important;
}
html[data-ui-theme="light"] body:has(#prompts-panel.active) .prompt-library-favorites-filter {
  color: #3d3d3d !important;
  border-color: #d8d8d8 !important;
  background: #fff !important;
}
html[data-ui-theme="light"] body:has(#prompts-panel.active) .prompt-library-favorites-filter:hover {
  color: #202020 !important;
  border-color: #bcbcbc !important;
  background: #f5f5f5 !important;
}
html[data-ui-theme="light"] body:has(#prompts-panel.active) .prompt-library-favorites-filter.is-active {
  color: #244b32 !important;
  border-color: #9bc9a9 !important;
  background: #e8f5eb !important;
}
html body:has(#prompts-panel.active):not(:has(#home-panel.active)):not(:has(#chat-panel.active)) .app-shell > .sidebar .module-nav {
  background: transparent !important;
  background-color: transparent !important;
  background-image: none !important;
}
html[data-ui-theme="light"] body:has(#prompts-panel.active) .app-shell > .sidebar .module-nav .nav-item.active {
  background: #e6e6e6 !important;
}

html[data-ui-theme="dark"] body:has(#prompts-panel.active) .prompt-library-search {
  color: #a9b4ad !important;
  border-color: #303a33 !important;
  background: #191f1b !important;
}
html[data-ui-theme="dark"] body:has(#prompts-panel.active) .prompt-library-search:focus-within {
  border-color: #759e83 !important;
}
html[data-ui-theme="dark"] body:has(#prompts-panel.active) .prompt-library-search .prompt-library-search-input {
  color: #e6eee8 !important;
  border: 0 !important;
  background: transparent !important;
}
html[data-ui-theme="dark"] body:has(#prompts-panel.active) .prompt-library-search-input::placeholder {
  color: #77857d !important;
}
html[data-ui-theme="dark"] body:has(#prompts-panel.active) .prompt-library-favorites-filter {
  color: #a9b4ad !important;
  border-color: #303a33 !important;
  background: transparent !important;
}
html[data-ui-theme="dark"] body:has(#prompts-panel.active) .prompt-library-favorites-filter:hover {
  color: #eef6ef !important;
  border-color: #66796b !important;
  background: #202922 !important;
}
html[data-ui-theme="dark"] body:has(#prompts-panel.active) .prompt-library-favorites-filter.is-active {
  color: #c6f4d6 !important;
  border-color: #668975 !important;
  background: #25372b !important;
}

@media (max-width: 820px) {
  html body .topbar-actions .topbar-utility-button { width: 34px !important; min-width: 34px; height: 34px !important; }
  html body .ui-language-menu { position: fixed; top: calc(50px + env(safe-area-inset-top)); right: 12px; max-width: calc(100vw - 24px); }
}

/* Keep the homepage outer surface borderless; launch cards retain their original effects. */
html body .panel-grid.home-only,
html body .panel-grid.home-only .creator-surface,
html body #home-panel,
html body #home-panel .home-stage {
  border-color: transparent !important;
  box-shadow: none !important;
}

/* The main navigation uses background states without dividing or framing lines. */
html body .app-shell > .sidebar,
html body .app-shell > .sidebar .module-nav,
html body .app-shell > .sidebar .nav-item,
html body .app-shell > .sidebar .account-panel,
html body .app-shell > .sidebar .account-card,
html body .app-shell > .sidebar .guest-actions,
html body .app-shell > .sidebar .profile-entry,
html body .app-shell > .sidebar .avatar {
  border-width: 0 !important;
  box-shadow: none !important;
}

html body .app-shell > .sidebar #guest-actions {
  background: transparent !important;
}

html body .app-shell > .sidebar #auth-card:not(.signed-in) {
  background: transparent !important;
}

html body .app-shell > .sidebar #auth-card.signed-in {
  background: transparent !important;
}

html body .app-shell > .sidebar #auth-card.signed-in #profile-entry {
  background: transparent !important;
  border-color: transparent !important;
  box-shadow: none !important;
}

html[data-ui-theme="light"] body .app-shell > .sidebar .profile-entry .avatar {
  color: #292929 !important;
  background: transparent !important;
}

/* Keep the shared dot canvas visible through the light theme's page wrappers. */
html[data-ui-theme="light"] body:not(:has(#home-panel.active)):not(:has(#chat-panel.active)) :is(.app-shell, .workspace, .sidebar, .topbar, .panel-grid, .creator-surface, .creator-surface > .panel, .result-rail, .result-list),
html[data-ui-theme="light"] body:has(#home-panel.active) :is(.app-shell, .workspace, .sidebar, .topbar, .panel-grid, .creator-surface, .creator-surface > .panel, .result-rail, .result-list),
html[data-ui-theme="light"] body:has(#chat-panel.active) :is(.app-shell, .workspace, .sidebar, .topbar, .panel-grid, .creator-surface, .creator-surface > .panel, .result-rail, .result-list) {
  background-color: transparent !important;
  background-image: none !important;
}
html[data-ui-theme="light"] body :is(#home-panel.active, #prompts-panel.active, #chat-panel.active, #image-panel.active, #video-panel.active, #music-panel.active, #image-tools-panel.active, #tasklog-panel.active) {
  background-color: transparent !important;
  background-image: none !important;
}

/* Keep the left rail transparent and its navigation states consistent everywhere. */
html body:has(#home-panel.active) .app-shell > .sidebar,
html body:has(#home-panel.active) .app-shell > .sidebar .module-nav,
html body:has(#chat-panel.active) .app-shell > .sidebar,
html body:has(#chat-panel.active) .app-shell > .sidebar .module-nav,
html body:not(:has(#home-panel.active)):not(:has(#chat-panel.active)):has(#panel-grid) .app-shell > .sidebar,
html body:not(:has(#home-panel.active)):not(:has(#chat-panel.active)):has(#panel-grid) .app-shell > .sidebar .module-nav {
  background: transparent !important;
  background-color: transparent !important;
  background-image: none !important;
}

html body:has(#home-panel.active) .app-shell > .sidebar .module-nav .nav-item,
html body:has(#chat-panel.active) .app-shell > .sidebar .module-nav .nav-item,
html body:not(:has(#home-panel.active)):not(:has(#chat-panel.active)):has(#panel-grid) .app-shell > .sidebar .module-nav .nav-item {
  border-color: transparent !important;
  box-shadow: none !important;
  transform: none !important;
}
html[data-ui-theme="dark"] body:has(#panel-grid) .app-shell > .sidebar .module-nav .nav-item {
  color: var(--button-muted) !important;
  background: transparent !important;
}
html[data-ui-theme="dark"] body:has(#panel-grid) .app-shell > .sidebar .module-nav .nav-item:hover {
  color: var(--button-text) !important;
  background: var(--button-ghost-hover) !important;
}
html[data-ui-theme="dark"] body:has(#panel-grid) .app-shell > .sidebar .module-nav .nav-item.active {
  color: var(--button-text) !important;
  border-color: var(--button-border) !important;
  background: var(--button-soft-hover) !important;
}
html[data-ui-theme="light"] body:has(#panel-grid) .app-shell > .sidebar .module-nav .nav-item {
  color: #555 !important;
  background: transparent !important;
}
html[data-ui-theme="light"] body:has(#panel-grid) .app-shell > .sidebar .module-nav .nav-item:hover {
  color: #171717 !important;
  background: #f1f1f1 !important;
}
html[data-ui-theme="light"] body:has(#panel-grid) .app-shell > .sidebar .module-nav .nav-item.active {
  color: #171717 !important;
  border-color: transparent !important;
  background: #e6e6e6 !important;
}

html[data-ui-theme="dark"] body:not(:has(#home-panel.active)):not(:has(#chat-panel.active)):has(#music-panel.active) .app-shell > .sidebar,
html[data-ui-theme="dark"] body:not(:has(#home-panel.active)):not(:has(#chat-panel.active)):has(#music-panel.active) .app-shell > .sidebar .module-nav,
html[data-ui-theme="light"] body:not(:has(#home-panel.active)):not(:has(#chat-panel.active)):has(#music-panel.active) .app-shell > .sidebar,
html[data-ui-theme="light"] body:not(:has(#home-panel.active)):not(:has(#chat-panel.active)):has(#music-panel.active) .app-shell > .sidebar .module-nav {
  background: transparent !important;
  background-color: transparent !important;
  background-image: none !important;
}
html[data-ui-theme="dark"] body:not(:has(#home-panel.active)):not(:has(#chat-panel.active)):has(#music-panel.active) .app-shell > .sidebar .module-nav .nav-item {
  color: var(--button-muted) !important;
  background: transparent !important;
}
html[data-ui-theme="dark"] body:not(:has(#home-panel.active)):not(:has(#chat-panel.active)):has(#music-panel.active) .app-shell > .sidebar .module-nav .nav-item:hover {
  color: var(--button-text) !important;
  background: var(--button-ghost-hover) !important;
}
html[data-ui-theme="dark"] body:not(:has(#home-panel.active)):not(:has(#chat-panel.active)):has(#music-panel.active) .app-shell > .sidebar .module-nav .nav-item.active {
  color: var(--button-text) !important;
  border-color: var(--button-border) !important;
  background: var(--button-soft-hover) !important;
}
html[data-ui-theme="light"] body:not(:has(#home-panel.active)):not(:has(#chat-panel.active)):has(#music-panel.active) .app-shell > .sidebar .module-nav .nav-item {
  color: var(--button-muted) !important;
  background: transparent !important;
}
html[data-ui-theme="light"] body:not(:has(#home-panel.active)):not(:has(#chat-panel.active)):has(#music-panel.active) .app-shell > .sidebar .module-nav .nav-item:hover {
  color: var(--button-text) !important;
  background: var(--button-ghost-hover) !important;
}
html[data-ui-theme="light"] body:not(:has(#home-panel.active)):not(:has(#chat-panel.active)):has(#music-panel.active) .app-shell > .sidebar .module-nav .nav-item.active {
  color: var(--button-text) !important;
  border-color: var(--button-border) !important;
  background: var(--button-soft-hover) !important;
}

/* Give the light-theme image/video controls layered card surfaces. */
html[data-ui-theme="light"] body:not(:has(#home-panel.active)):not(:has(#chat-panel.active)):has(#image-panel.active) .panel-grid.generation-mode .creator-surface,
html[data-ui-theme="light"] body:not(:has(#home-panel.active)):not(:has(#chat-panel.active)):has(#video-panel.active) .panel-grid.result-first .creator-surface {
  background: #e8ebed !important;
  border: 1px solid #d7dcdf !important;
  border-radius: 18px !important;
}
html[data-ui-theme="light"] body:has(#image-panel.active) #image-panel.active,
html[data-ui-theme="light"] body:has(#video-panel.active) #video-panel.active {
  background: transparent !important;
}
html[data-ui-theme="light"] body:has(#image-panel.active) #image-panel .creation-form,
html[data-ui-theme="light"] body:has(#video-panel.active) #video-panel .creation-form {
  background: transparent !important;
}
html[data-ui-theme="light"] body:has(#image-panel.active) #image-panel .creation-model-switch,
html[data-ui-theme="light"] body:has(#video-panel.active) #video-panel .creation-model-switch {
  color: #30363a !important;
  background: #f0f2f3 !important;
  border: 1px solid #d6dbde !important;
  border-radius: 12px !important;
  box-shadow: none !important;
}
html[data-ui-theme="light"] body:has(#image-panel.active) #image-panel .image-editor-stack,
html[data-ui-theme="light"] body:has(#video-panel.active) #video-panel .video-editor-stack {
  color: #292e32 !important;
  background: #fff !important;
  border: 1px solid #d9dddf !important;
  border-radius: 14px !important;
  box-shadow: 0 2px 8px rgba(25, 35, 40, 0.04) !important;
}
html[data-ui-theme="light"] body:has(#image-panel.active) #image-panel .image-reference-uploader,
html[data-ui-theme="light"] body:has(#video-panel.active) #video-panel .video-reference-launch,
html[data-ui-theme="light"] body:has(#video-panel.active) #video-panel .video-reference-upload {
  color: #515a5f !important;
  background: #f0f2f3 !important;
  border: 1px dashed #c8cfd2 !important;
  border-radius: 12px !important;
}
html[data-ui-theme="light"] body:has(#image-panel.active) #image-panel .image-reference-uploader > span,
html[data-ui-theme="light"] body:has(#image-panel.active) #image-panel .image-reference-uploader > span button,
html[data-ui-theme="light"] body:has(#video-panel.active) #video-panel .video-reference-launch > span {
  color: #515a5f !important;
}
html[data-ui-theme="light"] body:has(#image-panel.active) #image-panel .image-reference-uploader small,
html[data-ui-theme="light"] body:has(#video-panel.active) #video-panel .video-reference-launch > small {
  color: #5e6970 !important;
}
html[data-ui-theme="light"] body:has(#image-panel.active) #image-panel .image-reference-uploader:is(:hover, :focus-within),
html[data-ui-theme="light"] body:has(#video-panel.active) #video-panel .video-reference-launch:is(:hover, :focus-visible),
html[data-ui-theme="light"] body:has(#video-panel.active) #video-panel .video-reference-composer.reference-open .video-reference-launch {
  background: #e8ecee !important;
  border-color: #b8c1c6 !important;
  outline-color: #b8c1c6 !important;
}
html[data-ui-theme="light"] body:has(#image-panel.active) #image-panel .image-prompt-block,
html[data-ui-theme="light"] body:has(#video-panel.active) #video-panel .field-block {
  color: #30363a !important;
  background: #fff !important;
  border: 1px solid #d9dddf !important;
  border-radius: 12px !important;
}
html[data-ui-theme="light"] body:has(#image-panel.active) #image-panel .image-prompt-block textarea,
html[data-ui-theme="light"] body:has(#video-panel.active) #video-panel .field-block textarea {
  color: #24292d !important;
  background: transparent !important;
  border-color: transparent !important;
  box-shadow: none !important;
}
html[data-ui-theme="light"] body:has(#image-panel.active) #image-panel .image-parameter-control,
html[data-ui-theme="light"] body:has(#video-panel.active) #video-panel .video-advanced-settings {
  color: #42494e !important;
  background: #f0f2f3 !important;
  border: 1px solid #d7dcdf !important;
  border-radius: 10px !important;
}
html[data-ui-theme="light"] body:has(#image-panel.active) #image-panel .image-parameter-control {
  background: transparent !important;
  border-color: transparent !important;
  border-radius: 0 !important;
  box-shadow: none !important;
}
html[data-ui-theme="light"] body:has(#image-panel.active) #image-panel .image-generation-action-bar,
html[data-ui-theme="light"] body:has(#video-panel.active) #video-panel .generation-action-bar {
  background: #e6e9eb !important;
  border: 1px solid #d3d8db !important;
  border-radius: 12px !important;
}

/* Anchor the utility and account buttons to one viewport position on every page. */
@media (min-width: 821px) {
  html body .topbar-actions,
  html body:has(#prompts-panel.active) .topbar .topbar-actions {
    position: fixed !important;
    inset: 30px 30px auto auto !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: flex-end !important;
    gap: var(--space-2) !important;
    width: max-content !important;
    height: 34px !important;
    margin: 0 !important;
    padding: 0 !important;
    transform: none !important;
    z-index: 60 !important;
  }
}
@media (max-width: 820px) {
  /* Keep the first-paint mobile header consistent with the lazy-loaded
     workspace theme instead of showing a compact, wrapped action cluster. */
  html body .topbar {
    padding-right: 0 !important;
    padding-left: 0 !important;
  }

  html body .topbar-actions,
  html body:has(#prompts-panel.active) .topbar .topbar-actions {
    position: static !important;
    inset: auto !important;
    display: grid !important;
    grid-template-columns: repeat(7, minmax(0, 1fr)) !important;
    align-items: center !important;
    justify-content: stretch !important;
    gap: var(--space-1) !important;
    width: 100% !important;
    max-width: 100% !important;
    height: auto !important;
    margin: 0 !important;
    padding: 0 !important;
    transform: none !important;
    z-index: 60 !important;
  }

  html body .topbar-actions .ui-language-control,
  html body .topbar-actions .wechat-contact {
    display: block !important;
    width: 100% !important;
    min-width: 0 !important;
  }

  html body .topbar-actions :is(
    .wechat-contact-button,
    .referral-entry-button,
    .topbar-credit-button,
    .topbar-utility-button,
    .mobile-profile-entry,
    .mobile-login-entry
  ) {
    display: grid !important;
    grid-template-rows: 18px auto !important;
    align-items: center !important;
    justify-content: center !important;
    justify-items: center !important;
    align-content: center !important;
    box-sizing: border-box !important;
    width: 100% !important;
    min-width: 0 !important;
    height: 48px !important;
    padding: var(--space-1) 0 !important;
    gap: var(--space-2px) !important;
    white-space: nowrap !important;
  }

  html body .topbar-actions :is(
    .wechat-contact-button span,
    .referral-entry-button span,
    .topbar-credit-button span,
    .mobile-action-label,
    .mobile-login-entry span
  ) {
    display: block !important;
    max-width: 100% !important;
    overflow: hidden !important;
    font-size: 9px !important;
    line-height: 1.1 !important;
    text-align: center !important;
    text-overflow: clip !important;
    white-space: nowrap !important;
  }

  html body .topbar-actions :is(
    .wechat-contact-button svg,
    .referral-entry-button svg,
    .topbar-credit-button svg,
    .topbar-utility-button svg,
    .mobile-login-entry svg
  ) {
    width: 15px !important;
    height: 15px !important;
  }

  /* Mobile utility hierarchy: theme, language and account stay icon-led;
     operational shortcuts stay text-led for faster scanning. */
  html body .topbar-actions :is(
    #theme-toggle-button .mobile-action-label,
    #language-menu-button .mobile-action-label,
    #mobile-profile-entry .mobile-action-label
  ) {
    display: none !important;
  }

  html body .topbar-actions :is(
    #wechat-contact-button svg,
    #reward-tasks-entry svg,
    #referral-entry-button svg,
    #topbar-recharge-button svg,
    #mobile-login-entry svg
  ) {
    display: none !important;
  }

  html body .topbar-actions :is(
    #wechat-contact-button,
    #reward-tasks-entry,
    #referral-entry-button,
    #topbar-recharge-button,
    #mobile-login-entry
  ) {
    grid-template-rows: 1fr !important;
  }

  html body .topbar-actions :is(
    #theme-toggle-button,
    #language-menu-button,
    #mobile-profile-entry
  ) {
    grid-template-rows: 1fr !important;
  }

  html body .topbar-actions .mobile-profile-entry[hidden],
  html body .topbar-actions .mobile-login-entry[hidden] {
    display: none !important;
  }
}

html body:not(:has(#home-panel.active)):not(:has(#chat-panel.active)):has(#music-panel.active):has(.panel-grid.breeze-tts-only) .topbar {
  border-bottom: 0 !important;
  border-bottom-width: 0 !important;
}

/* Use two equal icon-led segments for the image/video generation modes. */
html body .panel-grid.generation-mode .generation-tabs,
html body .panel-grid.result-first .generation-tabs {
  display: grid !important;
  grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  align-items: stretch !important;
  gap: var(--space-2) !important;
  width: 100% !important;
  min-width: 0 !important;
  min-height: 58px !important;
  height: auto !important;
  margin: 0 !important;
  padding: var(--space-2) var(--space-3) !important;
  border: 0 !important;
  border-radius: 0 !important;
  background: transparent !important;
}
html body .panel-grid.generation-mode .generation-tabs > button:not([hidden]),
html body .panel-grid.result-first .generation-tabs > button:not([hidden]) {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  gap: var(--space-2) !important;
  width: 100% !important;
  min-width: 0 !important;
  min-height: 42px !important;
  padding: 0 var(--space-2) !important;
  color: #78837e !important;
  border: 1px solid transparent !important;
  border-radius: 8px !important;
  background: transparent !important;
  font-size: 13px !important;
  font-weight: 600 !important;
  white-space: nowrap !important;
  transform: none !important;
}
html body .panel-grid.generation-mode .generation-tabs > button:not([hidden])::after,
html body .panel-grid.result-first .generation-tabs > button:not([hidden])::after {
  display: none !important;
}
html body .panel-grid.generation-mode .generation-tabs > button:not([hidden]) svg,
html body .panel-grid.result-first .generation-tabs > button:not([hidden]) svg {
  display: block !important;
  width: 16px !important;
  height: 16px !important;
  flex: 0 0 16px !important;
}
html[data-ui-theme="light"] body .panel-grid.generation-mode .generation-tabs > button:not([hidden]):hover,
html[data-ui-theme="light"] body .panel-grid.result-first .generation-tabs > button:not([hidden]):hover {
  color: #303a36 !important;
  background: #f2f4f4 !important;
}
html[data-ui-theme="light"] body .panel-grid.generation-mode .generation-tabs > button:not([hidden]).active,
html[data-ui-theme="light"] body .panel-grid.result-first .generation-tabs > button:not([hidden]).active {
  color: #1f302a !important;
  border-color: #d3e1dc !important;
  background: #e8f1ee !important;
}
html[data-ui-theme="dark"] body .panel-grid.generation-mode .generation-tabs > button:not([hidden]),
html[data-ui-theme="dark"] body .panel-grid.result-first .generation-tabs > button:not([hidden]) {
  color: #98a59f !important;
}
html[data-ui-theme="dark"] body .panel-grid.generation-mode .generation-tabs > button:not([hidden]):hover,
html[data-ui-theme="dark"] body .panel-grid.result-first .generation-tabs > button:not([hidden]):hover {
  color: #e4eee9 !important;
  background: #1c2420 !important;
}
html[data-ui-theme="dark"] body .panel-grid.generation-mode .generation-tabs > button:not([hidden]).active,
html[data-ui-theme="dark"] body .panel-grid.result-first .generation-tabs > button:not([hidden]).active {
  color: #dcf5ed !important;
  border-color: rgba(53, 199, 176, 0.28) !important;
  background: rgba(53, 199, 176, 0.12) !important;
}

/* Light theme for the image-parameter popover and all controls inside it. */
html[data-ui-theme="light"] body:has(#image-panel.active) #image-parameter-popover:not([hidden]) {
  color: #30373b !important;
  border: 1px solid #d3d9dc !important;
  background: #f4f6f7 !important;
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
  box-shadow: 0 14px 34px rgba(31, 43, 49, 0.16) !important;
}
html[data-ui-theme="light"] body:has(#image-panel.active) #image-parameter-popover .image-parameter-label {
  color: #687379 !important;
}
html[data-ui-theme="light"] body:has(#image-panel.active) #image-parameter-popover .image-segmented-control,
html[data-ui-theme="light"] body:has(#image-panel.active) #image-parameter-popover .image-aspect-control {
  background: #e8ecee !important;
  border: 1px solid #dde2e4 !important;
}
html[data-ui-theme="light"] body:has(#image-panel.active) #image-parameter-popover .image-parameter-option {
  color: #59646a !important;
  border-color: transparent !important;
  background: transparent !important;
}
html[data-ui-theme="light"] body:has(#image-panel.active) #image-parameter-popover .image-parameter-option:hover {
  color: #303a3f !important;
  background: #dfe5e7 !important;
}
html[data-ui-theme="light"] body:has(#image-panel.active) #image-parameter-popover .image-parameter-option.active,
html[data-ui-theme="light"] body:has(#image-panel.active) #image-parameter-popover .image-parameter-option[aria-checked="true"] {
  color: #1d3a30 !important;
  background: #d7e9e1 !important;
  box-shadow: inset 0 0 0 1px #c2d9cf !important;
}
html[data-ui-theme="light"] body:has(#image-panel.active) #image-parameter-popover .image-parameter-option:focus-visible {
  outline: 2px solid rgba(53, 139, 112, 0.55) !important;
  outline-offset: 1px !important;
}
html[data-ui-theme="light"] body:has(#image-panel.active) #image-parameter-popover .image-format-controls label,
html[data-ui-theme="light"] body:has(#image-panel.active) #image-parameter-popover .image26-parameters label {
  color: #59646a !important;
}
html[data-ui-theme="light"] body:has(#image-panel.active) #image-parameter-popover .image-format-controls select,
html[data-ui-theme="light"] body:has(#image-panel.active) #image-parameter-popover .image26-parameters select,
html[data-ui-theme="light"] body:has(#image-panel.active) #image-parameter-popover .image26-parameters input {
  color: #283136 !important;
  border: 1px solid #cfd6d9 !important;
  background: #fff !important;
  color-scheme: light;
}
html[data-ui-theme="light"] body:has(#image-panel.active) #image-parameter-popover .image26-note {
  color: #667278 !important;
}
html[data-ui-theme="light"] body:has(#image-panel.active) #image-parameter-popover .image26-advanced-settings {
  border-top-color: #d6dcde !important;
}
html[data-ui-theme="light"] body:has(#image-panel.active) #image-parameter-popover .image26-advanced-settings summary {
  color: #384247 !important;
}

/* Match the video-parameter popover to the image popover in light mode. */
html[data-ui-theme="light"] body:has(#video-panel.active) #video-parameter-popover:not([hidden]) {
  color: #30373b !important;
  border: 1px solid #d3d9dc !important;
  border-radius: 8px !important;
  background: #f4f6f7 !important;
  box-shadow: 0 14px 34px rgba(31, 43, 49, 0.16) !important;
  color-scheme: light;
}
html[data-ui-theme="light"] body:has(#video-panel.active) #video-parameter-popover .video-parameter-section {
  padding: var(--space-3) !important;
  border: 1px solid #dde2e4 !important;
  border-radius: 10px !important;
  background: #e8ecee !important;
}
html[data-ui-theme="light"] body:has(#video-panel.active) #video-parameter-popover .video-parameter-section > span,
html[data-ui-theme="light"] body:has(#video-panel.active) #video-parameter-popover .video-parameter-grid label > span {
  color: #687379 !important;
}
html[data-ui-theme="light"] body:has(#video-panel.active) #video-parameter-popover .video-parameter-grid {
  padding: var(--space-2) !important;
  border: 1px solid #dde2e4 !important;
  border-radius: 10px !important;
  background: #e8ecee !important;
}
html[data-ui-theme="light"] body:has(#video-panel.active) #video-parameter-popover .video-parameter-grid select,
html[data-ui-theme="light"] body:has(#video-panel.active) #video-parameter-popover .video-parameter-grid input {
  color: #283136 !important;
  border: 1px solid #cfd6d9 !important;
  border-radius: 8px !important;
  background: #fff !important;
  color-scheme: light;
}
html[data-ui-theme="light"] body:has(#video-panel.active) #video-parameter-popover .video-duration-control .range-step-button,
html[data-ui-theme="light"] body:has(#video-panel.active) #video-parameter-popover .video-duration-control output {
  color: #344047 !important;
  border: 1px solid #cfd6d9 !important;
  background: #fff !important;
}
html[data-ui-theme="light"] body:has(#video-panel.active) #video-parameter-popover .video-advanced-settings {
  color: #384247 !important;
  border: 1px solid #d7dcdf !important;
  border-radius: 10px !important;
  background: #f0f2f3 !important;
}
html[data-ui-theme="light"] body:has(#video-panel.active) #video-parameter-popover .video-advanced-settings summary {
  color: #384247 !important;
}
html[data-ui-theme="light"] body:has(#video-panel.active) #video-parameter-popover .video-extra-grid {
  color: #515c61 !important;
  background: transparent !important;
}

/* Reference uploads use the same light surfaces as the video settings menus. */
html[data-ui-theme="light"] body:has(#video-panel.active) #video-reference-menu {
  color: #30373b !important;
  border-color: #d3d9dc !important;
  background: #f4f6f7 !important;
  box-shadow: 0 14px 34px rgba(31, 43, 49, 0.16) !important;
  color-scheme: light;
}
html[data-ui-theme="light"] body:has(#video-panel.active) #video-reference-menu .video-reference-menu-head strong {
  color: #30373b !important;
}
html[data-ui-theme="light"] body:has(#video-panel.active) #video-reference-menu .video-reference-menu-head span,
html[data-ui-theme="light"] body:has(#video-panel.active) #video-reference-menu .video-reference-choice small {
  color: #5e6970 !important;
}
html[data-ui-theme="light"] body:has(#video-panel.active) #video-reference-menu .video-reference-choice {
  color: var(--button-text) !important;
  border-color: #d9dddf !important;
  background: #fff !important;
}
html[data-ui-theme="light"] body:has(#video-panel.active) #video-reference-menu .video-reference-choice :is(span, b) {
  color: inherit !important;
}
html[data-ui-theme="light"] body:has(#video-panel.active) #video-reference-menu .video-reference-choice > svg {
  color: #515a5f !important;
}
html[data-ui-theme="light"] body:has(#video-panel.active) #video-reference-menu .video-reference-choice:is(:hover, :focus-within) {
  color: #30373b !important;
  border-color: #b8c1c6 !important;
  background: #e8ecee !important;
}

html[data-ui-theme="light"] body:has(#video-panel.active) #video-mode-menu:not([hidden]) {
  color: #30373b !important;
  border: 1px solid #d3d9dc !important;
  border-radius: 10px !important;
  background: #f4f6f7 !important;
  box-shadow: 0 14px 34px rgba(31, 43, 49, 0.16) !important;
}
html[data-ui-theme="light"] body:has(#video-panel.active) #video-mode-menu button {
  color: #465057 !important;
  border: 1px solid transparent !important;
  border-radius: 8px !important;
  background: transparent !important;
}
html[data-ui-theme="light"] body:has(#video-panel.active) #video-mode-menu button:hover {
  color: #303a3f !important;
  background: #e8ecee !important;
}
html[data-ui-theme="light"] body:has(#video-panel.active) #video-mode-menu button.active,
html[data-ui-theme="light"] body:has(#video-panel.active) #video-mode-menu button[aria-checked="true"] {
  color: #1d3a30 !important;
  border-color: #cbded5 !important;
  background: #dfeee7 !important;
}
html[data-ui-theme="light"] body:has(#video-panel.active) #video-mode-menu button small {
  color: #687379 !important;
}
html[data-ui-theme="light"] body:has(#video-panel.active) #video-mode-menu button[aria-checked="true"] small {
  color: #52645d !important;
}

/* Center Breeze's secondary tool pages within the workspace column. */
html body #music-panel .breeze-page-view:not([data-breeze-page="tts"]) {
  box-sizing: border-box !important;
  width: min(100%, 1120px) !important;
  max-width: 1120px !important;
  margin-inline: auto !important;
  padding: var(--space-8) clamp(var(--space-4), 2.5vw, var(--space-8)) !important;
}
html body #music-panel .breeze-page-view:not([data-breeze-page="tts"]) .breeze-page-intro,
html body #music-panel .breeze-page-view:not([data-breeze-page="tts"]) .breeze-tool-form,
html body #music-panel .breeze-page-view:not([data-breeze-page="tts"]) > .breeze-tool-status,
html body #music-panel .breeze-page-view:not([data-breeze-page="tts"]) > .breeze-generated-preview,
html body #music-panel .breeze-page-view:not([data-breeze-page="tts"]) > .breeze-blue-design-results,
html body #music-panel .breeze-page-view:not([data-breeze-page="tts"]) > .breeze-blue-save-voice {
  box-sizing: border-box;
  width: min(100%, 820px) !important;
  margin-left: auto !important;
  margin-right: auto !important;
}
html body #music-panel .breeze-page-view:not([data-breeze-page="tts"]) .breeze-page-intro {
  margin-top: 0 !important;
}
@media (max-width: 720px) {
  html body #music-panel .breeze-page-view:not([data-breeze-page="tts"]) {
    width: 100% !important;
    padding: var(--space-6) var(--space-4) !important;
  }
}

/* The voice workspace owns its own navigation; image/video tabs stay separate. */
html body .panel-grid.breeze-tts-only {
  --breeze-nav-height: 58px;
  --breeze-nav-item-height: 40px;
  padding-block: 0 !important;
}
html body .panel-grid.breeze-tts-only > .creator-surface {
  margin: 0 !important;
}
html body .breeze-top-nav {
  display: none !important;
}
html body .panel-grid.breeze-tts-only .creator-surface > .generation-tabs {
  display: none !important;
}
html body .panel-grid.breeze-tts-only .breeze-top-nav {
  display: flex !important;
  align-items: center !important;
  justify-content: flex-start !important;
  gap: var(--space-2) !important;
  width: 100% !important;
  min-width: 0 !important;
  box-sizing: border-box !important;
  flex: 0 0 var(--breeze-nav-height) !important;
  min-height: var(--breeze-nav-height) !important;
  height: var(--breeze-nav-height) !important;
  max-height: var(--breeze-nav-height) !important;
  margin: 0 !important;
  padding: var(--space-2) var(--space-4) !important;
  overflow-x: auto !important;
  overflow-y: hidden !important;
  border: 0 !important;
  border-bottom: 1px solid #e4e7e8 !important;
  border-radius: 0 !important;
  background: #fff !important;
  scrollbar-width: none;
}
html body .panel-grid.breeze-tts-only .breeze-top-nav::-webkit-scrollbar { display: none; }
html body .panel-grid.breeze-tts-only .breeze-top-nav .breeze-nav-item {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  gap: var(--space-2) !important;
  flex: 1 0 auto !important;
  width: auto !important;
  min-width: 0 !important;
  box-sizing: border-box !important;
  height: var(--breeze-nav-item-height) !important;
  min-height: var(--breeze-nav-item-height) !important;
  max-height: var(--breeze-nav-item-height) !important;
  margin-block: 0 !important;
  line-height: 1 !important;
  padding: 0 var(--space-2) !important;
  color: #5e686d !important;
  border: 1px solid transparent !important;
  border-radius: 7px !important;
  background: transparent !important;
  font-size: 12px !important;
  font-weight: 500 !important;
  white-space: nowrap !important;
  transform: none !important;
  cursor: pointer;
}
html body .panel-grid.breeze-tts-only .breeze-top-nav .breeze-nav-item span { color: inherit !important; }
html body .panel-grid.breeze-tts-only .breeze-top-nav .breeze-nav-item svg {
  display: block !important;
  width: 15px !important;
  height: 15px !important;
  flex: 0 0 15px !important;
}
html body .panel-grid.breeze-tts-only .breeze-top-nav .breeze-nav-item:hover {
  color: #202b2f !important;
  background: #f2f4f4 !important;
}
html body .panel-grid.breeze-tts-only .breeze-top-nav .breeze-nav-item.active {
  color: #17372c !important;
  border-color: #d3e2db !important;
  background: #e7f0ec !important;
  box-shadow: none !important;
}
html body .panel-grid.breeze-tts-only .breeze-top-nav .breeze-new-badge {
  padding: var(--space-hairline) var(--space-1) !important;
  margin-left: 0 !important;
  color: #815b58 !important;
  border-radius: 5px !important;
  background: #f4e8e7 !important;
  font-size: 9px !important;
  font-style: normal !important;
}
html body .panel-grid.breeze-tts-only .breeze-studio-layout {
  display: block !important;
  min-height: 0 !important;
  background: transparent !important;
}
html body .panel-grid.breeze-tts-only .breeze-studio-nav,
html body .panel-grid.breeze-tts-only .breeze-studio-brand {
  display: none !important;
}
html body .panel-grid.breeze-tts-only .breeze-studio-main {
  display: block !important;
  width: 100% !important;
  min-width: 0 !important;
  padding: 0 !important;
}
html body .panel-grid.breeze-tts-only .breeze-view-header {
  display: none !important;
}
@media (min-width: 1080px) {
  html body .panel-grid.breeze-tts-only #music-panel .breeze-studio-main {
    display: block !important;
    height: 100% !important;
    min-height: 0 !important;
    overflow: hidden !important;
  }
  html body .panel-grid.breeze-tts-only #music-panel .breeze-page-view {
    height: 100% !important;
    min-height: 0 !important;
  }
}
@media (max-width: 820px) {
  html body .panel-grid.breeze-tts-only {
    --breeze-nav-height: 52px;
    --breeze-nav-item-height: 38px;
  }
  html body .workspace:has(.panel-grid.breeze-tts-only) {
    padding-top: calc(var(--space-14) + env(safe-area-inset-top)) !important;
  }
  html body .panel-grid.breeze-tts-only .breeze-top-nav {
    position: sticky !important;
    top: calc(54px + env(safe-area-inset-top)) !important;
    z-index: 35 !important;
    padding: var(--space-1) var(--space-2) !important;
  }
  html body .panel-grid.breeze-tts-only .breeze-top-nav .breeze-nav-item {
    flex: 0 0 auto !important;
    gap: var(--space-1) !important;
    padding-inline: var(--space-2) !important;
    font-size: 11px !important;
  }
  html body .panel-grid.breeze-tts-only .breeze-top-nav .breeze-nav-item svg {
    width: 14px !important;
    height: 14px !important;
    flex-basis: 14px !important;
  }
}

/* Keep the video parameter menu clear of its 720p/aspect/duration summary button. */
html body #video-panel .video-parameter-popover {
  bottom: 120px !important;
}
@media (min-width: 821px) and (max-height: 740px) {
  html body #video-panel .video-parameter-popover {
    max-height: min(420px, calc(100dvh - 309px)) !important;
    overflow-y: auto !important;
    overscroll-behavior: contain;
  }
}
@media (max-width: 820px) {
  html body #video-panel .video-parameter-popover {
    max-height: min(480px, calc(100dvh - 380px)) !important;
    overflow-y: auto !important;
    overscroll-behavior: contain;
  }
}

/* Task history is a light, scan-friendly table when the light theme is active. */
html[data-ui-theme="light"] body .panel-grid.task-log-only .task-log-titlebar h3 { color: #202a24 !important; }
html[data-ui-theme="light"] body .panel-grid.task-log-only .task-log-titlebar p { color: #68766e !important; }
html[data-ui-theme="light"] body .panel-grid.task-log-only .task-log-title-actions .icon-button,
html[data-ui-theme="light"] body .panel-grid.task-log-only .task-log-pagination .icon-button { color: #536259 !important; border-color: #d6ded9 !important; background: #fff !important; }
html[data-ui-theme="light"] body .panel-grid.task-log-only .task-log-title-actions .icon-button:hover,
html[data-ui-theme="light"] body .panel-grid.task-log-only .task-log-pagination .icon-button:hover:not(:disabled) { color: #24382d !important; border-color: #bdcbc2 !important; background: #f2f6f3 !important; }
html[data-ui-theme="light"] body .panel-grid.task-log-only .task-log-categories { border-bottom-color: #dce3de !important; }
html[data-ui-theme="light"] body .panel-grid.task-log-only .task-log-category { color: #59675f !important; background: transparent !important; }
html[data-ui-theme="light"] body .panel-grid.task-log-only .task-log-category:hover { color: #263b2f !important; background: #f1f5f2 !important; }
html[data-ui-theme="light"] body .panel-grid.task-log-only .task-log-category.active { color: #20563e !important; background: #eaf2ed !important; }
html[data-ui-theme="light"] body .panel-grid.task-log-only .task-log-category.active::after { background: #318361 !important; }
html[data-ui-theme="light"] body .panel-grid.task-log-only .task-log-table { border-color: #dfe5e1 !important; background: #fff !important; }
html[data-ui-theme="light"] body .panel-grid.task-log-only .task-log-table-head { color: #5e6c64 !important; border-bottom: 1px solid #e1e7e3 !important; background: #f0f3f1 !important; }
html[data-ui-theme="light"] body .panel-grid.task-log-only .task-log-row,
html[data-ui-theme="light"] body .panel-grid.task-log-only .task-log-card.task-log-row { color: #28332d !important; border-top-color: #e7ebe8 !important; background: #fff !important; }
html[data-ui-theme="light"] body .panel-grid.task-log-only .task-log-row:hover { background: #f5f8f6 !important; }
html[data-ui-theme="light"] body .panel-grid.task-log-only .task-log-time,
html[data-ui-theme="light"] body .panel-grid.task-log-only .task-log-duration { color: #68766e !important; }
html[data-ui-theme="light"] body .panel-grid.task-log-only .task-log-task-id { color: #536d60 !important; }
html[data-ui-theme="light"] body .panel-grid.task-log-only .task-log-price { color: #44534a !important; }
html[data-ui-theme="light"] body .panel-grid.task-log-only .task-log-key svg,
html[data-ui-theme="light"] body .panel-grid.task-log-only .task-log-model svg { color: #718078 !important; }
html[data-ui-theme="light"] body .panel-grid.task-log-only .task-log-action { color: #617067 !important; }
html[data-ui-theme="light"] body .panel-grid.task-log-only .task-log-action:hover { color: #263c30 !important; background: #edf3ef !important; }
html[data-ui-theme="light"] body .panel-grid.task-log-only .status-completed .task-log-status-result,
html[data-ui-theme="light"] body .panel-grid.task-log-only .status-completed .task-log-status-result svg { color: #24734c !important; }
html[data-ui-theme="light"] body .panel-grid.task-log-only .status-failed .task-log-status-result,
html[data-ui-theme="light"] body .panel-grid.task-log-only .status-failed .task-log-status-result svg { color: #b44949 !important; }
html[data-ui-theme="light"] body .panel-grid.task-log-only .task-log-table-empty { color: #68766e !important; background: #fff !important; }
html[data-ui-theme="light"] body .panel-grid.task-log-only .task-log-table-empty svg { color: #8a9990 !important; }
html[data-ui-theme="light"] body .panel-grid.task-log-only .task-log-pagination { color: #65736b !important; }
html[data-ui-theme="light"] body .panel-grid.task-log-only .task-log-pagination .task-log-page-status { color: #536158 !important; }
html[data-ui-theme="light"] body .panel-grid.task-log-only .task-log-pagination .icon-button:disabled { color: #a6b0aa !important; border-color: #e0e5e2 !important; background: #f5f7f6 !important; }

/* The workflow stylesheet pins task-log row colors with !important. Keep the
   light theme selectors at equal specificity and later in the cascade. */
html[data-ui-theme="light"] body .panel-grid.task-log-only .task-log-table-shell { border-color: #dfe5e1 !important; background: transparent !important; }
html[data-ui-theme="light"] body .panel-grid.task-log-only .task-log-table { color: #28332d !important; border-color: #dfe5e1 !important; background: #fff !important; }
html[data-ui-theme="light"] body .panel-grid.task-log-only .task-log-table-head { color: #5e6c64 !important; border-color: #e1e7e3 !important; background: #f0f3f1 !important; }
html[data-ui-theme="light"] body .panel-grid.task-log-only .task-log-card.task-log-row,
html[data-ui-theme="light"] body .panel-grid.task-log-only .task-log-row { color: #28332d !important; border-top-color: #e7ebe8 !important; background: #fff !important; }
html[data-ui-theme="light"] body .panel-grid.task-log-only .task-log-card.task-log-row:hover,
html[data-ui-theme="light"] body .panel-grid.task-log-only .task-log-row:hover { color: #24352b !important; background: #f5f8f6 !important; }
html[data-ui-theme="light"] body .panel-grid.task-log-only .task-log-card.task-log-row .task-log-cell { color: inherit !important; }
html[data-ui-theme="light"] body .panel-grid.task-log-only .task-log-titlebar h3 { color: #202a24 !important; }
html[data-ui-theme="light"] body .panel-grid.task-log-only .task-log-titlebar p { color: #68766e !important; }
html[data-ui-theme="light"] body .panel-grid.task-log-only .task-log-task-id { color: #536d60 !important; }
html[data-ui-theme="light"] body .panel-grid.task-log-only .task-log-price { color: #44534a !important; }
html[data-ui-theme="light"] body .panel-grid.task-log-only .task-log-price.refunded { color: #218052 !important; }
html[data-ui-theme="light"] body .panel-grid.task-log-only .task-log-price.not-charged { color: #68766e !important; }
html[data-ui-theme="light"] body .panel-grid.task-log-only .task-log-price.checking { color: #946118 !important; }
html[data-ui-theme="light"] body .panel-grid.task-log-only .task-log-status-button { color: #20563e !important; border-color: #c9ded2 !important; background: #eaf3ee !important; }
html[data-ui-theme="light"] body .panel-grid.task-log-only .task-log-status-button:hover { color: #16452f !important; border-color: #a8c8b5 !important; background: #dcece2 !important; }
html[data-ui-theme="light"] body .panel-grid.task-log-only .task-log-table-empty { color: #68766e !important; background: #fff !important; }
html[data-ui-theme="light"] body .panel-grid.task-log-only .task-log-table-empty svg { color: #8a9990 !important; }
html[data-ui-theme="light"] body .panel-grid.task-log-only .task-log-pagination { color: #65736b !important; }
html[data-ui-theme="light"] body .panel-grid.task-log-only .task-log-pagination .task-log-page-status { color: #536158 !important; }
html[data-ui-theme="light"] body .panel-grid.task-log-only .task-log-title-actions .icon-button,
html[data-ui-theme="light"] body .panel-grid.task-log-only .task-log-pagination .icon-button { color: #536259 !important; border-color: #d6ded9 !important; background: #fff !important; }
html[data-ui-theme="light"] body .panel-grid.task-log-only .task-log-title-actions .icon-button:hover,
html[data-ui-theme="light"] body .panel-grid.task-log-only .task-log-pagination .icon-button:hover:not(:disabled) { color: #24382d !important; border-color: #bdcbc2 !important; background: #f2f6f3 !important; }
html[data-ui-theme="light"] body .panel-grid.task-log-only .task-log-pagination .icon-button:disabled { color: #a6b0aa !important; border-color: #e0e5e2 !important; background: #f5f7f6 !important; }

/* Let the global dotted canvas show through the task-log body in both themes. */
html body .panel-grid.task-log-only .task-log-table,
html body .panel-grid.task-log-only .task-log-table-body,
html body .panel-grid.task-log-only .task-log-card.task-log-row,
html body .panel-grid.task-log-only .task-log-row,
html body .panel-grid.task-log-only .task-log-table-empty { background: transparent !important; }
html body .panel-grid.task-log-only .task-log-card.task-log-row:hover,
html body .panel-grid.task-log-only .task-log-row:hover { background: rgba(255, 255, 255, .035) !important; }
html[data-ui-theme="light"] body .panel-grid.task-log-only .task-log-card.task-log-row,
html[data-ui-theme="light"] body .panel-grid.task-log-only .task-log-row,
html[data-ui-theme="light"] body .panel-grid.task-log-only .task-log-table-empty { background: transparent !important; }
html[data-ui-theme="light"] body .panel-grid.task-log-only .task-log-card.task-log-row:hover,
html[data-ui-theme="light"] body .panel-grid.task-log-only .task-log-row:hover { background: rgba(0, 0, 0, .025) !important; }

html[data-ui-theme="dark"] body,
html[data-ui-theme="dark"] body:not(:has(#home-panel.active)):not(:has(#chat-panel.active)):has(#music-panel.active) {
  background: radial-gradient(ellipse at bottom, #1b2735 0%, #090a0f 100%) fixed !important;
  background-color: #090a0f !important;
  background-image: radial-gradient(ellipse at bottom, #1b2735 0%, #090a0f 100%) !important;
}

html[data-ui-theme="dark"] body::before,
html[data-ui-theme="dark"] body::after,
html[data-ui-theme="dark"] body .app-shell::before,
html[data-ui-theme="dark"] body .app-shell::after {
  display: none !important;
  content: none !important;
}

html[data-ui-theme="dark"] body .workspace,
html[data-ui-theme="dark"] body .app-shell > .sidebar {
  background-color: transparent !important;
  background-image: none !important;
  background-blend-mode: normal !important;
}

/* Keep the voice page's outer canvas open to the shared stars behind its cards. */
html[data-ui-theme="dark"] body:has(#music-panel.active) #music-panel,
html[data-ui-theme="dark"] body:has(#music-panel.active) #music-panel :is(.breeze-studio-layout, .breeze-studio-main, #breeze-tts-page),
html[data-ui-theme="dark"] body:has(#music-panel.active) .panel-grid.breeze-tts-only .breeze-top-nav {
  background: transparent !important;
}

html[data-ui-theme="dark"] body .home-background-layer,
html[data-ui-theme="dark"] body .home-spotlight-layer,
html[data-ui-theme="dark"] body .home-dot-layer {
  display: none !important;
  animation: none !important;
}

@media (max-width: 720px) {
  html[data-ui-theme="dark"] body:has(#home-panel.active) .app-shell > .sidebar,
  html[data-ui-theme="dark"] body:has(#home-panel.active) .app-shell > .sidebar .module-nav,
  html[data-ui-theme="dark"] body:has(#chat-panel.active) .app-shell > .sidebar,
  html[data-ui-theme="dark"] body:has(#chat-panel.active) .app-shell > .sidebar .module-nav,
  html[data-ui-theme="dark"] body:not(:has(#home-panel.active)):not(:has(#chat-panel.active)):has(#panel-grid) .app-shell > .sidebar,
  html[data-ui-theme="dark"] body:not(:has(#home-panel.active)):not(:has(#chat-panel.active)):has(#panel-grid) .app-shell > .sidebar .module-nav,
  html[data-ui-theme="dark"] body:not(:has(#home-panel.active)):not(:has(#chat-panel.active)):has(#music-panel.active) .app-shell > .sidebar,
  html[data-ui-theme="dark"] body:not(:has(#home-panel.active)):not(:has(#chat-panel.active)):has(#music-panel.active) .app-shell > .sidebar .module-nav,
  html[data-ui-theme="dark"] body:not(:has(#home-panel.active)):not(:has(#chat-panel.active)):has(#prompts-panel.active) .app-shell > .sidebar,
  html[data-ui-theme="dark"] body:not(:has(#home-panel.active)):not(:has(#chat-panel.active)):has(#prompts-panel.active) .app-shell > .sidebar .module-nav,
  html[data-ui-theme="dark"] body:not(:has(#home-panel.active)):not(:has(#chat-panel.active)):has(#design-services-panel.active) .app-shell > .sidebar,
  html[data-ui-theme="dark"] body:not(:has(#home-panel.active)):not(:has(#chat-panel.active)):has(#design-services-panel.active) .app-shell > .sidebar .module-nav {
    background: #252827 !important;
    background-color: #252827 !important;
    background-image: none !important;
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
  }

  html[data-ui-theme="light"] body:has(#home-panel.active) .app-shell > .sidebar,
  html[data-ui-theme="light"] body:has(#home-panel.active) .app-shell > .sidebar .module-nav,
  html[data-ui-theme="light"] body:has(#chat-panel.active) .app-shell > .sidebar,
  html[data-ui-theme="light"] body:has(#chat-panel.active) .app-shell > .sidebar .module-nav,
  html[data-ui-theme="light"] body:not(:has(#home-panel.active)):not(:has(#chat-panel.active)):has(#panel-grid) .app-shell > .sidebar,
  html[data-ui-theme="light"] body:not(:has(#home-panel.active)):not(:has(#chat-panel.active)):has(#panel-grid) .app-shell > .sidebar .module-nav,
  html[data-ui-theme="light"] body:not(:has(#home-panel.active)):not(:has(#chat-panel.active)):has(#music-panel.active) .app-shell > .sidebar,
  html[data-ui-theme="light"] body:not(:has(#home-panel.active)):not(:has(#chat-panel.active)):has(#music-panel.active) .app-shell > .sidebar .module-nav,
  html[data-ui-theme="light"] body:not(:has(#home-panel.active)):not(:has(#chat-panel.active)):has(#prompts-panel.active) .app-shell > .sidebar,
  html[data-ui-theme="light"] body:not(:has(#home-panel.active)):not(:has(#chat-panel.active)):has(#prompts-panel.active) .app-shell > .sidebar .module-nav,
  html[data-ui-theme="light"] body:not(:has(#home-panel.active)):not(:has(#chat-panel.active)):has(#design-services-panel.active) .app-shell > .sidebar,
  html[data-ui-theme="light"] body:not(:has(#home-panel.active)):not(:has(#chat-panel.active)):has(#design-services-panel.active) .app-shell > .sidebar .module-nav {
    background: #f0f1ef !important;
    background-color: #f0f1ef !important;
    background-image: none !important;
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
  }
}
