.material-symbols-outlined {
    display: inline-block;
    font-size: 18px;
    font-variation-settings: 'FILL' 0, 'wght' 450, 'GRAD' 0, 'opsz' 20;
    line-height: 1;
    vertical-align: middle;
}

.google-icon {
    width: 18px;
    height: 18px;
    flex: 0 0 auto;
}

::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #dedee5; border-radius: 999px; }
::-webkit-scrollbar-thumb:hover { background: #aaaabc; }

html[data-theme='dark'] {
    color-scheme: dark;
    background: #0d0d10;
}

html[data-theme='dark'] body {
    background: #0d0d10;
    color: #f4f4f6;
}

@media (prefers-reduced-motion: no-preference) {
    html.theme-ready body,
    html.theme-ready .app-sidebar,
    html.theme-ready .app-topbar,
    html.theme-ready .app-main,
    html.theme-ready .panel,
    html.theme-ready .stat-card,
    html.theme-ready .auth-card,
    html.theme-ready .dropdown-panel,
    html.theme-ready .sample-card,
    html.theme-ready .sample-history-card,
    html.theme-ready .voice-picker,
    html.theme-ready .voice-tab,
    html.theme-ready .selected-voice-card,
    html.theme-ready .voice-row,
    html.theme-ready .voice-row-select,
    html.theme-ready .voice-card,
    html.theme-ready .voice-filter-bar,
    html.theme-ready .voice-capture-card,
    html.theme-ready .voice-preview-button,
    html.theme-ready .role-card,
    html.theme-ready .speech-upload-panel,
    html.theme-ready .speech-result-panel,
    html.theme-ready .speech-recorder-card,
    html.theme-ready .speech-file-pill,
    html.theme-ready .speech-metric-card,
    html.theme-ready .speech-recent-item,
    html.theme-ready .form-control,
    html.theme-ready .studio-textarea,
    html.theme-ready .upload-dropzone,
    html.theme-ready .message,
    html.theme-ready .nav-link,
    html.theme-ready .topbar-button,
    html.theme-ready .secondary-button,
    html.theme-ready .danger-button,
    html.theme-ready .prompt-chip,
    html.theme-ready .tool-pill,
    html.theme-ready .icon-button,
    html.theme-ready .theme-toggle,
    html.theme-ready .profile-trigger,
    html.theme-ready .password-toggle,
    html.theme-ready .dashboard-stat-card,
    html.theme-ready .dashboard-flow-step,
    html.theme-ready .dashboard-sample-card,
    html.theme-ready .dashboard-voice-card,
    html.theme-ready .dashboard-empty-card,
    html.theme-ready .bg-white,
    html.theme-ready .bg-surface,
    html.theme-ready .text-ink,
    html.theme-ready .text-muted,
    html.theme-ready .border-line {
        transition: background-color 260ms ease, border-color 260ms ease, color 260ms ease, box-shadow 260ms ease, opacity 220ms ease, transform 180ms ease;
    }

    html.theme-ready [data-theme-icon] {
        transition: transform 260ms ease;
    }

    html[data-theme='dark'].theme-ready [data-theme-icon] {
        transform: rotate(180deg);
    }
}

.app-sidebar {
    position: fixed;
    inset: 0 auto 0 0;
    z-index: 50;
    display: flex;
    width: 224px;
    flex-direction: column;
    border-right: 1px solid #e3e3e8;
    background: #fff;
    padding: 14px 0;
}

.app-topbar {
    position: fixed;
    left: 224px;
    right: 0;
    top: 0;
    z-index: 90;
    display: flex;
    height: 56px;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    border-bottom: 1px solid #e3e3e8;
    background: rgba(255, 255, 255, 0.92);
    padding: 0 24px;
    backdrop-filter: blur(16px);
    isolation: isolate;
}

.app-main {
    margin-left: 224px;
    margin-top: 56px;
    height: calc(100vh - 56px);
    overflow-x: hidden;
    overflow-y: auto;
}

.app-main:has(.avatar-main-shell) {
    background: #fff;
}

.studio-main-shell {
    max-width: 100%;
    min-width: 0;
    width: min(100%, 1520px);
    margin-right: auto;
    margin-left: auto;
}

.avatar-main-shell {
    display: flex;
    min-height: calc(100vh - 56px);
    flex-direction: column;
    background: #fff;
}

.nav-link {
    display: flex;
    align-items: center;
    gap: 10px;
    border-radius: 7px;
    padding: 7px 10px;
    color: #666675;
    font-size: 12.5px;
    font-weight: 650;
    transition: background-color 160ms ease, color 160ms ease, transform 160ms ease;
}

.nav-link:hover,
.nav-link-active {
    background: #f1f1f4;
    color: #171719;
}

.nav-link:active { transform: scale(0.99); }

.panel,
.stat-card,
.auth-card {
    border: 1px solid #e3e3e8;
    border-radius: 8px;
    background: #fff;
    box-shadow: 0 1px 2px rgba(17, 17, 24, 0.04);
}

.job-progress-panel,
.job-inline-progress {
    max-width: 100%;
    min-width: 0;
    overflow: hidden;
    position: relative;
}

.job-inline-progress [data-job-detail] {
    max-width: 100%;
    overflow-wrap: anywhere;
}

.job-progress-track {
    height: 4px;
    overflow: hidden;
    border-radius: 999px;
    background: #ececf2;
}

.job-progress-track > span {
    display: block;
    height: 100%;
    border-radius: inherit;
    background: linear-gradient(90deg, #6366f1, #14b8a6);
    transition: width 280ms ease;
}

.job-inline-audio {
    display: none;
}

.speech-status-queued {
    background: #eef2ff;
    color: #4f46e5;
}

.audio-recent-row {
    position: relative;
}

.audio-recent-row::before {
    position: absolute;
    inset: 10px auto 10px 0;
    width: 3px;
    content: '';
    border-radius: 999px;
    opacity: 0;
    transition: opacity 160ms ease;
}

.audio-recent-row-completed {
    border-color: rgba(34, 197, 94, 0.24);
    background: linear-gradient(90deg, rgba(236, 253, 245, 0.72), #ffffff 28%);
}

.audio-recent-row-completed::before {
    background: #22c55e;
    opacity: 1;
}

.audio-recent-row-processing,
.audio-recent-row-queued {
    border-color: rgba(99, 102, 241, 0.22);
    background: linear-gradient(90deg, rgba(238, 242, 255, 0.7), #ffffff 28%);
}

.audio-recent-row-processing::before,
.audio-recent-row-queued::before {
    background: #6366f1;
    opacity: 1;
}

.audio-recent-row-failed {
    border-color: rgba(220, 38, 38, 0.22);
    background: linear-gradient(90deg, rgba(254, 242, 242, 0.7), #ffffff 28%);
}

.audio-recent-row-failed::before {
    background: #dc2626;
    opacity: 1;
}

.audio-recent-row-completed [data-recent-row-player] {
    background: #ecfdf5;
    color: #16a34a;
}

.audio-recent-status {
    font-weight: 800;
}

.audio-recent-status-completed {
    color: #047857;
}

.audio-recent-status-processing,
.audio-recent-status-queued {
    color: #4f46e5;
}

.audio-recent-status-failed {
    color: #b42318;
}

.audio-recent-status-pill-completed {
    background: #dcfce7;
    color: #166534;
}

.audio-recent-status-pill-processing,
.audio-recent-status-pill-queued {
    background: #eef2ff;
    color: #4f46e5;
}

.audio-recent-status-pill-failed {
    background: #fef2f2;
    color: #b42318;
}

html[data-theme='dark'] .audio-recent-row {
    border-color: #292934;
    background: #121218;
}

html[data-theme='dark'] .audio-recent-row:hover {
    border-color: rgba(129, 140, 248, 0.45);
    background: #171722;
    box-shadow: 0 14px 32px rgba(0, 0, 0, 0.24);
}

html[data-theme='dark'] .audio-recent-row p:first-child {
    color: #f4f4f6;
}

html[data-theme='dark'] .audio-recent-row p:last-child {
    color: #a8a8b6;
}

html[data-theme='dark'] .audio-recent-row-completed {
    border-color: rgba(34, 197, 94, 0.36);
    background: linear-gradient(90deg, rgba(20, 83, 45, 0.42), #121218 34%);
}

html[data-theme='dark'] .audio-recent-row-processing,
html[data-theme='dark'] .audio-recent-row-queued {
    border-color: rgba(129, 140, 248, 0.34);
    background: linear-gradient(90deg, rgba(49, 46, 129, 0.34), #121218 34%);
}

html[data-theme='dark'] .audio-recent-row-failed {
    border-color: rgba(248, 113, 113, 0.35);
    background: linear-gradient(90deg, rgba(127, 29, 29, 0.32), #121218 34%);
}

html[data-theme='dark'] .audio-recent-row-completed [data-recent-row-player] {
    border-color: rgba(74, 222, 128, 0.35);
    background: rgba(22, 101, 52, 0.26);
    color: #86efac;
}

html[data-theme='dark'] .audio-recent-status-completed {
    color: #86efac;
}

html[data-theme='dark'] .audio-recent-status-processing,
html[data-theme='dark'] .audio-recent-status-queued {
    color: #a5b4fc;
}

html[data-theme='dark'] .audio-recent-status-failed {
    color: #fca5a5;
}

html[data-theme='dark'] .audio-recent-status-pill-completed {
    background: rgba(34, 197, 94, 0.18);
    color: #86efac;
}

html[data-theme='dark'] .audio-recent-status-pill-processing,
html[data-theme='dark'] .audio-recent-status-pill-queued {
    background: rgba(99, 102, 241, 0.18);
    color: #c7d2fe;
}

html[data-theme='dark'] .audio-recent-status-pill-failed {
    background: rgba(220, 38, 38, 0.18);
    color: #fca5a5;
}

html[data-theme='dark'] .audio-recent-row .icon-button {
    border-color: #292934;
    background: #0d0d10;
    color: #c7c7d4;
}

html[data-theme='dark'] .audio-recent-row .icon-button:hover {
    border-color: rgba(129, 140, 248, 0.45);
    background: #202028;
    color: #ffffff;
}

#voice-library {
    scroll-margin-top: 92px;
}

.auth-card {
    width: min(100%, 420px);
    padding: 24px;
}

.stat-card {
    display: flex;
    min-height: 96px;
    flex-direction: column;
    justify-content: center;
    padding: 16px;
}

.stat-label {
    color: #666675;
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 0;
    text-transform: uppercase;
}

.stat-value {
    margin-top: 8px;
    display: block;
    font-size: 22px;
    font-weight: 850;
}

.dashboard-hero {
    position: relative;
    overflow: hidden;
    background: linear-gradient(135deg, #fff 0%, #fbfbff 48%, #f7fffd 100%);
}

.dashboard-hero::after {
    position: absolute;
    right: -70px;
    bottom: -92px;
    width: 220px;
    height: 220px;
    border: 1px solid rgba(99, 102, 241, 0.16);
    border-radius: 999px;
    content: '';
}

.dashboard-kicker,
.dashboard-status {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    border-radius: 7px;
    padding: 5px 8px;
    font-size: 11px;
    font-weight: 850;
    text-transform: uppercase;
}

.dashboard-kicker {
    background: rgba(99, 102, 241, 0.08);
    color: #4f46e5;
}

.dashboard-status {
    color: #666675;
    text-transform: none;
}

.dashboard-status span {
    height: 7px;
    width: 7px;
    border-radius: 999px;
    background: #10b981;
}

.dashboard-hero-actions {
    position: relative;
    z-index: 1;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
}

.dashboard-stat-card {
    position: relative;
    min-height: 128px;
    overflow: hidden;
    border: 1px solid #e3e3e8;
    border-radius: 8px;
    background: #fff;
    padding: 14px;
    box-shadow: 0 1px 2px rgba(17, 17, 24, 0.04);
}

.dashboard-stat-card::before {
    position: absolute;
    inset: 0 0 auto;
    height: 3px;
    background: #6366f1;
    content: '';
}

.dashboard-stat-card-voices::before { background: #6366f1; }
.dashboard-stat-card-generations::before { background: #f59e0b; }
.dashboard-stat-card-completed::before { background: #22c55e; }
.dashboard-stat-card-credits::before { background: #e11d48; }
.dashboard-stat-card-stt::before { background: #2563eb; }
.dashboard-stat-card-tokens::before { background: #14b8a6; }

.dashboard-stat-topline {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

.dashboard-stat-icon {
    display: inline-flex;
    height: 32px;
    width: 32px;
    flex: 0 0 auto;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    background: #f1f1f4;
    color: #6366f1;
}

.dashboard-stat-card-generations .dashboard-stat-icon { color: #d97706; }
.dashboard-stat-card-completed .dashboard-stat-icon { color: #16a34a; }
.dashboard-stat-card-credits .dashboard-stat-icon { color: #e11d48; }
.dashboard-stat-card-stt .dashboard-stat-icon { color: #2563eb; }
.dashboard-stat-card-tokens .dashboard-stat-icon { color: #0f766e; }

.dashboard-stat-value {
    display: block;
    margin-top: 12px;
    color: #171719;
    font-size: 26px;
    font-weight: 900;
    line-height: 1;
}

.dashboard-stat-note {
    margin-top: 9px;
    color: #666675;
    font-size: 11px;
    font-weight: 750;
}

.dashboard-stat-note-positive {
    color: #16a34a;
}

.dashboard-stat-note-small {
    margin-top: 2px;
    font-size: 10px;
}

.dashboard-flow-step,
.dashboard-sample-card,
.dashboard-voice-card,
.dashboard-empty-card {
    border: 1px solid #e3e3e8;
    border-radius: 8px;
    background: #fff;
}

.dashboard-flow-step {
    min-height: 112px;
    padding: 14px;
}

.dashboard-flow-icon {
    display: inline-flex;
    height: 34px;
    width: 34px;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    background: rgba(99, 102, 241, 0.08);
    color: #6366f1;
}

.dashboard-sample-card,
.dashboard-voice-card {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px;
}

.dashboard-sample-wave {
    display: block;
    width: 92px;
    height: 30px;
    flex: 0 0 auto;
    opacity: 0.84;
    background: repeating-linear-gradient(90deg, #6366f1 0 3px, transparent 3px 7px);
    -webkit-mask: linear-gradient(90deg, transparent 0, #000 8px, #000 calc(100% - 8px), transparent 100%);
    mask: linear-gradient(90deg, transparent 0, #000 8px, #000 calc(100% - 8px), transparent 100%);
}

.dashboard-empty-card {
    border-style: dashed;
    padding: 16px;
    color: #666675;
    font-size: 13px;
    font-weight: 650;
}

.dashboard-voice-card:hover {
    border-color: rgba(99, 102, 241, 0.32);
    box-shadow: 0 10px 28px rgba(17, 17, 24, 0.07);
    transform: translateY(-1px);
}

.dashboard-voice-avatar {
    display: inline-flex;
    height: 42px;
    width: 42px;
    flex: 0 0 auto;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    border-radius: 999px;
    background: #f1f1f4;
    color: #6366f1;
}

.dashboard-voice-avatar-male {
    background: linear-gradient(135deg, #eef2ff 0%, #dbeafe 100%);
}

.dashboard-voice-avatar-female {
    background: linear-gradient(135deg, #ecfeff 0%, #ccfbf1 100%);
}

.dashboard-voice-avatar-robot {
    background: linear-gradient(135deg, #f8fafc 0%, #e2e8f0 100%);
}

.dashboard-voice-icon {
    display: block;
    height: 32px;
    width: 32px;
    object-fit: contain;
}

.dashboard-voice-name {
    display: block;
    min-width: 0;
    overflow: hidden;
    color: #171719;
    font-size: 13px;
    font-weight: 850;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.dashboard-voice-name:hover {
    color: #6366f1;
}

.dashboard-voice-tags {
    display: flex;
    min-width: 0;
    flex-wrap: wrap;
    gap: 5px;
    margin-top: 6px;
}

.dashboard-voice-tags span {
    max-width: 100%;
    overflow: hidden;
    border-radius: 6px;
    background: #f1f1f4;
    padding: 3px 6px;
    color: #666675;
    font-size: 10px;
    font-weight: 800;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.dashboard-voice-actions {
    display: flex;
    flex: 0 0 auto;
    align-items: center;
    gap: 5px;
}

.dashboard-voice-generate,
.dashboard-voice-generate.icon-button {
    background: #6366f1;
    color: #fff;
}

.dashboard-voice-generate .material-symbols-outlined {
    font-size: 18px;
}

.dashboard-voice-generate:hover,
.dashboard-voice-generate.icon-button:hover {
    background: #5558de;
    color: #fff;
}

.dashboard-voice-generate:active {
    transform: scale(0.98);
}

.topbar-button,
.secondary-button,
.danger-button,
.primary-button,
.tool-pill,
.prompt-chip,
.icon-button {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    border-radius: 7px;
    font-size: 12.5px;
    font-weight: 720;
    transition: background-color 160ms ease, color 160ms ease, border-color 160ms ease, transform 160ms ease, opacity 160ms ease;
}

.topbar-button,
.secondary-button,
.danger-button,
.prompt-chip {
    border: 1px solid #e3e3e8;
    background: #fff;
    color: #33333c;
    padding: 7px 11px;
}
.prompt-chip {
    min-height: 34px;
}

.topbar-button:hover,
.secondary-button:hover,
.prompt-chip:hover {
    background: #f1f1f4;
}

.danger-button {
    color: #b42318;
}

.danger-button:hover {
    border-color: #fecaca;
    background: #fff1f2;
}

.primary-button {
    background: #6366f1;
    color: white;
    padding: 8px 14px;
}

.primary-button:hover { background: #5558de; }
.primary-button:disabled { cursor: not-allowed; opacity: 0.45; }
.primary-button:active,
.secondary-button:active,
.icon-button:active { transform: scale(0.98); }

.icon-button {
    position: relative;
    display: inline-flex;
    height: 32px;
    width: 32px;
    justify-content: center;
    padding: 0;
    color: #666675;
}

.icon-button:hover { background: #f1f1f4; color: #171719; }
.icon-button:disabled { cursor: not-allowed; opacity: 0.4; }

.theme-toggle {
    display: inline-flex;
    height: 32px;
    width: 32px;
    align-items: center;
    justify-content: center;
    border: 1px solid #e3e3e8;
    border-radius: 8px;
    background: #fff;
    color: #666675;
    transition: background-color 160ms ease, color 160ms ease, border-color 160ms ease, transform 160ms ease;
}

.theme-toggle:hover {
    background: #f1f1f4;
    color: #171719;
}

.theme-toggle:active { transform: scale(0.98); }

.auth-theme-toggle {
    position: fixed;
    right: 18px;
    top: 18px;
    z-index: 20;
}

.profile-trigger {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    border-radius: 8px;
    padding: 4px 8px;
    transition: background-color 160ms ease, transform 160ms ease;
}

.profile-trigger:hover,
.profile-trigger[aria-expanded='true'] {
    background: #f1f1f4;
}

.profile-trigger:active { transform: scale(0.99); }

.dropdown-panel {
    position: absolute;
    right: 0;
    top: calc(100% + 8px);
    z-index: 120;
    width: min(360px, calc(100vw - 24px));
    overflow: hidden;
    border: 1px solid #e3e3e8;
    border-radius: 8px;
    background: #fff;
    box-shadow: 0 18px 50px rgba(17, 17, 24, 0.14);
}

.dropdown-panel-left {
    left: 0;
    right: auto;
}

.mobile-nav-button {
    display: none;
}

.mobile-nav-panel {
    width: min(300px, calc(100vw - 24px));
}

.sidebar-favorites-button {
    display: flex;
    width: 100%;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    border: 1px solid #e3e3e8;
    border-radius: 8px;
    background: #fff;
    padding: 8px;
    color: #171719;
    transition: background-color 160ms ease, border-color 160ms ease, transform 160ms ease;
}

.sidebar-favorites-button:hover,
.sidebar-favorites-button[aria-expanded='true'] {
    background: #f8f8fa;
}

.sidebar-favorites-button:active {
    transform: scale(0.99);
}

.sidebar-favorites-icon {
    display: inline-flex;
    height: 24px;
    width: 24px;
    align-items: center;
    justify-content: center;
    border-radius: 7px;
    background: #f7f7ff;
    color: #6366f1;
}

.sidebar-favorites-button.has-favorites .sidebar-favorites-icon {
    background: #fff1f2;
    color: #e11d48;
}

.sidebar-favorites-button.has-favorites .sidebar-favorites-icon .material-symbols-outlined {
    font-variation-settings: 'FILL' 1, 'wght' 650, 'GRAD' 0, 'opsz' 24;
}

.sidebar-favorites-count {
    display: inline-flex;
    min-width: 24px;
    height: 24px;
    align-items: center;
    justify-content: center;
    border-radius: 999px;
    background: #171719;
    padding: 0 7px;
    color: #fff;
    font-size: 11px;
    font-weight: 900;
}

.sidebar-favorites-panel {
    left: calc(100% + 10px);
    right: auto;
    top: 0;
    width: min(360px, calc(100vw - 260px));
}

.sidebar-favorites-list {
    display: grid;
    max-height: 340px;
    gap: 6px;
    overflow-y: auto;
    padding: 8px;
}

.sidebar-favorite-item {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto auto;
    align-items: center;
    gap: 8px;
    border: 1px solid #e3e3e8;
    border-radius: 8px;
    background: #fff;
    padding: 8px;
}

.sidebar-favorite-main {
    display: block;
    min-width: 0;
}

.sidebar-favorite-main span,
.sidebar-favorite-main small {
    display: block;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.sidebar-favorite-main span {
    color: #171719;
    font-size: 12.5px;
    font-weight: 850;
}

.sidebar-favorite-main small {
    margin-top: 2px;
    color: #666675;
    font-size: 10.5px;
    font-weight: 700;
}

.sidebar-favorite-item .voice-preview-button,
.sidebar-favorite-item .icon-button {
    min-width: 30px;
    height: 30px;
}

.sidebar-favorite-progress {
    grid-column: 1 / -1;
    display: block;
    height: 3px;
    overflow: hidden;
    border-radius: 999px;
    background: #eeeef3;
}

.sidebar-favorite-progress span {
    display: block;
    width: 0%;
    height: 100%;
    border-radius: inherit;
    background: #6366f1;
    transition: width 120ms linear;
}

.sidebar-favorites-empty {
    display: flex;
    min-height: 92px;
    align-items: center;
    justify-content: center;
    gap: 8px;
    border: 1px dashed #c8c8d2;
    border-radius: 8px;
    color: #666675;
    font-size: 12.5px;
    font-weight: 760;
}

.tool-pill {
    background: transparent;
    color: #666675;
    padding: 8px 10px;
    min-height: 34px;
}

.tool-pill:hover,
.tool-pill-active {
    background: #f1f1f4;
    color: #171719;
}

.sample-card,
.role-card {
    display: flex;
    min-height: 94px;
    cursor: pointer;
    flex-direction: column;
    gap: 6px;
    border: 1px solid #e3e3e8;
    border-radius: 8px;
    background: #fff;
    padding: 12px;
    transition: border-color 160ms ease, background-color 160ms ease, box-shadow 160ms ease, transform 160ms ease;
}

.sample-history-card {
    display: flex;
    min-width: 0;
    cursor: pointer;
    align-items: center;
    gap: 10px;
    border: 1px solid #e3e3e8;
    border-radius: 8px;
    background: #fff;
    padding: 10px;
    transition: border-color 160ms ease, background-color 160ms ease, box-shadow 160ms ease, transform 160ms ease;
}

.sample-history-card:hover,
.sample-history-card.is-active {
    border-color: rgba(99, 102, 241, 0.5);
    background: #f7f7ff;
    box-shadow: 0 10px 30px rgba(99, 102, 241, 0.08);
}

.sample-history-card:active { transform: scale(0.99); }
.sample-card .material-symbols-outlined,
.role-card .material-symbols-outlined {
    font-size: 18px;
}

.sample-card:hover,
.sample-card.is-active,
.role-card:hover,
.role-card.is-active {
    border-color: rgba(99, 102, 241, 0.45);
    background: #f7f7ff;
    box-shadow: 0 10px 30px rgba(99, 102, 241, 0.08);
}

.sample-card:active,
.role-card:active { transform: scale(0.99); }

.role-card:has(input:checked) {
    border-color: rgba(99, 102, 241, 0.55);
    background: #f7f7ff;
    box-shadow: 0 10px 30px rgba(99, 102, 241, 0.08);
}

.role-card-disabled {
    cursor: not-allowed;
    opacity: 0.58;
}

.role-card-disabled:hover {
    border-color: #e3e3e8;
    background: #fff;
    box-shadow: none;
}

.studio-workspace {
    display: grid;
    height: min(680px, calc(100vh - 174px));
    min-height: 560px;
    grid-template-columns: minmax(0, 1fr) minmax(430px, 500px);
    gap: 0;
    overflow: hidden;
}

.studio-compose-pane {
    display: flex;
    min-width: 0;
    min-height: 0;
    flex-direction: column;
    padding-right: 16px;
}

.studio-voice-pane {
    display: flex;
    height: 100%;
    min-width: 0;
    min-height: 0;
    flex-direction: column;
    border-left: 1px solid #e3e3e8;
    padding-left: 16px;
}

.studio-prompt-row {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    padding-top: 14px;
}

.studio-expression-panel {
    margin-top: 14px;
}

.studio-expression-heading {
    color: #666675;
    font-size: 12px;
    font-weight: 820;
    text-transform: uppercase;
}

.studio-settings-grid {
    margin-top: 8px;
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
}

.studio-summary-grid {
    align-items: start;
}

.studio-preview-panel {
    min-height: 0;
}

.studio-preview-list {
    display: grid;
    max-height: 292px;
    align-content: start;
    gap: 8px;
    overflow-y: auto;
    padding-right: 4px;
}

.studio-generate-bar {
    margin-top: auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    border-top: 1px solid #e3e3e8;
    padding-top: 14px;
}

.studio-generation-context {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    color: #666675;
    font-size: 13px;
    font-weight: 740;
}

.selected-generation-voice {
    display: inline-flex;
    min-height: 28px;
    max-width: min(100%, 340px);
    align-items: center;
    gap: 6px;
    border: 1px solid #dadae5;
    border-radius: 999px;
    background: #fff;
    padding: 4px 8px;
    color: #33333c;
}

.selected-generation-voice strong {
    display: inline-block;
    max-width: 190px;
    overflow: hidden;
    color: #171719;
    font-weight: 900;
    text-overflow: ellipsis;
    vertical-align: bottom;
    white-space: nowrap;
}

.selected-generation-voice.is-empty {
    border-color: #f0c9c9;
    background: #fff8f8;
    color: #9f3434;
}

.speech-text-workspace {
    display: grid;
    grid-template-columns: minmax(400px, 0.78fr) minmax(0, 1.22fr);
    gap: 16px;
    align-items: stretch;
}

.speech-upload-panel,
.speech-result-panel {
    min-width: 0;
    border: 1px solid #e3e3e8;
    border-radius: 8px;
    background: #fff;
    padding: 18px;
}

.speech-panel-heading,
.speech-result-header,
.speech-recorder-header,
.speech-result-toolbar,
.speech-recent-item {
    display: flex;
    align-items: center;
    gap: 12px;
}

.speech-panel-heading,
.speech-result-header,
.speech-recorder-header,
.speech-result-toolbar {
    justify-content: space-between;
}

.speech-result-header > span:not(.speech-status-badge) {
    min-width: 0;
    flex: 1 1 auto;
}

.speech-panel-heading {
    justify-content: flex-start;
}

.speech-panel-heading strong,
.speech-result-header strong,
.speech-recorder-header strong,
.speech-recent-item strong {
    display: block;
    min-width: 0;
    overflow: hidden;
    color: #171719;
    font-weight: 880;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.speech-panel-heading small,
.speech-recorder-header small,
.speech-recent-item small {
    margin-top: 2px;
    display: block;
    min-width: 0;
    overflow: hidden;
    color: #666675;
    font-size: 12px;
    font-weight: 680;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.speech-eyebrow {
    display: block;
    color: #666675;
    font-size: 11px;
    font-weight: 840;
    text-transform: uppercase;
}

.speech-panel-icon,
.speech-upload-icon,
.speech-empty-icon,
.speech-recent-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
    border-radius: 8px;
}

.speech-panel-icon {
    height: 40px;
    width: 40px;
    background: #eef2ff;
    color: #4f46e5;
}

.speech-upload-dropzone {
    min-height: 168px;
    align-items: stretch;
    gap: 8px;
    border-color: #d4d4df;
    background: linear-gradient(180deg, #fbfbfd 0%, #f5f6fb 100%);
    padding: 18px;
}

.speech-upload-icon {
    margin: 0 auto;
    height: 42px;
    width: 42px;
    background: #fff;
    color: #4f46e5;
    box-shadow: inset 0 0 0 1px #e3e3e8;
}

.speech-upload-title,
.speech-upload-meta {
    display: block;
    text-align: center;
}

.speech-upload-title {
    color: #171719;
    font-size: 15px;
    font-weight: 880;
}

.speech-upload-meta {
    color: #666675;
    font-size: 12px;
    font-weight: 680;
}

.speech-file-pill {
    margin-top: 8px;
    display: flex;
    min-height: 38px;
    align-items: center;
    gap: 8px;
    overflow: hidden;
    border: 1px solid #e3e3e8;
    border-radius: 8px;
    background: #fff;
    padding: 8px 10px;
    color: #666675;
    text-align: left;
}

.speech-file-pill strong {
    min-width: 0;
    overflow: hidden;
    color: #33333c;
    font-size: 12px;
    font-weight: 780;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.speech-recorder-card {
    margin-top: 12px;
    display: grid;
    gap: 12px;
    overflow: hidden;
    border: 1px solid #e3e3e8;
    border-radius: 8px;
    background: #f8f8fa;
    padding: 12px;
}

.speech-recorder-header {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    align-items: start;
    gap: 8px;
}

.speech-record-status,
.speech-status-badge {
    display: inline-flex;
    max-width: 100%;
    flex: 0 0 auto;
    min-height: 28px;
    align-items: center;
    border-radius: 999px;
    background: #fff;
    padding: 5px 9px;
    color: #666675;
    font-size: 11px;
    font-weight: 820;
    line-height: 1.25;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.speech-record-status {
    justify-self: start;
    max-width: 100%;
    white-space: normal;
}

.speech-record-status.is-recording {
    background: #fef2f2;
    color: #b42318;
}

.speech-record-status.is-attached {
    background: #ecfdf5;
    color: #047857;
}

.speech-status-completed {
    background: #ecfdf5;
    color: #047857;
}

.speech-status-failed {
    background: #fef2f2;
    color: #b42318;
}

.speech-record-actions {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
}

.speech-record-actions .secondary-button {
    justify-content: center;
}

.speech-record-actions [data-record-start].is-recording {
    border-color: #dc2626;
    background: #dc2626;
    color: #fff;
    animation: speech-record-pulse 820ms ease-in-out infinite;
}

.speech-record-actions [data-record-stop].is-stop-cue {
    border-color: #dc2626;
    color: #dc2626;
    animation: speech-stop-cue-pulse 820ms ease-in-out infinite;
}

.speech-record-preview {
    width: 100%;
    max-width: 100%;
    min-width: 0;
    height: 42px;
}

@keyframes speech-record-pulse {
    0%, 100% {
        box-shadow: 0 0 0 0 rgba(220, 38, 38, 0.32);
        transform: translateZ(0) scale(1);
    }

    50% {
        box-shadow: 0 0 0 7px rgba(220, 38, 38, 0);
        transform: translateZ(0) scale(0.985);
    }
}

@keyframes speech-stop-cue-pulse {
    0%, 100% {
        background: #fff;
        box-shadow: 0 0 0 0 rgba(220, 38, 38, 0.26);
    }

    50% {
        background: #fef2f2;
        box-shadow: 0 0 0 6px rgba(220, 38, 38, 0);
    }
}

.speech-submit-row {
    margin-top: 12px;
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(150px, auto);
    gap: 10px;
    align-items: end;
}

.speech-result-panel {
    display: flex;
    min-height: min(560px, calc(100vh - 220px));
    flex-direction: column;
}

.speech-result-toolbar {
    margin-top: 14px;
    color: #666675;
    font-size: 12px;
    font-weight: 760;
}

.speech-transcript-output {
    margin-top: 14px;
    min-height: 300px;
    flex: 1;
    width: 100%;
    resize: vertical;
    border: 1px solid #e3e3e8;
    border-radius: 8px;
    background: #fbfbfd;
    padding: 14px;
    color: #171719;
    font-size: 14px;
    font-weight: 560;
    line-height: 1.6;
}

.speech-metric-card {
    min-width: 0;
    border: 1px solid #e3e3e8;
    border-radius: 8px;
    background: #f8f8fa;
    padding: 12px;
}

.speech-failed-state {
    margin-top: 14px;
    display: flex;
    min-height: 180px;
    align-items: center;
    justify-content: center;
    gap: 8px;
    border: 1px solid #fecaca;
    border-radius: 8px;
    background: #fef2f2;
    padding: 18px;
    color: #b42318;
    text-align: center;
    font-size: 13px;
}

.speech-empty-result {
    margin-top: 14px;
    display: flex;
    min-height: 320px;
    flex: 1;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 7px;
    border: 1px dashed #e3e3e8;
    border-radius: 8px;
    background: #fbfbfd;
    color: #666675;
    padding: 18px;
    text-align: center;
    font-size: 13px;
    font-weight: 680;
}

.speech-empty-result strong {
    color: #171719;
    font-size: 15px;
    font-weight: 880;
}

.speech-empty-icon {
    height: 44px;
    width: 44px;
    background: #f1f1f4;
    color: #6366f1;
}

.speech-recent-panel {
    padding: 16px;
}

.speech-recent-list {
    display: grid;
    gap: 8px;
}

.speech-recent-item {
    min-width: 0;
    border: 1px solid #e3e3e8;
    border-radius: 8px;
    background: #fff;
    padding: 10px 12px;
    color: inherit;
}

.speech-recent-item:hover {
    border-color: rgba(99, 102, 241, 0.38);
    background: #f8f8fa;
}

.speech-recent-icon {
    height: 32px;
    width: 32px;
    background: #f1f1f4;
    color: #6366f1;
}

.clone-voice-workspace {
    display: grid;
    grid-template-columns: minmax(360px, 0.82fr) minmax(0, 1.18fr);
    gap: 16px;
    align-items: stretch;
}

.clone-sample-panel,
.clone-script-panel {
    min-width: 0;
}

.clone-script-panel {
    min-height: min(620px, calc(100vh - 190px));
}

.clone-textarea {
    margin-top: 14px;
    min-height: clamp(280px, 38vh, 420px);
}

.image-generation-workspace {
    display: grid;
    grid-template-columns: minmax(400px, 0.9fr) minmax(0, 1.1fr);
    gap: 16px;
    align-items: stretch;
}

.image-generation-form,
.image-preview-panel {
    display: flex;
    min-width: 0;
    flex-direction: column;
}

.image-generation-head,
.image-render-heading,
.image-generation-context,
.image-result-actions {
    display: flex;
    align-items: center;
    gap: 10px;
}

.image-generation-head {
    padding-bottom: 14px;
    border-bottom: 1px solid #e3e3e8;
}

.image-generation-head strong {
    display: block;
    overflow: hidden;
    color: #171719;
    font-weight: 900;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.image-generation-head small {
    display: block;
    margin-top: 2px;
    overflow: hidden;
    color: #666675;
    font-size: 12px;
    font-weight: 680;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.image-generation-icon {
    display: inline-flex;
    height: 42px;
    width: 42px;
    flex: 0 0 auto;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    background: linear-gradient(135deg, #6366f1 0%, #14b8a6 100%);
    color: #fff;
}

.image-generation-icon .material-symbols-outlined {
    font-size: 23px;
}

.image-model-pill {
    display: inline-flex;
    min-height: 28px;
    align-items: center;
    justify-content: center;
    border-radius: 999px;
    background: #ecfeff;
    padding: 4px 9px;
    color: #0f766e;
    font-size: 11px;
    font-weight: 900;
}

.image-prompt-label {
    display: block;
}

.image-generation-form textarea.form-control {
    min-height: clamp(210px, 29vh, 330px);
    resize: vertical;
    border-color: #dadae5;
    background: #fbfbfd;
    font-size: 14px;
    line-height: 1.55;
}

.image-generation-form textarea.form-control:focus {
    background: #fff;
}

.image-prompt-row {
    padding-top: 10px;
}

.image-render-panel {
    border: 1px solid #e3e3e8;
    border-radius: 8px;
    background: #f8f8fa;
    padding: 12px;
}

.image-render-heading {
    justify-content: space-between;
}

.image-render-heading span {
    color: #666675;
    font-size: 11px;
    font-weight: 800;
}

.image-settings-grid {
    margin-top: 10px;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
}

.image-settings-grid .control-label {
    border: 1px solid #e3e3e8;
    border-radius: 8px;
    background: #fff;
    padding: 9px;
}

.image-enhance-toggle {
    position: relative;
    margin-top: 10px;
    display: inline-flex;
    width: 100%;
    min-height: 42px;
    box-sizing: border-box;
    flex: 0 0 auto;
    align-items: center;
    gap: 9px;
    border: 1px solid #e3e3e8;
    border-radius: 8px;
    background: #fff;
    padding: 9px 10px;
    color: #171719;
    font-size: 13px;
    font-weight: 800;
    line-height: 1.2;
}

.image-enhance-toggle + .image-enhance-toggle {
    margin-top: 8px;
}

.image-enhance-toggle input,
.image-enhance-toggle input[type='checkbox'].form-control {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    min-height: 0;
    padding: 0;
}

.image-toggle-ui {
    position: relative;
    display: inline-flex;
    height: 22px;
    width: 40px;
    min-width: 40px;
    box-sizing: border-box;
    flex: 0 0 auto;
    align-items: center;
    border-radius: 999px;
    background: #dadae5;
    padding: 2px;
    transition: background-color 160ms ease;
}

.image-toggle-ui span {
    display: block;
    height: 18px;
    width: 18px;
    flex: 0 0 18px;
    border-radius: 999px;
    background: #fff;
    box-shadow: 0 1px 3px rgba(17, 17, 24, 0.22);
    transition: transform 160ms ease;
}

.image-enhance-toggle input:checked + .image-toggle-ui {
    background: #14b8a6;
}

.image-enhance-toggle input:checked + .image-toggle-ui span {
    transform: translateX(18px);
}

.image-generation-context {
    flex-wrap: wrap;
    color: #666675;
    font-size: 12px;
    font-weight: 760;
}

.image-generation-context span {
    display: inline-flex;
    align-items: center;
    gap: 5px;
}

.image-generation-context .material-symbols-outlined {
    color: #14b8a6;
    font-size: 17px;
}

.image-preview-panel {
    min-height: min(660px, calc(100vh - 182px));
}

.image-preview-header {
    padding-bottom: 14px;
    border-bottom: 1px solid #e3e3e8;
}

.image-preview-stage {
    display: flex;
    min-height: 360px;
    flex: 1 1 auto;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    border: 1px solid #e3e3e8;
    border-radius: 8px;
    background:
        linear-gradient(45deg, rgba(99, 102, 241, 0.06) 25%, transparent 25%, transparent 75%, rgba(99, 102, 241, 0.06) 75%),
        linear-gradient(45deg, rgba(20, 184, 166, 0.06) 25%, transparent 25%, transparent 75%, rgba(20, 184, 166, 0.06) 75%),
        #f8f8fa;
    background-position: 0 0, 12px 12px;
    background-size: 24px 24px;
    padding: 12px;
}

.image-preview-output {
    display: block;
    max-height: min(560px, calc(100vh - 315px));
    max-width: 100%;
    border-radius: 6px;
    object-fit: contain;
    box-shadow: 0 18px 44px rgba(17, 17, 24, 0.14);
}

.image-meta-grid {
    margin-top: 12px;
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 8px;
}

.image-result-actions {
    margin-top: 12px;
    flex-wrap: wrap;
    justify-content: flex-end;
}

.image-empty-result {
    flex: 1 1 auto;
    min-height: 360px;
    justify-content: center;
    background:
        linear-gradient(180deg, rgba(99, 102, 241, 0.05), rgba(20, 184, 166, 0.05)),
        #f8f8fa;
}

.image-recent-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 12px;
}

.image-recent-card {
    display: block;
    min-width: 0;
    border: 1px solid #e3e3e8;
    border-radius: 8px;
    background: #fff;
    padding: 10px;
    color: inherit;
    transition: border-color 160ms ease, background-color 160ms ease, transform 160ms ease, box-shadow 160ms ease;
}

.image-recent-card:hover {
    border-color: rgba(20, 184, 166, 0.48);
    background: #fbfbfd;
    box-shadow: 0 12px 28px rgba(17, 17, 24, 0.08);
    transform: translateY(-1px);
}

.image-recent-thumb,
.image-recent-placeholder {
    display: flex;
    width: 100%;
    aspect-ratio: 16 / 9;
    margin-bottom: 10px;
    align-items: center;
    justify-content: center;
    border-radius: 7px;
    background: #f1f1f4;
    color: #666675;
}

.image-recent-thumb {
    display: block;
    object-fit: cover;
}

.avatar-page-panel {
    display: flex;
    flex: 1 1 auto;
    flex-direction: column;
    background: linear-gradient(180deg, #fff 0%, #fbfcff 100%);
}

.avatar-workspace {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(360px, 0.58fr);
    gap: 16px;
    flex: 1 1 auto;
    align-items: stretch;
    background: #fff;
}

.avatar-builder,
.avatar-result-panel {
    min-width: 0;
    border: 1px solid #e3e3e8;
    border-radius: 8px;
    background: #fff;
    padding: 16px;
}

.avatar-builder {
    display: grid;
    align-content: start;
    gap: 14px;
}

.avatar-result-panel {
    position: sticky;
    top: 16px;
    display: flex;
    min-height: 560px;
    flex-direction: column;
}

.avatar-native-fields {
    display: none;
}

.avatar-builder-head,
.avatar-step-heading,
.avatar-generate-bar,
.avatar-selected-strip,
.avatar-audio-card,
.avatar-audio-select,
.avatar-source-tabs {
    display: flex;
    align-items: center;
}

.avatar-builder-head {
    gap: 12px;
    border-bottom: 1px solid #e3e3e8;
    padding-bottom: 14px;
}

.avatar-builder-head strong {
    display: block;
    overflow: hidden;
    color: #171719;
    font-weight: 900;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.avatar-builder-head small {
    display: block;
    margin-top: 2px;
    overflow: hidden;
    color: #666675;
    font-size: 12px;
    font-weight: 680;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.avatar-builder-icon,
.avatar-step-number,
.avatar-audio-icon,
.avatar-empty-frame {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
}

.avatar-builder-icon {
    height: 42px;
    width: 42px;
    border-radius: 8px;
    background: linear-gradient(135deg, #2563eb 0%, #0f766e 100%);
    color: #fff;
}

.avatar-builder-icon .material-symbols-outlined {
    font-size: 23px;
}

.avatar-builder-model {
    border-radius: 999px;
    background: #ecfeff;
    padding: 5px 9px;
    color: #0f766e;
    font-size: 11px;
    font-weight: 900;
}

.avatar-step-card {
    border: 1px solid #e3e3e8;
    border-radius: 8px;
    background: #f8f8fa;
    padding: 13px;
}

.avatar-step-heading {
    gap: 10px;
}

.avatar-step-heading strong,
.avatar-audio-card strong,
.avatar-empty-choice strong {
    display: block;
    color: #171719;
    font-size: 13px;
    font-weight: 880;
}

.avatar-step-heading small,
.avatar-audio-card small {
    display: block;
    margin-top: 2px;
    overflow: hidden;
    color: #666675;
    font-size: 12px;
    font-weight: 650;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.avatar-step-number {
    height: 28px;
    width: 28px;
    border-radius: 999px;
    background: #171719;
    color: #fff;
    font-size: 12px;
    font-weight: 900;
}

.avatar-source-tabs {
    margin-top: 12px;
    gap: 8px;
    border-radius: 8px;
    background: #fff;
    padding: 4px;
}

.avatar-source-tab {
    display: inline-flex;
    min-height: 38px;
    flex: 1 1 0;
    cursor: pointer;
    align-items: center;
    justify-content: center;
    gap: 7px;
    border-radius: 6px;
    color: #666675;
    font-size: 12px;
    font-weight: 820;
    transition: background-color 160ms ease, color 160ms ease, box-shadow 160ms ease;
}

.avatar-source-tab:hover,
.avatar-source-tab.is-active {
    background: #171719;
    color: #fff;
    box-shadow: 0 8px 22px rgba(17, 17, 24, 0.13);
}

.avatar-choice-panel {
    margin-top: 12px;
    min-height: 150px;
}

.avatar-choice-panel[data-avatar-image-panel='library'] {
    display: flex;
    flex-direction: column;
    gap: 10px;
    min-height: 220px;
}

.avatar-choice-panel.hidden {
    display: none;
}

.avatar-audio-list {
    display: grid;
    max-height: 300px;
    gap: 8px;
    overflow-y: auto;
    padding-right: 3px;
}

.avatar-audio-card {
    gap: 8px;
    border: 1px solid #e3e3e8;
    border-radius: 8px;
    background: #fff;
    padding: 8px;
    transition: border-color 160ms ease, box-shadow 160ms ease, transform 160ms ease;
}

.avatar-audio-card:hover,
.avatar-audio-card.is-active,
.avatar-profile-card:hover,
.avatar-profile-card.is-active {
    border-color: rgba(37, 99, 235, 0.5);
    box-shadow: 0 10px 24px rgba(17, 17, 24, 0.08);
}

.avatar-audio-card.is-active,
.avatar-profile-card.is-active {
    outline: 3px solid rgba(20, 184, 166, 0.5);
    outline-offset: 2px;
}

.avatar-audio-select {
    min-width: 0;
    flex: 1 1 auto;
    gap: 10px;
    border: 0;
    background: transparent;
    padding: 0;
    color: inherit;
}

.avatar-audio-icon {
    height: 36px;
    width: 36px;
    border-radius: 8px;
    background: #eef2ff;
    color: #2563eb;
}

.avatar-profile-grid {
    display: grid;
    max-height: 560px;
    overflow-y: auto;
    padding: 2px 4px 2px 2px;
    width: 100%;
    align-items: stretch;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    grid-auto-rows: minmax(188px, auto);
    gap: 10px;
    scroll-behavior: smooth;
}

.avatar-library-toolbar,
.avatar-filter-pills,
.avatar-library-pagination {
    display: flex;
    align-items: center;
}

.avatar-library-toolbar {
    flex-wrap: wrap;
    justify-content: space-between;
    gap: 10px;
}

.avatar-search-field {
    display: inline-flex;
    min-height: 34px;
    min-width: min(100%, 220px);
    flex: 1 1 220px;
    align-items: center;
    gap: 7px;
    border: 1px solid #e3e3e8;
    border-radius: 999px;
    background: #fff;
    padding: 0 11px;
    color: #666675;
}

.avatar-search-field .material-symbols-outlined {
    flex: 0 0 auto;
    font-size: 18px;
}

.avatar-search-field input {
    min-width: 0;
    width: 100%;
    border: 0;
    background: transparent;
    color: #171719;
    font-size: 12px;
    font-weight: 760;
    outline: 0;
}

.avatar-search-field input::placeholder {
    color: #888897;
}

.avatar-filter-pills,
.avatar-library-pagination {
    flex-wrap: wrap;
    gap: 6px;
}

.avatar-filter-pill,
.avatar-page-link,
.avatar-library-count,
.avatar-page-ellipsis {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 850;
}

.avatar-filter-pill {
    min-height: 32px;
    border: 1px solid #e3e3e8;
    background: #fff;
    padding: 0 12px;
    color: #666675;
    transition: background-color 160ms ease, border-color 160ms ease, color 160ms ease, box-shadow 160ms ease;
}

.avatar-filter-pill:hover,
.avatar-filter-pill.is-active {
    border-color: #171719;
    background: #171719;
    color: #fff;
    box-shadow: 0 8px 22px rgba(17, 17, 24, 0.13);
}

.avatar-library-count {
    min-height: 30px;
    flex: 0 0 auto;
    background: #f1f5f9;
    padding: 0 10px;
    color: #334155;
}

.avatar-library-pagination {
    justify-content: center;
    border-top: 1px solid #e3e3e8;
    padding-top: 10px;
}

.avatar-page-link,
.avatar-page-ellipsis {
    min-height: 30px;
    min-width: 30px;
    color: #666675;
}

.avatar-page-link {
    border: 1px solid #e3e3e8;
    background: #fff;
    transition: background-color 160ms ease, border-color 160ms ease, color 160ms ease;
}

.avatar-page-link:hover,
.avatar-page-link.is-active {
    border-color: #2563eb;
    background: #eef2ff;
    color: #2563eb;
}

.avatar-page-link.is-disabled {
    cursor: not-allowed;
    opacity: 0.45;
}

.avatar-page-link .material-symbols-outlined {
    font-size: 18px;
}

.avatar-profile-card {
    position: relative;
    display: flex;
    min-width: 0;
    min-height: 188px;
    appearance: none;
    flex-direction: column;
    align-items: stretch;
    gap: 7px;
    overflow: hidden;
    cursor: pointer;
    border: 1px solid #e3e3e8;
    border-radius: 8px;
    background: #fff;
    padding: 8px;
    color: inherit;
    font: inherit;
    line-height: 1.2;
    text-align: left;
    transition: border-color 160ms ease, background-color 160ms ease, box-shadow 160ms ease, transform 160ms ease;
}

.avatar-profile-card::after {
    position: absolute;
    top: 8px;
    right: 8px;
    display: inline-flex;
    height: 28px;
    width: 28px;
    align-items: center;
    justify-content: center;
    border-radius: 999px;
    background: #0f766e;
    color: #fff;
    content: "check";
    font-family: 'Material Symbols Outlined';
    font-size: 18px;
    font-variation-settings: 'FILL' 0, 'wght' 700, 'GRAD' 0, 'opsz' 20;
    line-height: 1;
    opacity: 0;
    transform: scale(0.78);
    transition: opacity 160ms ease, transform 160ms ease;
}

.avatar-profile-card.is-active {
    border-color: rgba(15, 118, 110, 0.78);
    background: linear-gradient(180deg, rgba(20, 184, 166, 0.1), rgba(37, 99, 235, 0.045)), #fff;
    box-shadow: 0 16px 34px rgba(15, 118, 110, 0.16);
    transform: translateY(-1px);
}

.avatar-profile-card.is-active::after {
    opacity: 1;
    transform: scale(1);
}

.avatar-profile-card.is-active .avatar-profile-thumb {
    box-shadow: 0 0 0 3px rgba(20, 184, 166, 0.25);
}

.avatar-profile-card.is-active .avatar-profile-name {
    color: #0f766e;
}

.avatar-profile-thumb {
    display: block;
    flex: 1 1 auto;
    overflow: hidden;
    width: 100%;
    min-height: 132px;
    height: clamp(132px, 16vw, 160px);
    border-radius: 7px;
    background: #f1f1f4;
}

.avatar-profile-thumb img {
    display: block;
    height: 100%;
    width: 100%;
    object-fit: cover;
}

.avatar-profile-name {
    display: block;
    flex: 0 0 auto;
    min-height: 18px;
    overflow: hidden;
    color: #171719;
    font-size: 12px;
    font-weight: 850;
    line-height: 1.25;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.avatar-empty-choice {
    display: flex;
    min-height: 118px;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
    border: 1px dashed #c8c8d2;
    border-radius: 8px;
    background: #fff;
    color: #666675;
    padding: 16px;
    text-align: center;
}

.avatar-profile-grid .avatar-empty-choice {
    grid-column: 1 / -1;
    min-height: 220px;
}

.avatar-load-state {
    display: contents;
}

.avatar-load-state.hidden {
    display: none;
}

.avatar-load-sentinel {
    grid-column: 1 / -1;
    height: 1px;
}

.avatar-profile-skeleton {
    cursor: default;
    pointer-events: none;
}

.avatar-skeleton-thumb {
    display: block;
    width: 100%;
    aspect-ratio: 4 / 5;
    border-radius: 7px;
}

.avatar-skeleton-name {
    display: block;
    height: 13px;
    margin-top: 9px;
    width: 72%;
}

.avatar-load-more {
    align-self: center;
    justify-content: center;
}

.avatar-upload-layout {
    display: grid;
    grid-template-columns: minmax(0, 0.95fr) minmax(220px, 0.7fr);
    gap: 12px;
    align-items: stretch;
}

.avatar-upload-dropzone {
    min-height: 220px;
    border-color: rgba(37, 99, 235, 0.28);
    background:
        linear-gradient(180deg, rgba(37, 99, 235, 0.045), rgba(15, 118, 110, 0.055)),
        #fff;
}

.avatar-image-dropzone.has-file {
    border-color: rgba(20, 184, 166, 0.55);
    background:
        linear-gradient(180deg, rgba(20, 184, 166, 0.08), rgba(37, 99, 235, 0.045)),
        #fff;
    box-shadow: 0 12px 28px rgba(15, 118, 110, 0.08);
}

.avatar-upload-preview {
    position: relative;
    display: flex;
    min-height: 220px;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    border: 1px solid #e3e3e8;
    border-radius: 8px;
    background:
        linear-gradient(135deg, rgba(37, 99, 235, 0.07), rgba(15, 118, 110, 0.08)),
        #fff;
}

.avatar-upload-preview img {
    display: block;
    height: 100%;
    width: 100%;
    object-fit: cover;
}

.avatar-upload-preview img[hidden],
.avatar-upload-preview img.hidden {
    display: none;
}

.avatar-upload-preview.has-image {
    border-color: rgba(20, 184, 166, 0.4);
    background: #0a0a0c;
    box-shadow: 0 14px 30px rgba(17, 17, 24, 0.1);
}

.avatar-upload-preview-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 7px;
    padding: 18px;
    color: #666675;
    text-align: center;
}

.avatar-upload-preview-empty .material-symbols-outlined {
    display: inline-flex;
    height: 48px;
    width: 48px;
    align-items: center;
    justify-content: center;
    border-radius: 999px;
    background: #eef2ff;
    color: #2563eb;
    font-size: 25px;
}

.avatar-upload-preview-empty strong {
    color: #171719;
    font-size: 13px;
    font-weight: 900;
}

.avatar-upload-preview-empty small {
    max-width: 190px;
    color: #666675;
    font-size: 12px;
    font-weight: 650;
}

.avatar-prompt-label textarea.form-control {
    min-height: 92px;
    resize: vertical;
}

.avatar-settings-grid {
    margin-top: 10px;
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 9px;
}

.avatar-settings-grid .control-label {
    border: 1px solid #e3e3e8;
    border-radius: 8px;
    background: #fff;
    padding: 9px;
}

.avatar-generate-bar {
    justify-content: space-between;
    gap: 12px;
    border: 1px solid #e3e3e8;
    border-radius: 8px;
    background: #fff;
    padding: 12px;
}

.avatar-selected-strip {
    min-width: 0;
    flex-wrap: wrap;
    gap: 8px;
}

.avatar-selected-strip > span {
    display: inline-flex;
    min-width: 0;
    max-width: 280px;
    align-items: center;
    gap: 6px;
    border-radius: 999px;
    background: #f1f5f9;
    padding: 6px 9px;
    color: #334155;
    font-size: 12px;
    font-weight: 780;
}

.avatar-selected-strip strong {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.avatar-result-header {
    border-bottom: 1px solid #e3e3e8;
    padding-bottom: 12px;
}

.avatar-video-stage,
.avatar-empty-result {
    overflow: hidden;
    border: 1px solid #e3e3e8;
    border-radius: 8px;
    background: #0a0a0c;
}

.avatar-video-stage {
    aspect-ratio: 16 / 9;
}

.avatar-video-stage video {
    display: block;
    height: 100%;
    width: 100%;
    object-fit: contain;
}

.avatar-empty-result {
    display: flex;
    min-height: 420px;
    flex: 1 1 auto;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
    background:
        linear-gradient(135deg, rgba(37, 99, 235, 0.08), rgba(15, 118, 110, 0.08)),
        #f8f8fa;
    color: #666675;
    text-align: center;
}

.avatar-empty-result strong {
    color: #171719;
    font-size: 15px;
    font-weight: 900;
}

.avatar-empty-frame {
    height: 72px;
    width: 72px;
    border-radius: 999px;
    background: #fff;
    color: #2563eb;
    box-shadow: inset 0 0 0 1px #e3e3e8;
}

.avatar-empty-frame .material-symbols-outlined {
    font-size: 32px;
}

@media (max-width: 1180px) {
    .avatar-workspace {
        grid-template-columns: 1fr;
    }

    .avatar-result-panel {
        position: static;
        min-height: 440px;
    }
}

@media (max-width: 760px) {
    .avatar-profile-grid,
    .avatar-settings-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .avatar-upload-layout {
        grid-template-columns: 1fr;
    }

    .avatar-generate-bar {
        align-items: stretch;
        flex-direction: column;
    }

    .avatar-generate-bar .primary-button {
        width: 100%;
    }
}

.clone-saved-samples {
    display: grid;
    max-height: 276px;
    gap: 8px;
    overflow-y: auto;
    padding-right: 4px;
}

.clone-sample-item {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 74px 34px 34px 34px;
    align-items: center;
    gap: 7px;
    overflow: visible;
}

.clone-sample-item:has(input:checked) {
    border-color: rgba(99, 102, 241, 0.5);
    background: #f7f7ff;
    box-shadow: 0 10px 30px rgba(99, 102, 241, 0.08);
}

.clone-sample-choice {
    display: grid;
    grid-column: 1;
    grid-row: 1;
    min-width: 0;
    cursor: pointer;
    grid-template-columns: auto minmax(0, 1fr);
    align-items: center;
    gap: 10px;
}

.clone-sample-item > .voice-preview-inline {
    grid-column: 2;
    grid-row: 1;
}

.clone-sample-item > .voice-preview-button {
    grid-column: 3;
    grid-row: 1;
}

.clone-sample-action {
    min-height: 34px;
    width: 34px;
    height: 34px;
    padding: 0;
}

.clone-sample-item > [data-sample-rename-toggle] {
    grid-column: 4;
    grid-row: 1;
}

.clone-sample-action .material-symbols-outlined {
    font-size: 18px;
}

.clone-sample-delete {
    grid-column: 5;
    grid-row: 1;
}

.clone-sample-delete:hover {
    border-color: rgba(220, 38, 38, 0.25);
    background: #fef2f2;
    color: #dc2626;
}

.clone-sample-item > [data-sample-rename-toggle][aria-expanded='true'] {
    border-color: rgba(99, 102, 241, 0.35);
    background: #eef2ff;
    color: #4f46e5;
}

.clone-sample-rename-panel {
    grid-column: 1 / -1;
    display: grid;
    width: 100%;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 8px;
    border: 1px solid #e3e3e8;
    border-radius: 8px;
    background: #f8f8fa;
    padding: 8px;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.7);
}

.clone-sample-rename-panel.hidden {
    display: none;
}

.clone-sample-rename-panel .form-control,
.clone-sample-rename-panel .secondary-button {
    min-height: 34px;
}

.history-workspace {
    display: grid;
    gap: 16px;
    align-items: start;
}

.history-panel {
    min-width: 0;
}

.voice-picker {
    display: flex;
    height: 100%;
    overflow: hidden;
    flex-direction: column;
    border: 1px solid #e3e3e8;
    border-radius: 8px;
    background: #f8f8fa;
    padding: 10px;
}

.voice-picker-header,
.voice-section-title {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.voice-count-pill,
.voice-tab-count {
    display: inline-flex;
    min-height: 24px;
    align-items: center;
    justify-content: center;
    border-radius: 999px;
    background: #fff;
    padding: 3px 8px;
    color: #666675;
    font-size: 11px;
    font-weight: 820;
}

.voice-tabs {
    margin-top: 10px;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 4px;
    border: 1px solid #e3e3e8;
    border-radius: 8px;
    background: #fff;
    padding: 3px;
}

.selected-voice-card {
    margin-top: 10px;
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    align-items: center;
    gap: 9px;
    border: 1px solid rgba(99, 102, 241, 0.28);
    border-radius: 8px;
    background: #fff;
    padding: 9px;
    box-shadow: 0 10px 28px rgba(99, 102, 241, 0.08);
}

.selected-voice-card.is-empty {
    border-color: #e7d4d4;
    box-shadow: none;
}

.selected-voice-card-icon {
    display: inline-flex;
    height: 34px;
    width: 34px;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    background: #f7f7ff;
    color: #6366f1;
}

.selected-voice-card-main {
    display: block;
    min-width: 0;
}

.selected-voice-eyebrow,
.selected-voice-card-main strong,
.selected-voice-card-main small {
    display: block;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.selected-voice-eyebrow {
    color: #666675;
    font-size: 10px;
    font-weight: 900;
    text-transform: uppercase;
}

.selected-voice-card-main strong {
    margin-top: 1px;
    color: #171719;
    font-size: 13px;
    font-weight: 900;
}

.selected-voice-card-main small {
    margin-top: 2px;
    color: #666675;
    font-size: 11px;
    font-weight: 700;
}

.voice-tab {
    display: inline-flex;
    min-height: 34px;
    cursor: pointer;
    align-items: center;
    justify-content: center;
    gap: 7px;
    border-radius: 6px;
    color: #666675;
    font-size: 12.5px;
    font-weight: 800;
    transition: background-color 160ms ease, color 160ms ease, box-shadow 160ms ease, transform 160ms ease;
}

.voice-tab:hover,
.voice-tab.is-active {
    background: #171719;
    color: #fff;
    box-shadow: 0 7px 18px rgba(17, 17, 24, 0.1);
}

.voice-tab.is-active .voice-tab-count {
    background: rgba(255, 255, 255, 0.16);
    color: #fff;
}

.voice-tab:active { transform: scale(0.99); }

.voice-tab-panel {
    margin-top: 10px;
    min-height: 0;
}

.studio-voice-pane .voice-tab-panel:not(.hidden) {
    display: flex;
    min-height: 0;
    flex: 1;
    flex-direction: column;
}

.voice-filter-bar,
.voice-capture-card {
    border: 1px solid #e3e3e8;
    border-radius: 8px;
    background: #fff;
    padding: 10px;
}

.voice-filter-header {
    display: flex;
    width: 100%;
    min-height: 24px;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.voice-filter-title {
    min-width: 0;
    flex: 1 1 auto;
}

.voice-filter-clear {
    display: inline-flex;
    flex: 0 0 auto;
    margin-left: auto;
    min-height: 24px;
    align-items: center;
    justify-content: center;
    border-radius: 999px;
    background: #f7f7ff;
    padding: 3px 9px;
    color: #6366f1;
    font-size: 11px;
    font-weight: 900;
}

.voice-filter-grid {
    margin-top: 8px;
    display: grid;
    grid-template-columns: minmax(120px, 0.8fr) minmax(110px, 0.7fr) minmax(130px, 0.85fr) auto;
    gap: 7px;
}

.voice-filter-search-row {
    margin-top: 8px;
}

.voice-filter-search-row .form-control {
    width: 100%;
}

.studio-voice-pane .voice-filter-grid {
    grid-template-columns: minmax(0, 1fr) minmax(0, 0.92fr) minmax(0, 1.12fr) 36px;
    gap: 7px;
}

.studio-voice-pane .voice-filter-grid.voice-filter-grid-has-accent {
    grid-template-columns: minmax(0, 0.95fr) minmax(0, 0.88fr) minmax(0, 0.78fr) minmax(0, 1fr) 36px;
}

.studio-voice-pane .voice-filter-grid .secondary-button {
    min-height: 36px;
    min-width: 0;
    padding: 0;
}

.studio-voice-pane .voice-filter-grid .form-control {
    min-height: 36px;
    padding: 6px 9px;
    font-size: 12px;
    font-weight: 760;
}

.studio-voice-pane .voice-filter-search-row .form-control {
    min-height: 36px;
    padding: 6px 10px;
    font-size: 12px;
    font-weight: 760;
}

.studio-voice-pane .voice-filter-grid .voice-filter-button-label {
    display: none;
}

.voice-results {
    margin-top: 8px;
    display: grid;
    align-content: start;
    grid-auto-rows: max-content;
    max-height: 354px;
    gap: 6px;
    overflow-y: auto;
    padding-right: 4px;
}

.studio-voice-pane .voice-results {
    min-height: 0;
    max-height: none;
    flex: 1;
}

.my-voice-results {
    max-height: 268px;
}

.voice-row {
    display: grid;
    min-width: 0;
    min-height: 56px;
    cursor: pointer;
    grid-template-columns: auto minmax(0, 1fr) 82px auto auto;
    align-items: center;
    gap: 8px;
    border: 1px solid #e3e3e8;
    border-radius: 8px;
    background: #fff;
    padding: 8px;
    transition: border-color 160ms ease, background-color 160ms ease, box-shadow 160ms ease, transform 160ms ease;
}

.studio-voice-pane .voice-row {
    grid-template-columns: auto minmax(0, 1fr) 66px 34px 34px;
    align-items: center;
}

.voice-changer-voice-list .voice-row {
    grid-template-columns: auto minmax(0, 1fr) 66px 34px 30px;
}

.voice-changer-voice-list {
    max-height: 260px;
}

.studio-voice-pane .voice-preview-inline {
    grid-column: auto;
    min-width: 0;
    width: 100%;
}

.voice-row:hover,
.voice-row.is-active,
.voice-row:has(input:checked) {
    border-color: rgba(99, 102, 241, 0.5);
    background: #f7f7ff;
    box-shadow: 0 10px 30px rgba(99, 102, 241, 0.08);
}

.voice-row:active { transform: scale(0.995); }

.voice-row-select {
    position: relative;
    display: inline-flex;
    min-height: 30px;
    width: 30px;
    align-items: center;
    justify-content: center;
    border: 1px solid #dadae5;
    border-radius: 7px;
    background: #fff;
    padding: 0;
    color: #666675;
}

.voice-row-select::after {
    position: absolute;
    left: 9px;
    top: 5px;
    width: 8px;
    height: 14px;
    content: '';
    opacity: 0;
    transform: rotate(45deg) scale(0.86);
    border: solid currentColor;
    border-width: 0 2px 2px 0;
    transition: opacity 140ms ease, transform 140ms ease;
}

.voice-row.is-active .voice-row-select,
.voice-row:has(input:checked) .voice-row-select {
    border-color: #171719;
    background: #171719;
    color: #fff;
}

.voice-row.is-active .voice-row-select::after,
.voice-row:has(input:checked) .voice-row-select::after {
    opacity: 1;
    transform: rotate(45deg) scale(1);
}

.voice-avatar {
    display: inline-flex;
    height: 30px;
    width: 30px;
    align-items: center;
    justify-content: center;
    border-radius: 999px;
    background: #f1f1f4;
    color: #6366f1;
}

.voice-row-main {
    display: block;
    min-width: 0;
}

.voice-row-title,
.voice-row-meta,
.voice-row-note {
    display: block;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.voice-row-title {
    color: #171719;
    font-size: 13px;
    font-weight: 840;
}

.voice-row-meta,
.voice-row-note {
    margin-top: 2px;
    color: #666675;
    font-size: 11px;
    font-weight: 680;
}

.voice-tags {
    margin-top: 3px;
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
}

.studio-voice-pane .voice-tags {
    display: none;
}

.voice-tags span {
    border-radius: 999px;
    background: #f1f1f4;
    padding: 1px 5px;
    color: #666675;
    font-size: 9.5px;
    font-weight: 820;
}

.voice-preview-inline {
    min-width: 70px;
}

.voice-waveform {
    position: relative;
    display: block;
    height: 18px;
    overflow: hidden;
    border-radius: 5px;
    background: repeating-linear-gradient(90deg, #d9d9e4 0 3px, transparent 3px 7px);
    opacity: 0.9;
}

.voice-waveform::after {
    position: absolute;
    inset: 0;
    content: '';
    background: linear-gradient(180deg, transparent 0 18%, #fff 18% 28%, transparent 28% 46%, #fff 46% 57%, transparent 57% 72%, #fff 72% 82%, transparent 82% 100%);
    opacity: 0.72;
}

.voice-waveform > span {
    position: absolute;
    inset: 0 auto 0 0;
    z-index: 1;
    width: 0;
    border-radius: inherit;
    background: repeating-linear-gradient(90deg, #6366f1 0 3px, transparent 3px 7px);
    transition: width 120ms linear;
}

.voice-preview-button {
    display: inline-flex;
    min-width: 34px;
    height: 34px;
    align-items: center;
    justify-content: center;
    gap: 0;
    border: 1px solid #e3e3e8;
    border-radius: 999px;
    background: #fff;
    padding: 0;
    color: #33333c;
    font-size: 0;
    font-weight: 800;
    transition: background-color 160ms ease, color 160ms ease, border-color 160ms ease, transform 160ms ease;
}

.voice-preview-button:hover,
.voice-preview-button.is-playing {
    border-color: #171719;
    background: #171719;
    color: #fff;
}

.voice-preview-button:active { transform: scale(0.98); }

.voice-preview-button [data-preview-label] {
    display: none;
}

.voice-empty-state {
    margin-top: 10px;
    display: flex;
    min-height: 118px;
    align-items: center;
    justify-content: center;
    gap: 8px;
    border: 1px dashed #c8c8d2;
    border-radius: 8px;
    background: #fff;
    color: #666675;
    font-size: 13px;
    font-weight: 720;
}

.voice-library-shell {
    display: grid;
    gap: 14px;
}

.voice-library-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 16px;
}

.voice-library-metrics {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 8px;
}

.voice-library-metrics span {
    display: inline-flex;
    min-height: 34px;
    align-items: center;
    gap: 5px;
    border: 1px solid #e3e3e8;
    border-radius: 7px;
    background: #f8f8fa;
    padding: 7px 10px;
    color: #666675;
    font-size: 12px;
    font-weight: 760;
}

.voice-library-metrics strong {
    color: #171719;
    font-weight: 900;
}

.voice-library-section {
    display: grid;
    gap: 10px;
}

.voice-library-section-title {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    color: #171719;
    font-size: 13px;
    font-weight: 880;
}

.voice-library-section-title a {
    color: #6366f1;
    font-size: 12px;
    font-weight: 800;
}

.voice-explore-panel {
    padding: 12px;
}

.voice-library-filter {
    display: grid;
    gap: 10px;
}

.voice-library-filter-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.voice-library-filter-grid {
    display: grid;
    grid-template-columns: minmax(220px, 1.3fr) repeat(4, minmax(140px, 0.72fr)) auto;
    gap: 8px;
}

.voice-favorite-filter {
    display: inline-flex;
    min-height: 34px;
    cursor: pointer;
    align-items: center;
    gap: 7px;
    border: 1px solid #e3e3e8;
    border-radius: 7px;
    background: #fff;
    padding: 7px 10px;
    color: #33333c;
    font-size: 12.5px;
    font-weight: 780;
}

.voice-favorite-filter input {
    height: 14px;
    width: 14px;
    border-radius: 4px;
    color: #6366f1;
}

.voice-card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(238px, 1fr));
    gap: 10px;
}

.voice-card-grid-compact {
    grid-template-columns: repeat(auto-fill, minmax(218px, 1fr));
}

.voice-library-results {
    margin-top: 12px;
    max-height: min(72vh, 760px);
    overflow-y: auto;
    padding-right: 4px;
}

.voice-card {
    display: grid;
    min-width: 0;
    gap: 10px;
    border: 1px solid #e3e3e8;
    border-radius: 8px;
    background: #fff;
    padding: 12px;
    box-shadow: 0 1px 2px rgba(17, 17, 24, 0.035);
}

.voice-card:hover {
    border-color: rgba(99, 102, 241, 0.42);
    box-shadow: 0 12px 28px rgba(99, 102, 241, 0.07);
}

.voice-card-topline,
.voice-card-preview,
.voice-card-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

.voice-card-topline {
    justify-content: space-between;
}

.voice-card-title {
    min-width: 0;
    overflow: hidden;
    color: #171719;
    font-size: 14px;
    font-weight: 890;
    line-height: 1.25;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.voice-card-title:hover {
    color: #6366f1;
}

.voice-card-meta {
    min-width: 0;
    overflow: hidden;
    color: #666675;
    font-size: 11.5px;
    font-weight: 700;
    line-height: 1.35;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.voice-card-tags {
    display: flex;
    min-height: 20px;
    flex-wrap: wrap;
    gap: 4px;
}

.voice-card-tags span {
    border-radius: 999px;
    background: #f1f1f4;
    padding: 2px 6px;
    color: #666675;
    font-size: 10px;
    font-weight: 820;
}

.voice-card-preview .voice-waveform {
    flex: 1;
}

.voice-card-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
}

.voice-favorite-button.is-active {
    border-color: rgba(225, 29, 72, 0.36);
    background: #fff1f2;
    color: #e11d48;
}

.voice-favorite-button.is-active [data-favorite-icon] {
    color: #e11d48;
    font-variation-settings: 'FILL' 1, 'wght' 650, 'GRAD' 0, 'opsz' 24;
}

.voice-favorite-button:disabled {
    cursor: progress;
    opacity: 0.65;
}

.voice-library-load-state {
    display: contents;
}

.voice-library-load-state.hidden {
    display: none;
}

.voice-card-skeleton,
.voice-card-skeleton:hover {
    border-color: #e3e3e8;
    box-shadow: none;
    pointer-events: none;
}

.voice-load-more {
    grid-column: 1 / -1;
    width: 100%;
}

.voice-load-sentinel {
    grid-column: 1 / -1;
}

.is-shaking {
    animation: ui-shake 420ms ease;
}

@keyframes ui-shake {
    20%, 60% { transform: translateX(-2px); }
    40%, 80% { transform: translateX(2px); }
}

.voice-detail-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(280px, 360px);
    gap: 14px;
    align-items: start;
}

.voice-detail-main,
.voice-detail-side {
    padding: 16px;
}

.voice-detail-main {
    display: grid;
    gap: 18px;
}

.voice-detail-hero {
    display: flex;
    align-items: center;
    gap: 16px;
}

.voice-detail-avatar {
    display: inline-flex;
    height: 64px;
    width: 64px;
    flex: 0 0 auto;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    background: #f1f1f4;
    color: #6366f1;
}

.voice-detail-avatar .material-symbols-outlined {
    font-size: 30px;
}

.voice-detail-player {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 12px;
    align-items: center;
    border: 1px solid #e3e3e8;
    border-radius: 8px;
    background: #f8f8fa;
    padding: 12px;
}

.voice-detail-player .voice-waveform {
    height: 26px;
}

.voice-detail-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.voice-detail-side {
    display: grid;
    gap: 10px;
}

.voice-detail-stat {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    border-bottom: 1px solid #e3e3e8;
    padding-bottom: 10px;
}

.voice-detail-stat span {
    color: #666675;
    font-size: 12px;
    font-weight: 780;
}

.voice-detail-stat strong {
    color: #171719;
    font-size: 13px;
    font-weight: 880;
    text-align: right;
}

.voice-detail-filter-links {
    display: grid;
    gap: 7px;
    padding-top: 4px;
}

.voice-detail-filter-links a {
    display: flex;
    align-items: center;
    justify-content: space-between;
    border: 1px solid #e3e3e8;
    border-radius: 7px;
    padding: 8px 10px;
    color: #33333c;
    font-size: 12.5px;
    font-weight: 780;
}

.voice-detail-filter-links a:hover {
    background: #f1f1f4;
}

.voice-load-state {
    display: grid;
    gap: 6px;
}

.voice-load-state.hidden {
    display: none;
}

.voice-load-sentinel {
    min-height: 1px;
}

.voice-load-more {
    width: 100%;
}

.voice-row-skeleton,
.voice-row-skeleton:hover {
    cursor: default;
    border-color: #e3e3e8;
    background: #fff;
    box-shadow: none;
    pointer-events: none;
    transform: none;
}

.skeleton-block {
    position: relative;
    display: block;
    overflow: hidden;
    border-radius: 999px;
    background: #ececf2;
}

.skeleton-block::after {
    position: absolute;
    inset: 0;
    content: '';
    transform: translateX(-100%);
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.78), transparent);
    animation: voice-skeleton-shimmer 1.2s ease-in-out infinite;
}

.skeleton-avatar {
    height: 30px;
    width: 30px;
}

.skeleton-title {
    height: 12px;
    width: min(78%, 220px);
}

.skeleton-line {
    margin-top: 7px;
    height: 9px;
    width: min(58%, 170px);
}

.skeleton-wave {
    height: 18px;
    width: 100%;
    border-radius: 5px;
}

.skeleton-button {
    height: 34px;
    width: 34px;
}

@keyframes voice-skeleton-shimmer {
    100% {
        transform: translateX(100%);
    }
}

@media (prefers-reduced-motion: reduce) {
    .skeleton-block::after {
        animation: none;
    }
}

.voice-capture-grid {
    margin-top: 10px;
    display: grid;
    gap: 10px;
}

.studio-textarea {
    min-height: 150px;
    width: 100%;
    resize: vertical;
    border: 0;
    border-radius: 8px;
    background: #fff;
    padding: 2px 0 16px;
    font-size: 15.5px;
    line-height: 1.5;
    outline: none;
    transition: box-shadow 160ms ease;
}

.studio-textarea-large {
    min-height: clamp(220px, 34vh, 300px);
    flex: 1;
    padding: 4px 0 18px;
    font-size: 16px;
}

.studio-textarea:focus { box-shadow: none; }

.form-control {
    width: 100%;
    border-radius: 7px;
    border-color: #e3e3e8;
    background-color: #fff;
    color: #171719;
    font-size: 13px;
    font-weight: 600;
    transition: border-color 160ms ease, box-shadow 160ms ease;
    min-height: 38px;
    padding-top: 7px;
    padding-bottom: 7px;
}

select.form-control {
    padding-right: 34px;
}

.search-datalist-control {
    position: relative;
    min-width: 0;
}

.search-datalist-input {
    padding-right: 34px;
}

.search-datalist-input::-webkit-calendar-picker-indicator {
    display: none !important;
    opacity: 0;
}

.search-datalist-icon {
    pointer-events: none;
    position: absolute;
    right: 9px;
    top: 50%;
    transform: translateY(-50%);
    color: #6f717d;
    font-size: 18px;
    line-height: 1;
}

textarea.form-control {
    min-height: 84px;
}

.form-control:focus {
    border-color: #6366f1;
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.12);
}

.password-field {
    position: relative;
    display: block;
    margin-top: 7px;
}

.password-field .form-control {
    margin-top: 0;
    padding-right: 42px;
}

.password-toggle {
    position: absolute;
    right: 6px;
    top: 50%;
    z-index: 2;
    display: inline-flex;
    height: 32px;
    width: 32px;
    transform: translateY(-50%);
    align-items: center;
    justify-content: center;
    border-radius: 7px;
    color: #666675;
    transition: background-color 160ms ease, color 160ms ease;
}

.password-toggle:hover {
    background: #f1f1f4;
    color: #171719;
}

.password-toggle .material-symbols-outlined { font-size: 18px; }

input[type='checkbox'].form-control {
    height: 18px;
    width: 18px;
    border-radius: 4px;
}

.field-label,
.control-label {
    display: block;
    color: #33333c;
    font-size: 12px;
    font-weight: 760;
}

.control-label .form-control { margin-top: 7px; }
.field-label .form-control { margin-top: 7px; }

.field-error {
    margin-top: 6px;
    color: #b42318;
    font-size: 12px;
    font-weight: 700;
}

.message {
    display: flex;
    align-items: center;
    gap: 8px;
    border-radius: 8px;
    border: 1px solid #e3e3e8;
    background: #fff;
    padding: 10px 12px;
    font-size: 12.5px;
    font-weight: 750;
}

.message-success { border-color: #bbf7d0; background: #f0fdf4; color: #166534; }
.message-error { border-color: #fecaca; background: #fef2f2; color: #b42318; }

.history-results.is-loading {
    opacity: 0.55;
    pointer-events: none;
}

.upload-dropzone {
    position: relative;
    display: flex;
    min-height: 116px;
    cursor: pointer;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    border: 1px dashed #c8c8d2;
    border-radius: 8px;
    background: #f8f8fa;
    padding: 16px;
    text-align: center;
    transition: border-color 160ms ease, background-color 160ms ease;
}

.upload-dropzone:hover {
    border-color: #6366f1;
    background: #f4f4ff;
}

.upload-dropzone input[type='file'] {
    position: absolute;
    inset: 0;
    cursor: pointer;
    opacity: 0;
}

.floating-player {
    position: fixed;
    bottom: 24px;
    left: 50%;
    z-index: 60;
    display: grid;
    grid-template-columns: 40px minmax(0, 1fr) max-content 28px 28px;
    width: min(92vw, 640px);
    transform: translateX(-50%);
    align-items: center;
    gap: 12px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 24px;
    background: #08080a;
    padding: 10px 12px;
    color: white;
    box-shadow: 0 24px 70px rgba(0, 0, 0, 0.26);
    transition: opacity 220ms ease, transform 220ms ease;
}

.floating-player.translate-y-24 {
    transform: translateX(-50%) translateY(96px) !important;
}

.floating-player.is-visible {
    transform: translateX(-50%) translateY(0) !important;
}

.floating-player-toggle,
.floating-player-action {
    justify-self: center;
    flex: 0 0 auto;
}

.floating-player .floating-player-toggle {
    border: 1px solid rgba(255, 255, 255, 0.82);
    background: #ffffff;
    color: #08080a;
}

.floating-player .floating-player-toggle:hover {
    background: #f4f4f6;
    color: #08080a;
}

html[data-theme='dark'] .floating-player .floating-player-toggle {
    border: 1px solid rgba(99, 102, 241, 0.6);
    background: #181820;
    color: #ffffff;
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.06), 0 0 0 5px rgba(99, 102, 241, 0.18);
}

html[data-theme='dark'] .floating-player .floating-player-toggle:hover {
    background: #232333;
    color: #ffffff;
}

.floating-player-body {
    display: grid;
    min-width: 0;
    gap: 7px;
}

#floating-title {
    display: block;
    max-width: 100%;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    direction: auto;
    unicode-bidi: plaintext;
    line-height: 1.25;
}

.floating-player-time {
    min-width: 54px;
    text-align: right;
    white-space: nowrap;
}

.floating-player.is-visible {
    pointer-events: auto;
    transform: translateX(-50%) translateY(0);
    opacity: 1;
}

.floating-player.is-auto-ready #floating-toggle {
    box-shadow: 0 0 0 5px rgba(99, 102, 241, 0.28);
}

[data-floating-progress-track]:focus-visible {
    outline: 2px solid #a5b4fc;
    outline-offset: 3px;
}

[data-floating-progress-track] {
    touch-action: none;
    user-select: none;
}

#floating-progress {
    pointer-events: none;
    transition: width 80ms linear;
}

[data-floating-progress-track].is-scrubbing #floating-progress {
    transition: none;
}

.line-clamp-2 {
    display: -webkit-box;
    line-clamp: 2;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

html[data-theme='dark'] .app-sidebar,
html[data-theme='dark'] .app-topbar,
html[data-theme='dark'] .panel,
html[data-theme='dark'] .stat-card,
html[data-theme='dark'] .auth-card,
html[data-theme='dark'] .dashboard-stat-card,
html[data-theme='dark'] .dashboard-flow-step,
html[data-theme='dark'] .dashboard-sample-card,
html[data-theme='dark'] .dashboard-voice-card,
html[data-theme='dark'] .dashboard-empty-card,
html[data-theme='dark'] .dropdown-panel,
html[data-theme='dark'] .sample-card,
html[data-theme='dark'] .sample-history-card,
html[data-theme='dark'] .voice-picker,
html[data-theme='dark'] .voice-tabs,
html[data-theme='dark'] .voice-tab,
html[data-theme='dark'] .voice-row,
html[data-theme='dark'] .voice-filter-bar,
html[data-theme='dark'] .voice-capture-card,
html[data-theme='dark'] .voice-empty-state,
html[data-theme='dark'] .voice-preview-button,
html[data-theme='dark'] .role-card,
html[data-theme='dark'] .speech-upload-panel,
html[data-theme='dark'] .speech-result-panel,
html[data-theme='dark'] .avatar-builder,
html[data-theme='dark'] .avatar-result-panel,
html[data-theme='dark'] .avatar-step-card,
html[data-theme='dark'] .avatar-source-tabs,
html[data-theme='dark'] .avatar-audio-card,
html[data-theme='dark'] .avatar-profile-card,
html[data-theme='dark'] .avatar-filter-pill,
html[data-theme='dark'] .avatar-page-link,
html[data-theme='dark'] .avatar-search-field,
html[data-theme='dark'] .avatar-empty-choice,
html[data-theme='dark'] .avatar-upload-preview,
html[data-theme='dark'] .avatar-generate-bar,
html[data-theme='dark'] .avatar-settings-grid .control-label,
html[data-theme='dark'] .image-render-panel,
html[data-theme='dark'] .image-settings-grid .control-label,
html[data-theme='dark'] .image-enhance-toggle,
html[data-theme='dark'] .image-preview-stage,
html[data-theme='dark'] .image-recent-card,
html[data-theme='dark'] .image-recent-thumb,
html[data-theme='dark'] .image-recent-placeholder,
html[data-theme='dark'] .speech-recorder-card,
html[data-theme='dark'] .speech-file-pill,
html[data-theme='dark'] .speech-record-status,
html[data-theme='dark'] .speech-status-badge,
html[data-theme='dark'] .speech-transcript-output,
html[data-theme='dark'] .speech-metric-card,
html[data-theme='dark'] .speech-empty-result,
html[data-theme='dark'] .speech-recent-item,
html[data-theme='dark'] .form-control,
html[data-theme='dark'] .studio-textarea,
html[data-theme='dark'] .upload-dropzone,
html[data-theme='dark'] .message {
    border-color: #2a2a32;
    background-color: #111115;
    color: #f4f4f6;
}

html[data-theme='dark'] .app-topbar {
    background: rgba(17, 17, 21, 0.92);
}

html[data-theme='dark'] .dashboard-hero {
    background: linear-gradient(135deg, #111115 0%, #141421 54%, #101f1d 100%);
}

html[data-theme='dark'] .dashboard-kicker {
    background: rgba(129, 140, 248, 0.16);
    color: #c7d2fe;
}

html[data-theme='dark'] .dashboard-stat-value,
html[data-theme='dark'] .dashboard-voice-name {
    color: #f4f4f6;
}

html[data-theme='dark'] .dashboard-stat-icon,
html[data-theme='dark'] .dashboard-flow-icon,
html[data-theme='dark'] .dashboard-voice-avatar,
html[data-theme='dark'] .dashboard-voice-tags span {
    background: #202028;
}

html[data-theme='dark'] .dashboard-voice-avatar-male {
    background: linear-gradient(135deg, #1e1b4b 0%, #172554 100%);
}

html[data-theme='dark'] .dashboard-voice-avatar-female {
    background: linear-gradient(135deg, #134e4a 0%, #083344 100%);
}

html[data-theme='dark'] .dashboard-voice-avatar-robot {
    background: linear-gradient(135deg, #1f2937 0%, #0f172a 100%);
}

html[data-theme='dark'] .dashboard-voice-generate {
    background: #818cf8;
    color: #101014;
}

html[data-theme='dark'] .dashboard-voice-generate:hover {
    background: #a5b4fc;
}

html[data-theme='dark'] .dashboard-voice-card:hover {
    border-color: rgba(129, 140, 248, 0.72);
    background: #171728;
    box-shadow: 0 14px 34px rgba(0, 0, 0, 0.22);
}

html[data-theme='dark'] .app-main,
html[data-theme='dark'] .bg-surface {
    background-color: #0d0d10 !important;
}

html[data-theme='dark'] .bg-white,
html[data-theme='dark'] .bg-panel {
    background-color: #111115 !important;
}

html[data-theme='dark'] .bg-indigo-50,
html[data-theme='dark'] .bg-orange-100 {
    background-color: rgba(99, 102, 241, 0.16) !important;
}

html[data-theme='dark'] .text-ink {
    color: #f4f4f6 !important;
}

html[data-theme='dark'] .text-muted {
    color: #a8a8b6 !important;
}

html[data-theme='dark'] .border-line {
    border-color: #2a2a32 !important;
}

html[data-theme='dark'] .audio-recent-row-completed.border-line {
    border-color: rgba(34, 197, 94, 0.42) !important;
}

html[data-theme='dark'] .audio-recent-row-processing.border-line,
html[data-theme='dark'] .audio-recent-row-queued.border-line {
    border-color: rgba(129, 140, 248, 0.36) !important;
}

html[data-theme='dark'] .audio-recent-row-failed.border-line {
    border-color: rgba(248, 113, 113, 0.4) !important;
}

html[data-theme='dark'] .audio-recent-row-completed [data-recent-row-player].icon-button {
    border-color: rgba(74, 222, 128, 0.4);
    background-color: rgba(22, 101, 52, 0.28) !important;
    color: #86efac;
}

html[data-theme='dark'] .studio-voice-pane,
html[data-theme='dark'] .studio-generate-bar,
html[data-theme='dark'] .avatar-builder-head,
html[data-theme='dark'] .avatar-result-header,
html[data-theme='dark'] .image-generation-head,
html[data-theme='dark'] .image-preview-header {
    border-color: #2a2a32;
}

html[data-theme='dark'] .nav-link,
html[data-theme='dark'] .tool-pill,
html[data-theme='dark'] .icon-button,
html[data-theme='dark'] .theme-toggle,
html[data-theme='dark'] .password-toggle,
html[data-theme='dark'] .voice-tab,
html[data-theme='dark'] .voice-preview-button,
html[data-theme='dark'] .avatar-source-tab {
    color: #a8a8b6;
}

html[data-theme='dark'] .nav-link:hover,
html[data-theme='dark'] .nav-link-active,
html[data-theme='dark'] .tool-pill:hover,
html[data-theme='dark'] .tool-pill-active,
html[data-theme='dark'] .icon-button:hover,
html[data-theme='dark'] .theme-toggle:hover,
html[data-theme='dark'] .password-toggle:hover,
html[data-theme='dark'] .voice-tab:hover,
html[data-theme='dark'] .voice-tab.is-active,
html[data-theme='dark'] .avatar-source-tab:hover,
html[data-theme='dark'] .avatar-source-tab.is-active,
html[data-theme='dark'] .avatar-filter-pill:hover,
html[data-theme='dark'] .avatar-filter-pill.is-active,
html[data-theme='dark'] .avatar-page-link:hover,
html[data-theme='dark'] .avatar-page-link.is-active,
html[data-theme='dark'] .voice-preview-button:hover,
html[data-theme='dark'] .voice-preview-button.is-playing,
html[data-theme='dark'] .profile-trigger:hover,
html[data-theme='dark'] .profile-trigger[aria-expanded='true'] {
    background: #202028;
    color: #fff;
}

html[data-theme='dark'] .topbar-button,
html[data-theme='dark'] .secondary-button,
html[data-theme='dark'] .danger-button,
html[data-theme='dark'] .prompt-chip,
html[data-theme='dark'] .theme-toggle,
html[data-theme='dark'] .sidebar-favorites-button,
html[data-theme='dark'] .sidebar-favorite-item,
html[data-theme='dark'] .selected-voice-card,
html[data-theme='dark'] .selected-generation-voice,
html[data-theme='dark'] .voice-row-select {
    border-color: #2a2a32;
    background: #111115;
    color: #f4f4f6;
}

html[data-theme='dark'] .topbar-button:hover,
html[data-theme='dark'] .secondary-button:hover,
html[data-theme='dark'] .prompt-chip:hover,
html[data-theme='dark'] .sidebar-favorites-button:hover,
html[data-theme='dark'] .sidebar-favorites-button[aria-expanded='true'] {
    background: #202028;
}

html[data-theme='dark'] .sidebar-favorites-icon {
    background: #202028;
    color: #c7c7d4;
}

html[data-theme='dark'] .sidebar-favorites-button.has-favorites .sidebar-favorites-icon {
    background: rgba(225, 29, 72, 0.16);
    color: #fb7185;
}

html[data-theme='dark'] .sidebar-favorite-main span {
    color: #f4f4f6;
}

html[data-theme='dark'] .sidebar-favorite-main small,
html[data-theme='dark'] .sidebar-favorites-empty {
    color: #a8a8b6;
}

html[data-theme='dark'] .sidebar-favorite-progress {
    background: #272731;
}

html[data-theme='dark'] .voice-filter-clear {
    background: #202028;
    color: #c7c7d4;
}

html[data-theme='dark'] .selected-voice-card-icon {
    background: #202028;
    color: #c7c7d4;
}

html[data-theme='dark'] .selected-voice-card-main strong,
html[data-theme='dark'] .selected-generation-voice strong,
html[data-theme='dark'] .avatar-builder-head strong,
html[data-theme='dark'] .avatar-step-heading strong,
html[data-theme='dark'] .avatar-audio-card strong,
html[data-theme='dark'] .avatar-profile-name,
html[data-theme='dark'] .avatar-empty-choice strong,
html[data-theme='dark'] .avatar-empty-result strong {
    color: #f4f4f6;
}

html[data-theme='dark'] .selected-voice-eyebrow,
html[data-theme='dark'] .selected-voice-card-main small,
html[data-theme='dark'] .studio-generation-context,
html[data-theme='dark'] .avatar-builder-head small,
html[data-theme='dark'] .avatar-step-heading small,
html[data-theme='dark'] .avatar-audio-card small {
    color: #a8a8b6;
}

html[data-theme='dark'] .avatar-selected-strip > span,
html[data-theme='dark'] .avatar-library-count,
html[data-theme='dark'] .avatar-empty-frame,
html[data-theme='dark'] .avatar-audio-icon,
html[data-theme='dark'] .avatar-profile-thumb,
html[data-theme='dark'] .avatar-upload-preview-empty .material-symbols-outlined {
    background: #202028;
}

html[data-theme='dark'] .avatar-page-panel {
    background: linear-gradient(180deg, #111115 0%, #101014 100%);
}

html[data-theme='dark'] .avatar-main-shell,
html[data-theme='dark'] .app-main:has(.avatar-main-shell),
html[data-theme='dark'] .avatar-workspace {
    background: #0d0d10;
}

html[data-theme='dark'] .avatar-upload-preview-empty strong {
    color: #f4f4f6;
}

html[data-theme='dark'] .avatar-search-field input {
    color: #f4f4f6;
}

html[data-theme='dark'] .avatar-profile-card.is-active {
    border-color: rgba(45, 212, 191, 0.72);
    background: linear-gradient(180deg, rgba(20, 184, 166, 0.16), rgba(37, 99, 235, 0.1)), #111115;
    box-shadow: 0 16px 34px rgba(20, 184, 166, 0.14);
}

html[data-theme='dark'] .avatar-profile-card.is-active .avatar-profile-name {
    color: #5eead4;
}

html[data-theme='dark'] .sample-card:hover,
html[data-theme='dark'] .sample-card.is-active,
html[data-theme='dark'] .sample-history-card:hover,
html[data-theme='dark'] .sample-history-card.is-active,
html[data-theme='dark'] .clone-sample-item:has(input:checked),
html[data-theme='dark'] .voice-row:hover,
html[data-theme='dark'] .voice-row.is-active,
html[data-theme='dark'] .voice-row:has(input:checked),
html[data-theme='dark'] .role-card:hover,
html[data-theme='dark'] .role-card.is-active,
html[data-theme='dark'] .role-card:has(input:checked) {
    border-color: rgba(129, 140, 248, 0.72);
    background: #171728;
    box-shadow: 0 14px 34px rgba(0, 0, 0, 0.22);
}

html[data-theme='dark'] .voice-row.is-active .voice-row-select,
html[data-theme='dark'] .voice-row:has(input:checked) .voice-row-select {
    border-color: #818cf8;
    background: #818cf8;
    color: #101014;
}

html[data-theme='dark'] .voice-count-pill,
html[data-theme='dark'] .voice-tab-count,
html[data-theme='dark'] .voice-avatar,
html[data-theme='dark'] .voice-tags span {
    background: #202028;
    color: #c7c7d4;
}

html[data-theme='dark'] .voice-tab.is-active .voice-tab-count {
    background: rgba(255, 255, 255, 0.14);
    color: #fff;
}

html[data-theme='dark'] .voice-row-title {
    color: #f4f4f6;
}

html[data-theme='dark'] .voice-library-metrics span,
html[data-theme='dark'] .voice-favorite-filter,
html[data-theme='dark'] .voice-card,
html[data-theme='dark'] .voice-detail-player,
html[data-theme='dark'] .voice-detail-filter-links a {
    border-color: #2a2a32;
    background: #111115;
    color: #f4f4f6;
}

html[data-theme='dark'] .voice-library-metrics strong,
html[data-theme='dark'] .voice-library-section-title,
html[data-theme='dark'] .voice-card-title,
html[data-theme='dark'] .voice-detail-stat strong {
    color: #f4f4f6;
}

html[data-theme='dark'] .voice-card-meta,
html[data-theme='dark'] .voice-detail-stat span {
    color: #a8a8b6;
}

html[data-theme='dark'] .voice-card-tags span,
html[data-theme='dark'] .voice-detail-avatar,
html[data-theme='dark'] .voice-favorite-button.is-active {
    background: #202028;
    color: #c7c7d4;
}

html[data-theme='dark'] .voice-favorite-button.is-active {
    background: rgba(225, 29, 72, 0.14);
    color: #fb7185;
}

html[data-theme='dark'] .voice-favorite-button.is-active [data-favorite-icon] {
    color: #fb7185;
}

html[data-theme='dark'] .voice-card:hover,
html[data-theme='dark'] .voice-favorite-button.is-active {
    border-color: rgba(251, 113, 133, 0.72);
}

html[data-theme='dark'] .voice-row-meta,
html[data-theme='dark'] .voice-row-note {
    color: #a8a8b6;
}

html[data-theme='dark'] .voice-row-skeleton,
html[data-theme='dark'] .voice-row-skeleton:hover {
    border-color: #2a2a32;
    background: #111115;
    box-shadow: none;
}

html[data-theme='dark'] .clone-sample-rename-panel {
    border-color: #292934;
    background: #181820;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

html[data-theme='dark'] .clone-sample-delete:hover {
    border-color: rgba(248, 113, 113, 0.35);
    background: rgba(127, 29, 29, 0.24);
    color: #fca5a5;
}

html[data-theme='dark'] .skeleton-block {
    background: #202028;
}

html[data-theme='dark'] .skeleton-block::after {
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.08), transparent);
}

html[data-theme='dark'] .voice-waveform {
    background: repeating-linear-gradient(90deg, #333340 0 3px, transparent 3px 7px);
}

html[data-theme='dark'] .voice-waveform::after {
    background: linear-gradient(180deg, transparent 0 18%, #111115 18% 28%, transparent 28% 46%, #111115 46% 57%, transparent 57% 72%, #111115 72% 82%, transparent 82% 100%);
}

html[data-theme='dark'] .form-control,
html[data-theme='dark'] .studio-textarea {
    background-color: #0d0d10;
}

html[data-theme='dark'] .speech-upload-dropzone {
    background: linear-gradient(180deg, #111115 0%, #15151d 100%);
}

html[data-theme='dark'] .speech-panel-icon,
html[data-theme='dark'] .speech-upload-icon,
html[data-theme='dark'] .speech-empty-icon,
html[data-theme='dark'] .speech-recent-icon {
    background: #171728;
    color: #a5b4fc;
}

html[data-theme='dark'] .speech-panel-heading strong,
html[data-theme='dark'] .image-generation-head strong,
html[data-theme='dark'] .speech-result-header strong,
html[data-theme='dark'] .speech-recorder-header strong,
html[data-theme='dark'] .speech-recent-item strong,
html[data-theme='dark'] .speech-upload-title,
html[data-theme='dark'] .speech-file-pill strong,
html[data-theme='dark'] .speech-empty-result strong {
    color: #f4f4f6;
}

html[data-theme='dark'] .speech-status-completed {
    background: rgba(16, 185, 129, 0.14);
    color: #6ee7b7;
}

html[data-theme='dark'] .speech-record-status.is-attached {
    background: rgba(16, 185, 129, 0.14);
    color: #6ee7b7;
}

html[data-theme='dark'] .speech-record-status.is-recording {
    background: rgba(248, 113, 113, 0.12);
    color: #fca5a5;
}

html[data-theme='dark'] .speech-record-actions [data-record-stop].is-stop-cue {
    border-color: #fca5a5;
    color: #fca5a5;
}

html[data-theme='dark'] .image-generation-head small,
html[data-theme='dark'] .image-prompt-label .field-label,
html[data-theme='dark'] .image-render-heading span,
html[data-theme='dark'] .image-generation-context,
html[data-theme='dark'] .image-recent-card p:last-child {
    color: #a8a8b6;
}

html[data-theme='dark'] .image-model-pill {
    background: rgba(20, 184, 166, 0.14);
    color: #5eead4;
}

html[data-theme='dark'] .image-generation-form textarea.form-control {
    border-color: #2a2a32;
    background: #0d0d10;
}

html[data-theme='dark'] .image-preview-stage {
    background:
        linear-gradient(45deg, rgba(129, 140, 248, 0.07) 25%, transparent 25%, transparent 75%, rgba(129, 140, 248, 0.07) 75%),
        linear-gradient(45deg, rgba(45, 212, 191, 0.06) 25%, transparent 25%, transparent 75%, rgba(45, 212, 191, 0.06) 75%),
        #0d0d10;
    background-position: 0 0, 12px 12px;
    background-size: 24px 24px;
}

html[data-theme='dark'] .image-preview-output {
    box-shadow: 0 18px 44px rgba(0, 0, 0, 0.38);
}

html[data-theme='dark'] .image-recent-card:hover {
    border-color: rgba(45, 212, 191, 0.52);
    background: #171728;
}

html[data-theme='dark'] .speech-status-failed,
html[data-theme='dark'] .speech-failed-state {
    border-color: rgba(248, 113, 113, 0.34);
    background: rgba(248, 113, 113, 0.12);
    color: #fca5a5;
}

html[data-theme='dark'] .form-control::placeholder,
html[data-theme='dark'] .studio-textarea::placeholder {
    color: #797988;
}

html[data-theme='dark'] .upload-dropzone:hover {
    border-color: #818cf8;
    background: #171728;
}

html[data-theme='dark'] .message-success {
    border-color: rgba(34, 197, 94, 0.32);
    background: rgba(34, 197, 94, 0.12);
    color: #86efac;
}

html[data-theme='dark'] .message-error,
html[data-theme='dark'] .danger-button:hover {
    border-color: rgba(248, 113, 113, 0.34);
    background: rgba(248, 113, 113, 0.12);
    color: #fca5a5;
}

@media (max-width: 1180px) {
    .studio-workspace {
        height: auto;
        min-height: 0;
        overflow: visible;
        grid-template-columns: 1fr;
    }

    .studio-compose-pane {
        min-height: 520px;
        padding-right: 0;
    }

    .studio-voice-pane {
        margin-top: 16px;
        border-left: 0;
        border-top: 1px solid #e3e3e8;
        padding-left: 0;
        padding-top: 16px;
    }

    .studio-voice-pane .voice-picker {
        min-height: 560px;
    }

    .studio-voice-pane .voice-results {
        max-height: min(52vh, 520px);
    }

    .speech-text-workspace {
        grid-template-columns: minmax(0, 1fr);
    }

    .clone-voice-workspace {
        grid-template-columns: minmax(0, 1fr);
    }

    .image-generation-workspace {
        grid-template-columns: minmax(0, 1fr);
    }

    .image-preview-panel {
        min-height: 0;
    }

    .speech-result-panel {
        min-height: 0;
    }

    .speech-submit-row {
        grid-template-columns: minmax(0, 1fr);
    }
}

@media (min-width: 1280px) {
    .history-workspace {
        grid-template-columns: minmax(0, 1.08fr) minmax(420px, 0.92fr);
    }
}

@media (max-width: 900px) {
    .app-sidebar {
        display: none;
    }

    .app-topbar {
        left: 0;
        padding: 0 12px;
    }

    .app-main {
        margin-left: 0;
    }

    .mobile-nav-button {
        display: inline-flex;
    }

    .topbar-button {
        display: none;
    }

    .voice-filter-grid {
        grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    }

    .voice-filter-grid .secondary-button {
        justify-content: center;
    }

    .studio-settings-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .image-recent-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

}

@media (max-width: 640px) {
    .app-topbar {
        gap: 8px;
    }

    .auth-card {
        padding: 20px;
    }

    .dropdown-panel {
        position: fixed;
        left: 12px;
        right: 12px;
        top: 64px;
        width: auto;
    }

    .floating-player {
        bottom: 12px;
        grid-template-columns: 40px minmax(0, 1fr) 28px 28px;
        width: calc(100vw - 24px);
        gap: 10px;
    }

    .floating-player-time {
        display: none;
    }

    .voice-picker {
        padding: 10px;
    }

    .studio-compose-pane {
        min-height: 0;
    }

    .studio-textarea-large {
        min-height: clamp(210px, 32dvh, 260px);
    }

    .studio-settings-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .image-settings-grid,
    .image-meta-grid,
    .image-recent-grid {
        grid-template-columns: 1fr;
    }

    .image-generation-head {
        align-items: flex-start;
    }

    .image-model-pill {
        display: none;
    }

    .image-preview-stage,
    .image-empty-result {
        min-height: 260px;
    }

    .studio-generate-bar {
        flex-direction: column;
        align-items: stretch;
    }

    .studio-generation-context,
    .selected-generation-voice {
        width: 100%;
    }

    .selected-generation-voice strong {
        max-width: min(260px, 52vw);
    }

    .studio-generate-bar .primary-button {
        width: 100%;
    }

    .voice-tabs {
        grid-template-columns: 1fr;
    }

    .voice-filter-grid {
        grid-template-columns: 1fr;
    }

    .studio-voice-pane .voice-filter-grid,
    .studio-voice-pane .voice-filter-grid.voice-filter-grid-has-accent {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .studio-voice-pane .voice-filter-grid .secondary-button {
        padding: 7px 11px;
    }

    .studio-voice-pane .voice-filter-grid .voice-filter-button-label {
        display: inline;
    }

    .sidebar-favorites-panel {
        left: 0;
        top: calc(100% + 8px);
        width: min(360px, calc(100vw - 24px));
    }

    .voice-row {
        grid-template-columns: auto minmax(0, 1fr) auto auto;
        align-items: start;
    }

    .studio-voice-pane .voice-row {
        grid-template-columns: auto minmax(0, 1fr) auto auto;
    }

    .voice-row-select {
        width: 32px;
    }

    .voice-library-heading,
    .voice-library-filter-header,
    .voice-detail-hero {
        align-items: stretch;
        flex-direction: column;
    }

    .voice-library-filter-grid,
    .voice-detail-layout,
    .voice-detail-player {
        grid-template-columns: 1fr;
    }

    .voice-library-results {
        max-height: 620px;
    }

    .voice-preview-inline {
        grid-column: 2 / -1;
        width: 100%;
    }

    .studio-voice-pane .voice-preview-inline {
        grid-column: 2 / -1;
    }

    .voice-preview-button {
        min-width: 36px;
        padding: 7px;
    }

    .voice-preview-button [data-preview-label] {
        display: none;
    }
}

@media (max-width: 640px) {
    html,
    body {
        max-width: 100%;
        overflow-x: hidden;
    }

    body {
        -webkit-text-size-adjust: 100%;
    }

    .app-main {
        height: calc(100dvh - 56px);
        overflow-x: hidden;
        -webkit-overflow-scrolling: touch;
    }

    .app-main > div,
    .studio-main-shell,
    .studio-summary-grid,
    .voice-library-shell,
    .history-workspace,
    .speech-text-workspace,
    .clone-voice-workspace,
    .image-generation-workspace,
    .voice-detail-layout {
        min-width: 0;
    }

    .studio-summary-grid {
        grid-template-columns: minmax(0, 1fr) !important;
    }

    .studio-summary-grid > * {
        min-width: 0;
    }

    .app-main > div {
        padding-right: 12px;
        padding-left: 12px;
    }

    .panel,
    .auth-card,
    .voice-library-heading,
    .voice-explore-panel,
    .voice-detail-main,
    .voice-detail-side,
    .speech-upload-panel,
    .speech-result-panel {
        border-radius: 10px;
    }

    .app-topbar {
        min-width: 0;
    }

    .app-topbar > div:first-child {
        min-width: 0;
        flex: 1 1 auto;
    }

    .app-topbar > div:last-child {
        flex: 0 0 auto;
        gap: 6px;
    }

    .profile-trigger span:not(.material-symbols-outlined):not(:first-child),
    .profile-trigger .truncate {
        display: none;
    }

    .profile-trigger {
        padding: 4px;
    }

    .mobile-nav-panel {
        max-height: calc(100dvh - 82px);
        overflow-y: auto;
    }

    .tool-nav {
        position: sticky;
        top: 0;
        z-index: 12;
        flex-wrap: nowrap !important;
        overflow-x: auto;
        overflow-y: hidden;
        padding: 8px 10px;
        scroll-padding-inline: 10px;
        scroll-snap-type: x proximity;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
    }

    .tool-nav::-webkit-scrollbar {
        display: none;
    }

    .tool-nav .tool-pill {
        min-height: 34px;
        flex: 0 0 auto;
        justify-content: center;
        padding: 7px 11px;
        scroll-snap-align: start;
        white-space: nowrap;
    }

    .tool-nav .tool-pill .material-symbols-outlined {
        font-size: 17px;
    }

    .form-control,
    .studio-textarea,
    .speech-transcript-output,
    .primary-button,
    .secondary-button,
    .danger-button,
    .icon-button,
    .voice-preview-button,
    .prompt-chip,
    .tool-pill {
        min-height: 40px;
    }

    .primary-button,
    .secondary-button,
    .danger-button {
        min-width: 0;
    }

    .studio-prompt-row,
    .image-prompt-row {
        display: flex;
        flex-wrap: nowrap;
        gap: 8px;
        overflow-x: auto;
        overflow-y: hidden;
        padding-bottom: 2px;
        scroll-padding-inline: 2px;
        scroll-snap-type: x proximity;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
    }

    .studio-prompt-row::-webkit-scrollbar,
    .image-prompt-row::-webkit-scrollbar {
        display: none;
    }

    .prompt-chip {
        flex: 0 0 auto;
        justify-content: center;
        max-width: min(220px, 74vw);
        scroll-snap-align: start;
        white-space: nowrap;
        text-align: center;
    }

    .speech-upload-panel,
    .speech-result-panel,
    .voice-detail-main,
    .voice-detail-side,
    .voice-explore-panel,
    .voice-library-heading {
        padding: 14px;
    }

    .speech-recorder-header,
    .speech-result-header,
    .image-generation-head,
    .image-render-heading,
    .voice-library-section-title,
    .voice-detail-actions,
    .image-result-actions {
        align-items: stretch;
        flex-direction: column;
    }

    .speech-record-actions,
    .voice-detail-actions,
    .image-result-actions,
    .job-result-actions,
    .panel form.flex {
        display: grid;
        grid-template-columns: 1fr;
        width: 100%;
    }

    .speech-record-actions .secondary-button,
    .voice-detail-actions .primary-button,
    .voice-detail-actions .secondary-button,
    .image-result-actions .primary-button,
    .image-result-actions .secondary-button,
    .job-result-actions .secondary-button,
    .panel form.flex .primary-button,
    .panel form.flex .secondary-button,
    .panel form.flex .danger-button,
    .panel form.flex select {
        width: 100%;
        justify-content: center;
    }

    .panel form.flex select {
        min-width: 0 !important;
    }

    .speech-record-preview,
    audio,
    .voice-detail-player,
    .voice-waveform {
        width: 100%;
        min-width: 0;
    }

    .speech-file-pill {
        width: 100%;
        max-width: 100%;
    }

    .speech-file-pill strong {
        min-width: 0;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    .studio-generate-bar,
    .image-generate-bar,
    .speech-submit-row {
        gap: 10px;
    }

    .studio-generate-bar .primary-button,
    .image-generate-bar .primary-button,
    .speech-submit-row .primary-button {
        min-height: 44px;
    }

    .voice-row,
    .studio-voice-pane .voice-row {
        grid-template-columns: auto minmax(0, 1fr) auto;
        gap: 9px;
    }

    .studio-voice-pane .voice-filter-grid,
    .studio-voice-pane .voice-filter-grid.voice-filter-grid-has-accent {
        display: flex;
        grid-template-columns: none !important;
        flex-wrap: nowrap;
        gap: 6px;
        overflow-x: auto;
        overflow-y: hidden;
        padding-bottom: 2px;
        scroll-padding-inline: 2px;
        scroll-snap-type: x proximity;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
    }

    .studio-voice-pane .voice-filter-grid::-webkit-scrollbar {
        display: none;
    }

    .studio-voice-pane .voice-filter-grid > *,
    .studio-voice-pane .voice-filter-grid .form-control {
        flex: 0 0 118px;
        min-width: 0;
        scroll-snap-align: start;
    }

    .studio-voice-pane .voice-filter-grid .form-control,
    .studio-voice-pane .voice-filter-search-row .form-control {
        min-height: 32px;
        padding: 5px 8px;
        font-size: 11.5px;
    }

    .studio-voice-pane .voice-filter-grid .secondary-button {
        flex: 0 0 34px;
        min-height: 32px;
        width: 34px;
        padding: 0;
    }

    .studio-voice-pane .voice-filter-grid .voice-filter-button-label {
        display: none;
    }

    .studio-voice-pane .voice-results {
        gap: 5px;
    }

    .studio-voice-pane .voice-row {
        min-height: 44px;
        grid-template-columns: 26px minmax(0, 1fr) 30px 28px;
        align-items: center;
        gap: 6px;
        padding: 6px;
    }

    .studio-voice-pane .voice-avatar {
        width: 26px;
        height: 26px;
    }

    .studio-voice-pane .voice-avatar .material-symbols-outlined {
        font-size: 16px;
    }

    .studio-voice-pane .voice-row-title {
        font-size: 12.2px;
        line-height: 1.2;
    }

    .studio-voice-pane .voice-row-meta,
    .studio-voice-pane .voice-row-note {
        margin-top: 1px;
        font-size: 10.5px;
        line-height: 1.25;
    }

    .studio-voice-pane .voice-preview-inline {
        display: none;
    }

    .studio-voice-pane .voice-preview-button {
        grid-column: auto;
        min-height: 30px;
        min-width: 30px;
        width: 30px;
        height: 30px;
        padding: 0;
    }

    .studio-voice-pane .voice-row-select {
        grid-column: auto;
        min-height: 28px;
        width: 28px;
    }

    .voice-row > .voice-row-select {
        grid-column: 3;
    }

    .voice-row .voice-preview-button {
        grid-column: 3;
    }

    .studio-voice-pane .voice-row > .voice-row-select {
        grid-column: 4;
        grid-row: 1;
    }

    .studio-voice-pane .voice-row .voice-preview-button {
        grid-column: 3;
        grid-row: 1;
    }

    .voice-preview-inline {
        grid-column: 2 / -1;
    }

    .clone-sample-item {
        grid-template-columns: minmax(0, 1fr) 32px 32px 32px;
        gap: 6px;
        padding: 7px;
    }

    .clone-sample-item .voice-preview-inline {
        display: none;
    }

    .clone-sample-item > .voice-preview-button {
        grid-column: 2;
    }

    .clone-sample-item > [data-sample-rename-toggle] {
        grid-column: 3;
    }

    .clone-sample-delete {
        grid-column: 4;
    }

    .clone-sample-action,
    .clone-sample-item .voice-preview-button {
        min-height: 32px;
        width: 32px;
        height: 32px;
    }

    .clone-sample-choice {
        gap: 7px;
    }

    .clone-sample-rename-panel {
        grid-template-columns: minmax(0, 1fr);
        gap: 6px;
    }

    .clone-sample-rename-panel .secondary-button {
        width: 100%;
        justify-content: center;
    }

    .voice-card-grid,
    .voice-card-grid-compact,
    .voice-library-results,
    .dashboard-stat-grid,
    .dashboard-flow-grid,
    .image-recent-grid {
        grid-template-columns: 1fr;
    }

    .voice-card,
    .dashboard-voice-card,
    .dashboard-sample-card,
    .dashboard-flow-step,
    .dashboard-stat-card,
    .image-recent-card,
    .speech-recent-item {
        min-width: 0;
    }

    .dashboard-hero-actions,
    .voice-library-metrics,
    .voice-library-filter-header > div:last-child {
        width: 100%;
    }

    .dashboard-hero-actions,
    .voice-library-metrics {
        display: grid;
        grid-template-columns: 1fr;
    }

    .dashboard-hero-actions .primary-button,
    .dashboard-hero-actions .secondary-button,
    .voice-library-filter-header .secondary-button {
        width: 100%;
        justify-content: center;
    }

    .dashboard-voice-card {
        display: grid;
        grid-template-columns: auto minmax(0, 1fr) auto;
        align-items: center;
    }

    .dashboard-voice-actions {
        grid-column: 3;
        flex-direction: column;
    }

    .history-panel > .mb-5,
    .image-recent-panel > .mb-3,
    .speech-recent-panel > .mb-3,
    .panel > .mb-3,
    .panel > .mb-5 {
        align-items: flex-start;
    }

    .history-panel form,
    .panel form[method='get'],
    .voice-library-filter-grid,
    .voice-filter-grid,
    .image-settings-grid,
    .image-meta-grid,
    .studio-voice-pane .studio-settings-grid {
        grid-template-columns: 1fr !important;
    }

    [data-audio-recent-row] {
        display: grid;
        grid-template-columns: auto minmax(0, 1fr);
        align-items: start;
    }

    [data-audio-recent-row] > div:last-child {
        grid-column: 2;
        width: 100%;
        justify-content: flex-start;
    }

    [data-audio-recent-row] .icon-button {
        min-width: 36px;
    }

    .floating-player {
        bottom: max(12px, env(safe-area-inset-bottom));
        border-radius: 18px;
        padding: 8px 9px;
    }
}

@media (max-width: 480px) {
    .app-topbar {
        height: 52px;
    }

    .app-main {
        margin-top: 52px;
        height: calc(100dvh - 52px);
    }

    .app-main > div {
        padding: 10px;
    }

    .tool-nav .tool-pill {
        flex-basis: auto;
    }

    .panel,
    .auth-card,
    .voice-library-heading,
    .voice-explore-panel,
    .voice-detail-main,
    .voice-detail-side,
    .speech-upload-panel,
    .speech-result-panel {
        border-radius: 9px;
    }

    .voice-detail-hero h1,
    .voice-library-heading h1 {
        font-size: 1.5rem;
        line-height: 1.15;
    }

    .dashboard-voice-card {
        grid-template-columns: auto minmax(0, 1fr);
    }

    .dashboard-voice-actions {
        grid-column: 1 / -1;
        flex-direction: row;
        justify-content: flex-start;
        padding-left: 54px;
    }

    .voice-card-topline,
    .speech-panel-heading,
    .speech-result-toolbar {
        align-items: flex-start;
        flex-direction: column;
    }

    .speech-result-toolbar .secondary-button {
        width: 100%;
        justify-content: center;
    }

    .floating-player {
        grid-template-columns: 36px minmax(0, 1fr) 28px;
    }

    .floating-player-action:not(#floating-download) {
        display: none;
    }
}
/* Doodle Explainer builder */
.doodle-workspace {
    display: grid;
    grid-template-columns: minmax(420px, 1fr) minmax(0, 1fr);
    gap: 16px;
    align-items: start;
}

.doodle-builder-form,
.doodle-result-panel {
    display: flex;
    min-width: 0;
    flex-direction: column;
}

.doodle-result-panel {
    position: sticky;
    top: 0;
    min-height: 0;
}

.doodle-name-field {
    display: block;
}

.doodle-scenes {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.doodle-scene-card {
    border: 1px solid #e3e3e8;
    border-radius: 8px;
    background: #f8f8fa;
    padding: 12px;
}

.doodle-scene-head {
    display: flex;
    align-items: center;
    gap: 8px;
}

.doodle-scene-number {
    color: #171719;
    font-size: 13px;
    font-weight: 900;
}

.doodle-scene-duration {
    border-radius: 999px;
    background: #ecfeff;
    padding: 2px 8px;
    color: #0f766e;
    font-size: 11px;
    font-weight: 900;
}

.doodle-scene-actions {
    margin-left: auto;
    display: inline-flex;
    gap: 4px;
}

.doodle-scene-grid {
    margin-top: 10px;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
}

.doodle-scene-column {
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.doodle-scene-label {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: #666675;
    font-size: 11px;
    font-weight: 800;
    text-transform: uppercase;
}

.doodle-scene-label .material-symbols-outlined {
    font-size: 16px;
    color: #6366f1;
}

.doodle-file-field {
    position: relative;
    display: inline-flex;
    width: 100%;
    min-height: 40px;
    align-items: center;
    gap: 8px;
    overflow: hidden;
    cursor: pointer;
    border: 1px dashed #c9c9d6;
    border-radius: 8px;
    background: #fff;
    padding: 8px 10px;
    color: #171719;
    font-size: 12px;
    font-weight: 760;
}

.doodle-file-field input[type='file'] {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
}

.doodle-file-field .material-symbols-outlined {
    font-size: 18px;
    color: #6366f1;
}

.doodle-file-field span:last-child {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.doodle-pick-select {
    font-size: 12px;
}

.doodle-point-stage {
    position: relative;
    overflow: hidden;
    border: 1px solid #e3e3e8;
    border-radius: 8px;
    background: #fff;
    cursor: crosshair;
}

.doodle-point-stage img {
    display: block;
    width: 100%;
    max-height: 240px;
    object-fit: contain;
    background: #fff;
}

.doodle-point-marker {
    position: absolute;
    display: inline-flex;
    height: 22px;
    width: 22px;
    align-items: center;
    justify-content: center;
    border: 2px solid #fff;
    border-radius: 999px;
    transform: translate(-50%, -50%);
    color: #fff;
    font-size: 10px;
    font-weight: 900;
    box-shadow: 0 2px 6px rgba(17, 17, 24, 0.35);
    pointer-events: none;
}

.doodle-point-start {
    background: #16a34a;
}

.doodle-point-end {
    background: #dc2626;
}

.doodle-point-tools {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
}

.doodle-point-mode {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    border: 1px solid #e3e3e8;
    border-radius: 999px;
    background: #fff;
    padding: 4px 10px;
    color: #666675;
    font-size: 11px;
    font-weight: 800;
}

.doodle-point-mode.is-active {
    border-color: #6366f1;
    color: #171719;
}

.doodle-dot {
    display: inline-block;
    height: 8px;
    width: 8px;
    border-radius: 999px;
}

.doodle-dot-start { background: #16a34a; }
.doodle-dot-end { background: #dc2626; }

.doodle-point-hint {
    color: #666675;
    font-size: 11px;
    font-weight: 640;
}

.doodle-scene-audio-preview {
    width: 100%;
    height: 34px;
}

.doodle-scene-audio-preview[hidden],
.doodle-point-stage[hidden],
.doodle-point-tools[hidden] {
    display: none;
}

.doodle-layer-tools {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: 10px;
}

.doodle-layer-tools[hidden] {
    display: none;
}

.doodle-layer-add-row {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.doodle-layer-add {
    padding: 6px 10px;
    font-size: 12px;
}

.doodle-layer-list {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.doodle-layer-row {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 6px;
    border: 1px solid var(--line, #e4e4ec);
    border-radius: 10px;
    background: #fff;
    padding: 6px 8px;
}

.doodle-layer-kind {
    flex: 0 0 auto;
    min-width: 28px;
    border-radius: 8px;
    background: #eef1f7;
    color: #3b4254;
    font-size: 11px;
    font-weight: 800;
    text-align: center;
    padding: 4px 5px;
}

.doodle-layer-text {
    flex: 1 1 140px;
    min-width: 120px;
    height: 32px;
    font-size: 12px;
}

.doodle-layer-font {
    flex: 0 0 auto;
    width: 108px;
    height: 32px;
    font-size: 12px;
}

.doodle-layer-size {
    flex: 0 0 auto;
    width: 74px;
    accent-color: #4b5563;
}

.doodle-layer-color {
    flex: 0 0 auto;
    width: 30px;
    height: 30px;
    padding: 0;
    border: 1px solid var(--line, #e4e4ec);
    border-radius: 8px;
    background: transparent;
}

.doodle-layer-actions {
    display: flex;
    gap: 2px;
    margin-left: auto;
}

.doodle-layer-overlay {
    position: absolute;
    max-width: 92%;
    cursor: grab;
    user-select: none;
    touch-action: none;
    line-height: 1.2;
    white-space: pre-wrap;
    border: 1px dashed transparent;
    border-radius: 6px;
    padding: 1px 3px;
    z-index: 4;
}

.doodle-layer-overlay:hover,
.doodle-layer-overlay.is-dragging {
    border-color: rgba(59, 130, 246, 0.75);
    background: rgba(59, 130, 246, 0.08);
    cursor: grabbing;
}

.doodle-layer-overlay img {
    display: block;
    pointer-events: none;
    max-width: 100%;
}

.doodle-layer-overlay.is-invalid {
    border-color: rgba(220, 38, 38, 0.7);
}

html[data-theme='dark'] .doodle-layer-row {
    border-color: #33333e;
    background: #17171c;
}

html[data-theme='dark'] .doodle-layer-kind {
    background: #26262e;
    color: #cfd3e0;
}

.doodle-layer-image-name {
    flex: 1 1 120px;
    min-width: 100px;
    font-size: 12px;
    font-weight: 640;
    color: #666675;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

@font-face {
    font-family: 'Caveat';
    src: url('../fonts/doodle/Caveat.ttf') format('truetype');
    font-display: swap;
}

@font-face {
    font-family: 'Patrick Hand';
    src: url('../fonts/doodle/PatrickHand.ttf') format('truetype');
    font-display: swap;
}

@font-face {
    font-family: 'Shadows Into Light';
    src: url('../fonts/doodle/ShadowsIntoLight.ttf') format('truetype');
    font-display: swap;
}

@font-face {
    font-family: 'Kalam';
    src: url('../fonts/doodle/Kalam.ttf') format('truetype');
    font-display: swap;
}

@font-face {
    font-family: 'Indie Flower';
    src: url('../fonts/doodle/IndieFlower.ttf') format('truetype');
    font-display: swap;
}

.doodle-editor-layers-panel {
    display: flex;
    flex-direction: column;
    gap: 8px;
    border: 1px solid var(--line, #e4e4ec);
    border-radius: 12px;
    background: #fff;
    padding: 12px;
    flex: 0 1 auto;
    min-height: 0;
    overflow: hidden;
}

.doodle-editor-layers {
    display: flex;
    flex-direction: column;
    gap: 4px;
    overflow-y: auto;
    max-height: 220px;
    min-height: 0;
}

.doodle-editor-layer-item {
    display: flex;
    align-items: center;
    gap: 7px;
    border: 1px solid var(--line, #e4e4ec);
    border-radius: 8px;
    background: #fff;
    padding: 5px 8px;
    cursor: pointer;
    text-align: left;
    width: 100%;
}

.doodle-editor-layer-item.is-active {
    border-color: #3b82f6;
    background: rgba(59, 130, 246, 0.07);
}

.doodle-editor-layer-number {
    flex: 0 0 auto;
    min-width: 20px;
    border-radius: 6px;
    background: #1d2733;
    color: #fff;
    font-size: 10px;
    font-weight: 800;
    text-align: center;
    padding: 2px 4px;
}

.doodle-editor-layer-label {
    flex: 1 1 auto;
    min-width: 0;
    font-size: 12px;
    font-weight: 640;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    color: #3b4254;
}

html[data-theme='dark'] .doodle-editor-layers-panel,
html[data-theme='dark'] .doodle-editor-layer-item {
    background: #1c1c22;
    border-color: #33333e;
}

html[data-theme='dark'] .doodle-editor-layer-label {
    color: #cfd3e0;
}

.doodle-editor-modal {
    position: fixed;
    inset: 0;
    z-index: 90;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(15, 17, 24, 0.72);
    padding: 18px;
}

.doodle-editor-modal[hidden] {
    display: none;
}

body.doodle-editor-open {
    overflow: hidden;
}

.doodle-editor-shell {
    display: flex;
    flex-direction: column;
    gap: 10px;
    width: min(1180px, 100%);
    max-height: 94vh;
    border-radius: 16px;
    background: var(--surface, #f6f7fa);
    border: 1px solid var(--line, #e4e4ec);
    padding: 14px;
    overflow: auto;
}

.doodle-editor-topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 10px;
}

.doodle-editor-topbar strong {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 15px;
    font-weight: 800;
}

.doodle-editor-topbar-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.doodle-editor-topbar-actions .secondary-button,
.doodle-editor-topbar-actions .primary-button {
    padding: 7px 12px;
    font-size: 12px;
}

.doodle-editor-body {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 240px;
    gap: 12px;
    align-items: start;
}

.doodle-editor-stage-wrap {
    display: flex;
    justify-content: center;
    min-width: 0;
}

.doodle-editor-stage {
    position: relative;
    width: fit-content;
    max-width: 100%;
    border-radius: 12px;
    overflow: hidden;
    border: 1px solid var(--line, #e4e4ec);
    background:
        linear-gradient(45deg, #eceef3 25%, transparent 25%, transparent 75%, #eceef3 75%),
        linear-gradient(45deg, #eceef3 25%, #fff 25%, #fff 75%, #eceef3 75%);
    background-size: 22px 22px;
    background-position: 0 0, 11px 11px;
    min-height: 200px;
}

.doodle-editor-stage > img[data-editor-image] {
    display: block;
    max-width: 100%;
    max-height: 68vh;
    width: auto;
    height: auto;
    user-select: none;
}

.doodle-editor-overlay {
    z-index: 6;
}

.doodle-editor-overlay.is-selected {
    border-color: rgba(59, 130, 246, 0.95);
    background: rgba(59, 130, 246, 0.1);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.25);
}

.doodle-editor-side {
    display: flex;
    flex-direction: column;
    gap: 10px;
    max-height: 74vh;
    min-width: 0;
}

.doodle-editor-props {
    display: flex;
    flex-direction: column;
    gap: 10px;
    border: 1px solid var(--line, #e4e4ec);
    border-radius: 12px;
    background: #fff;
    padding: 12px;
    flex: 0 0 auto;
}

.doodle-editor-props[hidden] {
    display: none;
}

.doodle-editor-props-title {
    font-size: 12px;
    font-weight: 800;
    text-transform: uppercase;
    color: #666675;
}

.doodle-editor-props label {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.doodle-editor-props input[type='color'] {
    width: 44px;
    height: 34px;
    padding: 0;
    border: 1px solid var(--line, #e4e4ec);
    border-radius: 8px;
    background: transparent;
}

.doodle-editor-props input[type='range'] {
    accent-color: #4b5563;
}

.doodle-editor-props-actions {
    display: flex;
    gap: 4px;
}

.doodle-editor-hint {
    font-size: 11px;
    font-weight: 640;
    color: #666675;
    text-align: center;
}

.doodle-editor-slides-panel {
    display: flex;
    flex-direction: column;
    gap: 8px;
    border: 1px solid var(--line, #e4e4ec);
    border-radius: 12px;
    background: #fff;
    padding: 12px;
    flex: 1 1 auto;
    min-height: 0;
    overflow: hidden;
}

.doodle-editor-slides {
    display: flex;
    flex-direction: column;
    gap: 8px;
    overflow-y: auto;
    padding: 2px;
    min-height: 0;
}

.doodle-editor-slide {
    position: relative;
    flex: 0 0 auto;
    width: 100%;
    height: 96px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid var(--line, #e4e4ec);
    border-radius: 10px;
    background: #fff;
    overflow: hidden;
    cursor: pointer;
    padding: 0;
    color: #9a9aa8;
}

.doodle-editor-slide img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    pointer-events: none;
}

.doodle-editor-slide.is-active {
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.25);
}

.doodle-editor-slide:disabled {
    cursor: not-allowed;
    opacity: 0.55;
}

.doodle-editor-slide-number {
    position: absolute;
    left: 6px;
    bottom: 5px;
    min-width: 20px;
    border-radius: 6px;
    background: rgba(15, 17, 24, 0.78);
    color: #fff;
    font-size: 11px;
    font-weight: 800;
    text-align: center;
    padding: 1px 5px;
    pointer-events: none;
}

html[data-theme='dark'] .doodle-editor-slide {
    background: #1c1c22;
    border-color: #33333e;
}

html[data-theme='dark'] .doodle-editor-slides-panel {
    background: #1c1c22;
    border-color: #33333e;
}

html[data-theme='dark'] .doodle-editor-shell {
    background: #17171c;
    border-color: #33333e;
}

html[data-theme='dark'] .doodle-editor-stage {
    background: #101014;
    border-color: #33333e;
}

html[data-theme='dark'] .doodle-editor-props {
    background: #1c1c22;
    border-color: #33333e;
}

@media (max-width: 860px) {
    .doodle-editor-body {
        grid-template-columns: minmax(0, 1fr);
    }
}

.doodle-add-scene {
    align-self: flex-start;
}

html[data-theme='dark'] .doodle-scene-card {
    border-color: #33333e;
    background: #1c1c22;
}

html[data-theme='dark'] .doodle-file-field,
html[data-theme='dark'] .doodle-point-stage,
html[data-theme='dark'] .doodle-point-mode {
    border-color: #33333e;
    background: #17171c;
    color: #e6e6ee;
}

html[data-theme='dark'] .doodle-scene-number {
    color: #e6e6ee;
}

@media (max-width: 1100px) {
    .doodle-workspace {
        grid-template-columns: minmax(0, 1fr);
    }

    .doodle-result-panel {
        position: static;
    }
}

@media (max-width: 640px) {
    .doodle-scene-grid {
        grid-template-columns: minmax(0, 1fr);
    }
}
