/* ToolsByDcx global theme switcher.
 * Dark remains the product default; light mode is opt-in and persisted per browser.
 */
:root {
    color-scheme: dark;
    --dcx-bg: #0b0f19;
    --dcx-surface: #111827;
    --dcx-raised: #162032;
    --dcx-field: #1e293b;
    --dcx-border: rgba(148, 163, 184, .22);
    --dcx-text: #e2e8f0;
    --dcx-heading: #f8fafc;
    --dcx-muted: #94a3b8;
}

html[data-theme="light"] {
    color-scheme: light;
    --body-bg-h: 210;
    --body-bg-s: 40%;
    --body-bg-l: 98%;
    --body-color: 215 25% 27%;
    --heading-color: 222 47% 11% / .92;
    --border-color: 214 32% 91%;
    --section-bg: 210 40% 96%;
    --dcx-bg: #f8fafc;
    --dcx-surface: #ffffff;
    --dcx-raised: #f1f5f9;
    --dcx-field: #ffffff;
    --dcx-border: #dbe3ef;
    --dcx-text: #334155;
    --dcx-heading: #0f172a;
    --dcx-muted: #64748b;
}

/* Shared layout surfaces */
html[data-theme="light"] body,
html[data-theme="light"] .page-wrapper,
html[data-theme="light"] .body-wrapper,
html[data-theme="light"] .bodywrapper__inner,
html[data-theme="light"] .default-version {
    background-color: var(--dcx-bg) !important;
    color: var(--dcx-text) !important;
}

html[data-theme="light"] .navbar-wrapper,
html[data-theme="light"] .reseller-navbar {
    background-color: var(--dcx-surface) !important;
    border-color: var(--dcx-border) !important;
    box-shadow: 0 4px 20px rgba(15, 23, 42, .08) !important;
}

html[data-theme="light"] .sidebar-card-floating,
html[data-theme="light"] .sidebar,
html[data-theme="light"] .card,
html[data-theme="light"] .card.custom--card,
html[data-theme="light"] .box-shadow3,
html[data-theme="light"] .widget-two,
html[data-theme="light"] .widget-one,
html[data-theme="light"] .widget-three,
html[data-theme="light"] .widget-four,
html[data-theme="light"] .widget-five,
html[data-theme="light"] .widget-six,
html[data-theme="light"] .widget-seven,
html[data-theme="light"] .bg--white,
html[data-theme="light"] .box--shadow2 {
    background-color: var(--dcx-surface) !important;
    border-color: var(--dcx-border) !important;
    color: var(--dcx-text) !important;
    box-shadow: 0 8px 24px rgba(15, 23, 42, .06) !important;
}

html[data-theme="light"] .card-header,
html[data-theme="light"] .card-footer,
html[data-theme="light"] .widget-two:hover,
html[data-theme="light"] .list-group,
html[data-theme="light"] .list-group-item,
html[data-theme="light"] .table thead th,
html[data-theme="light"] .table th,
html[data-theme="light"] .table td,
html[data-theme="light"] .table-dark-custom thead th,
html[data-theme="light"] .dropdown-menu__header,
html[data-theme="light"] .dropdown-menu__footer {
    background-color: var(--dcx-raised) !important;
    border-color: var(--dcx-border) !important;
    color: var(--dcx-text) !important;
}

html[data-theme="light"] .table,
html[data-theme="light"] .table-dark-custom,
html[data-theme="light"] .list-group-item,
html[data-theme="light"] .widget-two__content p,
html[data-theme="light"] .widget-two__content span,
html[data-theme="light"] .text-muted,
html[data-theme="light"] .text--muted,
html[data-theme="light"] small,
html[data-theme="light"] .small {
    color: var(--dcx-muted) !important;
}

html[data-theme="light"] h1,
html[data-theme="light"] h2,
html[data-theme="light"] h3,
html[data-theme="light"] h4,
html[data-theme="light"] h5,
html[data-theme="light"] h6,
html[data-theme="light"] .page-title,
html[data-theme="light"] label,
html[data-theme="light"] .form-label,
html[data-theme="light"] .form-group label,
html[data-theme="light"] .modal-title {
    color: var(--dcx-heading) !important;
}

html[data-theme="light"] .text-dark,
html[data-theme="light"] .text--dark {
    color: var(--dcx-text) !important;
}

html[data-theme="light"] .form-control,
html[data-theme="light"] .form-select,
html[data-theme="light"] input.form-control,
html[data-theme="light"] textarea.form-control,
html[data-theme="light"] select.form-control,
html[data-theme="light"] .input-group-text,
html[data-theme="light"] .select2-container--default .select2-selection--single,
html[data-theme="light"] .select2-container--default .select2-selection--multiple,
html[data-theme="light"] .select2-search--dropdown .select2-search__field {
    background-color: var(--dcx-field) !important;
    border-color: var(--dcx-border) !important;
    color: var(--dcx-text) !important;
}

html[data-theme="light"] .form-control::placeholder,
html[data-theme="light"] input.form-control::placeholder,
html[data-theme="light"] textarea.form-control::placeholder,
html[data-theme="light"] .select2-container--default .select2-selection__placeholder {
    color: #94a3b8 !important;
}

html[data-theme="light"] .form-control:focus,
html[data-theme="light"] .form-select:focus {
    background-color: #ffffff !important;
    color: #0f172a !important;
    border-color: var(--base-color, #4634ff) !important;
}

/* Admin user forms: these cards previously used dark-only local colors, so
 * they became grey blocks with low-contrast text in the light theme. */
html[data-theme="light"] .dcx-tts-assignment,
html[data-theme="light"] .dcx-expiry-panel,
html[data-theme="light"] .dcx-tts-credit-card {
    background: #f8fafc !important;
    background-color: #f8fafc !important;
    border-color: #dbe3ef !important;
    color: #334155 !important;
}

html[data-theme="light"] .dcx-tts-assignment strong,
html[data-theme="light"] .dcx-tts-assignment small,
html[data-theme="light"] .dcx-tts-credit-card small,
html[data-theme="light"] .dcx-tts-credit-card .small,
html[data-theme="light"] .dcx-expiry-panel small {
    color: #64748b !important;
}

html[data-theme="light"] .dcx-tts-assignment strong,
html[data-theme="light"] .dcx-tts-credit-card label,
html[data-theme="light"] .dcx-expiry-panel label {
    color: #0f172a !important;
}

html[data-theme="light"] .dcx-tts-credit-card .input-group-text,
html[data-theme="light"] .dcx-expiry-panel .input-group-text,
html[data-theme="light"] .bg--dark {
    background: #e2e8f0 !important;
    background-color: #e2e8f0 !important;
    border-color: #cbd5e1 !important;
    color: #334155 !important;
}

html[data-theme="light"] .form-control:disabled,
html[data-theme="light"] .form-select:disabled,
html[data-theme="light"] input:disabled {
    background-color: #eef2f7 !important;
    color: #64748b !important;
    border-color: #dbe3ef !important;
    opacity: 1 !important;
}

/* Public authentication pages use legacy hsl(white/opacity) rules. In light
 * mode those rules make labels, password fields, and helper links disappear.
 */
html[data-theme="light"] .account-section {
    background-color: #f8fafc !important;
    background-image: none !important;
}

html[data-theme="light"] .account-section::before {
    background: linear-gradient(135deg, #f8fafc 0%, #eef2ff 100%) !important;
}

html[data-theme="light"] .account-form {
    background: #ffffff !important;
    border: 1px solid #dbe3ef !important;
    border-radius: 18px !important;
    box-shadow: 0 18px 45px rgba(15, 23, 42, .10) !important;
    padding: 34px !important;
}

html[data-theme="light"] .account-form__desc,
html[data-theme="light"] .account-form .form--label,
html[data-theme="light"] .account-form .form-check-label,
html[data-theme="light"] .account-form .have-account__text,
html[data-theme="light"] .account-form .account-form__icon,
html[data-theme="light"] .account-form .text-muted {
    color: #334155 !important;
}

html[data-theme="light"] .account-form .form--control,
html[data-theme="light"] .account-form input.form-control,
html[data-theme="light"] .account-form input.form--control {
    background: #ffffff !important;
    border: 1px solid #cbd5e1 !important;
    color: #0f172a !important;
    box-shadow: none !important;
}

html[data-theme="light"] .account-form .form--control::placeholder {
    color: #94a3b8 !important;
}

/* Chrome/Edge keep their own autofill text paint. Override it explicitly so
 * saved usernames/passwords remain readable in both themes. */
html[data-theme="light"] .account-form input:-webkit-autofill,
html[data-theme="light"] .account-form input:-webkit-autofill:hover,
html[data-theme="light"] .account-form input:-webkit-autofill:focus,
html[data-theme="light"] .account-form input:-webkit-autofill:active {
    -webkit-text-fill-color: #0f172a !important;
    caret-color: #0f172a !important;
    -webkit-box-shadow: 0 0 0 1000px #ffffff inset !important;
    box-shadow: 0 0 0 1000px #ffffff inset !important;
}

html[data-theme="dark"] .account-form input:-webkit-autofill,
html[data-theme="dark"] .account-form input:-webkit-autofill:hover,
html[data-theme="dark"] .account-form input:-webkit-autofill:focus,
html[data-theme="dark"] .account-form input:-webkit-autofill:active {
    -webkit-text-fill-color: #f8fafc !important;
    caret-color: #f8fafc !important;
    -webkit-box-shadow: 0 0 0 1000px #111827 inset !important;
    box-shadow: 0 0 0 1000px #111827 inset !important;
}

html[data-theme="light"] .account-form input:-moz-autofill {
    color: #0f172a !important;
    box-shadow: 0 0 0 1000px #ffffff inset !important;
}

/* Admin user filters were authored with a dark-only palette. Keep the pills
 * and their container aligned with the rest of the light admin surface. */
html[data-theme="light"] .admin-user-filter-bar {
    background: #ffffff !important;
    border-bottom-color: #dbe3ef !important;
}

html[data-theme="light"] .admin-user-filter-field label {
    color: #334155 !important;
}

html[data-theme="light"] .admin-user-filter-pill {
    color: #334155 !important;
    background: #f1f5f9 !important;
    border-color: #cbd5e1 !important;
}

html[data-theme="light"] .admin-user-filter-pill:hover {
    color: #312e81 !important;
    background: #eef2ff !important;
    border-color: #818cf8 !important;
}

html[data-theme="light"] .admin-user-filter-pill.is-active {
    color: #ffffff !important;
    background: linear-gradient(135deg, #4f46e5, #6d5dfc) !important;
    border-color: #6d5dfc !important;
}

html[data-theme="light"] .admin-user-filter-pill--plan.is-active {
    color: #ffffff !important;
    background: linear-gradient(135deg, #15803d, #22c55e) !important;
    border-color: #22c55e !important;
}

html[data-theme="light"] .admin-user-filter-actions .btn-outline--dark {
    color: #334155 !important;
    border-color: #94a3b8 !important;
    background: #ffffff !important;
}

html[data-theme="light"] .admin-user-filter-actions .btn-outline--dark:hover {
    color: #0f172a !important;
    background: #f1f5f9 !important;
}

html[data-theme="light"] .account-form .forgot-password,
html[data-theme="light"] .account-form .have-account__link {
    color: #4338ca !important;
}

html[data-theme="light"] .account-form .account-form__icon {
    background: #ffffff !important;
    border-color: #cbd5e1 !important;
}

/* Chat history page had its own dark-only card palette. */
html[data-theme="light"] .dcx-chat-history .chat-history-card {
    background: #ffffff !important;
    border-color: #dbe3ef !important;
    box-shadow: 0 10px 28px rgba(15, 23, 42, .06) !important;
}

html[data-theme="light"] .dcx-chat-history .chat-history-card__header {
    background: #f1f5f9 !important;
    border-color: #dbe3ef !important;
}

html[data-theme="light"] .dcx-chat-history .chat-history-card__header h4,
html[data-theme="light"] .dcx-chat-history .chat-history-item__title {
    color: #0f172a !important;
}

html[data-theme="light"] .dcx-chat-history .chat-history-card__header p,
html[data-theme="light"] .dcx-chat-history .chat-history-item__meta,
html[data-theme="light"] .dcx-chat-history .chat-history-empty {
    color: #64748b !important;
}

html[data-theme="light"] .dcx-chat-history .chat-history-item {
    background: #f8fafc !important;
    border-color: #dbe3ef !important;
}

html[data-theme="light"] .dcx-chat-history .chat-history-item:hover,
html[data-theme="light"] .dcx-chat-history .chat-history-item:focus-visible {
    background: #eef2ff !important;
    border-color: #a5b4fc !important;
}

html[data-theme="light"] .dcx-chat-history .chat-history-item__open,
html[data-theme="light"] .dcx-chat-history .chat-history-share-url {
    color: #4338ca !important;
}

html[data-theme="light"] .dcx-chat-history .chat-history-share-url {
    background: #eef2ff !important;
    border-color: #c7d2fe !important;
}

html[data-theme="light"] .dcx-chat-history .chat-history-count {
    color: #4338ca !important;
    background: #eef2ff !important;
    border-color: #c7d2fe !important;
}

html[data-theme="light"] .dcx-chat-history .chat-history-delete-all,
html[data-theme="light"] .dcx-chat-history .chat-history-delete {
    color: #b91c1c !important;
    background: #fef2f2 !important;
    border-color: #fecaca !important;
}

html[data-theme="light"] .dropdown-menu,
html[data-theme="light"] .select2-dropdown,
html[data-theme="light"] .modal-content {
    background-color: var(--dcx-surface) !important;
    border-color: var(--dcx-border) !important;
    color: var(--dcx-text) !important;
    box-shadow: 0 16px 45px rgba(15, 23, 42, .16) !important;
}

html[data-theme="light"] .dropdown-item,
html[data-theme="light"] .dropdown-menu__item,
html[data-theme="light"] .select2-container--default .select2-results__option,
html[data-theme="light"] .select2-container--default .select2-selection__rendered {
    color: var(--dcx-text) !important;
}

html[data-theme="light"] .dropdown-item:hover,
html[data-theme="light"] .dropdown-menu__item:hover,
html[data-theme="light"] .select2-container--default .select2-results__option--highlighted.select2-results__option--selectable,
html[data-theme="light"] .select2-container--default .select2-results__option--selected {
    background-color: #e2e8f0 !important;
    color: #0f172a !important;
}

html[data-theme="light"] .modal-header,
html[data-theme="light"] .modal-footer,
html[data-theme="light"] .table td,
html[data-theme="light"] .table th,
html[data-theme="light"] .table-dark-custom tbody td,
html[data-theme="light"] .breadcrumb-nav,
html[data-theme="light"] .breadcrumb-nav li a,
html[data-theme="light"] .breadcrumb-nav .nav-link {
    border-color: var(--dcx-border) !important;
}

html[data-theme="light"] .breadcrumb-nav li a,
html[data-theme="light"] .breadcrumb-nav .nav-link {
    background: var(--dcx-surface) !important;
    color: var(--dcx-text) !important;
}

html[data-theme="light"] .nav-pills .nav-link:not(.active),
html[data-theme="light"] .sidebar-submenu-box .nav-link:not(.active),
html[data-theme="light"] .navbar-user__name,
html[data-theme="light"] .navbar-user,
html[data-theme="light"] .primary--layer,
html[data-theme="light"] .reseller-navbar .dropdown-item {
    color: var(--dcx-text) !important;
}

html[data-theme="light"] .nav-pills .nav-link:not(.active) i,
html[data-theme="light"] .nav-pills .nav-link:not(.active) span,
html[data-theme="light"] .sidebar-submenu-box .nav-link:not(.active) i,
html[data-theme="light"] .sidebar-submenu-box .nav-link:not(.active) span {
    color: var(--dcx-muted) !important;
}

html[data-theme="light"] .nav-pills .nav-link:hover:not(.active),
html[data-theme="light"] .sidebar-submenu-box .nav-link:hover,
html[data-theme="light"] .table-hover tbody tr:hover td {
    background-color: #eef2f7 !important;
}

html[data-theme="light"] .alert-success,
html[data-theme="light"] .alert--success { background-color: #ecfdf5 !important; color: #047857 !important; border-color: #a7f3d0 !important; }
html[data-theme="light"] .alert-warning,
html[data-theme="light"] .alert--warning { background-color: #fffbeb !important; color: #92400e !important; border-color: #fde68a !important; }
html[data-theme="light"] .alert-danger,
html[data-theme="light"] .alert--danger { background-color: #fef2f2 !important; color: #b91c1c !important; border-color: #fecaca !important; }
html[data-theme="light"] .alert-info,
html[data-theme="light"] .alert--info { background-color: #eff6ff !important; color: #1d4ed8 !important; border-color: #bfdbfe !important; }

html[data-theme="light"] ::-webkit-scrollbar-track { background: #f1f5f9 !important; }
html[data-theme="light"] ::-webkit-scrollbar-thumb { background: #cbd5e1 !important; border-color: #f1f5f9 !important; }
html[data-theme="light"] * { scrollbar-color: #cbd5e1 #f1f5f9; }

/* Page-specific ToolsByDcx surfaces use local variables; retheme them here. */
html[data-theme="light"] .dcx-tts,
html[data-theme="light"] .dcx-music,
html[data-theme="light"] .dcx-tts-studio,
html[data-theme="light"] .dcx-clone-page {
    --tts-surface: #ffffff;
    --tts-raised: #f1f5f9;
    --tts-field: #ffffff;
    --tts-text: #0f172a;
    --tts-muted: #64748b;
    --tts-line: #dbe3ef;
    --music-surface: #ffffff;
    --music-raised: #f1f5f9;
    --music-field: #ffffff;
    --music-text: #0f172a;
    --music-muted: #64748b;
    --surface: #ffffff;
    --surface-raised: #f1f5f9;
    --field: #ffffff;
    --text: #0f172a;
    --muted: #64748b;
    --clone-surface: #ffffff;
    --clone-raised: #f1f5f9;
    --clone-field: #ffffff;
    --clone-text: #0f172a;
    --clone-muted: #64748b;
    --clone-line: #dbe3ef;
}

html[data-theme="light"] .landing-header,
html[data-theme="light"] .header {
    background: rgba(255, 255, 255, .92) !important;
    border-bottom-color: var(--dcx-border) !important;
    box-shadow: 0 4px 20px rgba(15, 23, 42, .06) !important;
}

html[data-theme="light"] .dcx-tts .tts-panel,
html[data-theme="light"] .dcx-tts .tts-panel__header,
html[data-theme="light"] .dcx-tts .tts-library__toolbar,
html[data-theme="light"] .dcx-tts .tts-voice-card,
html[data-theme="light"] .dcx-tts .tts-selected-voice,
html[data-theme="light"] .dcx-tts .tts-audio-player,
html[data-theme="light"] .dcx-tts .tts-page,
html[data-theme="light"] .dcx-tts .tts-provider-tabs {
    border-color: var(--dcx-border) !important;
    background: var(--dcx-surface) !important;
    color: var(--dcx-text) !important;
}

html[data-theme="light"] .dcx-tts .tts-library input,
html[data-theme="light"] .dcx-tts .tts-library select,
html[data-theme="light"] .dcx-tts .tts-composer textarea {
    color: #0f172a !important;
    background: #ffffff !important;
    border-color: var(--dcx-border) !important;
}

html[data-theme="light"] .dcx-tts .tts-panel h4,
html[data-theme="light"] .dcx-tts .tts-voice-card h5,
html[data-theme="light"] .dcx-tts .tts-voice-card__name,
html[data-theme="light"] .dcx-tts .tts-selected-voice__copy strong,
html[data-theme="light"] .dcx-tts .tts-player-title,
html[data-theme="light"] .dcx-tts .tts-page__label {
    color: #0f172a !important;
}

html[data-theme="light"] .dcx-tts .tts-panel__header p,
html[data-theme="light"] .dcx-tts .tts-voice-card__description,
html[data-theme="light"] .dcx-tts .tts-voice-card__meta,
html[data-theme="light"] .dcx-tts .tts-help,
html[data-theme="light"] .dcx-tts .tts-library__summary,
html[data-theme="light"] .dcx-tts .tts-library__empty {
    color: #64748b !important;
}

html[data-theme="light"] .dcx-music__card,
html[data-theme="light"] .dcx-music__toggle-row,
html[data-theme="light"] .dcx-music__cost,
html[data-theme="light"] .dcx-music__history-item {
    border-color: var(--dcx-border) !important;
    background: var(--music-surface) !important;
    color: var(--music-text) !important;
}

html[data-theme="light"] .dcx-music__modes,
html[data-theme="light"] .dcx-music__field textarea,
html[data-theme="light"] .dcx-music__field input,
html[data-theme="light"] .dcx-music__field select {
    border-color: var(--dcx-border) !important;
    background: var(--music-field) !important;
    color: var(--music-text) !important;
}

html[data-theme="light"] .dcx-music__field label,
html[data-theme="light"] .dcx-music__toggle-row strong,
html[data-theme="light"] .dcx-music__cost strong,
html[data-theme="light"] .dcx-music__history-item strong {
    color: #0f172a !important;
}

html[data-theme="light"] .dcx-tts-studio .studio-shell,
html[data-theme="light"] .dcx-tts-studio .studio-pane,
html[data-theme="light"] .dcx-tts-studio .studio-side,
html[data-theme="light"] .dcx-tts-studio .studio-settings,
html[data-theme="light"] .dcx-tts-studio .studio-composer,
html[data-theme="light"] .dcx-tts-studio .studio-output,
html[data-theme="light"] .dcx-tts-studio .studio-history,
html[data-theme="light"] .dcx-tts-studio .studio-modal__dialog,
html[data-theme="light"] .dcx-tts-studio .studio-modal__header,
html[data-theme="light"] .dcx-tts-studio .studio-modal__body,
html[data-theme="light"] .dcx-tts-studio .studio-modal__footer,
html[data-theme="light"] .dcx-tts-studio .studio-modal-card {
    border-color: var(--dcx-border) !important;
    background: var(--surface) !important;
    color: var(--text) !important;
}

html[data-theme="light"] .dcx-tts-studio .studio-modal__filters,
html[data-theme="light"] .dcx-tts-studio .studio-modal-filter input,
html[data-theme="light"] .dcx-tts-studio .studio-modal-filter select,
html[data-theme="light"] .dcx-tts-studio .studio-modal-card__tag,
html[data-theme="light"] .dcx-tts-studio .studio-voice-picker {
    border-color: var(--dcx-border) !important;
    background: var(--field) !important;
    color: var(--text) !important;
}

html[data-theme="light"] .dcx-tts-studio .studio-modal-card__name,
html[data-theme="light"] .dcx-tts-studio .studio-modal__heading h2,
html[data-theme="light"] .dcx-tts-studio .studio-field,
html[data-theme="light"] .dcx-tts-studio .studio-label {
    color: #0f172a !important;
}

html[data-theme="light"] .dcx-clone-card,
html[data-theme="light"] .dcx-clone-item,
html[data-theme="light"] .dcx-clone-cost,
html[data-theme="light"] .dcx-clone-recorder {
    border-color: var(--clone-line) !important;
    background: var(--clone-surface) !important;
    color: var(--clone-text) !important;
}

html[data-theme="light"] .dcx-clone-field input,
html[data-theme="light"] .dcx-clone-upload,
html[data-theme="light"] .dcx-clone-recorder__bar {
    border-color: var(--clone-line) !important;
    background: var(--clone-field) !important;
    color: var(--clone-text) !important;
}

/* Final light-theme contrast pass for the user tools. These pages contain
 * legacy inline dark-theme colors, so keep the overrides scoped and explicit
 * instead of changing the dark theme defaults. */
html[data-theme="light"] .dcx-music .dcx-music__heading p,
html[data-theme="light"] .dcx-music .dcx-music__field small,
html[data-theme="light"] .dcx-music .dcx-music__toggle-row span,
html[data-theme="light"] .dcx-music .dcx-music__cost small,
html[data-theme="light"] .dcx-music .dcx-music__balance,
html[data-theme="light"] .dcx-music .dcx-music__note,
html[data-theme="light"] .dcx-music .dcx-music__history-item small,
html[data-theme="light"] .dcx-music .dcx-music__player-meta,
html[data-theme="light"] .dcx-music .dcx-music__empty {
    color: #64748b !important;
}

html[data-theme="light"] .dcx-music .dcx-music__field textarea::placeholder,
html[data-theme="light"] .dcx-music .dcx-music__field input::placeholder {
    color: #64748b !important;
    opacity: 1 !important;
}

html[data-theme="light"] .dcx-music .dcx-music__submit:disabled {
    border-color: #cbd5e1 !important;
    color: #475569 !important;
    background: #e2e8f0 !important;
    opacity: 1 !important;
}

html[data-theme="light"] .dcx-music .dcx-music__status,
html[data-theme="light"] .dcx-music .dcx-music__message {
    border-color: #86efac !important;
    color: #047857 !important;
    background: #ecfdf5 !important;
}

html[data-theme="light"] .dcx-music .dcx-music__message {
    border: 0 !important;
    background: transparent !important;
}

html[data-theme="light"] .dcx-music .dcx-music__message.is-error,
html[data-theme="light"] .dcx-music .dcx-music__history-item .status.failed {
    color: #b91c1c !important;
}

html[data-theme="light"] .dcx-music .dcx-music__history-item .status.completed {
    color: #047857 !important;
}

/* The Studio has many small controls and an inline dark palette. Retheme the
 * entire component so placeholders, disabled actions, providers and audio
 * output remain legible on a white surface. */
html[data-theme="light"] .dcx-tts-studio {
    --surface: #ffffff;
    --surface-raised: #f8fafc;
    --field: #ffffff;
    --text: #0f172a;
    --muted: #64748b;
    --line: #dbe3ef;
    color: #0f172a !important;
    background: #ffffff !important;
    border-color: #dbe3ef !important;
    box-shadow: 0 12px 32px rgba(15, 23, 42, .08) !important;
}

html[data-theme="light"] .dcx-tts-studio .studio-head,
html[data-theme="light"] .dcx-tts-studio .studio-side,
html[data-theme="light"] .dcx-tts-studio .studio-composer,
html[data-theme="light"] .dcx-tts-studio .studio-script,
html[data-theme="light"] .dcx-tts-studio .studio-tab {
    color: #0f172a !important;
    background: #ffffff !important;
    border-color: #dbe3ef !important;
}

html[data-theme="light"] .dcx-tts-studio .studio-head h1,
html[data-theme="light"] .dcx-tts-studio .studio-label,
html[data-theme="light"] .dcx-tts-studio .studio-field__top label,
html[data-theme="light"] .dcx-tts-studio .studio-tab.is-active,
html[data-theme="light"] .dcx-tts-studio .studio-audio-player__title,
html[data-theme="light"] .dcx-tts-studio .studio-history__item strong {
    color: #0f172a !important;
}

html[data-theme="light"] .dcx-tts-studio .studio-script::placeholder,
html[data-theme="light"] .dcx-tts-studio .studio-tip,
html[data-theme="light"] .dcx-tts-studio .studio-count,
html[data-theme="light"] .dcx-tts-studio .studio-cost small,
html[data-theme="light"] .dcx-tts-studio .studio-status,
html[data-theme="light"] .dcx-tts-studio .studio-output__state,
html[data-theme="light"] .dcx-tts-studio .studio-audio-player__time,
html[data-theme="light"] .dcx-tts-studio .studio-history__item small,
html[data-theme="light"] .dcx-tts-studio .studio-history__loading,
html[data-theme="light"] .dcx-tts-studio .studio-history__empty,
html[data-theme="light"] .dcx-tts-studio .studio-model-note {
    color: #64748b !important;
    opacity: 1 !important;
}

html[data-theme="light"] .dcx-tts-studio .studio-helper__button,
html[data-theme="light"] .dcx-tts-studio .studio-language,
html[data-theme="light"] .dcx-tts-studio .studio-select,
html[data-theme="light"] .dcx-tts-studio .studio-voice-picker,
html[data-theme="light"] .dcx-tts-studio .studio-provider {
    color: #334155 !important;
    background: #f8fafc !important;
    border-color: #cbd5e1 !important;
}

html[data-theme="light"] .dcx-tts-studio .studio-helper__button:hover,
html[data-theme="light"] .dcx-tts-studio .studio-helper__button[aria-expanded="true"],
html[data-theme="light"] .dcx-tts-studio .studio-provider:hover,
html[data-theme="light"] .dcx-tts-studio .studio-provider.is-active,
html[data-theme="light"] .dcx-tts-studio .studio-voice-picker:hover:not(:disabled) {
    color: #c2410c !important;
    background: #fff7ed !important;
    border-color: #fdba74 !important;
}

html[data-theme="light"] .dcx-tts-studio .studio-provider i {
    color: #334155 !important;
    background: #ffffff !important;
    border-color: #cbd5e1 !important;
}

html[data-theme="light"] .dcx-tts-studio .studio-provider__icon--elevenlabs { color: #be185d !important; }
html[data-theme="light"] .dcx-tts-studio .studio-provider__icon--minimax { color: #be123c !important; }
html[data-theme="light"] .dcx-tts-studio .studio-provider__icon--edge { color: #92400e !important; }
html[data-theme="light"] .dcx-tts-studio .studio-provider__icon--fishaudio { color: #0e7490 !important; }
html[data-theme="light"] .dcx-tts-studio .studio-provider__icon--cloned { color: #c2410c !important; }
html[data-theme="light"] .dcx-tts-studio .studio-provider__icon--library { color: #1d4ed8 !important; }

html[data-theme="light"] .dcx-tts-studio .studio-cost,
html[data-theme="light"] .dcx-tts-studio .studio-output,
html[data-theme="light"] .dcx-tts-studio .studio-audio-player,
html[data-theme="light"] .dcx-tts-studio .studio-history__item {
    color: #334155 !important;
    background: #f8fafc !important;
    border-color: #dbe3ef !important;
}

html[data-theme="light"] .dcx-tts-studio .studio-cost__line,
html[data-theme="light"] .dcx-tts-studio .studio-output__label,
html[data-theme="light"] .dcx-tts-studio .studio-audio-player__meta {
    color: #334155 !important;
}

html[data-theme="light"] .dcx-tts-studio .studio-cost strong,
html[data-theme="light"] .dcx-tts-studio .studio-output__label i,
html[data-theme="light"] .dcx-tts-studio .studio-provider-badge,
html[data-theme="light"] .dcx-tts-studio .studio-library-link,
html[data-theme="light"] .dcx-tts-studio .studio-voice-picker > i {
    color: #c2410c !important;
}

html[data-theme="light"] .dcx-tts-studio .studio-generate:disabled {
    color: #475569 !important;
    background: #e2e8f0 !important;
    opacity: 1 !important;
}

html[data-theme="light"] .dcx-tts-studio .studio-status.is-error {
    color: #b91c1c !important;
}

html[data-theme="light"] .dcx-tts-studio .studio-modal__providers,
html[data-theme="light"] .dcx-tts-studio .studio-modal__filters,
html[data-theme="light"] .dcx-tts-studio .studio-modal-filter input,
html[data-theme="light"] .dcx-tts-studio .studio-modal-filter select,
html[data-theme="light"] .dcx-tts-studio .studio-modal-card__tag,
html[data-theme="light"] .dcx-tts-studio .studio-modal-language-pill,
html[data-theme="light"] .dcx-tts-studio .studio-modal__pagination button,
html[data-theme="light"] .dcx-tts-studio .studio-modal__page {
    color: #334155 !important;
    background: #f8fafc !important;
    border-color: #dbe3ef !important;
}

html[data-theme="light"] .dcx-tts-studio .studio-modal__heading p,
html[data-theme="light"] .dcx-tts-studio .studio-modal-filter label,
html[data-theme="light"] .dcx-tts-studio .studio-modal__summary,
html[data-theme="light"] .dcx-tts-studio .studio-modal-language-pill small {
    color: #64748b !important;
}

html[data-theme="light"] .dcx-tts-studio .studio-modal__heading h2,
html[data-theme="light"] .dcx-tts-studio .studio-modal-card__name,
html[data-theme="light"] .dcx-tts-studio .studio-modal-language-pill strong {
    color: #0f172a !important;
}

/* Extensions and dashboard product rows used the dark base palette even
 * after the surrounding card switched to light mode. */
html[data-theme="light"] .dashboard-section .card.custom--card .card-header,
html[data-theme="light"] .dcx-user-dashboard .card.custom--card .card-header {
    color: #0f172a !important;
    background: #f1f5f9 !important;
    border-color: #dbe3ef !important;
}

html[data-theme="light"] .dashboard-section .card.custom--card .card-title.text-white,
html[data-theme="light"] .dcx-user-dashboard .card-title.text-white,
html[data-theme="light"] .dcx-user-dashboard h3.text-white,
html[data-theme="light"] .dcx-user-dashboard h5.text-white {
    color: #0f172a !important;
}

html[data-theme="light"] .dashboard-section .product-item,
html[data-theme="light"] .dcx-user-dashboard .product-item {
    color: #334155 !important;
    background: #ffffff !important;
    border-color: #dbe3ef !important;
}

html[data-theme="light"] .dashboard-section .product-item__title,
html[data-theme="light"] .dashboard-section .product-item__title .text--base,
html[data-theme="light"] .dcx-user-dashboard .product-item__title,
html[data-theme="light"] .dcx-user-dashboard .product-item__title .text--base,
html[data-theme="light"] .dashboard-section .product-item__content .text-white,
html[data-theme="light"] .dcx-user-dashboard .product-item__content .text-white {
    color: #0f172a !important;
}

html[data-theme="light"] .dashboard-section .product-item__content .text-muted,
html[data-theme="light"] .dashboard-section .product-item__content .small,
html[data-theme="light"] .dcx-user-dashboard .product-item__content .text-muted,
html[data-theme="light"] .dcx-user-dashboard .product-item__content .small {
    color: #64748b !important;
}

html[data-theme="light"] .dashboard-section .badge--dark,
html[data-theme="light"] .dcx-user-dashboard .badge--dark {
    color: #334155 !important;
    background: #e2e8f0 !important;
    border-color: #cbd5e1 !important;
}

html[data-theme="light"] .dashboard-section .badge--secondary,
html[data-theme="light"] .dcx-user-dashboard .badge--secondary {
    color: #475569 !important;
    background: #f1f5f9 !important;
    border-color: #cbd5e1 !important;
}

html[data-theme="light"] .dashboard-section .badge--success,
html[data-theme="light"] .dcx-user-dashboard .badge--success,
html[data-theme="light"] .dcx-user-dashboard .text-success,
html[data-theme="light"] .dcx-user-dashboard .text--success {
    color: #047857 !important;
}

html[data-theme="light"] .dashboard-section .product-item__button .btn--base {
    color: #ffffff !important;
    background: #f97316 !important;
    border-color: #ea580c !important;
}

html[data-theme="light"] .dashboard-section .product-item__button .btn--base:hover,
html[data-theme="light"] .dashboard-section .product-item__button .btn--base:focus-visible {
    color: #ffffff !important;
    background: #ea580c !important;
    border-color: #c2410c !important;
}

html[data-theme="light"] .dcx-user-dashboard > .row > [class*="col-"] > .card:not(.custom--card),
html[data-theme="light"] .dcx-user-dashboard .card.p-4 {
    color: #334155 !important;
    background: #ffffff !important;
    border-color: #dbe3ef !important;
}

html[data-theme="light"] .dcx-user-dashboard .text-muted,
html[data-theme="light"] .dcx-user-dashboard .small,
html[data-theme="light"] .dcx-user-dashboard p {
    color: #64748b !important;
}

html[data-theme="light"] .dcx-user-dashboard .dcx-action-success {
    color: #047857 !important;
    background: #ecfdf5 !important;
    border-color: #86efac !important;
}

html[data-theme="light"] .dcx-user-dashboard .dcx-action-success:hover,
html[data-theme="light"] .dcx-user-dashboard .dcx-action-success:focus-visible {
    color: #065f46 !important;
    background: #d1fae5 !important;
    border-color: #34d399 !important;
}

/* Payment/deposit screens still inherit the legacy dark-only payment rules. */
html[data-theme="light"] .deposit-form .gateway-card .card-header {
    color: #0f172a !important;
    background: #f1f5f9 !important;
    border-color: #dbe3ef !important;
}

html[data-theme="light"] .deposit-form .gateway-card .card-header .card-title,
html[data-theme="light"] .deposit-form .gateway-card .card-header .card-title.text-white {
    color: #0f172a !important;
}

html[data-theme="light"] .deposit-form .gateway-card .card-body,
html[data-theme="light"] .deposit-form .gateway-card .payment-system-list {
    color: #334155 !important;
    background: #ffffff !important;
}

html[data-theme="light"] .deposit-form .payment-item {
    color: #334155 !important;
    background: #ffffff !important;
    border-color: #cbd5e1 !important;
}

html[data-theme="light"] .deposit-form .payment-item:hover {
    background: #fff7ed !important;
    border-color: #fdba74 !important;
}

html[data-theme="light"] .deposit-form .payment-item:has(.payment-item__radio:checked),
html[data-theme="light"] .deposit-form .payment-item.check {
    color: #0f172a !important;
    background: #eef2ff !important;
    border-color: #6366f1 !important;
}

html[data-theme="light"] .deposit-form .payment-item__name {
    color: #0f172a !important;
}

html[data-theme="light"] .deposit-form .payment-item__check {
    border-color: #94a3b8 !important;
    background: #ffffff !important;
}

html[data-theme="light"] .deposit-form .payment-item:has(.payment-item__radio:checked) .payment-item__check,
html[data-theme="light"] .deposit-form .payment-item.check .payment-item__check {
    background: #4f46e5 !important;
    border-color: #4f46e5 !important;
    box-shadow: 0 0 0 3px rgba(79, 70, 229, .18) !important;
}

html[data-theme="light"] .deposit-form .deposit-info .text,
html[data-theme="light"] .deposit-form .deposit-info__title p,
html[data-theme="light"] .deposit-form .deposit-info__input p,
html[data-theme="light"] .deposit-form .deposit-info__input p span,
html[data-theme="light"] .deposit-form .info-text p {
    color: #334155 !important;
}

html[data-theme="light"] .deposit-form .deposit-info__title p,
html[data-theme="light"] .deposit-form .info-text p {
    color: #64748b !important;
}

html[data-theme="light"] .deposit-form .deposit-info__input-group .form-control {
    color: #0f172a !important;
    background: #ffffff !important;
    border-color: #cbd5e1 !important;
}

html[data-theme="light"] .deposit-form .deposit-info__input-group-text {
    color: #334155 !important;
    background: #f1f5f9 !important;
    border-color: #cbd5e1 !important;
}

html[data-theme="light"] .deposit-form hr {
    border-color: #dbe3ef !important;
    opacity: 1 !important;
}

html[data-theme="light"] .deposit-form .btn--base {
    color: #ffffff !important;
    background: #f97316 !important;
    border-color: #ea580c !important;
}

html[data-theme="light"] .deposit-form .btn--base:hover,
html[data-theme="light"] .deposit-form .btn--base:focus-visible {
    color: #ffffff !important;
    background: #ea580c !important;
    border-color: #c2410c !important;
}

/* The original nav rule accidentally put the active background on the inner
 * span as well, which looks like browser text selection. Keep the active pill
 * on the link itself and make its children transparent. */
.nav-pills .nav-link.active span,
.nav-pills .nav-link.active i,
.sidebar-submenu-box .nav-link.active span,
.sidebar-submenu-box .nav-link.active i {
    background: transparent !important;
    box-shadow: none !important;
}

html[data-theme="light"] .nav-pills .nav-link.active,
html[data-theme="light"] .nav-pills .nav-link.active i,
html[data-theme="light"] .nav-pills .nav-link.active span {
    color: #ffffff !important;
}

html[data-theme="light"] .sidebar-submenu-box .nav-link.active {
    color: #4338ca !important;
    background: #eef2ff !important;
    box-shadow: inset 3px 0 0 #6366f1 !important;
}

html[data-theme="light"] .sidebar-submenu-box .nav-link.active i,
html[data-theme="light"] .sidebar-submenu-box .nav-link.active span {
    color: #4338ca !important;
}

/* Compact, readable subscription cards in the light theme. */
html[data-theme="light"] .dcx-plans-page .dcx-plan-card {
    background: #ffffff !important;
    border-color: #dbe3ef !important;
    box-shadow: 0 10px 24px rgba(15, 23, 42, .07) !important;
}

html[data-theme="light"] .dcx-plans-page .dcx-plan-card-header {
    background: #f1f5f9 !important;
    border-color: #dbe3ef !important;
}

html[data-theme="light"] .dcx-plans-page .dcx-plan-name,
html[data-theme="light"] .dcx-plans-page .dcx-plan-price,
html[data-theme="light"] .dcx-plans-page .dcx-plan-feature {
    color: #0f172a !important;
}

html[data-theme="light"] .dcx-plans-page .dcx-plan-feature i {
    color: #047857 !important;
}

html[data-theme="light"] .dcx-plans-page .dcx-plan-action-current {
    color: #4338ca !important;
    background: #eef2ff !important;
    border-color: #c7d2fe !important;
}

/* Theme control */
.dcx-theme-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: .4rem;
    min-height: 36px;
    padding: .4rem .7rem;
    border: 1px solid rgba(148, 163, 184, .35);
    border-radius: 999px;
    background: rgba(148, 163, 184, .08);
    color: #cbd5e1;
    cursor: pointer;
    font: inherit;
    font-size: .82rem;
    transition: background-color .2s ease, border-color .2s ease, color .2s ease, transform .2s ease;
}
.dcx-theme-toggle:hover { transform: translateY(-1px); border-color: var(--base-color, #6366f1); color: #fff; background: rgba(99, 102, 241, .16); }
.dcx-theme-toggle i { font-size: 1rem; color: #fbbf24; }
html[data-theme="light"] .dcx-theme-toggle { border-color: #cbd5e1; background: #f8fafc; color: #334155; }
html[data-theme="light"] .dcx-theme-toggle:hover { color: #0f172a; background: #eef2f7; }
html[data-theme="light"] .dcx-theme-toggle i { color: #4f46e5; }

/* These controls are inside flex action lists on admin/user top bars. */
.navbar__action-list .dcx-theme-toggle-item { display: flex; align-items: center; }
.dcx-theme-toggle-item .dcx-theme-toggle { margin-inline: .15rem; }
.dcx-theme-fallback {
    position: fixed;
    top: 1rem;
    right: 1rem;
    z-index: 2000;
}
body:has(.navbar-wrapper) .dcx-theme-fallback,
body:has(.reseller-navbar) .dcx-theme-fallback,
body:has(.landing-header) .dcx-theme-fallback { display: none; }
@media (max-width: 575px) {
    .dcx-theme-toggle { min-width: 36px; padding-inline: .55rem; }
}
