/* === GLOBAL STYLES === */

* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

img,
svg,
video {
    max-width: 100%;
}

/* === GLOBAL STYLES === */

.page-content {
    width: min(100% - 2rem, var(--landing-container));
    max-width: none;
    margin: 0 auto;
    padding: 0;
    border-radius: 0;
    box-sizing: border-box;
}

.text-box {
    border-radius: var(--radius-md);
    padding: var(--spacing-sm) var(--spacing-xl) 0 var(--spacing-sm);
    margin-bottom: var(--spacing-2xl);
}

/* CSS variables are loaded via variables.css link tag in HTML */

/* ========== BASE STYLES ========== */
body {
    font-family: var(--font-family-base);
    margin: 0;
    padding: 0;
    line-height: 1.6;
    font-size: var(--font-size-base);
    min-height: 100vh;
    color: var(--app-text);
    background:
        radial-gradient(circle at 10% 0%, rgba(0, 98, 255, 0.08), transparent 34rem),
        radial-gradient(circle at 86% 10%, rgba(255, 140, 0, 0.09), transparent 28rem),
        linear-gradient(180deg, #ffffff 0%, var(--app-bg) 58%, #ffffff 100%);
    text-rendering: optimizeLegibility;
    -webkit-font-smoothing: antialiased;
}

/* Screen-reader only text */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 2px;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
    border-radius: var(--radius-sm);
}

/* ========== TYPOGRAPHY ========== */
h1 {
    color: var(--color-h1);
    font-size: var(--font-size-h1);
    font-weight: var(--font-weight-xbold);
    margin-top: var(--spacing-sm);
    margin-bottom: var(--spacing-sm);
    line-height: 1.5;
}

h2 {
    color: var(--color-h2);
    font-size: var(--font-size-h2);
    font-weight: var(--font-weight-semibold);
    margin-top: var(--spacing-xl);
    margin-bottom: var(--spacing-4xl);
    line-height: 1.4;
}

h3 {
    color: var(--color-h3);
    font-size: var(--font-size-h3);
    font-weight: var(--font-weight-semibold);
    margin-top: var(--spacing-6xl);
    margin-bottom: var(--spacing-lg);
    line-height: 1.2;
    letter-spacing: 1.1px;
}

h4 {
    color: var(--color-h3);
    font-size: var(--font-size-mlg);
    font-weight: var(--font-weight-semibold);
    margin-top: var(--spacing-5xl);
    margin-bottom: var(--spacing-lg);
    line-height: 1.2;
}

p {
    margin-top: var(--spacing-sm);
    margin-bottom: var(--spacing-sm);
    color: var(--color-text-primary);
}

a {
    color: var(--color-h2);
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
    text-decoration-thickness: 2px;
    text-underline-offset: 4px;
}

small {
    font-size: var(--font-size-xs);
    color: var(--color-text-tertiary);
}

small.helper {
    display: block;
    color: var(--color-text-tertiary);
    margin-top: var(--spacing-sm);
    font-size: var(--font-size-xs);
}

/* ========== FORM ELEMENTS ========== */
input[type="email"],
input[type="password"],
input[type="text"],
input[type="number"] {
    margin-bottom: 10px;
    display: block;
    padding: var(--spacing-sm);
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    border: 1px solid var(--color-border-input);
    border-radius: var(--radius-sm);
}

select,
input[type="text"],
textarea {
    width: 100%;
    padding: var(--spacing-sm) 10px;
    border: 1px solid var(--color-border-input);
    border-radius: var(--radius-xl);
    box-sizing: border-box;
    font-size: var(--font-size-base);
    font-family: inherit;
}

textarea {
    min-height: 220px;
    resize: vertical;
}

label {
    display: block;
    margin-bottom: var(--spacing-xs);
    font-weight: var(--font-weight-normal);
    font-size: var(--font-size-sm);
    color: var(--color-text-secondary);
}

input[type="file"]:disabled {
    cursor: not-allowed;
    opacity: 0.6;
}

.form-group {
    margin-bottom: var(--spacing-xl);
    display: block;
}

/* ========== BUTTONS ========== */
/* Unified button styles - use class="button" on any element to style as a button */
.button {
    display: inline-block;
    padding: var(--spacing-sm) var(--spacing-md);
    background-color: var(--color-bg-blue);
    color: var(--color-text-white);
    border: none;
    border-radius: var(--radius-lg);
    cursor: pointer;
    margin-right: 10px;
    margin-top: 5px;
    font-family: var(--font-family-base);
    font-weight: var(--font-weight-semibold);
    font-size: var(--font-size-sm);
    transition: background-color var(--transition-base), transform var(--transition-fast);
}

/* Primary button variant - Generate Audio,
Generate Custom Voice */
.button-primary {
    background: linear-gradient(135deg, var(--color-info), var(--color-bg-blue), var(--color-info));
    color: var(--color-text-white);
    margin: var(--spacing-lg) 0;
    padding: var(--spacing-md) var(--spacing-md);
}

.button-primary:hover {
    background-color: var(--color-info-swal-darker);
    font-weight: var(--font-weight-bold);
}

/* Block button variant */
.button--block {
    display: block;
    width: 100%;
    box-sizing: border-box;
    font-family: var(--font-family-base);
}

.button:hover {
    background-color: var(--color-info-swal-darker);
    color: var(--color-text-white);
    transform: translateY(-1px);
}

.button:disabled,
.button[disabled],
.button.disabled {
    background-color: #b3d7ff;
    cursor: not-allowed;
    opacity: 0.7;
}

.button.disabled:hover {
    background-color: #b3d7ff;
    transform: none;
}

/* Remove text decoration from button links */
a.button {
    text-decoration: none;
}

a.button:hover {
    text-decoration: none;
}

/* Small button variant (for compact buttons like Clear Text) */
.button-sm {
    font-size: var(--font-size-xs);
    padding: var(--spacing-sm) var(--spacing-lg);
    margin: 0;
    border: 1px solid var(--color-border-dark);
    background-color: var(--color-bg-lighter);
    color: var(--color-text-primary);
}

.button-sm:hover {
    background-color: var(--color-bg-tertiary);
    color: var(--color-text-primary);
}

/* Button color variations */
.button.red {
    background-color: var(--color-accent-red);
    color: var(--color-text-white);
}

.button.red:hover {
    background-color: var(--color-accent-red-hover);
    color: var(--color-text-white);
}

.button.orange {
    background-color: var(--color-accent-orange);
    color: var(--color-text-white);
}

.button.orange:hover {
    background-color: var(--color-accent-orange-hover);
    transform: translateY(-1px);
}

.button.google {
    background-color: var(--color-google);
    color: var(--color-text-white);
}

.button.google:hover {
    background-color: var(--color-google-hover);
    color: var(--color-text-white);
    transform: translateY(-1px);
}

/* Reset Audio Synth. Settings,
Upload Text,
Cleat Text buttons */
.secondary-button {
    background-color: var(--color-bg-tertiary);
    color: var(--color-text-primary);
    font-family: var(--font-family-base);
    flex: 0 0 auto;
    padding: var(--spacing-sm) var(--spacing-lg);
    font-size: var(--font-size-sm);
    white-space: nowrap;
    margin: 0;
}

.secondary-button:hover {
    background-color: var(--color-border-light);
    color: var(--color-text-primary);
}

.secondary-button.disabled {
    background-color: var(--color-secondary-light);
    cursor: not-allowed;
    opacity: 0.7;
}

.secondary-button.disabled:hover {
    background-color: var(--color-secondary-light);
}

/* ========== STATUS MESSAGES ========== */
.success {
    color: var(--color-success);
    font-weight: var(--font-weight-bold);
}

.error {
    color: var(--color-error);
    font-weight: var(--font-weight-bold);
}

.warning {
    color: var(--color-h3);
    font-weight: var(--font-weight-normal);
}

#status-message {
    padding: 15px;
    margin-top: 15px;
    border-radius: var(--radius-md);
    font-weight: var(--font-weight-semibold);
    text-align: center;
}

/* Generic alerts (replaces inline colored boxes) */
.alert {
    display: block;
    padding: 10px 20px;
    border-radius: var(--radius-lg);
    border: 1px solid var(--color-warning-border);
    background-color: var(--color-bg-secondary);
    color: var(--color-text-secondary);
    font-size: var(--font-size-sm);
}

.alert--warning {
    letter-spacing: 0.5px;
    border-left: 4px solid var(--color-accent-orange);
}

.alert--success {
    background-color: var(--color-bg-primary);
    border-color: var(--color-accent-orange);
    color: var(--color-text-secondary);
}

.alert--error {
    background-color: var(--color-error-bg);
    border-color: var(--color-error-border);
    color: var(--color-error-text);
}

.alert a,
.settings-card__header p a,
.guest-account-cta__card a:not(.button) {
    color: var(--app-primary);
    font-weight: var(--font-weight-semibold);
    text-decoration: none;
}

.alert a:hover,
.settings-card__header p a:hover,
.guest-account-cta__card a:not(.button):hover {
    text-decoration: underline;
    text-decoration-thickness: 2px;
    text-underline-offset: 4px;
}

/* Panels (simple card-like blocks used in Home instructions/status) */
.panel {
    border: 1px solid var(--color-border-lighter);
    border-radius: var(--radius-xl);
    padding: 15px 30px 20px;
    box-shadow: var(--shadow-sm);
    margin-left: var(--spacing-md);
}

.panel--muted {
    background-color: var(--color-bg-tertiary);
    border-color: var(--color-border-dark);
}

/* Info text helper */
.text-info {
    color: var(--color-text-light);
}

/* Inline radio group row */
.radio-group {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    margin-top: 8px;
}

/* Home page controls: sliders + radio buttons (use theme accent colors) */
#speed-slider,
#pitch-slider,
#volume-slider,
#mode-short,
#mode-long {
    accent-color: var(--color-primary-dark);
}

#speed-slider:hover,
#pitch-slider:hover,
#volume-slider:hover,
#speed-slider:active,
#pitch-slider:active,
#volume-slider:active,
#speed-slider:focus-visible,
#pitch-slider:focus-visible,
#volume-slider:focus-visible,
#mode-short:hover,
#mode-long:hover,
#mode-short:active,
#mode-long:active,
#mode-short:focus-visible,
#mode-long:focus-visible,
#mode-short:checked,
#mode-long:checked {
    accent-color: var(--color-bg-blue);
}

/* Hidden file input used with <label for="..."> buttons */
.file-input-hidden {
    display: none;
}

/* Full-width wrapper for primary CTA buttons */
.button-wrap {
    width: 100%;
}

/* Byte counter highlighting (over byte limit) */
.byte-counter--overlimit {
    color: var(--color-error);
    font-weight: var(--font-weight-bold);
}

/* Progress bar */
.progress {
    background-color: var(--color-border-dark);
    height: 25px;
    border-radius: 12px;
    overflow: hidden;
    margin: 10px 0;
}

/* ========== UTILITY CLASSES ========== */
.hidden {
    display: none !important;
}

/* ========== SYSTEM BANNER ========== */
#system-banner {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: 0.75rem;
    position: sticky;
    top: 0;
    z-index: 9999;
    box-sizing: border-box;
    padding: 5px 20px;
    background: linear-gradient(135deg, #007bff 0%, #0062ff 100%);
    color: white;
    font-size: 14px;
    font-weight: var(--font-weight-semibold);
    text-align: center;
}

.system-banner__text {
    justify-self: center;
    min-width: 0;
    padding-left: 42px;
    overflow-wrap: anywhere;
}

.system-banner__dismiss {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    margin: 0;
    padding: 0;
    border: 1px solid rgba(255, 255, 255, 0.36);
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.14);
    color: inherit;
    cursor: pointer;
    font: inherit;
    font-size: 22px;
    line-height: 1;
    transition: background-color var(--transition-fast), border-color var(--transition-fast), transform var(--transition-fast);
}

.system-banner__dismiss:hover {
    border-color: rgba(255, 255, 255, 0.72);
    background: rgba(255, 255, 255, 0.22);
    transform: translateY(-1px);
}

.system-banner__dismiss:focus-visible {
    outline: 3px solid rgba(255, 255, 255, 0.72);
    outline-offset: 2px;
}

/* ========== SWEETALERT2 ========== */
.swal2-container {
    font-family: var(--landing-font, var(--font-family-base));
}

.swal2-container.swal2-backdrop-show,
.swal2-container.swal2-noanimation {
    background: rgba(16, 24, 40, 0.48) !important;
    backdrop-filter: blur(8px);
}

body.swal2-toast-shown .swal2-container,
body.swal2-toast-shown .swal2-container.swal2-backdrop-show,
body.swal2-toast-shown .swal2-container.swal2-noanimation {
    background: transparent !important;
    backdrop-filter: none !important;
}

.swal2-popup {
    border: 1px solid var(--landing-border, rgba(16, 24, 40, 0.11)) !important;
    border-radius: var(--landing-radius-xl, 36px) !important;
    background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.98), rgba(247, 250, 255, 0.78)),
    var(--landing-surface-solid, #ffffff) !important;
    box-shadow: var(--landing-shadow-lg, 0 30px 80px rgba(16, 24, 40, 0.14)) !important;
    color: var(--landing-text, #101828) !important;
    padding: clamp(1.35rem, 4vw, 2rem) !important;
}

.swal2-title {
    margin: 0 !important;
    padding: 0 !important;
    color: var(--landing-text, #101828) !important;
    font-size: clamp(1.55rem, 4vw, 2.35rem) !important;
    font-weight: var(--font-weight-xbold) !important;
    line-height: 1.08 !important;
    letter-spacing: -0.045em !important;
}

.swal2-html-container,
.swal2-content {
    margin: 1rem 0 0 !important;
    color: var(--landing-text-soft, #344054) !important;
    font-size: 1rem !important;
    line-height: 1.65 !important;
}

.swal2-html-container p {
    color: inherit;
}

.swal2-html-container strong {
    color: var(--landing-text, #101828);
}

.swal2-actions {
    gap: 0.75rem !important;
    margin: 1.5rem 0 0 !important;
}

.swal2-styled {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    min-height: 46px !important;
    margin: 0 !important;
    padding: 0.78rem 1.15rem !important;
    border: 1px solid transparent !important;
    border-radius: 999px !important;
    box-shadow: none !important;
    font-family: var(--landing-font, var(--font-family-base)) !important;
    font-size: 0.92rem !important;
    font-weight: var(--font-weight-bold) !important;
    line-height: 1 !important;
    transition: transform 160ms ease, box-shadow 160ms ease, background-color 160ms ease, border-color 160ms ease !important;
}

.swal2-actions .swal2-styled[style*="display: none"],
.swal2-actions .swal2-styled[style*="display:none"] {
    display: none !important;
}

.swal2-styled:focus {
    box-shadow: 0 0 0 4px rgba(0, 98, 255, 0.15) !important;
}

.swal2-styled:hover {
    transform: translateY(-1px);
}

.swal2-confirm {
    color: #fff !important;
    background: linear-gradient(135deg, var(--landing-primary, #0062ff), var(--landing-brand, #1a5674)) !important;
    box-shadow: 0 12px 26px rgba(0, 98, 255, 0.2) !important;
}

.swal2-confirm:hover {
    background: linear-gradient(135deg, var(--landing-primary-hover, #004dd1), var(--landing-brand-dark, #004085)) !important;
    box-shadow: 0 16px 34px rgba(0, 98, 255, 0.28) !important;
}

.swal2-deny,
.swal2-confirm.swal2-deny,
.swal2-confirm--danger {
    color: #fff !important;
    background: linear-gradient(135deg, var(--color-accent-red, #dc3545), #b4232f) !important;
    box-shadow: 0 12px 26px rgba(220, 53, 69, 0.18) !important;
}

.swal2-deny:hover,
.swal2-confirm.swal2-deny:hover,
.swal2-confirm--danger:hover {
    background: linear-gradient(135deg, var(--color-accent-red-hover, #c82333), #9f1d29) !important;
    box-shadow: 0 16px 34px rgba(220, 53, 69, 0.24) !important;
}

.swal2-cancel {
    color: var(--landing-text, #101828) !important;
    background: rgba(255, 255, 255, 0.82) !important;
    border-color: var(--landing-border, rgba(16, 24, 40, 0.11)) !important;
    box-shadow: var(--landing-shadow-sm, 0 8px 24px rgba(16, 24, 40, 0.06)) !important;
}

.swal2-cancel:hover {
    color: var(--landing-text, #101828) !important;
    border-color: var(--landing-border-strong, rgba(26, 86, 116, 0.22)) !important;
    background: #fff !important;
}

.swal2-close {
    color: var(--landing-text-muted, #667085) !important;
    transition: color 160ms ease, transform 160ms ease;
}

.swal2-close:hover {
    color: var(--landing-text, #101828) !important;
    transform: translateY(-1px);
}

.swal2-icon {
    margin: 0 auto 1.2rem !important;
    border-width: 0.22rem !important;
    box-shadow: 0 12px 28px rgba(16, 24, 40, 0.08);
}

.swal2-icon.swal2-success {
    border-color: rgba(18, 183, 106, 0.32) !important;
    color: #12b76a !important;
}

.swal2-icon.swal2-error {
    border-color: rgba(220, 53, 69, 0.3) !important;
    color: var(--color-accent-red, #dc3545) !important;
}

.swal2-icon.swal2-warning {
    border-color: rgba(255, 140, 0, 0.35) !important;
    color: var(--landing-accent, #ff8c00) !important;
}

.swal2-icon.swal2-info,
.swal2-icon.swal2-question {
    border-color: rgba(0, 98, 255, 0.28) !important;
    color: var(--landing-primary, #0062ff) !important;
}

.swal2-timer-progress-bar {
    background: linear-gradient(90deg, var(--landing-primary, #0062ff), var(--landing-accent, #ff8c00)) !important;
}

/* SweetAlert2: ensure inputs never overflow the modal width */
.swal2-popup .swal2-input,
.swal2-popup .swal2-textarea,
.swal2-popup .swal2-select {
    box-sizing: border-box !important;
    width: calc(100% - (var(--spacing-md) + var(--spacing-md))) !important;
    max-width: 100% !important;
    min-width: 0 !important;
    margin-left: var(--spacing-md) !important;
    margin-right: var(--spacing-md) !important;
    border: 1px solid var(--landing-border, rgba(16, 24, 40, 0.11)) !important;
    border-radius: var(--landing-radius-md, 18px) !important;
    color: var(--landing-text, #101828) !important;
    background: rgba(255, 255, 255, 0.86) !important;
}

.swal2-popup .swal2-input:focus,
.swal2-popup .swal2-textarea:focus,
.swal2-popup .swal2-select:focus {
    border-color: var(--landing-primary, #0062ff) !important;
    box-shadow: 0 0 0 4px rgba(0, 98, 255, 0.13) !important;
}

.swal2-popup.swal2-toast {
    width: min(100% - 2rem, 420px) !important;
    padding: 0.85rem 1rem !important;
    border-radius: var(--landing-radius-lg, 28px) !important;
    background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.98), rgba(247, 250, 255, 0.86)),
    #fff !important;
    box-shadow: var(--landing-shadow-md, 0 18px 48px rgba(16, 24, 40, 0.1)) !important;
}

.swal2-popup.swal2-toast .swal2-title {
    color: var(--landing-text, #101828) !important;
    font-size: 0.95rem !important;
    font-weight: var(--font-weight-bold) !important;
    letter-spacing: -0.015em !important;
    line-height: 1.35 !important;
}

.swal2-popup.swal2-toast .swal2-icon {
    width: 2rem !important;
    height: 2rem !important;
    min-width: 2rem !important;
    margin: 0 0.7rem 0 0 !important;
    box-shadow: none !important;
}

.swal2-popup.swal2-toast .swal2-timer-progress-bar {
    height: 0.22rem;
}

.progress-info {
    display: grid;
    gap: 0.8rem;
    margin-top: 0.25rem;
}

.swal-progress-track {
    height: 26px;
    overflow: hidden;
    margin: 0.2rem 0;
    border: 1px solid rgba(0, 98, 255, 0.14);
    border-radius: 999px;
    background: rgba(234, 242, 255, 0.86);
}

#swal-progress-status,
#swal-progress-percent {
    margin: 0;
    color: var(--landing-text-soft, #344054);
}

#swal-progress-bar {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100%;
    width: 0%;
    background: linear-gradient(135deg, var(--landing-primary, #0062ff), var(--landing-brand, #1a5674));
    color: #fff;
    font-size: 0.78rem;
    font-weight: var(--font-weight-xbold);
    transition: width 0.3s ease;
}

#swal-progress-bar,
#swal-progress-bar[id] {
    border-radius: 999px;
}

.swal-meta-note {
    margin-top: 0.95rem !important;
    color: var(--landing-text-muted, #667085) !important;
    font-size: 0.95rem !important;
}

.swal-danger-note {
    margin-top: 0.95rem !important;
    color: var(--color-accent-red, #dc3545) !important;
    font-weight: var(--font-weight-bold) !important;
}

.swal-warning-panel {
    margin: 0.75rem 0 1rem;
    padding: 1rem;
    border: 1px solid rgba(255, 140, 0, 0.26);
    border-left: 4px solid var(--landing-accent, #ff8c00);
    border-radius: var(--landing-radius-md, 18px);
    background: rgba(255, 244, 228, 0.86);
    color: #7a4a00;
    text-align: left;
}

.swal-warning-panel p {
    margin: 0 0 0.75rem !important;
    color: inherit !important;
}

.swal-warning-panel p:last-child {
    margin-bottom: 0 !important;
}

.swal-warning-panel__lead {
    font-size: 1.05rem !important;
}

.swal-warning-panel__lead strong {
    color: var(--color-accent-red, #dc3545) !important;
    font-size: 1.12em;
}

.swal-warning-panel ul {
    margin: 0.45rem 0 0;
    padding-left: 1.25rem;
}

.swal-warning-panel li {
    color: #7a4a00;
}

.swal-error-details {
    margin-top: 1rem;
    padding: 0.9rem;
    border: 1px solid var(--landing-border, rgba(16, 24, 40, 0.11));
    border-radius: var(--landing-radius-md, 18px);
    background: rgba(247, 250, 255, 0.8);
    text-align: left;
}

.swal-error-details summary {
    color: var(--landing-text, #101828);
    cursor: pointer;
    font-weight: var(--font-weight-bold);
}

.swal-error-details pre {
    margin: 0.75rem 0 0;
    color: var(--landing-text-soft, #344054);
    font-size: 0.84rem;
    white-space: pre-wrap;
    word-wrap: break-word;
}

/* Simple spacing utility for message blocks */
.notice {
    margin: 15px 0 35px;
    font-size: var(--font-size-sm);
    letter-spacing: 0.5px;
}

.section-title {
    margin-bottom: var(--spacing-lg);
    margin-top: var(--spacing-md);
}

/* ========== LAYOUT ========== */
.h1-background {
    font-weight: var(--font-weight-semibold);
    border-radius: var(--radius-full);
    color: var(--color-text-secondary);
    border: 2px solid var(--color-bg-blue);
    padding: var(--spacing-md) var(--spacing-7xl) var(--spacing-xl);
}

/* ========== HEADER ========== */
#header-placeholder {
    display: contents;
}

.main-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: nowrap;
    position: sticky;
    top: var(--system-banner-offset, 0px);
    z-index: 50;
    max-width: none;
    min-height: 64px;
    margin: 0;
    padding: 6px clamp(var(--spacing-md), 3vw, var(--spacing-7xl));
    border-bottom: 1px solid rgba(16, 24, 40, 0.08);
    background: rgba(255, 255, 255, 0.86);
    box-shadow: 0 8px 24px rgba(16, 24, 40, 0.04);
    backdrop-filter: blur(18px);
    box-sizing: border-box;
    gap: var(--spacing-xl);
}

.brand-logo {
    flex: 0 0 auto;
    min-width: 0;
}

.brand-logo a {
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 0.65rem;
    max-width: 100%;
    transition: transform 0.25s ease, filter 0.25s ease;
    color: #101828;
    font-weight: var(--font-weight-bold);
    letter-spacing: -0.025em;
}

.brand-logo__image {
    display: block;
    width: auto;
    height: 42px;
    max-width: min(100%, 180px);
    object-fit: contain;
    transform: translateY(3px); /* up; use a positive value to move down */
}

.brand-logo a:hover {
    transform: translateY(-2px);
}

.main-nav ul {
    margin: 0;
    padding: 0;
    list-style: none;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: nowrap;
    gap: 0.35rem;
}

.main-nav {
    flex: 1 1 auto;
    min-width: 0;
}

.main-nav li {
    margin: 0;
}

.main-nav a {
    text-decoration: none;
    color: #344054;
    font-weight: var(--font-weight-bold);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 40px;
    padding: 0.65rem 0.8rem;
    border: 1px solid transparent;
    border-radius: 999px;
    font-size: 0.92rem;
    line-height: 1;
    transition: color var(--transition-base), background-color var(--transition-base), border-color var(--transition-base), transform var(--transition-fast);
}

.main-nav a:hover {
    color: var(--color-bg-blue);
    text-decoration: none;
    background-color: rgba(0, 98, 255, 0.06);
    transform: translateY(-1px);
}

.main-nav a.active-page {
    font-weight: var(--font-weight-bold);
    color: #101828;
    background: #fff;
    border-color: rgba(26, 86, 116, 0.18);
    box-shadow: 0 8px 24px rgba(16, 24, 40, 0.06);
}

.header-credits {
    font-weight: var(--font-weight-bold);
    text-decoration: none;
}

.orange-text {
    color: var(--color-accent-orange);
}

.green-text {
    color: var(--color-accent-green);
}

.auth-section {
    display: flex;
    align-items: center;
    gap: 0.55rem;
    flex: 0 1 auto;
    min-width: 0;
    justify-content: flex-end;
    flex-wrap: nowrap;
}

#header-credits-status {
    font-size: var(--font-size-xs);
    color: var(--color-primary);
    white-space: nowrap;
    min-width: 0;
    padding: 0.4rem 0.65rem;
    border: 1px solid rgba(26, 86, 116, 0.14);
    border-radius: 999px;
    background: rgba(234, 242, 255, 0.72);
}

.header-account {
    position: relative;
    flex: 0 0 auto;
}

.header-account-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: auto;
    height: auto;
    margin: 0;
    padding: 0;
    border: 0;
    border-radius: 0;
    background: transparent;
    color: #344054;
    font-size: 32px;
    /* font-size: calc(var(--font-size-xs) * 1.6 + 0.8rem + 2px); */
    line-height: 1;
    cursor: pointer;
    box-shadow: none;
    transition: color var(--transition-base), transform var(--transition-fast);
}

.header-account-btn i {
    display: block;
    width: 1em;
    height: 1em;
    line-height: 1;
}

.header-account-btn:hover,
.header-account-btn[aria-expanded="true"] {
    color: var(--color-bg-blue);
    background: transparent;
}

@media (min-width: 769px) {
    .header-account-btn:hover {
        transform: translateY(-1px);
    }
}

.header-account-btn--signed-in,
.header-account-btn--signed-in:hover,
.header-account-btn--signed-in[aria-expanded="true"] {
    color: var(--color-accent-green);
}

.header-account-menu {
    position: absolute;
    top: calc(100% + 0.4rem);
    right: 0;
    z-index: 90;
    display: grid;
    gap: 0.55rem;
    width: max-content;
    min-width: 210px;
    max-width: calc(100vw - 1.25rem);
    margin: 0;
    padding: 0.65rem;
    border: 1px solid rgba(26, 86, 116, 0.16);
    border-radius: 14px;
    background: #fff;
    box-shadow: 0 12px 32px rgba(16, 24, 40, 0.12);
}

.header-account-menu[hidden] {
    display: none;
}

.header-account-email,
.header-account-link,
.header-account-logout {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    box-sizing: border-box;
    width: 100%;
    margin: 0;
    padding: 0.6rem 0.75rem;
    border-radius: 10px;
    color: #344054;
    font-size: var(--font-size-xs);
    font-weight: var(--font-weight-bold);
    line-height: 1.4;
    text-align: left;
}

.header-account-email {
    background: rgba(234, 242, 255, 0.9);
    white-space: nowrap;
}

.header-account-logout i {
    display: block;
    flex: 0 0 auto;
    width: 1em;
    height: 1em;
    line-height: 1;
    text-align: center;
    transform: translateY(1px);
}

.header-account-logout span {
    line-height: 1;
}

.header-account-link,
.header-account-logout {
    border: 0;
    background: rgba(16, 24, 40, 0.04);
    font-family: inherit;
    text-decoration: none;
    cursor: pointer;
    box-shadow: none;
}

.header-account-link:hover,
.header-account-logout:hover {
    color: #101828;
    background: rgba(0, 98, 255, 0.12);
    text-decoration: none;
}

.workspace-menu-toggle {
    display: none;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
    font-size: 18px;
    width: 38px;
    height: 38px;
    margin: 0;
    padding: 0;
    border: 2px solid rgba(26, 86, 116, 0.16);
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.9);
    color: var(--app-text);
    box-shadow: var(--app-shadow-sm);
    cursor: pointer;
    transition: transform 160ms ease, border-color 160ms ease, box-shadow 160ms ease;
}

@media (min-width: 769px) and (max-width: 1440px) {
    .main-header {
        gap: var(--spacing-md);
        padding-inline: clamp(var(--spacing-md), 2.25vw, var(--spacing-4xl));
    }

    .brand-logo__image {
        max-width: min(100%, 160px);
    }

    .main-nav a {
        padding-inline: 0.65rem;
        font-size: var(--font-size-sm);
    }

    .auth-section {
        gap: 0.45rem;
    }
}

/* ========== FOOTER ========== */ 
.main-footer {
    padding: 3rem var(--spacing-xl) 1.5rem;
    margin-top: var(--spacing-8xl);
    border-top: 1px solid rgba(16, 24, 40, 0.1);
    background-color: #fff;
}

.footer-shell {
    display: grid;
    gap: 2rem;
    align-items: start;
    width: min(100%, var(--container-max-width));
    margin: 0 auto;
}

.footer-brand a {
    display: inline-flex;
    align-items: center;
    gap: 0.65rem;
    color: #101828;
    font-weight: var(--font-weight-bold);
    letter-spacing: -0.025em;
    text-decoration: none;
}

.footer-brand a:hover {
    color: #101828;
    text-decoration: none;
}

.footer-brand .brand-logo__image {
    height: 48px;
}

.footer-brand p {
    max-width: 420px;
    margin: 0.8rem 0 0;
    color: #667085;
    font-size: 0.95rem;
}

.footer-links {
    display: grid;
    grid-template-columns: repeat(2, minmax(120px, 1fr));
    gap: 0.65rem 1.1rem;
    margin-bottom: 0;
}

.footer-links a {
    color: #344054;
    text-decoration: none;
    font-size: var(--font-size-sm);
    font-weight: var(--font-weight-bold);
    margin: 0;
    transition: color var(--transition-base);
}

.footer-links a:hover {
    color: var(--color-bg-blue);
    text-decoration: none;
}

.footer-links a.active-page {
    text-decoration: none;
    font-weight: var(--font-weight-bold);
    color: #101828;
}

.footer-copyright {
    width: min(100%, var(--container-max-width));
    font-size: var(--font-size-sm);
    margin: 2rem auto 0;
    padding-top: 1.25rem;
    border-top: 1px solid rgba(16, 24, 40, 0.08);
    color: #667085;
}

@media (min-width: 720px) {
    .footer-shell {
        grid-template-columns: minmax(260px, 1fr) minmax(320px, 0.8fr);
    }
}

/* ========== TEXT CONTROLS ========== */
.char-count {
    display: inline-block;
    margin: 0;
    padding: 0.32rem 0.55rem;
    border: 1px solid rgba(26, 86, 116, 0.12);
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.76);
    color: var(--app-text-muted);
    font-size: 0.78rem;
    font-weight: var(--font-weight-bold);
}

.text-controls-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 0.55rem;
    gap: 0.6rem;
}

.text-controls-left {
    flex: 0 0 auto;
    display: flex;
    align-items: center;
}

.text-controls-center {
    flex: 0 0 auto;
    display: flex;
    justify-content: center;
}

.text-controls-center button {
    margin: 0;
    height: auto;
}

.text-controls-right {
    flex: 1 1 auto;
    display: flex;
    justify-content: flex-end;
    align-items: center;
    text-align: right;
}

.text-controls-right .char-count {
    margin-top: 0;
    margin-right: 0;
    margin-left: 15px;
}

#generate-button {
    width: 100%;
    margin-top: 15px;
    margin-right: 0;
}

/* ========== AUDIO OUTPUT ========== */
.audio-output-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin-top: 15px;
}

#audio-player {
    flex: 1 1 auto;
    max-width: 500px;
}

/* Text box for text pages like Terms,
Privacy {
    border-radius: var(--radius-md);
    padding: var(--spacing-sm) var(--spacing-xl) 0 var(--spacing-sm);
    margin-bottom: var(--spacing-2xl);
}

/* ========== TABLES ========== */
table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.88rem;
    margin: var(--spacing-xl) 0;
}

table thead {
    background-color: var(--color-bg-tertiary);
    border-collapse: collapse;
}

table th {
    padding: var(--spacing-md) 14px;
    text-align: left;
    font-weight: var(--font-weight-semibold);
    color: var(--color-text-primary);
    border-collapse: collapse;
}

table td {
    padding: 10px 14px;
    text-align: left;
    border-collapse: collapse;
    color: var(--color-text-secondary);
}

table tbody tr:nth-child(even) {
    background-color: var(--color-bg-lighter);
}

table tbody tr:hover {
    background-color: var(--color-bg-tertiary);
    transition: background-color 0.15s ease;
}

/* ========== RESPONSIVE DESIGN ========== */
@media (max-width: 768px) {
    body {
    font-size: var(--font-size-sm);
    }
    .main-header {
    flex-direction: row;
    flex-wrap: nowrap;
    align-items: center;
    justify-content: flex-start;
    margin: 0;
    min-height: 56px;
    padding: 8px 10px;
    gap: 0.4rem;
    }
    .workspace-menu-toggle {
    display: inline-flex;
    }
    .brand-logo {
    flex: 1 1 auto;
    min-width: 0;
    margin-bottom: 0;
    text-align: left;
    }
    .brand-logo a {
    justify-content: flex-start;
    max-width: 100%;
    }
    .brand-logo__image {
    height: 42px;
    max-width: min(100%, 132px);
    transform: translateY(4px); /* up; use a positive value to move down */
    /* transform: none; */
    }
    .main-nav {
    position: absolute;
    top: calc(100% + 0.45rem);
    left: 10px;
    z-index: 80;
    flex: none;
    width: min(100vw - 1.25rem, 320px);
    padding: 0.65rem;
    border: 1px solid rgba(26, 86, 116, 0.16);
    border-radius: 16px;
    background: #fff;
    box-shadow: 0 12px 32px rgba(16, 24, 40, 0.12);
    opacity: 0;
    pointer-events: none;
    transform: translateY(-8px);
    transition: opacity 160ms ease, transform 160ms ease;
    }
    .main-header.workspace-menu-open .main-nav {
    opacity: 1;
    pointer-events: auto;
    transform: translateY(0);
    }
    .main-nav ul {
    display: grid;
    justify-content: stretch;
    flex-wrap: nowrap;
    gap: 0.25rem;
    }
    .main-nav li {
    margin: 0;
    }
    .main-nav a {
    justify-content: flex-start;
    width: 100%;
    box-sizing: border-box;
    }
    .auth-section {
    flex: 0 0 auto;
    justify-content: flex-end;
    min-width: auto;
    margin-top: 0;
    margin-left: auto;
    flex-wrap: nowrap;
    gap: 0.35rem;
    }
    .h1-background {
    padding: var(--spacing-md) var(--spacing-2xl) var(--spacing-md);
    }
    .profile-grid {
    grid-template-columns: 1fr;
    gap: var(--spacing-xl);
    }
    table {
    display: block;
    overflow-x: auto;
    white-space: nowrap;
    -webkit-overflow-scrolling: touch;
    }
    .pricing-table-container {
    grid-template-columns: 1fr;
    gap: var(--spacing-lg);
    }
    #authFormsContainer {
    max-width: 100%;
    padding: 0 10px;
    }
    .text-controls-row {
    flex-direction: column;
    align-items: stretch;
    gap: var(--spacing-sm);
    }
    .text-controls-left,
    .text-controls-center,
    .text-controls-right {
    justify-content: center;
    text-align: center;
    }
    .text-controls-right {
    flex-direction: column;
    }
    .text-controls-right .char-count {
    margin-left: 0;
    margin-top: var(--spacing-xs);
    }
    .audio-output-row {
    flex-direction: column;
    align-items: stretch;
    }
    #audio-player {
    max-width: 100%;
    width: 100%;
    }
    #download-link {
    width: auto;
    max-width: 100%;
    align-self: center;
    box-sizing: border-box;
    text-align: center;
    white-space: normal;
    }
    .secondary-button {
    width: 100%;
    text-align: center;
    }
}

@media (max-width: 480px) {
    #system-banner {
        padding: 5px 10px;
        text-align: left;
    }

    .system-banner__text {
        justify-self: start;
        padding-left: 0;
    }

    .system-banner__dismiss {
        width: 30px;
        height: 30px;
    }

    .button {
        padding: 9px var(--spacing-md);
        font-size: var(--font-size-xs);
    }

    .h1-background {
        padding: var(--spacing-md) var(--spacing-2xl) var(--spacing-md);
    }

    .main-nav a {
        min-height: 36px;
        padding: 0.55rem 0.65rem;
        font-size: var(--font-size-xs);
    }

    .footer-links {
        grid-template-columns: 1fr;
    }
}


/* ========== MARKETING COMPONENTS ========== */

/* === LANDING DESIGN SYSTEM === */

.site-header a:not(.btn),
.landing-footer a:not(.btn),
.site-header ~ main a:not(.btn) {
    color: inherit;
}

.container {
    width: min(100% - 2rem, var(--landing-container));
    margin-inline: auto;
}

.skip-link {
    position: absolute;
    left: 1rem;
    top: 0.75rem;
    z-index: 100;
    padding: 0.6rem 0.9rem;
    border-radius: 999px;
    color: #fff;
    background: var(--landing-text);
    transform: translateY(-150%);
    transition: transform 160ms ease;
}

.skip-link:focus {
    transform: translateY(0);
}

.section {
    padding-block: var(--landing-space-section);
}

.section--tight {
    padding-block: var(--landing-space-tight);
}

.section--muted {
    background:
    linear-gradient(180deg, rgba(247, 250, 255, 0.76), rgba(244, 247, 251, 0.94)),
    var(--landing-bg-muted);
    border-block: 1px solid rgba(16, 24, 40, 0.06);
}

.site-header {
    position: sticky;
    top: 0;
    z-index: 50;
    border-bottom: 1px solid rgba(16, 24, 40, 0.08);
    background: rgba(255, 255, 255, 0.84);
    backdrop-filter: blur(18px);
}

.landing-nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-height: 72px;
    gap: 1rem;
}

.brand-mark {
    display: inline-flex;
    align-items: center;
    gap: 0.65rem;
    color: var(--landing-text);
    font-weight: var(--font-weight-bold);
    letter-spacing: -0.025em;
    text-decoration: none;
}

.brand-mark:hover {
    color: var(--landing-text);
    text-decoration: none;
}

.brand-mark__logo {
    width: 96px;
    height: 96px;
    object-fit: contain;
}

.landing-nav__links {
    display: none;
    align-items: center;
    gap: 1.35rem;
    color: var(--landing-text-soft);
    font-size: 0.95rem;
    font-weight: var(--font-weight-bold);
}

.landing-nav__aside {
    display: flex;
    align-items: center;
    gap: 0.85rem;
}

.locale-switcher {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    color: var(--landing-text-soft);
    font-size: 0.85rem;
    font-weight: var(--font-weight-bold);
    white-space: nowrap;
}

.locale-switcher a {
    color: inherit;
    text-decoration: none;
}

.locale-switcher a:hover {
    color: var(--landing-primary);
}

.locale-switcher a[aria-current="page"] {
    color: var(--landing-text);
    font-weight: var(--font-weight-bold);
}

.landing-nav__links a,
.landing-footer__links a {
    text-decoration: none;
    transition: color 160ms ease;
}

.landing-nav__links a:hover,
.landing-footer__links a:hover {
    color: var(--landing-primary);
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 48px;
    padding: 0.8rem 1.2rem;
    border: 1px solid transparent;
    border-radius: 999px;
    font-weight: var(--font-weight-bold);
    line-height: 1;
    text-decoration: none;
    transition: transform 160ms ease, box-shadow 160ms ease, background-color 160ms ease, border-color 160ms ease;
    white-space: nowrap;
}

.btn:hover {
    transform: translateY(-1px);
    text-decoration: none;
}

.btn--small {
    min-height: 40px;
    padding: 0.65rem 0.95rem;
    font-size: 0.9rem;
}

.btn--primary {
    color: #fff;
    background: linear-gradient(135deg, var(--landing-primary), var(--landing-brand));
    box-shadow: 0 12px 26px rgba(0, 98, 255, 0.22);
}

.btn--primary:hover {
    color: #fff;
    background: linear-gradient(135deg, var(--landing-primary-hover), var(--landing-brand-dark));
    box-shadow: 0 16px 34px rgba(0, 98, 255, 0.28);
}

.btn--secondary {
    color: var(--landing-text);
    background: rgba(255, 255, 255, 0.82);
    border-color: var(--landing-border);
    box-shadow: var(--landing-shadow-sm);
}

.btn--secondary:hover {
    color: var(--landing-text);
    border-color: var(--landing-border-strong);
}

.hero-section {
    padding-top: clamp(4rem, 9vw, 7rem);
    overflow: hidden;
}

.hero-grid {
    display: grid;
    gap: 3rem;
    align-items: center;
}

.hero-copy {
    max-width: 760px;
}

.eyebrow {
    margin: 0 0 1rem;
    color: var(--landing-brand);
    font-size: 0.78rem;
    font-weight: var(--font-weight-xbold);
    letter-spacing: 0.13em;
    text-transform: uppercase;
}

.site-header ~ main h1,
.site-header ~ main h2,
.site-header ~ main h3,
.site-header ~ main p {
    margin-top: 0;
}

.site-header ~ main h1 {
    margin-bottom: 1.25rem;
    line-height: 0.98;
    letter-spacing: -0.065em;
    max-width: 12ch;
}

.site-header ~ main h2 {
    margin-bottom: 1rem;
    line-height: 1.08;
    letter-spacing: -0.045em;
}

.site-header ~ main h3 {
    margin-bottom: 0.65rem;
    line-height: 1.25;
    letter-spacing: -0.02em;
}

.site-header ~ main p {
    color: var(--landing-text-soft);
}

.hero-lede {
    max-width: 680px;
    color: var(--landing-text-soft);
    font-size: clamp(1rem, 2vw, 1.2rem);
    line-height: 1.55;
}

.hero-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.85rem;
    margin-top: 2rem;
}

.trust-row {
    display: flex;
    flex-wrap: wrap;
    gap: 0.65rem;
    margin-top: 1.6rem;
    color: var(--landing-text-muted);
    font-size: 0.92rem;
}

.trust-row span,
.trust-row a,
.badge {
    display: inline-flex;
    align-items: center;
    width: max-content;
    border: 1px solid rgba(26, 86, 116, 0.16);
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.76);
}

.trust-row span,
.trust-row a {
    padding: 0.38rem 0.7rem;
}

.trust-row a {
    color: inherit;
    text-decoration: none;
}

.trust-row a:hover {
    color: var(--landing-primary);
    border-color: rgba(0, 98, 255, 0.28);
}

.badge {
    padding: 0.4rem 0.72rem;
    color: var(--landing-brand);
    font-size: 0.8rem;
    font-weight: var(--font-weight-bold);
}

.product-preview {
    position: relative;
}

.product-preview::before {
    position: absolute;
    inset: 12% -18% auto auto;
    width: 260px;
    height: 260px;
    border-radius: 999px;
    background: rgba(255, 140, 0, 0.14);
    content: "";
    filter: blur(24px);
}

.preview-window {
    position: relative;
    padding: 1rem;
    border: 1px solid rgba(255, 255, 255, 0.86);
    border-radius: var(--landing-radius-xl);
    background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.96), rgba(247, 250, 255, 0.82)),
    var(--landing-surface-solid);
    box-shadow: var(--landing-shadow-lg);
}

.preview-window__bar {
    display: flex;
    gap: 0.45rem;
    padding: 0.6rem 0.75rem 1rem;
}

.preview-window__bar span {
    width: 10px;
    height: 10px;
    border-radius: 999px;
    background: #d0d5dd;
}

.preview-card {
    display: grid;
    gap: 1.5rem;
    padding: clamp(1.25rem, 4vw, 2rem);
    border: 1px solid var(--landing-border);
    border-radius: var(--landing-radius-lg);
    background: #fff;
}

.preview-title {
    margin: 1.1rem 0 0.85rem;
    color: var(--landing-text);
    font-size: clamp(1.65rem, 5vw, 2.45rem);
    font-weight: var(--font-weight-xbold);
    line-height: 1.05;
    letter-spacing: -0.045em;
}

.mini-controls {
    display: grid;
    gap: 0.75rem;
    align-content: end;
}

.control-line {
    height: 12px;
    width: 72%;
    border-radius: 999px;
    background: linear-gradient(90deg, rgba(0, 98, 255, 0.26), rgba(26, 86, 116, 0.1));
}

.control-line--wide {
    width: 100%;
}

.control-line--short {
    width: 46%;
}

.preview-status {
    display: flex;
    align-items: center;
    gap: 0.55rem;
    margin: 1rem 0.5rem 0.2rem;
    color: var(--landing-text-muted);
    font-size: 0.92rem;
    font-weight: var(--font-weight-bold);
}

.status-dot {
    width: 10px;
    height: 10px;
    border-radius: 999px;
    background: #12b76a;
    box-shadow: 0 0 0 6px rgba(18, 183, 106, 0.12);
}

.card,
.step-card,
.audio-demo,
.video-card,
.faq-item,
.final-cta {
    border: 1px solid var(--landing-border);
    border-radius: var(--landing-radius-lg);
    background: var(--landing-surface-solid);
    box-shadow: var(--landing-shadow-sm);
}

.card {
    padding: 1.35rem;
    transition: transform 160ms ease, box-shadow 160ms ease, border-color 160ms ease;
}

.card:hover {
    transform: translateY(-3px);
    border-color: var(--landing-border-strong);
    box-shadow: var(--landing-shadow-md);
}

.card p,
.step-card p,
.video-card p,
.final-cta p {
    margin-bottom: 0;
}

.card--feature {
    padding: clamp(1.25rem, 4vw, 2rem);
}

.section-heading {
    max-width: 760px;
    margin-bottom: clamp(2rem, 5vw, 3.25rem);
}

.section-heading p:last-child {
    max-width: 640px;
    font-size: 1.08rem;
}

.how-it-works-grid {
    display: grid;
    gap: clamp(1.5rem, 4vw, 3rem);
    align-items: stretch;
}

.how-it-works-panel {
    position: relative;
    overflow: hidden;
    background:
    radial-gradient(circle at 88% 16%, rgba(255, 140, 0, 0.12), transparent 18rem),
    linear-gradient(145deg, rgba(255, 255, 255, 0.98), rgba(247, 250, 255, 0.9));
    box-shadow: var(--landing-shadow-md);
}

.how-it-works-panel:hover {
    transform: none;
}

.how-it-works-card {
    display: grid;
    align-content: start;
}

.how-it-works-card .section-heading {
    margin-bottom: clamp(1.5rem, 4vw, 2.25rem);
}

.how-it-works-card .steps-grid {
    grid-template-columns: 1fr;
}

.feature-grid,
.steps-grid {
    display: grid;
    gap: 1rem;
}

.feature-grid {
    grid-template-columns: 1fr;
}

.icon-pill {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 42px;
    height: 42px;
    margin-bottom: 1.2rem;
    border-radius: 14px;
    color: var(--landing-primary);
    background: var(--landing-primary-soft);
    font-weight: var(--font-weight-xbold);
}

.steps-grid {
    counter-reset: step;
}

.step-card {
    position: relative;
    padding: 1.5rem;
}

.step-card span {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    margin-bottom: 1.2rem;
    border-radius: 999px;
    color: #fff;
    background: var(--landing-text);
    font-weight: var(--font-weight-xbold);
}

.audio-demo {
    display: grid;
    gap: 2.5rem;
    align-items: center;
}

.audio-demo--hero {
    gap: 1.35rem;
    align-items: start;
}

.audio-demo--hero h2 {
    font-size: clamp(1.5rem, 3vw, 2.05rem);
}

.audio-demo--hero .demo-transcript {
    max-height: 16rem;
}

.audio-player-panel {
    display: grid;
    gap: 1rem;
}

.audio-player-panel audio {
    width: 100%;
}

@media (min-width: 960px) {
    @supports (-moz-appearance: none) {
        .audio-demo--hero .audio-player-panel {
            gap: 0.65rem;
        }

        .audio-demo--hero .audio-player-panel audio {
            display: block;
            margin-top: -5.75rem;
        }
    }
}

.demo-transcript {
    max-height: calc(3 * 1.45em + 2rem);
    overflow-y: auto;
    padding: 1rem;
    border: 1px solid rgba(26, 86, 116, 0.14);
    border-radius: var(--landing-radius-md);
    background: rgba(247, 250, 255, 0.74);
    scrollbar-color: rgba(26, 86, 116, 0.42) rgba(26, 86, 116, 0.08);
    scrollbar-width: thin;
}

.demo-transcript::-webkit-scrollbar {
    width: 10px;
}

.demo-transcript::-webkit-scrollbar-track {
    border-radius: 999px;
    background: rgba(26, 86, 116, 0.08);
}

.demo-transcript::-webkit-scrollbar-thumb {
    border: 2px solid rgba(247, 250, 255, 0.74);
    border-radius: 999px;
    background: rgba(26, 86, 116, 0.42);
}

.demo-transcript blockquote {
    margin: 0;
    padding-right: 0.45rem;
}

.demo-transcript blockquote p {
    margin-bottom: 0.75rem;
    color: var(--landing-text-soft);
    font-size: 0.82rem;
    line-height: 1.45;
}

.demo-transcript blockquote p:last-child {
    margin-bottom: 0;
}

.demo-transcript .demo-line__name {
    font-weight: var(--font-weight-xbold);
}

.demo-transcript blockquote p.demo-line--emma {
    color: var(--landing-accent);
}

.demo-transcript blockquote p.demo-line--daniel {
    color: var(--landing-brand);
}

.waveform {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.35rem;
    min-height: 110px;
    padding: 1.1rem;
    border: 1px solid rgba(0, 98, 255, 0.14);
    border-radius: var(--landing-radius-md);
    background:
    linear-gradient(135deg, rgba(0, 98, 255, 0.08), rgba(255, 140, 0, 0.08)),
    #fff;
}

.waveform span {
    width: 100%;
    max-width: 14px;
    border-radius: 999px;
    background: linear-gradient(180deg, var(--landing-primary), var(--landing-brand));
}

.waveform span:nth-child(1) {
    height: 22px;
}

.waveform span:nth-child(2) {
    height: 44px;
}

.waveform span:nth-child(3) {
    height: 70px;
}

.waveform span:nth-child(4) {
    height: 52px;
}

.waveform span:nth-child(5) {
    height: 88px;
}

.waveform span:nth-child(6) {
    height: 38px;
}

.waveform span:nth-child(7) {
    height: 66px;
}

.waveform span:nth-child(8) {
    height: 96px;
}

.waveform span:nth-child(9) {
    height: 54px;
}

.waveform span:nth-child(10) {
    height: 78px;
}

.waveform span:nth-child(11) {
    height: 42px;
}

.waveform span:nth-child(12) {
    height: 28px;
}

.youtube-grid,
.content-layout {
    display: grid;
    gap: clamp(2rem, 6vw, 4rem);
    align-items: start;
}

.check-list {
    display: grid;
    gap: 0.85rem;
    margin: 1.5rem 0 0;
    padding: 0;
    list-style: none;
}

.check-list li {
    position: relative;
    padding-left: 2rem;
    color: var(--landing-text-soft);
}

.check-list li::before {
    position: absolute;
    left: 0;
    top: 0.2rem;
    width: 1.1rem;
    height: 1.1rem;
    border-radius: 999px;
    color: #fff;
    background: var(--landing-brand);
    content: "";
}

.check-list li::after {
    position: absolute;
    left: 0.36rem;
    top: 0.43rem;
    width: 0.36rem;
    height: 0.62rem;
    border: solid #fff;
    border-width: 0 2px 2px 0;
    content: "";
    transform: rotate(45deg);
}

.video-card {
    padding: 0.85rem;
}

.video-card p {
    padding: 0.7rem 0.25rem 0.1rem;
    color: var(--landing-text);
    font-size: 0.92rem;
    font-weight: var(--font-weight-bold);
}

.video-frame {
    position: relative;
    overflow: hidden;
    border-radius: 22px;
    background: var(--landing-text);
    aspect-ratio: 16 / 9;
}

.video-frame iframe {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    border: 0;
}

.content-aside {
    position: sticky;
    top: 104px;
}

.content-aside h2 {
    margin-top: 1rem;
    font-size: clamp(1.65rem, 4vw, 2.55rem);
}

.long-form {
    max-width: 760px;
}

.long-form p {
    margin-bottom: 1.25rem;
    color: var(--landing-text-soft);
    font-size: 1.05rem;
}

.long-form a,
.seo-link-row a {
    color: var(--landing-brand);
    font-weight: var(--font-weight-bold);
    text-decoration: none;
}

.long-form a:hover,
.seo-link-row a:hover {
    color: var(--landing-primary);
}

.seo-link-row {
    display: flex;
    flex-wrap: wrap;
    gap: 0.65rem;
    margin-top: 1.5rem;
}

.use-case-grid {
    display: grid;
    gap: 1rem;
}

.demo-showcase-grid {
    display: grid;
    gap: clamp(1.25rem, 4vw, 2rem);
    margin-bottom: clamp(1.5rem, 4vw, 2.5rem);
}

.demo-card {
    overflow: hidden;
    padding: 0;
}

.demo-card:hover {
    transform: translateY(-3px);
}

.demo-card__media {
    position: relative;
    overflow: hidden;
    display: flex;
    justify-content: center;
    padding: 1.25rem;
    background: var(--landing-text);
}

.demo-card__media img {
    display: block;
    width: min(100%, 300px);
    height: auto;
    aspect-ratio: 300 / 480;
    border-radius: var(--landing-radius-md);
    object-fit: contain;
    box-shadow: var(--landing-shadow-md);
}

.demo-card__label {
    position: absolute;
    left: 1rem;
    bottom: 1rem;
    color: #fff;
    background: rgba(16, 24, 40, 0.72);
    backdrop-filter: blur(12px);
}

.demo-card__body {
    display: grid;
    align-content: start;
    gap: 1rem;
    padding: clamp(1.25rem, 4vw, 1.75rem);
}

.demo-card__body h3 {
    margin-bottom: 0.35rem;
    font-size: clamp(1.35rem, 3vw, 1.85rem);
}

.demo-card__controls audio {
    display: block;
    width: 100%;
}

@supports (-moz-appearance: none) {
    .demo-card__controls audio {
        height: 40px;
    }
}

.faq-list {
    display: grid;
    gap: 0.85rem;
    max-width: 900px;
}

.faq-item {
    overflow: hidden;
}

.faq-item summary {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 1.1rem 1.25rem;
    color: var(--landing-text);
    cursor: pointer;
    font-weight: var(--font-weight-bold);
    list-style: none;
}

.faq-item summary::-webkit-details-marker {
    display: none;
}

.faq-item summary::after {
    flex: 0 0 auto;
    width: 10px;
    height: 10px;
    border: solid var(--landing-text-muted);
    border-width: 0 2px 2px 0;
    content: "";
    transform: rotate(45deg);
    transition: transform 160ms ease;
}

.faq-item[open] summary::after {
    transform: rotate(225deg);
}

.faq-item p {
    margin: 0;
    padding: 0 1.25rem 1.25rem;
}

.final-cta-section {
    padding-top: 0;
}

.final-cta {
    overflow: hidden;
    padding: clamp(2rem, 6vw, 4rem);
    color: #fff;
    background:
    radial-gradient(circle at 10% 10%, rgba(255, 255, 255, 0.24), transparent 20rem),
    linear-gradient(135deg, var(--landing-brand-dark), var(--landing-text));
    box-shadow: var(--landing-shadow-lg);
}

.site-header ~ main .final-cta h2,
.site-header ~ main .final-cta p {
    color: #fff;
}

.final-cta p {
    max-width: 720px;
    opacity: 0.86;
}

.final-cta .eyebrow {
    color: #ffd49b;
}

.landing-footer {
    padding-block: 3rem 1.5rem;
    border-top: 1px solid var(--landing-border);
    background: #fff;
}

.landing-footer__grid {
    display: grid;
    gap: 2rem;
}

.landing-footer__grid p {
    max-width: 420px;
    margin: 1rem 0 0;
    color: var(--landing-text-muted);
}

.landing-footer__links {
    display: grid;
    gap: 0.65rem;
    color: var(--landing-text-soft);
    font-weight: var(--font-weight-bold);
}

.landing-footer__bottom {
    margin-top: 2rem;
    padding-top: 1.25rem;
    border-top: 1px solid rgba(16, 24, 40, 0.08);
    color: var(--landing-text-muted);
    font-size: 0.9rem;
}

/* Reusable foundations for future marketing pages */
.pricing-card,
.form-card,
.input-field {
    border: 1px solid var(--landing-border);
    border-radius: var(--landing-radius-md);
    background: var(--landing-surface-solid);
    box-shadow: var(--landing-shadow-sm);
}

.pricing-card,
.form-card {
    padding: 1.5rem;
}

.label {
    display: block;
    margin-bottom: 0.45rem;
    color: var(--landing-text-soft);
    font-size: 0.9rem;
    font-weight: var(--font-weight-bold);
}

.input-field {
    width: 100%;
    padding: 0.85rem 0.95rem;
    color: var(--landing-text);
}

.input-field:focus {
    outline: 3px solid rgba(0, 98, 255, 0.16);
    border-color: var(--landing-primary);
}

@media (min-width: 720px) {
    .landing-nav__links {
        display: flex;
    }

    .feature-grid,
.use-case-grid,
.demo-showcase-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .steps-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    .audio-demo {
        grid-template-columns: 0.9fr 1.1fr;
    }

    .audio-demo.audio-demo--hero {
        grid-template-columns: 1fr;
    }

    .landing-footer__grid {
        grid-template-columns: 1fr auto;
    }

    .landing-footer__links {
        grid-template-columns: repeat(2, minmax(120px, 1fr));
    }
}

@media (min-width: 960px) {
    .hero-grid {
        grid-template-columns: minmax(0, 1.05fr) minmax(380px, 0.95fr);
    }

    .how-it-works-grid {
        grid-template-columns: minmax(0, 1fr) minmax(380px, 0.95fr);
        align-items: center;
    }

    .feature-grid {
        grid-template-columns: repeat(5, minmax(0, 1fr));
    }

    .youtube-grid {
        grid-template-columns: minmax(0, 0.85fr) minmax(440px, 1fr);
    }

    .content-layout {
        grid-template-columns: minmax(260px, 0.42fr) minmax(0, 0.58fr);
    }

    .use-case-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

@media (max-width: 520px) {
    .container {
        width: min(100% - 1.25rem, var(--landing-container));
    }

    .brand-mark span {
        font-size: 0.95rem;
    }

    .brand-mark__logo {
        width: 46px;
        height: 46px;
    }

    .landing-nav {
        min-height: 64px;
    }

    .landing-nav .btn {
        display: none;
    }

    .btn {
        width: 100%;
    }

    .hero-actions {
        width: 100%;
    }

    .card,
.step-card {
        padding: 1.15rem;
    }

    .content-aside {
        position: static;
    }
}

@media (prefers-reduced-motion: reduce) {
    *::before,
*::after {
        scroll-behavior: auto !important;
        transition-duration: 0.01ms !important;
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
    }
}

/* ========== APP SHELL ========== */

.app-home {
    padding-bottom: clamp(4rem, 7vw, 6rem);
}

.app-container {
    width: min(100% - 2rem, var(--landing-container, 1180px));
    margin-inline: auto;
    margin-top: 0rem;
    margin-bottom: 1.5rem;
}

.app-intro {
    display: grid;
    gap: clamp(1.25rem, 3vw, 2rem);
    align-items: end;
    padding-block: clamp(3.6rem, 8vw, 6.8rem) clamp(2rem, 5vw, 3.4rem);
}

.app-intro__copy {
    max-width: 780px;
}

.app-intro__copy a {
    color: var(--app-primary);
    font-weight: var(--font-weight-bold);
    text-decoration: none;
}

.app-intro__copy a:hover {
    text-decoration: underline;
    text-decoration-thickness: 2px;
    text-underline-offset: 4px;
}

.app-intro h1 {
    max-width: none;
    margin: 0 0 0.85rem;
    line-height: 0.98;
    letter-spacing: -0.065em;
}

.app-intro p:not(.eyebrow) {
    max-width: 680px;
    margin: 0;
    color: var(--app-text-soft);
    font-size: clamp(1rem, 2vw, 1.2rem);
}

/* Content-page section rhythm. Scoped so Generator and My Account stay on their own spacing. */
.content-page {
    padding-bottom: var(--content-page-end);
}

.app-home.content-page {
    padding-bottom: var(--content-page-end);
}

body.content-page {
    padding-bottom: 0;
}

.content-page .section {
    padding-block: 0;
}

.content-page > .app-intro,
.content-page > .faq-hero,
.content-page > .pricing-hero,
.content-page > .page-content.h1-background {
    padding-top: var(--content-space-hero-top);
    padding-bottom: 0;
}

.content-page > .app-container,
.content-page > section,
.content-page > .page-content.h1-background {
    margin-top: 0;
    margin-bottom: var(--content-space-section);
}

.content-page > .app-container:last-child,
.content-page > section:last-child,
.content-page > .page-content.h1-background:last-child {
    margin-bottom: 0;
}

.content-page > .app-shell:has(+ .home-after-generator:not(:has(#guest-account-cta:not(.hidden)))) {
    margin-bottom: 0;
}

.content-page .about-content,
.content-page .legal-content,
.content-page .faq-content,
.content-page .custom-voices-public {
    gap: var(--content-space-stack);
}

.content-page .custom-voices-section {
    padding-block: 0;
}

.content-page .about-layout,
.content-page .legal-layout {
    gap: var(--content-space-stack);
}

.flow-steps {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.65rem;
    margin: 0;
    padding: 0;
    list-style: none;
}

.flow-steps li {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    min-height: 48px;
    padding: 0.65rem 0.8rem;
    border: 1px solid rgba(26, 86, 116, 0.14);
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.78);
    color: var(--app-text-soft);
    font-size: 0.9rem;
    font-weight: var(--font-weight-bold);
    box-shadow: var(--app-shadow-sm);
}

.flow-steps span {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
    width: 28px;
    height: 28px;
    border-radius: 999px;
    color: #fff;
    background: linear-gradient(135deg, var(--app-primary), var(--app-brand));
    font-size: 0.8rem;
    font-weight: var(--font-weight-xbold);
}

.app-shell {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(300px, 360px);
    gap: clamp(1.5rem, 4vw, 3rem);
    align-items: start;
}

.workspace-column,
.settings-column {
    min-width: 0;
}

.settings-column {
    position: sticky;
    top: 96px;
}

.app-card {
    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.74)),
    var(--app-surface);
    box-shadow: var(--app-shadow-md);
}

.workspace-card {
    padding: clamp(1.25rem, 4vw, 2rem);
}

.settings-card {
    padding: clamp(1.15rem, 3vw, 1.5rem);
}

.app-card__header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1.2rem;
}

.app-card__header h2,
.output-card h2 {
    margin: 0 0 0.35rem;
    color: var(--app-text);
    font-size: clamp(1.45rem, 3vw, 2.15rem);
    line-height: 1.05;
    letter-spacing: -0.045em;
}

.settings-card__header {
    margin-bottom: 0.75rem;
}

.settings-card__header h2 {
    font-size: 1.35rem;
}

.app-card__header p:not(.eyebrow),
.output-card__header p:not(.eyebrow) {
    margin: 0;
    color: var(--app-text-muted);
    font-size: 0.9rem;
    line-height: 1.45;
}

.field-label {
    margin-bottom: 0.55rem;
    color: var(--app-text-muted);
    font-size: 0.78rem;
    font-weight: var(--font-weight-xbold);
    letter-spacing: 0.11em;
    text-transform: uppercase;
}

.editor-group {
    margin-bottom: 0;
}

.workspace-style-field + .editor-group {
    margin-top: 0.1rem;
}

.workspace-style-field + .editor-group > .editor-label,
.workspace-style-field + .editor-group > label {
    margin-top: 0.5rem;
}

.editor-label {
    margin-top: 1rem;
    margin-bottom: 0.35rem;
}

.editor-shell {
    overflow: hidden;
    border: 1px solid rgba(16, 24, 40, 0.1);
    border-radius: var(--app-radius-lg);
    background: #fff;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.9);
    transition: border-color 160ms ease, box-shadow 160ms ease;
}

.editor-shell:focus-within {
    border-color: var(--app-primary);
    box-shadow: var(--app-shadow-focus), inset 0 1px 0 rgba(255, 255, 255, 0.9);
}

.app-home textarea {
    display: block;
    width: 100%;
    min-height: clamp(360px, 48vh, 560px);
    padding: clamp(1rem, 2.5vw, 1.4rem);
    border: 0;
    border-radius: 0;
    background:
    linear-gradient(180deg, rgba(247, 250, 255, 0.45), rgba(255, 255, 255, 0) 9rem),
    #fff;
    color: var(--app-text);
    font-size: 1.02rem;
    line-height: 1.5;
    resize: vertical;
}

.app-home textarea.style-instructions-textarea {
    min-height: 112px;
    max-height: 180px;
    padding: 0.85rem 0.95rem;
    border: 1px solid var(--app-border);
    border-radius: var(--app-radius-sm);
    background: #fff;
    color: var(--app-brand);
    font-size: 0.92rem;
    line-height: 1.5;
    overflow-y: auto;
}

.app-home #text-input {
    border: 1px solid var(--app-border);
    border-radius: var(--app-radius-sm);
    background: #fff;
}

#short-text-group .editor-shell {
    overflow: visible;
    border: 0;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
}

#short-text-group .editor-shell:focus-within {
    box-shadow: none;
}

.app-field.workspace-style-field {
    margin-bottom: 0.3rem;
}

.workspace-style-field textarea.style-instructions-textarea {
    width: 100%;
    max-height: 220px;
    box-sizing: border-box;
}

.workspace-style-field .text-controls-row {
    margin-top: 0.4rem;
}

.auto-language-note {
    margin: 0.35rem 0 0;
    padding: 0.7rem 0.8rem;
    border: 1px solid rgba(26, 86, 116, 0.12);
    border-radius: var(--app-radius-sm);
    background: rgba(255, 255, 255, 0.72);
    color: var(--app-text-muted);
    font-size: 0.85rem;
    font-weight: var(--font-weight-normal);
}

.app-home textarea::placeholder {
    color: rgba(102, 112, 133, 0.78);
}

.app-home textarea:focus {
    outline: none;
}

.text-controls-left,
.text-controls-center {
    gap: 0.4rem;
}

.text-controls-right {
    gap: 0.4rem;
}

.app-home .button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.45rem;
    min-height: 44px;
    margin: 0;
    padding: 0.75rem 1rem;
    border: 1px solid transparent;
    border-radius: 999px;
    font-weight: var(--font-weight-bold);
    line-height: 1;
    text-decoration: none;
    transition: transform 160ms ease, box-shadow 160ms ease, background-color 160ms ease, border-color 160ms ease;
}

.app-home .button:hover {
    transform: translateY(-1px);
    text-decoration: none;
}

.app-home .button-primary {
    width: 100%;
    min-height: 62px;
    padding: 1rem 1.35rem;
    color: #fff;
    background: linear-gradient(135deg, var(--app-primary), var(--app-brand));
    box-shadow: 0 16px 36px rgba(0, 98, 255, 0.26);
    font-size: 1.02rem;
}

.app-home .button-primary:hover {
    color: #fff;
    background: linear-gradient(135deg, #004dd1, var(--color-primary-dark, #004085));
    box-shadow: 0 20px 44px rgba(0, 98, 255, 0.32);
}

.app-home .secondary-button {
    color: var(--app-text);
    background: rgba(255, 255, 255, 0.84);
    border-color: var(--app-border);
    box-shadow: var(--app-shadow-sm);
}

.app-home .secondary-button:hover {
    color: var(--app-text);
    background: #fff;
    border-color: var(--app-border-strong);
}

.generate-area {
    margin-top: 0.8rem;
}

.guest-account-cta {
    margin-top: clamp(1.25rem, 3vw, 2rem);
}

.guest-account-cta__card {
    display: grid;
    justify-items: start;
    gap: 0.75rem;
    padding: clamp(1.25rem, 4vw, 2rem);
}

.guest-account-cta__card .eyebrow {
    margin-bottom: 0;
}

.app-home .guest-account-cta__card h2 {
    margin: 0;
    color: var(--app-text);
    font-size: clamp(1.45rem, 3vw, 2.15rem);
    font-weight: var(--font-weight-bold);
    line-height: 1.05;
    letter-spacing: -0.045em;
}

.guest-account-cta__card p:not(.eyebrow) {
    max-width: 48rem;
    margin: 0;
    color: var(--app-text-soft);
    line-height: 1.5;
}

.guest-account-cta__card .button-primary {
    width: auto;
    margin: 0.35rem 0 0;
}

.app-home input[type="text"],
.app-home select {
    min-height: 46px;
    padding: 0.75rem 0.9rem;
    border: 1px solid var(--app-border);
    border-radius: var(--app-radius-sm);
    background: #fff;
    color: var(--app-text);
    box-shadow: 0 1px 0 rgba(16, 24, 40, 0.02);
    transition: border-color 160ms ease, box-shadow 160ms ease;
}

.app-home input[type="text"]:focus,
.app-home select:focus {
    outline: none;
    border-color: var(--app-primary);
    box-shadow: var(--app-shadow-focus);
}

.app-home label {
    color: var(--app-text-soft);
    font-size: 0.88rem;
    font-weight: var(--font-weight-bold);
}

.app-home label i {
    width: 1.15rem;
    color: var(--app-brand);
}

.app-field {
    margin-bottom: 0;
}

.settings-group {
    display: grid;
    gap: 0.9rem;
    padding-top: 0.95rem;
}

.settings-group--primary {
    padding: 0;
}

.settings-details {
    margin-top: 0.9rem;
    border: 1px solid rgba(16, 24, 40, 0.08);
    border-radius: var(--app-radius-md);
    background: rgba(255, 255, 255, 0.64);
}

.settings-details summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 0.95rem 1rem;
    color: var(--app-text);
    cursor: pointer;
    font-weight: var(--font-weight-xbold);
    list-style: none;
}

.settings-details summary::-webkit-details-marker {
    display: none;
}

.settings-details summary::after {
    flex: 0 0 auto;
    width: 9px;
    height: 9px;
    border: solid var(--app-text-muted);
    border-width: 0 2px 2px 0;
    content: "";
    transform: rotate(45deg);
    transition: transform 160ms ease;
}

.settings-details[open] summary::after {
    transform: rotate(225deg);
}

.settings-details .settings-group {
    padding: 0 1rem 1rem;
}

.app-home input[type="range"] {
    width: 100%;
    accent-color: var(--app-primary);
}

.app-home small {
    display: block;
    margin-top: 0.42rem;
    color: var(--app-text-muted);
    font-size: 0.78rem;
}

.app-home .alert,
.app-home .panel,
.output-card {
    border: 1px solid var(--app-border);
    border-radius: var(--app-radius-md);
    background: rgba(255, 255, 255, 0.88);
    box-shadow: var(--app-shadow-sm);
}

.app-home .alert {
    padding: 0.95rem 1rem;
    color: var(--app-text-soft);
}

.app-home .alert--warning {
    border-left: 0;
    border-color: rgba(255, 140, 0, 0.28);
    background: linear-gradient(135deg, rgba(255, 244, 228, 0.9), rgba(255, 255, 255, 0.9));
}

.app-home .notice {
    margin: 1rem 0;
}

.app-home #status-message {
    margin-top: 1rem;
    text-align: left;
}

.output-card {
    margin-top: 1rem;
    padding: 1rem;
}

.output-card__header h3,
.output-card__header h2 {
    margin-top: 0;
}

.output-card__header h3 {
    margin-bottom: 0.3rem;
    color: var(--app-text);
    font-size: 1.05rem;
    letter-spacing: -0.02em;
}

.output-card__header p {
    margin: 0;
    color: var(--app-text-muted);
}

.app-home .panel {
    margin-left: 0;
}

.app-home .progress {
    height: 16px;
    border-radius: 999px;
    background: rgba(16, 24, 40, 0.08);
}

#audio-player {
    width: 100%;
    max-width: none;
}

#download-link {
    flex: 0 0 auto;
}

.byte-counter--overlimit {
    border-color: rgba(220, 53, 69, 0.26);
    color: var(--color-error, #dc3545);
    background: rgba(248, 215, 218, 0.42);
}

/* Full screen workspace page */
.main-header--workspace {
    display: grid;
    grid-template-columns: auto minmax(140px, auto) minmax(200px, 360px) minmax(0, 1fr);
    gap: clamp(0.8rem, 2vw, 1.25rem);
    min-height: 60px;
    padding-block: 6px;
    padding-inline: clamp(0.75rem, 2vw, 1.4rem);
}

.main-header--workspace .brand-logo {
    justify-self: start;
}

.main-header--workspace .brand-logo__image {
    height: 42px;
}

.main-header--workspace .auth-section {
    grid-column: 4;
    justify-self: end;
}

.main-header--workspace .workspace-menu-toggle {
    display: inline-flex;
}

.workspace-menu-toggle:hover {
    border-color: var(--app-border-strong);
    box-shadow: var(--app-shadow-md);
    transform: translateY(-1px);
}

.main-nav--workspace {
    position: absolute;
    top: calc(100% + 0.55rem);
    left: clamp(0.75rem, 2vw, 1.4rem);
    z-index: 80;
    width: min(100vw - 1.5rem, 320px);
    padding: 0.65rem;
    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.86)),
    #fff;
    box-shadow: var(--app-shadow-md);
    opacity: 0;
    pointer-events: none;
    transform: translateY(-8px);
    transition: opacity 160ms ease, transform 160ms ease;
}

.main-header--workspace.workspace-menu-open .main-nav--workspace {
    opacity: 1;
    pointer-events: auto;
    transform: translateY(0);
}

.main-nav--workspace ul {
    display: grid;
    gap: 0.25rem;
}

.main-nav--workspace a {
    justify-content: flex-start;
    width: 100%;
    box-sizing: border-box;
}

.app-fullscreen-workspace {
    padding: clamp(0.55rem, 1.4vw, 0.95rem) 0 clamp(3rem, 5vw, 4.5rem);
}

.workspace-title {
    margin: 0 0 0.35rem;
    color: var(--app-text);
    font-size: clamp(1.75rem, 3vw, 2.6rem);
    line-height: 1.02;
    letter-spacing: -0.055em;
}

.app-fullscreen-workspace textarea {
    min-height: clamp(420px, 58vh, 720px);
}

.app-fullscreen-workspace #text-input,
.app-fullscreen-workspace #long-text-input {
    height: clamp(260px, 42vh, 520px);
    min-height: 140px;
}

.workspace-operations-empty {
    margin: 0;
    padding: 1.2rem;
    border: 1px dashed rgba(26, 86, 116, 0.22);
    border-radius: var(--app-radius-md);
    background: rgba(255, 255, 255, 0.68);
    color: var(--app-text-muted);
    text-align: center;
}

#workspaceShortOperationsList {
    display: grid;
    gap: 0.65rem;
}

.workspace-operation-card__header {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 1rem;
    align-items: center;
}

.workspace-operation-card__toggle {
    display: block;
    width: 100%;
    margin: 0;
    padding: 0;
    border: 0;
    background: transparent;
    color: inherit;
    font: inherit;
    text-align: left;
    cursor: pointer;
    appearance: none;
}

.workspace-operation-card__toggle:focus-visible {
    outline: 2px solid var(--app-border-strong);
    outline-offset: 3px;
    border-radius: 8px;
}

.workspace-operation-card__filename {
    display: block;
    margin: 0 0 0.4rem;
    color: var(--app-text);
    font-size: 0.88rem;
    font-weight: var(--font-weight-bold);
    letter-spacing: -0.02em;
}

.workspace-operation-card__title--failed {
    color: var(--app-text-muted);
    font-weight: var(--font-weight-semibold);
}

.workspace-operation-card__meta {
    display: flex;
    flex-wrap: wrap;
    gap: 0.45rem 0.75rem;
    color: var(--app-text-muted);
    font-size: 0.8rem;
}

.workspace-operation-card__meta-item {
    display: inline-flex;
    gap: 0.3rem;
}

.workspace-operation-card__meta-label {
    color: var(--app-text-soft);
    font-weight: var(--font-weight-bold);
}

.workspace-operation-card__actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.6rem;
    align-items: center;
    justify-content: flex-end;
}

.workspace-operation-card__preview {
    display: grid;
    gap: 0.7rem;
    padding: 0.75rem 0.8rem;
    border: 1px solid rgba(26, 86, 116, 0.1);
    border-radius: var(--app-radius-sm);
    background: rgba(247, 251, 255, 0.9);
}

.workspace-operation-card__preview-player {
    width: 100%;
}

.workspace-operation-card__preview-audio {
    display: block;
    width: 100%;
}

@supports (-moz-appearance: none) {
    .workspace-operation-card__preview-player {
        position: relative;
        height: 2.5rem;
        overflow: hidden;
    }

    .workspace-operation-card__preview-audio {
        position: absolute;
        right: 0;
        bottom: 0;
        left: 0;
        height: auto;
    }
}

.workspace-operation-card__preview-block h4 {
    margin: 0 0 0.35rem;
    color: var(--app-text-soft);
    font-size: 0.75rem;
    font-weight: var(--font-weight-bold);
    letter-spacing: 0.02em;
    text-transform: uppercase;
}

.workspace-operation-card__preview-copy {
    max-height: 12rem;
    margin: 0;
    overflow: auto;
    white-space: pre-wrap;
    overflow-wrap: anywhere;
    color: var(--app-text);
    font-family: inherit;
    font-size: 0.84rem;
    line-height: 1.45;
}

.workspace-operation-card__preview-empty {
    margin: 0;
    color: var(--app-text-muted);
    font-size: 0.84rem;
}

.app-home .status--icon-only {
    font-size: 1rem;
    font-weight: var(--font-weight-normal);
}

.app-home .button-small {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.42rem;
    min-height: 36px;
    padding: 0.55rem 0.8rem;
    border: 1px solid var(--app-border);
    border-radius: 999px;
    background: #fff;
    color: var(--app-text);
    box-shadow: var(--app-shadow-sm);
    font-family: var(--landing-font, var(--font-family-base));
    font-size: 0.82rem;
    font-weight: var(--font-weight-bold);
    cursor: pointer;
}

.app-home .button-small:hover {
    border-color: var(--app-border-strong);
    background: var(--app-surface-soft);
    transform: translateY(-1px);
}

.app-home .button-small:disabled {
    opacity: 0.56;
    cursor: not-allowed;
    transform: none;
}

.app-home .status {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    font-size: 0.85rem;
    font-weight: var(--font-weight-bold);
    white-space: nowrap;
}

.app-home .status--success {
    color: #067647;
}

.app-home .status--warning {
    color: #9a5b00;
}

.app-home .status--error {
    color: #b4232f;
}

#projectStudioDescriptionInput,
#projectStudioStyleInstructionsInput {
    min-height: 8.5rem;
    padding: 0.75rem 0.9rem;
    border: 1px solid var(--app-border);
    border-radius: var(--app-radius-sm);
    background: #fff;
    color: var(--app-text);
    box-shadow: 0 1px 0 rgba(16, 24, 40, 0.02);
    font-size: 0.92rem;
    line-height: 1.5;
    transition: border-color 160ms ease, box-shadow 160ms ease;
}

#projectStudioStyleInstructionsInput {
    min-height: 7.5rem;
}

#projectStudioDescriptionInput:focus,
#projectStudioStyleInstructionsInput:focus {
    outline: none;
    border-color: var(--app-primary);
    box-shadow: var(--app-shadow-focus);
}

.cm-editor.is-dragging-split,
.cm-editor.is-dragging-split .cm-content {
    cursor: ns-resize;
}

@media (min-width: 1041px) {
    .app-fullscreen-workspace .output-card h2 {
        font-size: 1.2rem;
        line-height: 1.2;
        letter-spacing: -0.03em;
    }
}

@media (min-width: 900px) {
    .app-intro {
        grid-template-columns: minmax(0, 1fr) minmax(360px, 0.52fr);
    }
}

@media (max-width: 1040px) {
    .app-shell {
        grid-template-columns: 1fr;
    }

    .settings-column {
        position: static;
    }

    .settings-card {
        display: grid;
        gap: 0.9rem;
    }

    .project-nav-column,
.project-inspector-column {
        position: static;
    }
}

@media (max-width: 760px) {
    .app-intro {
        padding-top: 2rem;
    }

    .flow-steps {
        grid-template-columns: 1fr;
    }

    .app-card__header {
        display: grid;
    }

    .app-home textarea {
        min-height: 320px;
    }

    .text-controls-row {
        align-items: stretch;
    }

    .text-controls-left,
.text-controls-center,
.text-controls-right {
        justify-content: stretch;
    }

    .text-controls-left,
.text-controls-center {
        display: grid;
    }

    .text-controls-right {
        align-items: stretch;
        text-align: left;
    }

    .audio-output-row {
        align-items: stretch;
    }

    #download-link {
        width: 100%;
    }

    .workspace-operation-card__header {
        grid-template-columns: 1fr;
    }

    .workspace-operation-card__actions {
        justify-content: flex-start;
    }
}

@media (max-width: 520px) {
    .app-container {
        width: min(100% - 1.25rem, var(--landing-container, 1180px));
    }

    .workspace-card,
.settings-card {
        padding: 0.8rem;
        border-radius: 22px;
    }

    .editor-shell,
.app-card,
.output-card {
        border-radius: 22px;
    }
}

@media (max-width: 768px) {
    .main-header--workspace {
        display: flex;
        flex-wrap: wrap;
        align-items: center;
        gap: 0.4rem;
    }

    .main-header--workspace .brand-logo {
        flex: 1 1 auto;
        min-width: 0;
    }

    .main-header--workspace .brand-logo__image {
        height: 38px;
        transform: translateY(4px); /* up; use a positive value to move down */
        /* transform: none; */
    }

    .main-header--workspace .auth-section {
        order: 0;
        flex: 0 0 auto;
        grid-column: auto;
        margin-left: auto;
        justify-self: auto;
        justify-content: flex-end;
    }
}

/* ========== PAYMENT RESULT ========== */

.payment-result-container {
    width: min(100% - 2rem, 980px);
    margin-inline: auto;
}

.payment-result-section {
    padding-block: clamp(3rem, 8vw, 6rem);
}

.payment-result-card > * {
    position: relative;
}

.payment-result-card h1 {
    max-width: 720px;
    margin: 0 0 1rem;
    line-height: 0.98;
    letter-spacing: -0.065em;
}

.payment-result-lede {
    max-width: 680px;
    margin: 0;
    color: var(--landing-text-soft);
    font-size: clamp(1.05rem, 2.5vw, 1.25rem);
    line-height: 1.65;
}

.payment-result-panel {
    display: grid;
    gap: 0.85rem;
    width: 100%;
    margin-top: clamp(1.5rem, 4vw, 2rem);
}

.payment-result-panel > div {
    padding: 1rem;
    border: 1px solid rgba(26, 86, 116, 0.13);
    border-radius: var(--landing-radius-md);
    background: rgba(255, 255, 255, 0.78);
    text-align: left;
    box-shadow: var(--landing-shadow-sm);
}

.payment-result-panel strong {
    display: block;
    color: var(--landing-text);
    font-size: 1rem;
}

.payment-result-panel p {
    margin: 0.25rem 0 0;
    color: var(--landing-text-muted);
    font-size: 0.94rem;
    line-height: 1.55;
}

.payment-result-actions {
    justify-content: center;
}

.payment-result-redirect {
    width: 100%;
    margin-top: clamp(1.6rem, 4vw, 2.25rem);
    padding-top: 1.25rem;
    border-top: 1px solid rgba(16, 24, 40, 0.08);
}

.countdown {
    color: var(--landing-text-muted);
    font-size: 0.95rem;
}

.manual-redirect {
    margin-top: 0.7rem;
}

@media (min-width: 720px) {
    .payment-result-panel {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 520px) {
    .payment-result-container {
        width: min(100% - 1.25rem, 980px);
    }

    .payment-result-section {
        padding-block: 2.25rem;
    }

    .payment-result-card {
        border-radius: 24px;
    }

    .payment-result-icon {
        width: 74px;
        height: 74px;
        border-radius: 22px;
    }
}
