/* === CUSTOM VOICES === */

.custom-voices-hero .app-intro__copy {
    max-width: 880px;
}

.custom-voices-hero h1 {
    max-width: 920px;
}

.custom-voices-hero__actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    margin-top: clamp(1.2rem, 3vw, 1.75rem);
}

.custom-voices-hero__actions .button-primary,
.custom-voices-cta .button-primary {
    width: auto;
    min-height: 48px;
    padding: 0.8rem 1.2rem;
}

.custom-voices-secondary-link {
    color: var(--app-text);
    background: rgba(255, 255, 255, 0.84);
    border-color: var(--app-border);
    box-shadow: var(--app-shadow-sm);
}

.custom-voices-secondary-link:hover {
    color: var(--app-text);
    background: rgba(255, 255, 255, 0.84);
    border-color: var(--app-border-strong);
}

.custom-voices-steps {
    align-self: end;
}

.custom-voices-public {
    display: grid;
}

.custom-voices-overview {
    display: grid;
    gap: clamp(1.25rem, 3vw, 2rem);
    padding: clamp(1.25rem, 4vw, 2rem);
}

.custom-voices-overview h2 {
    max-width: 760px;
    margin: 0 0 0.7rem;
    color: var(--app-text);
    font-size: clamp(1.65rem, 4vw, 2.65rem);
    line-height: 1.05;
    letter-spacing: -0.05em;
}

.custom-voices-overview p:not(.eyebrow),
.custom-voice-feature p {
    margin: 0;
    color: var(--app-text-muted);
}

.custom-voices-feature-grid {
    display: grid;
    gap: 0.85rem;
}

.custom-voice-feature {
    padding: clamp(1.15rem, 3vw, 1.5rem);
    border: 1px solid rgba(26, 86, 116, 0.13);
    border-radius: var(--app-radius-md);
    background: rgba(255, 255, 255, 0.74);
}

.custom-voice-feature .icon-pill {
    margin-bottom: 0.85rem;
}

.custom-voice-feature h3 {
    margin-bottom: 0.4rem;
}

.custom-voices-section {
    display: grid;
    gap: clamp(1.15rem, 3vw, 1.75rem);
}

.custom-voices-section__header {
    max-width: 820px;
}

.custom-voices-section__header h2,
.custom-voices-cta h2 {
    margin: 0 0 0.75rem;
    color: var(--app-text);
    font-size: clamp(1.65rem, 4vw, 2.65rem);
    line-height: 1.06;
    letter-spacing: -0.05em;
}

.custom-voices-section__header p:not(.eyebrow),
.custom-voices-cta p {
    margin: 0;
    color: var(--app-text-soft);
    font-size: clamp(0.98rem, 2vw, 1.1rem);
}

.create-voice-section .app-card__header h2 {
    margin-bottom: 0.75rem;
    font-size: clamp(1.65rem, 4vw, 2.65rem);
    line-height: 1.06;
    letter-spacing: -0.05em;
}

.custom-voices-card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 240px), 1fr));
    gap: clamp(0.85rem, 2vw, 1.1rem);
}

.custom-voices-card {
    padding: clamp(1.1rem, 3vw, 1.45rem);
    border: 1px solid rgba(26, 86, 116, 0.13);
    border-radius: var(--app-radius-md);
    background:
        linear-gradient(145deg, rgba(255, 255, 255, 0.96), rgba(247, 250, 255, 0.74)),
        #fff;
    box-shadow: var(--app-shadow-sm);
}

.custom-voices-card .icon-pill {
    margin-bottom: 0.85rem;
}

.custom-voices-card h3,
.custom-voices-compare-card h3,
.custom-voices-prose h3 {
    margin: 0 0 0.45rem;
    color: var(--app-text);
    line-height: 1.22;
    letter-spacing: -0.025em;
}

.custom-voices-card p {
    margin: 0;
    color: var(--app-text-muted);
}

.custom-voices-compare-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: clamp(0.95rem, 3vw, 1.25rem);
}

.custom-voices-compare-card {
    padding: clamp(1.15rem, 3vw, 1.6rem);
    border: 1px solid var(--app-border);
    border-radius: var(--app-radius-lg);
    background:
        linear-gradient(145deg, rgba(255, 255, 255, 0.98), rgba(247, 250, 255, 0.78)),
        #fff;
    box-shadow: var(--app-shadow-md);
}

.custom-voices-compare-card--before {
    border-color: rgba(180, 35, 24, 0.15);
}

.custom-voices-compare-card--after {
    border-color: rgba(2, 122, 72, 0.18);
}

.custom-voices-check-list {
    display: grid;
    gap: 0.7rem;
    margin: 0;
    padding: 0;
    list-style: none;
}

.custom-voices-check-list li {
    display: flex;
    gap: 0.65rem;
    align-items: flex-start;
    color: var(--app-text-soft);
}

.custom-voices-check-list i {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
    width: 24px;
    height: 24px;
    border-radius: 999px;
    font-size: 0.72rem;
}

.custom-voices-compare-card--before i {
    color: #b42318;
    background: rgba(254, 243, 242, 0.92);
}

.custom-voices-compare-card--after i {
    color: #027a48;
    background: rgba(236, 253, 243, 0.92);
}

.custom-voices-table-wrap {
    overflow-x: auto;
    border: 1px solid var(--app-border);
    border-radius: var(--app-radius-lg);
    background: rgba(255, 255, 255, 0.9);
    box-shadow: var(--app-shadow-md);
}

.custom-voices-table {
    width: 100%;
    min-width: 620px;
    border-collapse: collapse;
}

.custom-voices-table th,
.custom-voices-table td {
    padding: clamp(0.85rem, 2vw, 1.1rem);
    text-align: left;
    vertical-align: top;
    border-bottom: 1px solid rgba(16, 24, 40, 0.08);
}

.custom-voices-table th {
    color: var(--app-text);
    background: rgba(234, 242, 255, 0.78);
    font-size: 0.9rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.custom-voices-table td {
    color: var(--app-text-soft);
}

.custom-voices-table tr:last-child td {
    border-bottom: 0;
}

.custom-voices-seo-content {
    scroll-margin-top: 96px;
}

.custom-voices-prose {
    padding: clamp(1.25rem, 4vw, 2rem);
}

.custom-voices-prose p {
    max-width: 880px;
    margin-bottom: 1rem;
    color: var(--app-text-soft);
}

.custom-voices-prose p:last-child {
    margin-bottom: 0;
}

.custom-voices-prose h3 {
    margin-top: clamp(1.2rem, 3vw, 1.6rem);
    font-size: clamp(1.15rem, 2.5vw, 1.35rem);
}

.custom-voices-trust .custom-voices-card {
    background:
        linear-gradient(145deg, rgba(255, 255, 255, 0.98), rgba(234, 242, 255, 0.58)),
        #fff;
}

.custom-voices-faq-list {
    display: grid;
    gap: 0.75rem;
}

.custom-voices-faq details {
    border: 1px solid var(--app-border);
    border-radius: var(--app-radius-md);
    background:
        linear-gradient(145deg, rgba(255, 255, 255, 0.98), rgba(247, 250, 255, 0.72)),
        #fff;
    box-shadow: var(--app-shadow-sm);
}

.custom-voices-faq summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 1rem 1.1rem;
    color: var(--app-text);
    cursor: pointer;
    font-weight: var(--font-weight-bold);
    line-height: 1.3;
    list-style: none;
}

.custom-voices-faq summary::-webkit-details-marker {
    display: none;
}

.custom-voices-faq summary::after {
    flex: 0 0 auto;
    color: var(--app-primary);
    content: "+";
    font-size: 1.25rem;
    font-weight: var(--font-weight-bold);
}

.custom-voices-faq details[open] summary::after {
    content: "-";
}

.custom-voices-faq summary:focus-visible {
    outline: none;
    box-shadow: var(--app-shadow-focus);
}

.custom-voices-faq details p {
    margin: 0;
    padding: 0 1.1rem 1rem;
    color: var(--app-text-muted);
}

#custom-voices-content {
    scroll-margin-top: 96px;
}

.custom-voices-workspace {
    display: grid;
    grid-template-columns: minmax(0, 1.5fr) minmax(300px, 0.72fr);
    gap: clamp(1.5rem, 4vw, 3rem);
    align-items: start;
}

.create-voice-section,
.existing-voices-section {
    min-width: 0;
}

.existing-voices-section {
    position: sticky;
    top: 96px;
}

.create-voice-section .form-group {
    display: grid;
    gap: 0.4rem;
    margin-bottom: 1rem;
    margin-top: 0.5rem;
}

.create-voice-section .helper {
    margin-top: 0;
    margin-bottom: 0.5rem;
}

.recording-section {
    display: grid;
    gap: 0.9rem;
    margin-top: 2rem;
    padding: 1rem;
    border: 1px solid rgba(16, 24, 40, 0.08);
    border-radius: var(--app-radius-md);
    background: rgba(255, 255, 255, 0.64);
}

.recording-section h4 {
    display: flex;
    align-items: center;
    gap: 0.55rem;
    margin: 0;
    color: var(--app-text);
    font-size: 1.02rem;
    line-height: 1.25;
    letter-spacing: -0.02em;
}

.recording-section h4 i {
    color: var(--app-brand);
}

.consent-script-box,
.info-box {
    border: 1px solid var(--app-border);
    border-radius: var(--app-radius-md);
    box-shadow: var(--app-shadow-sm);
}

.consent-script-box {
    padding: 1rem;
    border-color: rgba(0, 98, 255, 0.18);
    background:
        linear-gradient(135deg, rgba(234, 242, 255, 0.92), rgba(255, 255, 255, 0.92)),
        #fff;
}

.consent-label {
    margin: 0 0 0.55rem;
    color: var(--app-brand);
}

.consent-script-text {
    margin: 0;
    color: var(--app-text);
    font-size: 1.02rem;
    font-style: italic;
    line-height: 1.55;
}

.consent-warning {
    margin: 0.75rem 0 0;
    color: var(--app-text-soft);
    font-size: 0.88rem;
}

.consent-warning i {
    color: var(--app-accent);
}

.info-box {
    padding: 1rem;
    background: rgba(247, 250, 255, 0.78);
}

.info-box--compact {
    padding: 0.9rem;
}

.info-box p {
    margin: 0 0 0.55rem;
    color: var(--app-brand);
}

.info-box ul {
    margin: 0;
    padding-left: 1.15rem;
    color: var(--app-text-soft);
}

.info-box li {
    margin-bottom: 0.35rem;
    font-size: 0.92rem;
}

.info-box li:last-child {
    margin-bottom: 0;
}

.audio-controls,
.audio-preview,
.upload-alternative {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    min-width: 0;
}

.audio-controls {
    flex-wrap: wrap;
}

.record-btn,
.stop-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.45rem;
    min-height: 44px;
    padding: 0.75rem 1rem;
    border: 1px solid transparent;
    border-radius: 999px;
    color: #fff;
    cursor: pointer;
    font-weight: var(--font-weight-bold);
    line-height: 1;
    transition: transform 160ms ease, box-shadow 160ms ease, background-color 160ms ease;
}

.record-btn {
    background: linear-gradient(135deg, var(--app-accent), #ff6f00);
    box-shadow: 0 12px 26px rgba(255, 140, 0, 0.22);
}

.record-btn:hover,
.stop-btn:hover {
    transform: translateY(-1px);
}

.record-btn:hover {
    box-shadow: 0 16px 34px rgba(255, 140, 0, 0.28);
}

.record-btn.recording {
    animation: pulse 1s infinite;
}

.stop-btn {
    background: linear-gradient(135deg, #dc3545, #b42318);
    box-shadow: 0 12px 26px rgba(220, 53, 69, 0.2);
}

@keyframes pulse {
    0% { box-shadow: 0 0 0 0 rgba(220, 53, 69, 0.4); }
    70% { box-shadow: 0 0 0 10px rgba(220, 53, 69, 0); }
    100% { box-shadow: 0 0 0 0 rgba(220, 53, 69, 0); }
}

.timer {
    min-height: 40px;
    padding: 0.6rem 0.8rem;
    border: 1px solid rgba(26, 86, 116, 0.12);
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.78);
    color: var(--app-text-muted);
    font-family: ui-monospace, SFMono-Regular, Consolas, "Liberation Mono", monospace;
    font-size: 0.88rem;
    font-weight: var(--font-weight-bold);
}

.audio-preview {
    flex-wrap: wrap;
    padding: 0.85rem;
    border: 1px solid var(--app-border);
    border-radius: var(--app-radius-md);
    background: #fff;
}

.audio-preview audio {
    flex: 1 1 260px;
    width: 100%;
    min-width: 0;
    max-width: 100%;
}

.status-icon {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    color: #027a48;
    font-size: 0.88rem;
    font-weight: var(--font-weight-bold);
}

.upload-alternative {
    flex-wrap: wrap;
    padding-top: 0.85rem;
    border-top: 1px dashed rgba(26, 86, 116, 0.22);
    color: var(--app-text-muted);
    font-size: 0.88rem;
}

.upload-alternative span {
    flex: 1 1 260px;
}

.app-home .button.small,
.app-home .button-sm {
    min-height: 38px;
    padding: 0.6rem 0.85rem;
    font-size: 0.82rem;
}

.app-home .red {
    color: #b42318;
    background: rgba(254, 243, 242, 0.92);
    border-color: rgba(180, 35, 24, 0.18);
}

.app-home .red:hover {
    color: #912018;
    border-color: rgba(180, 35, 24, 0.32);
    background: #fff;
}

.create-voice-action {
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid rgba(16, 24, 40, 0.08);
}

#create-voice-btn:disabled {
    cursor: not-allowed;
    opacity: 0.62;
}

.status-message {
    margin-top: 0.85rem;
    padding: 0.85rem 1rem;
    border: 1px solid var(--app-border);
    border-radius: var(--app-radius-md);
    text-align: center;
    font-weight: var(--font-weight-bold);
}

.status-message.success {
    border-color: rgba(18, 183, 106, 0.24);
    color: #027a48;
    background: rgba(236, 253, 243, 0.86);
}

.status-message.error {
    border-color: rgba(220, 53, 69, 0.26);
    color: #b42318;
    background: rgba(254, 243, 242, 0.88);
}

.loading-indicator,
.empty-state {
    padding: 1.35rem;
    border: 1px solid rgba(26, 86, 116, 0.12);
    border-radius: var(--app-radius-md);
    background: rgba(247, 250, 255, 0.7);
    color: var(--app-text-muted);
    text-align: center;
}

.loading-indicator i {
    margin-right: 0.45rem;
    color: var(--app-primary);
}

.empty-state i {
    margin-bottom: 0.75rem;
    color: rgba(102, 112, 133, 0.5);
    font-size: 2.35rem;
}

.empty-state p {
    margin: 0.25rem 0;
    color: var(--app-text-soft);
}

.empty-state .small {
    color: var(--app-text-muted);
    font-size: 0.88rem;
}

.voices-list {
    display: grid;
    gap: 0.75rem;
    margin: 0;
    padding: 0;
    list-style: none;
}

.voice-item {
    padding: 1rem;
    border: 1px solid rgba(26, 86, 116, 0.13);
    border-radius: var(--app-radius-md);
    background: rgba(255, 255, 255, 0.82);
    transition: transform 160ms ease, box-shadow 160ms ease, border-color 160ms ease;
}

.voice-item:hover {
    transform: translateY(-2px);
    border-color: var(--app-border-strong);
    box-shadow: var(--app-shadow-sm);
}

.voice-item-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 0.8rem;
    margin-bottom: 0.7rem;
}

.voice-name {
    margin: 0;
    color: var(--app-text);
    font-size: 1rem;
    font-weight: var(--font-weight-xbold);
    letter-spacing: -0.02em;
}

.voice-item-actions {
    flex: 0 0 auto;
}

.voice-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 0.55rem;
    color: var(--app-text-muted);
    font-size: 0.84rem;
}

.voice-meta span {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
}

.voice-meta i {
    color: var(--app-brand);
}

.custom-voices-cta {
    position: relative;
    overflow: hidden;
    display: grid;
    gap: 1rem;
    justify-items: start;
    padding: clamp(1.4rem, 5vw, 2.4rem);
}

.custom-voices-cta::before {
    position: absolute;
    inset: auto -5rem -6rem auto;
    width: 16rem;
    height: 16rem;
    border-radius: 999px;
    background: rgba(255, 140, 0, 0.16);
    content: "";
    filter: blur(18px);
}

.custom-voices-cta > * {
    position: relative;
}

@media (min-width: 760px) {
    .custom-voices-feature-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    .custom-voices-card-grid--six {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

@media (max-width: 1040px) {
    .custom-voices-workspace {
        grid-template-columns: 1fr;
    }

    .existing-voices-section {
        position: static;
    }
}

@media (max-width: 760px) {
    .custom-voices-hero__actions .button {
        width: 100%;
    }

    .custom-voices-compare-grid {
        grid-template-columns: 1fr;
    }

    .audio-controls {
        align-items: stretch;
    }

    .audio-controls .record-btn,
    .audio-controls .stop-btn,
    .audio-controls .timer {
        max-width: 100%;
    }

    .custom-voices-table {
        min-width: 560px;
    }
}

@media (max-width: 520px) {
    .recording-section,
    .custom-voice-feature,
    .custom-voices-card,
    .custom-voices-compare-card,
    .custom-voices-faq details,
    .loading-indicator,
    .empty-state,
    .voice-item {
        border-radius: 22px;
    }

    .voice-item-header {
        display: grid;
    }
}
