/* === Reset & Base === */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

[hidden] {
    display: none !important;
}

:root {
    /* Backgrounds — deeper, desaturated */
    --bg-primary: #0c0d12;
    --bg-secondary: #12131a;
    --bg-card: #1a1b24;
    --bg-elevated: #22232e;
    --bg-surface: #161720;

    /* Text */
    --text-primary: #e8e8ec;
    --text-secondary: #7a7b8e;
    --text-tertiary: #4e4f5e;

    /* Accent — refined gold */
    --accent: #c9a267;
    --accent-hover: #dbb57e;
    --accent-muted: rgba(201, 162, 103, 0.12);

    /* Semantic */
    --error: #e5484d;
    --success: #30a46c;
    --warning: #f5a623;

    /* Borders */
    --border: #1f2029;
    --border-hover: #2e2f3d;

    /* Radii */
    --radius-sm: 6px;
    --radius-md: 8px;
    --radius-lg: 12px;
    --radius-full: 9999px;

    /* Shadows */
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.3);
    --shadow-md: 0 2px 8px rgba(0, 0, 0, 0.4);
    --shadow-lg: 0 8px 24px rgba(0, 0, 0, 0.5);

    /* Transitions */
    --transition-fast: 150ms ease;
    --transition-base: 200ms ease;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    font-size: 14px;
    line-height: 1.6;
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

.container {
    max-width: 800px;
    margin: 0 auto;
    padding: 2rem 1.5rem;
}

.container-app {
    max-width: 960px;
}

/* === Header === */
header {
    text-align: center;
    margin-bottom: 2.5rem;
}

header h1 {
    font-size: 1.75rem;
    font-weight: 600;
    color: var(--text-primary);
    letter-spacing: -0.01em;
}

.subtitle {
    color: var(--text-secondary);
    margin-top: 0.4rem;
    font-size: 0.875rem;
}

/* === Tabs (underline style) === */
.tabs {
    display: flex;
    gap: 0;
    margin-bottom: 0;
    border-bottom: 1px solid var(--border);
}

.tab {
    flex: 1;
    padding: 0.625rem 1rem;
    background: transparent;
    border: none;
    border-bottom: 2px solid transparent;
    color: var(--text-secondary);
    cursor: pointer;
    font-size: 0.8125rem;
    font-weight: 500;
    transition: color var(--transition-fast), border-color var(--transition-fast);
    text-align: center;
}

.tab:first-child {
    border-radius: 0;
}

.tab:last-child {
    border-radius: 0;
}

.tab.active {
    background: transparent;
    color: var(--text-primary);
    border-bottom: 2px solid var(--accent);
}

.tab:hover:not(.active) {
    color: var(--text-primary);
}

/* === Tab Content === */
.tab-content {
    display: none;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-top: none;
    border-radius: 0 0 var(--radius-md) var(--radius-md);
    padding: 1.5rem;
}

.tab-content.active {
    display: block;
}

/* === Drop Zone === */
.drop-zone {
    border: 1.5px dashed var(--border-hover);
    border-radius: var(--radius-lg);
    padding: 3rem 1rem;
    text-align: center;
    cursor: pointer;
    transition: border-color var(--transition-fast), background var(--transition-fast);
}

.drop-zone:hover,
.drop-zone.drag-over {
    border-color: var(--accent);
    background: var(--accent-muted);
}

.drop-zone-inner svg {
    color: var(--text-tertiary);
    margin-bottom: 0.75rem;
}

.drop-zone-inner p {
    color: var(--text-secondary);
}

.drop-zone-hint {
    font-size: 0.75rem;
    margin-top: 0.3rem;
    color: var(--text-tertiary);
}

.file-selected {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    margin-top: 1rem;
    padding: 0.5rem 1rem;
    background: var(--accent-muted);
    border-radius: var(--radius-sm);
    color: var(--accent);
    font-size: 0.875rem;
}

/* === Textarea === */
textarea {
    width: 100%;
    min-height: 200px;
    padding: 0.75rem;
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-family: inherit;
    font-size: 0.875rem;
    resize: vertical;
    line-height: 1.6;
    transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}

textarea::placeholder {
    color: var(--text-tertiary);
}

textarea:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 2px var(--accent-muted);
}

/* === Character Counter === */
.char-counter {
    display: flex;
    justify-content: space-between;
    font-size: 0.75rem;
    color: var(--text-tertiary);
    margin-top: 0.35rem;
    padding: 0 0.25rem;
}
.char-counter.counter-warn { color: var(--warning); }
.char-counter.counter-over { color: var(--error); }

/* === Settings Card === */
.settings-card {
    margin-top: 1.5rem;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 1.25rem 1.5rem;
}

.settings-card-header {
    font-size: 0.6875rem;
    font-weight: 600;
    color: var(--text-tertiary);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    margin-bottom: 1rem;
    padding-bottom: 0.6rem;
    border-bottom: 1px solid var(--border);
}

.settings-row {
    margin-bottom: 1.25rem;
}

.settings-row:last-child {
    margin-bottom: 0;
}

.settings-row > label {
    display: block;
    margin-bottom: 0.4rem;
    color: var(--text-secondary);
    font-size: 0.8125rem;
    font-weight: 500;
}

.settings-row select,
.settings-row input[type="range"] {
    width: 100%;
}

/* Speed + Pitch side by side */
.settings-row-pair {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.25rem;
}

.setting-pair-item label {
    display: block;
    margin-bottom: 0.4rem;
    color: var(--text-secondary);
    font-size: 0.8125rem;
    font-weight: 500;
}

.setting-pair-item input[type="range"] {
    width: 100%;
}

/* === Voice Category Filters === */
.voice-category-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    margin-bottom: 0.6rem;
}

.category-chip {
    padding: 0.25rem 0.625rem;
    background: transparent;
    border: 1px solid var(--border);
    border-radius: var(--radius-full);
    color: var(--text-secondary);
    font-size: 0.75rem;
    font-weight: 500;
    cursor: pointer;
    transition: all var(--transition-fast);
    white-space: nowrap;
}

.category-chip:hover {
    border-color: var(--border-hover);
    color: var(--text-primary);
}

.category-chip.active {
    background: var(--accent);
    color: var(--bg-primary);
    border-color: var(--accent);
}

.voice-count {
    display: block;
    margin-top: 0.3rem;
    font-size: 0.75rem;
    color: var(--text-tertiary);
}

/* === Voice Trigger Button === */
.voice-trigger {
    width: 100%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.5rem 0.5rem 0.5rem 0.75rem;
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-size: 0.875rem;
    cursor: pointer;
    text-align: left;
    transition: border-color var(--transition-fast);
    gap: 0.5rem;
}

.voice-trigger:hover {
    border-color: var(--border-hover);
}

.voice-trigger-text {
    flex: 1;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.voice-trigger-action {
    flex-shrink: 0;
    padding: 0.25rem 0.65rem;
    background: var(--accent);
    color: var(--bg-primary);
    border-radius: var(--radius-sm);
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.02em;
    transition: background var(--transition-fast);
}

.voice-trigger:hover .voice-trigger-action {
    background: var(--accent-hover);
}

/* === Voice Browser Modal === */
.voice-modal-overlay {
    position: fixed;
    inset: 0;
    z-index: 1000;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1.5rem;
}

.voice-modal {
    width: 100%;
    max-width: 860px;
    max-height: 85vh;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    box-shadow: var(--shadow-lg);
}

.voice-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid var(--border);
}

.voice-modal-header h3 {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0;
}

.voice-modal-close {
    background: none;
    border: none;
    color: var(--text-tertiary);
    font-size: 1.5rem;
    cursor: pointer;
    padding: 0 0.3rem;
    line-height: 1;
    transition: color var(--transition-fast);
}

.voice-modal-close:hover {
    color: var(--text-primary);
}

.voice-modal-toolbar {
    padding: 1rem 1.5rem;
    border-bottom: 1px solid var(--border);
}

.voice-search {
    width: 100%;
    padding: 0.5rem 0.75rem;
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-size: 0.875rem;
    font-family: inherit;
    margin-bottom: 0.6rem;
    transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}

.voice-search:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 2px var(--accent-muted);
}

.voice-modal-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    align-items: center;
}

.voice-gender-filters,
.voice-modal .voice-category-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
}

.filter-chip {
    padding: 0.25rem 0.625rem;
    background: transparent;
    border: 1px solid var(--border);
    border-radius: var(--radius-full);
    color: var(--text-secondary);
    font-size: 0.75rem;
    font-weight: 500;
    cursor: pointer;
    transition: all var(--transition-fast);
    white-space: nowrap;
}

.filter-chip:hover {
    border-color: var(--border-hover);
    color: var(--text-primary);
}

.filter-chip.active {
    background: var(--accent);
    color: var(--bg-primary);
    border-color: var(--accent);
}

/* Voice card grid */
.voice-card-grid {
    flex: 1;
    overflow-y: auto;
    padding: 1.25rem 1.5rem;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 0.625rem;
    align-content: start;
}

.voice-card {
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 0.875rem;
    cursor: pointer;
    transition: border-color var(--transition-fast), background var(--transition-fast);
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
}

.voice-card:hover {
    border-color: var(--border-hover);
    background: var(--bg-elevated);
}

.voice-card.selected {
    border-color: var(--accent);
    background: var(--accent-muted);
}

.voice-card-name {
    font-weight: 500;
    font-size: 0.875rem;
    color: var(--text-primary);
}

.voice-card-meta {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.75rem;
    color: var(--text-tertiary);
}

.voice-badge {
    font-weight: 600;
    font-size: 0.6875rem;
    padding: 0.1rem 0.35rem;
    border-radius: 3px;
}

.voice-badge-M {
    color: #5dade2;
    background: rgba(93, 173, 226, 0.12);
}

.voice-badge-F {
    color: #f1948a;
    background: rgba(241, 148, 138, 0.12);
}

.voice-card-actions {
    display: flex;
    gap: 0.4rem;
    margin-top: 0.4rem;
}

.voice-preview-btn {
    background: none;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text-tertiary);
    font-size: 0.75rem;
    padding: 0.2rem 0.5rem;
    cursor: pointer;
    transition: all var(--transition-fast);
    flex: 1;
}

.voice-preview-btn:hover {
    color: var(--accent);
    border-color: var(--accent);
}

.voice-preview-btn.playing {
    color: var(--accent);
    border-color: var(--accent);
}

.voice-modal-footer {
    padding: 0.6rem 1.5rem;
    border-top: 1px solid var(--border);
    font-size: 0.75rem;
    color: var(--text-tertiary);
    text-align: center;
}

/* ── Mood Selector (Gemini voices) ── */

/* Legacy grid span — kept for compatibility */
.setting-full-width { grid-column: 1 / -1; }

.mood-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    margin-bottom: 0.6rem;
}

.mood-chip {
    padding: 0.25rem 0.625rem;
    background: transparent;
    border: 1px solid var(--border);
    border-radius: var(--radius-full);
    color: var(--text-secondary);
    font-size: 0.75rem;
    font-weight: 500;
    cursor: pointer;
    transition: all var(--transition-fast);
    white-space: nowrap;
}

.mood-chip:hover {
    border-color: var(--border-hover);
    color: var(--text-primary);
}

.mood-chip.active {
    background: var(--accent);
    color: var(--bg-primary);
    border-color: var(--accent);
}

.mood-chip-locked {
    opacity: 0.3;
    cursor: not-allowed;
    pointer-events: none;
}

.mood-hint {
    font-size: 0.6875rem;
    color: var(--text-tertiary);
    font-weight: 400;
}

#custom-mood-field {
    margin-top: 0.5rem;
}

#custom-mood-input {
    width: 100%;
    padding: 0.5rem 0.75rem;
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-size: 0.875rem;
    font-family: inherit;
    box-sizing: border-box;
    transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}

#custom-mood-input:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 2px var(--accent-muted);
}

#custom-mood-field .mood-hint {
    display: block;
    margin-top: 0.3rem;
}

select {
    padding: 0.5rem 0.75rem;
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-size: 0.875rem;
    font-family: inherit;
    transition: border-color var(--transition-fast);
}

select:focus {
    outline: none;
    border-color: var(--accent);
}

input[type="range"] {
    -webkit-appearance: none;
    appearance: none;
    height: 4px;
    background: var(--border-hover);
    border-radius: 2px;
    outline: none;
}

input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 14px;
    height: 14px;
    background: var(--accent);
    border-radius: 50%;
    cursor: pointer;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
}

input[type="range"]::-moz-range-thumb {
    width: 14px;
    height: 14px;
    background: var(--accent);
    border-radius: 50%;
    cursor: pointer;
    border: none;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
}

/* === Preset Row === */
.preset-row {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

.preset-row select {
    flex: 1;
}

/* === Generation Options === */
.generation-options {
    margin-top: 1rem;
    padding: 1rem;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
}

.option-row {
    margin-bottom: 0.75rem;
}

.option-row:last-child {
    margin-bottom: 0;
}

.option-row label {
    display: block;
    margin-bottom: 0.3rem;
    color: var(--text-secondary);
    font-size: 0.8125rem;
    font-weight: 500;
}

.option-row input[type="text"] {
    width: 100%;
    padding: 0.5rem 0.75rem;
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-size: 0.875rem;
    font-family: inherit;
    transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}

.option-row input[type="text"]:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 2px var(--accent-muted);
}

.checkbox-label {
    display: flex !important;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
}

.checkbox-label input[type="checkbox"] {
    accent-color: var(--accent);
    width: 16px;
    height: 16px;
}

/* === Source Text Picker === */
.source-text-picker {
    margin-top: 0.75rem;
}

.source-text-picker select {
    width: 100%;
}

/* === Standard Buttons === */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.5rem 1rem;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-family: inherit;
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    text-decoration: none;
    white-space: nowrap;
    transition: all var(--transition-fast);
}

.btn:hover {
    border-color: var(--border-hover);
    background: var(--bg-elevated);
}

.btn.btn-primary {
    background: var(--accent);
    color: var(--bg-primary);
    border-color: var(--accent);
}

.btn.btn-primary:hover {
    background: var(--accent-hover);
}

/* === Small Buttons === */
.btn-small {
    padding: 0.3rem 0.625rem;
    background: transparent;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    font-size: 0.8125rem;
    font-weight: 500;
    cursor: pointer;
    text-decoration: none;
    transition: all var(--transition-fast);
    white-space: nowrap;
}

.btn-small:hover {
    color: var(--text-primary);
    border-color: var(--border-hover);
}

.btn-small.btn-primary {
    background: var(--accent);
    color: var(--bg-primary);
    border-color: var(--accent);
}

.btn-small.btn-primary:hover {
    background: var(--accent-hover);
}

.btn-small.btn-danger {
    color: var(--error);
    border-color: transparent;
}

.btn-small.btn-danger:hover {
    border-color: var(--error);
    background: rgba(229, 72, 77, 0.08);
}

/* === Mood disabled state (non-Gemini voices) === */
.mood-disabled {
    opacity: 0.4;
    pointer-events: none;
    user-select: none;
}

/* === Slider disabled state (unsupported voice params) === */
.slider-disabled {
    opacity: 0.4;
    pointer-events: none;
    user-select: none;
}
.slider-hint {
    color: var(--text-tertiary);
    font-size: 0.6875rem;
    font-style: italic;
    display: block;
    min-height: 1rem;
}

/* Voice preview unavailable flash */
.voice-preview-btn.preview-unavailable {
    color: var(--text-tertiary);
    border-color: var(--text-tertiary);
}

/* === Preset inline save form === */
.preset-save-inline {
    display: flex;
    gap: 0.4rem;
    margin-top: 0.5rem;
}

.preset-save-inline input[type="text"] {
    flex: 1;
    padding: 0.3rem 0.6rem;
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-size: 0.8125rem;
    transition: border-color var(--transition-fast);
}

.preset-save-inline input[type="text"]:focus {
    outline: none;
    border-color: var(--accent);
}

/* === Usage Bar === */
.usage-bar {
    margin-top: 1rem;
    text-align: center;
}

.usage-bar-track {
    height: 4px;
    background: var(--border-hover);
    border-radius: var(--radius-full);
    overflow: hidden;
    margin-bottom: 0.35rem;
}

.usage-bar-fill {
    height: 100%;
    border-radius: var(--radius-full);
    transition: width 0.5s ease;
}

.usage-bar-fill.usage-green {
    background: var(--success);
}

.usage-bar-fill.usage-orange {
    background: var(--warning);
}

.usage-bar-fill.usage-red {
    background: var(--error);
}

.usage-bar-label {
    font-size: 0.75rem;
    color: var(--text-tertiary);
}

/* === Generation Summary === */
.generation-summary {
    text-align: center;
    font-size: 0.75rem;
    color: var(--text-tertiary);
    margin-top: 0.75rem;
    min-height: 1.2em;
}

/* === Buttons === */
.btn-generate {
    display: block;
    width: 100%;
    margin-top: 1.5rem;
    padding: 0.75rem;
    background: var(--accent);
    color: var(--bg-primary);
    border: 1px solid transparent;
    border-radius: var(--radius-md);
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: background var(--transition-fast);
    box-shadow: var(--shadow-sm);
}

.btn-generate:hover {
    background: var(--accent-hover);
}

.btn-generate:disabled {
    opacity: 0.4;
    cursor: not-allowed;
    filter: grayscale(0.2);
}

.btn-clear {
    background: none;
    border: none;
    color: var(--text-tertiary);
    font-size: 1.2rem;
    cursor: pointer;
    padding: 0 0.3rem;
    line-height: 1;
    transition: color var(--transition-fast);
}

.btn-clear:hover {
    color: var(--text-primary);
}

/* === Flash Banner === */
.flash-banner {
    margin-bottom: 1.5rem;
    padding: 0.75rem 1rem;
    background: rgba(48, 164, 108, 0.12);
    border: 1px solid var(--success);
    border-radius: var(--radius-md);
    color: var(--success);
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 0.875rem;
}

/* === Tier Upgrade Prompts === */
.tier-upgrade-note {
    margin-top: 0.5rem;
    font-size: 0.8125rem;
    color: var(--text-secondary);
}

.tier-upgrade-note a {
    color: var(--accent);
    text-decoration: none;
    font-weight: 500;
}

.tier-upgrade-note a:hover {
    text-decoration: underline;
}

.tier-upgrade-banner {
    margin-top: 1rem;
    margin-bottom: 0.5rem;
    padding: 1rem;
    background: var(--accent-muted);
    border: 1px solid var(--accent);
    border-radius: var(--radius-md);
    text-align: center;
    color: var(--text-secondary);
    font-size: 0.875rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    flex-wrap: wrap;
}

/* === Error Banner === */
/* Patreon connect gate */
.patreon-gate {
    margin-top: 1rem;
    padding: 1.25rem 1.5rem;
    background: rgba(249, 104, 84, 0.06);
    border: 1px solid rgba(249, 104, 84, 0.2);
    border-radius: var(--radius-lg);
    text-align: center;
}

.patreon-gate-text {
    color: var(--text-secondary);
    margin-bottom: 0.75rem;
    font-size: 0.875rem;
}

.patreon-gate-btn {
    display: inline-block;
    padding: 0.6rem 1.5rem;
    background: #f96854;
    color: #fff;
    border-radius: var(--radius-sm);
    text-decoration: none;
    font-weight: 600;
    font-size: 0.875rem;
    transition: background var(--transition-fast);
}

.patreon-gate-btn:hover {
    background: #e5553d;
}

.error-banner {
    margin-top: 1rem;
    padding: 0.75rem 1rem;
    background: rgba(229, 72, 77, 0.1);
    border: 1px solid var(--error);
    border-radius: var(--radius-md);
    color: var(--error);
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 0.875rem;
}

/* === Progress === */
.progress-section {
    margin-top: 1.5rem;
    text-align: center;
}

.progress-section h3 {
    margin-bottom: 1rem;
    color: var(--text-primary);
    font-weight: 600;
    font-size: 1rem;
}

.progress-bar-track {
    width: 100%;
    height: 4px;
    background: var(--border-hover);
    border-radius: var(--radius-full);
    overflow: hidden;
}

.progress-bar-fill {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, var(--accent), var(--accent-hover));
    border-radius: var(--radius-full);
    transition: width 0.3s ease;
}

.progress-text {
    margin-top: 0.75rem;
    color: var(--text-secondary);
    font-size: 0.8125rem;
}

/* === Result Section (Player) === */
.result-section {
    margin-top: 1.5rem;
    text-align: center;
}

.result-section h3 {
    margin-bottom: 1rem;
    color: var(--success);
    font-weight: 600;
    font-size: 1rem;
}

.audio-player {
    margin-bottom: 1rem;
}

.audio-player audio {
    width: 100%;
    border-radius: var(--radius-md);
    outline: none;
}

.result-actions {
    display: flex;
    gap: 0.75rem;
    justify-content: center;
    margin-top: 1rem;
}

.btn-result {
    display: inline-block;
    padding: 0.5rem 1rem;
    border-radius: var(--radius-md);
    font-size: 0.875rem;
    font-weight: 500;
    text-decoration: none;
    cursor: pointer;
    transition: all var(--transition-fast);
    background: var(--accent);
    color: var(--bg-primary);
}

.btn-result:hover {
    background: var(--accent-hover);
}

.btn-result-secondary {
    background: transparent;
    border: 1px solid var(--accent);
    color: var(--accent);
}

.btn-result-secondary:hover {
    background: var(--accent);
    color: var(--bg-primary);
}

.result-meta {
    margin-top: 0.75rem;
    font-size: 0.75rem;
    color: var(--text-tertiary);
}

/* === Top Navigation === */
.top-nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem 1.5rem;
    background: var(--bg-primary);
    border-bottom: 1px solid var(--border);
}

.nav-links {
    display: flex;
    gap: 0.25rem;
}

.nav-link {
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 0.8125rem;
    font-weight: 500;
    padding: 0.375rem 0.75rem;
    border-radius: var(--radius-sm);
    transition: all var(--transition-fast);
}

.nav-link:hover {
    color: var(--text-primary);
    background: rgba(255, 255, 255, 0.04);
}

.nav-link.active {
    color: var(--text-primary);
    background: rgba(255, 255, 255, 0.06);
}

.nav-right {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.nav-user {
    color: var(--text-tertiary);
    font-size: 0.8125rem;
}

.nav-crown {
    display: inline-flex;
    align-items: center;
    margin-left: 0.3rem;
    cursor: default;
    filter: drop-shadow(0 0 3px rgba(255, 215, 0, 0.5));
    transition: filter var(--transition-fast);
}

.nav-crown:hover {
    filter: drop-shadow(0 0 6px rgba(255, 215, 0, 0.8));
}

.logout-form {
    display: inline;
}

.btn-logout {
    background: none;
    border: 1px solid var(--border);
    color: var(--text-secondary);
    padding: 0.3rem 0.75rem;
    border-radius: var(--radius-sm);
    font-size: 0.75rem;
    font-weight: 500;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.btn-logout:hover {
    color: var(--text-primary);
    border-color: var(--border-hover);
}

/* === Login / Register Form === */
.login-form {
    max-width: 380px;
    margin: 0 auto;
    padding: 2rem;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
}

.form-group {
    margin-bottom: 1.25rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.4rem;
    color: var(--text-secondary);
    font-size: 0.8125rem;
    font-weight: 500;
}

.form-group input {
    width: 100%;
    padding: 0.625rem 0.75rem;
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-size: 0.875rem;
    font-family: inherit;
    transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}

.form-group input:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 2px var(--accent-muted);
}

.form-group input::placeholder {
    color: var(--text-tertiary);
}

.login-form .error-banner {
    margin-top: 0;
    margin-bottom: 1.25rem;
}

.login-form .cf-turnstile {
    display: flex;
    justify-content: center;
    margin-bottom: 1.25rem;
}

.login-form .btn-generate {
    margin-top: 0.5rem;
}

.form-link {
    margin-top: 1rem;
    text-align: center;
    color: var(--text-secondary);
    font-size: 0.8125rem;
}

.form-link a {
    color: var(--accent);
    text-decoration: none;
}

.form-link a:hover {
    text-decoration: underline;
}

/* === Library Page === */
.library-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.library-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 1.25rem 1.5rem;
    transition: border-color var(--transition-fast);
}

.library-card:hover {
    border-color: var(--border-hover);
}

.library-card-header {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    margin-bottom: 0.4rem;
}

.library-card-title {
    font-size: 0.9375rem;
    font-weight: 500;
    color: var(--text-primary);
}

.library-card-date {
    font-size: 0.75rem;
    color: var(--text-tertiary);
    white-space: nowrap;
}

.library-card-meta {
    display: flex;
    justify-content: space-between;
    font-size: 0.75rem;
    color: var(--text-tertiary);
    margin-bottom: 0.75rem;
}

.library-card-player {
    margin-bottom: 0.75rem;
}

.library-card-player audio {
    width: 100%;
    height: 36px;
    border-radius: var(--radius-sm);
}

.library-card-actions {
    display: flex;
    gap: 0.375rem;
    align-items: center;
}

.library-card-actions .btn-danger {
    margin-left: auto;
}

.library-header {
    margin-bottom: 1rem;
    font-size: 0.8125rem;
    color: var(--text-tertiary);
}

.library-load-more {
    text-align: center;
    margin-top: 1.5rem;
}

/* === Texts Page === */
.texts-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.text-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 1.25rem 1.5rem;
    transition: border-color var(--transition-fast);
}

.text-card:hover {
    border-color: var(--border-hover);
}

.text-card-header {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    margin-bottom: 0.4rem;
}

.text-card-title {
    font-size: 0.9375rem;
    font-weight: 500;
    color: var(--text-primary);
}

.text-card-date {
    font-size: 0.75rem;
    color: var(--text-tertiary);
}

.text-card-meta {
    display: flex;
    gap: 0.75rem;
    align-items: center;
    font-size: 0.75rem;
    color: var(--text-tertiary);
    margin-bottom: 0.75rem;
}

.text-badge {
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 0.1rem 0.5rem;
    font-size: 0.6875rem;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.text-card-actions {
    display: flex;
    gap: 0.375rem;
    align-items: center;
}

.text-card-actions .btn-danger {
    margin-left: auto;
}

.texts-toolbar {
    display: flex;
    justify-content: flex-end;
    margin-bottom: 1.25rem;
}

.new-text-card {
    margin-bottom: 1rem;
    border-radius: var(--radius-lg);
}

.new-text-field {
    margin-bottom: 0.75rem;
}
.new-text-field label {
    display: block;
    font-size: 0.8125rem;
    color: var(--text-secondary);
    margin-bottom: 0.25rem;
    font-weight: 500;
}

.new-text-title-input {
    width: 100%;
    padding: 0.5rem 0.75rem;
    background: var(--bg-surface);
    color: var(--text-primary);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    font-family: inherit;
    font-size: 0.875rem;
    transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}
.new-text-title-input:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 2px var(--accent-muted);
}

.btn-edit {
    background: var(--accent);
    color: var(--bg-primary);
}
.btn-edit:hover {
    filter: brightness(1.1);
}

.text-card-editor {
    margin-top: 0.75rem;
    border-top: 1px solid var(--border);
    padding-top: 0.75rem;
}

.text-editor-area {
    width: 100%;
    min-height: 200px;
    padding: 0.75rem;
    background: var(--bg-surface);
    color: var(--text-primary);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    font-family: inherit;
    font-size: 0.875rem;
    line-height: 1.6;
    resize: vertical;
    transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}
.text-editor-area:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 2px var(--accent-muted);
}

.text-editor-actions {
    display: flex;
    gap: 0.5rem;
    margin-top: 0.5rem;
    justify-content: flex-end;
}

/* === Empty State === */
.empty-state {
    text-align: center;
    color: var(--text-tertiary);
    padding: 3rem 1rem;
    font-size: 0.9375rem;
}

/* === Landing Page === */
.landing-body {
    background: var(--bg-primary);
}

.landing-hero {
    min-height: 70vh;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 6rem 1.5rem 4rem;
    background:
        radial-gradient(ellipse at 50% 0%, rgba(26, 27, 36, 0.8) 0%, transparent 70%),
        var(--bg-primary);
}

.landing-hero-inner {
    max-width: 680px;
}

.landing-title {
    font-size: 2.75rem;
    font-weight: 700;
    color: var(--accent);
    letter-spacing: -0.02em;
    line-height: 1.15;
    margin-bottom: 1.25rem;
}

.landing-tagline {
    font-size: 1.0625rem;
    color: var(--text-secondary);
    line-height: 1.7;
    margin-bottom: 2.5rem;
    max-width: 540px;
    margin-left: auto;
    margin-right: auto;
}

.landing-cta-group {
    display: flex;
    gap: 0.75rem;
    justify-content: center;
    flex-wrap: wrap;
}

.landing-btn {
    display: inline-block;
    padding: 0.75rem 1.75rem;
    border-radius: var(--radius-md);
    font-size: 0.9375rem;
    font-weight: 600;
    text-decoration: none;
    transition: all var(--transition-fast);
    cursor: pointer;
}

.landing-btn:hover {
    transform: none;
}

.landing-btn-primary {
    background: var(--accent);
    color: var(--bg-primary);
}

.landing-btn-primary:hover {
    background: var(--accent-hover);
}

.landing-btn-secondary {
    background: transparent;
    color: var(--accent);
    border: 1px solid var(--accent);
}

.landing-btn-secondary:hover {
    background: var(--accent-muted);
}

.landing-container {
    max-width: 900px;
    margin: 0 auto;
    padding: 0 1.5rem;
}

.landing-section-title {
    text-align: center;
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 3rem;
    letter-spacing: -0.01em;
}

/* Features */
.landing-features {
    padding: 5rem 0;
    background: var(--bg-secondary);
}

.landing-feature-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
}

.landing-feature-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 2rem;
    text-align: left;
    transition: border-color var(--transition-fast);
}

.landing-feature-card:hover {
    border-color: var(--border-hover);
}

.landing-feature-icon {
    color: var(--accent);
    margin-bottom: 1rem;
    width: 28px;
    height: 28px;
}

.landing-feature-icon svg {
    width: 28px;
    height: 28px;
}

.landing-feature-card h3 {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
}

.landing-feature-card p {
    font-size: 0.8125rem;
    color: var(--text-secondary);
    line-height: 1.6;
}

/* Hear Our Voices */
.landing-voices {
    padding: 5rem 0;
    background: var(--bg-secondary);
}

.landing-voices-subtitle {
    text-align: center;
    color: var(--text-secondary);
    margin-bottom: 2rem;
    font-size: 0.9375rem;
}

.landing-voice-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 0.75rem;
    max-width: 900px;
    margin: 0 auto;
}

.landing-voice-sample {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 1rem 1.25rem;
    transition: border-color var(--transition-fast);
}

.landing-voice-sample:hover {
    border-color: var(--border-hover);
}

.landing-voice-info {
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
}

.landing-voice-name {
    font-weight: 500;
    font-size: 0.9375rem;
    color: var(--text-primary);
}

.landing-voice-detail {
    font-size: 0.75rem;
    color: var(--text-tertiary);
}

.landing-play-btn {
    background: transparent;
    border: 1px solid var(--accent);
    color: var(--accent);
    padding: 0.375rem 0.875rem;
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-size: 0.8125rem;
    font-weight: 500;
    white-space: nowrap;
    transition: all var(--transition-fast);
}

.landing-play-btn:hover {
    background: var(--accent);
    color: var(--bg-primary);
}

.landing-play-btn.playing {
    background: var(--accent);
    color: var(--bg-primary);
}

/* Steps */
.landing-steps {
    padding: 5rem 0;
}

.landing-steps-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 2.5rem;
}

.landing-step {
    text-align: center;
}

.landing-step-number {
    width: 40px;
    height: 40px;
    margin: 0 auto 1rem;
    background: var(--accent);
    color: var(--bg-primary);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    font-weight: 700;
}

.landing-step h3 {
    font-size: 0.9375rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
}

.landing-step p {
    font-size: 0.8125rem;
    color: var(--text-secondary);
    line-height: 1.6;
}

/* Final CTA */
.landing-final-cta {
    padding: 5rem 0;
    background: var(--bg-secondary);
    text-align: center;
}

.landing-final-cta h2 {
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.75rem;
    letter-spacing: -0.01em;
}

.landing-final-cta p {
    color: var(--text-secondary);
    font-size: 0.9375rem;
    margin-bottom: 2rem;
}

/* === Landing Nav === */
.landing-nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1.25rem 2rem;
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    z-index: 10;
}

.landing-nav-brand {
    font-size: 1.0625rem;
    font-weight: 600;
    color: var(--accent);
    text-decoration: none;
    letter-spacing: -0.01em;
}

.landing-nav-links {
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

.landing-nav-link {
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 0.875rem;
    font-weight: 500;
    transition: color var(--transition-fast);
}

.landing-nav-link:hover {
    color: var(--text-primary);
}

.landing-btn-sm {
    padding: 0.4375rem 1.125rem;
    font-size: 0.8125rem;
}

/* === Landing Pricing Preview === */
.landing-pricing-preview {
    padding: 5rem 0;
    background: var(--bg-secondary);
}

.landing-pricing-subtitle {
    text-align: center;
    color: var(--text-secondary);
    font-size: 0.9375rem;
    margin-top: -1.5rem;
    margin-bottom: 2.5rem;
}

.landing-pricing-strip {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 0.625rem;
}

.landing-pricing-chip {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 1rem 0.75rem;
    text-align: center;
    transition: border-color var(--transition-fast);
}

.landing-pricing-chip:hover {
    border-color: var(--border-hover);
}

.landing-pricing-chip-featured {
    border-color: var(--accent);
    background: var(--accent-muted);
}

.landing-pricing-chip-name {
    display: block;
    font-weight: 600;
    font-size: 0.75rem;
    color: var(--text-primary);
    margin-bottom: 0.35rem;
}

.landing-pricing-chip-price {
    display: block;
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--accent);
    margin-bottom: 0.3rem;
}

.landing-pricing-chip-detail {
    display: block;
    font-size: 0.6875rem;
    color: var(--text-tertiary);
}

/* === Pricing Page === */
.pricing-hero {
    text-align: center;
    padding: 6rem 1.5rem 2rem;
    background:
        radial-gradient(ellipse at 50% 0%, rgba(26, 27, 36, 0.8) 0%, transparent 70%),
        var(--bg-primary);
}

.pricing-container {
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 1.5rem;
}

.pricing-section {
    padding: 2rem 0 4rem;
}

.pricing-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
}

.pricing-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 1.75rem 1.5rem;
    display: flex;
    flex-direction: column;
    position: relative;
    transition: border-color var(--transition-fast);
}

.pricing-card:hover {
    border-color: var(--border-hover);
}

.pricing-card-featured {
    border-color: var(--accent);
    background: var(--accent-muted);
}

.pricing-card-badge {
    position: absolute;
    top: -12px;
    left: 50%;
    transform: translateX(-50%);
    background: var(--accent);
    color: var(--bg-primary);
    font-size: 0.6875rem;
    font-weight: 700;
    padding: 0.25rem 0.875rem;
    border-radius: var(--radius-full);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.pricing-card-header {
    text-align: center;
    margin-bottom: 1.5rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid var(--border);
}

.pricing-card-tier {
    display: block;
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
}

.pricing-card-price {
    font-size: 2.25rem;
    font-weight: 700;
    color: var(--accent);
    line-height: 1;
    letter-spacing: -0.02em;
}

.pricing-card-mo {
    font-size: 0.9375rem;
    font-weight: 400;
    color: var(--text-secondary);
}

.pricing-card-period {
    display: block;
    font-size: 0.75rem;
    color: var(--text-tertiary);
    margin-top: 0.25rem;
}

.pricing-card-features {
    list-style: none;
    padding: 0;
    margin: 0 0 1.5rem 0;
    flex: 1;
}

.pricing-card-features li {
    padding: 0.35rem 0;
    font-size: 0.8125rem;
    color: var(--text-secondary);
    padding-left: 1.5rem;
    position: relative;
}

.pricing-card-features li::before {
    content: "\2713";
    position: absolute;
    left: 0;
    color: var(--accent);
    font-weight: 600;
    font-size: 0.75rem;
}

.pricing-card-features li strong {
    color: var(--text-primary);
}

.pricing-feature-muted {
    opacity: 0.4;
}

.pricing-feature-muted::before {
    content: "\2013" !important;
    color: var(--text-tertiary) !important;
}

.pricing-feature-check {
    color: var(--success) !important;
}

.pricing-card-btn {
    display: block;
    text-align: center;
    padding: 0.625rem 1rem;
    border-radius: var(--radius-md);
    font-size: 0.875rem;
    font-weight: 600;
    text-decoration: none;
    transition: all var(--transition-fast);
}

.pricing-card-btn:hover {
    transform: none;
}

.pricing-card-btn-primary {
    background: transparent;
    color: var(--accent);
    border: 1px solid var(--accent);
}

.pricing-card-btn-primary:hover {
    background: var(--accent-muted);
}

.pricing-card-btn-secondary {
    background: var(--accent-muted);
    color: var(--accent);
    border: 1px solid var(--border);
}

.pricing-card-btn-accent {
    background: var(--accent);
    color: var(--bg-primary);
}

.pricing-card-btn-accent:hover {
    background: var(--accent-hover);
}

/* Voice Categories */
.pricing-categories {
    padding: 4rem 0;
    background: var(--bg-secondary);
}

.pricing-categories-subtitle {
    text-align: center;
    color: var(--text-secondary);
    font-size: 0.9375rem;
    margin-top: -1.5rem;
    margin-bottom: 2.5rem;
}

.pricing-categories-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.75rem;
}

.pricing-category-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 1.25rem;
    transition: border-color var(--transition-fast);
}

.pricing-category-card:hover {
    border-color: var(--border-hover);
}

.pricing-category-card h4 {
    font-size: 0.9375rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.2rem;
}

.pricing-category-count {
    font-size: 0.75rem;
    color: var(--accent);
    font-weight: 600;
}

.pricing-category-card p {
    font-size: 0.8125rem;
    color: var(--text-secondary);
    line-height: 1.5;
    margin: 0.5rem 0;
}

.pricing-category-tier {
    display: inline-block;
    font-size: 0.6875rem;
    font-weight: 500;
    color: var(--text-secondary);
    background: rgba(255, 255, 255, 0.04);
    padding: 0.2rem 0.6rem;
    border-radius: var(--radius-sm);
}

/* Comparison Table */
.pricing-comparison {
    padding: 4rem 0;
}

.pricing-table-wrap {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.pricing-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.8125rem;
    min-width: 600px;
}

.pricing-table th,
.pricing-table td {
    padding: 0.75rem 1rem;
    text-align: center;
    border-bottom: 1px solid var(--border);
}

.pricing-table th:first-child,
.pricing-table td:first-child {
    text-align: left;
    font-weight: 500;
    color: var(--text-primary);
}

.pricing-table th {
    font-weight: 500;
    font-size: 0.75rem;
    color: var(--text-secondary);
    background: var(--bg-secondary);
    position: sticky;
    top: 0;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.pricing-table td {
    color: var(--text-secondary);
}

.pricing-table tr:hover td {
    background: rgba(255, 255, 255, 0.02);
}

.pricing-table-featured {
    background: var(--accent-muted) !important;
}

.pricing-check {
    color: var(--accent) !important;
    font-size: 1rem;
}

.pricing-cross {
    color: rgba(122, 123, 142, 0.3) !important;
    font-size: 0.9375rem;
}

/* FAQ */
.pricing-faq {
    padding: 4rem 0;
    background: var(--bg-secondary);
}

.pricing-faq-list {
    max-width: 740px;
    margin: 0 auto;
}

.pricing-faq-item {
    border-bottom: 1px solid var(--border);
}

.pricing-faq-item summary {
    padding: 1rem 0;
    font-size: 0.9375rem;
    font-weight: 500;
    color: var(--text-primary);
    cursor: pointer;
    list-style: none;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.pricing-faq-item summary::after {
    content: "+";
    font-size: 1.25rem;
    color: var(--text-tertiary);
    font-weight: 300;
    transition: transform var(--transition-fast);
}

.pricing-faq-item[open] summary::after {
    content: "\2212";
}

.pricing-faq-item summary::-webkit-details-marker {
    display: none;
}

.pricing-faq-item p {
    padding: 0 0 1.25rem;
    font-size: 0.875rem;
    color: var(--text-secondary);
    line-height: 1.7;
}

/* === Profile Page === */
.profile-section {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    margin-bottom: 1rem;
}

.profile-section-title {
    font-size: 0.6875rem;
    font-weight: 600;
    color: var(--text-tertiary);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    margin-bottom: 1rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid var(--border);
}

.profile-info-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.625rem 0;
}

.profile-info-row + .profile-info-row {
    border-top: 1px solid var(--border);
}

.profile-label {
    color: var(--text-secondary);
    font-size: 0.8125rem;
}

.profile-value {
    color: var(--text-primary);
    font-size: 0.875rem;
    text-align: right;
}

.profile-badge {
    display: inline-block;
    padding: 0.15rem 0.6rem;
    border-radius: var(--radius-full);
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.02em;
}

.profile-badge-free {
    background: rgba(122, 123, 142, 0.12);
    color: var(--text-secondary);
    border: 1px solid var(--border);
}

.profile-badge-patron {
    background: var(--accent-muted);
    color: var(--accent);
    border: 1px solid var(--accent);
}

.profile-badge-owner {
    background: rgba(255, 215, 0, 0.1);
    color: #FFD700;
    border: 1px solid rgba(255, 215, 0, 0.3);
}

.profile-badge-adventurer {
    background: rgba(48, 164, 108, 0.12);
    color: #30a46c;
    border: 1px solid rgba(48, 164, 108, 0.3);
}

.profile-badge-scribe {
    background: rgba(52, 152, 219, 0.12);
    color: #3498db;
    border: 1px solid rgba(52, 152, 219, 0.3);
}

.profile-badge-bard {
    background: rgba(155, 89, 182, 0.12);
    color: #bb7fe2;
    border: 1px solid rgba(155, 89, 182, 0.3);
}

.profile-badge-archmage {
    background: rgba(229, 72, 77, 0.12);
    color: #e5484d;
    border: 1px solid rgba(229, 72, 77, 0.3);
}

.profile-badge-deity {
    background: linear-gradient(135deg, rgba(255, 215, 0, 0.1), rgba(192, 192, 192, 0.06));
    color: #FFD700;
    border: 1px solid rgba(255, 215, 0, 0.3);
}

/* === Usage Section === */
.usage-bar-track {
    width: 100%;
    height: 4px;
    background: var(--border-hover);
    border-radius: var(--radius-full);
    overflow: hidden;
    margin-bottom: 0.75rem;
}

.usage-bar-fill {
    height: 100%;
    background: var(--accent);
    border-radius: var(--radius-full);
    transition: width 0.4s ease;
}

.usage-stats {
    display: flex;
    justify-content: space-between;
    font-size: 0.8125rem;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
}

.usage-meta {
    display: flex;
    justify-content: space-between;
    font-size: 0.75rem;
    color: var(--text-tertiary);
    margin-bottom: 0.5rem;
}

.usage-commercial {
    margin-top: 0.5rem;
    font-size: 0.8125rem;
    color: var(--success);
}

.profile-form {
    display: flex;
    flex-direction: column;
    gap: 0;
}

.profile-form .form-group {
    margin-bottom: 1rem;
}

.profile-form .form-group label {
    display: block;
    margin-bottom: 0.4rem;
    color: var(--text-secondary);
    font-size: 0.8125rem;
    font-weight: 500;
}

.profile-form .form-group input {
    width: 100%;
    padding: 0.5rem 0.75rem;
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-size: 0.875rem;
    font-family: inherit;
    transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}

.profile-form .form-group input:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 2px var(--accent-muted);
}

.profile-form .btn-small {
    align-self: flex-start;
}

.profile-status {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.8125rem;
    font-weight: 500;
}

.profile-status::before {
    content: '';
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
}

.profile-status-linked {
    color: var(--success);
}

.profile-status-linked::before {
    background: var(--success);
    box-shadow: 0 0 4px rgba(48, 164, 108, 0.5);
}

.profile-status-unlinked {
    color: var(--text-secondary);
}

.profile-status-unlinked::before {
    background: var(--text-secondary);
}

.profile-status-error {
    color: var(--error);
}

.profile-status-error::before {
    background: var(--error);
    box-shadow: 0 0 4px rgba(229, 72, 77, 0.5);
}

.patreon-warning {
    color: var(--text-secondary);
    font-size: 0.8125rem;
    margin: 0.5rem 0;
    padding: 0.5rem 0.75rem;
    background: rgba(249, 104, 84, 0.06);
    border-radius: var(--radius-sm);
    border-left: 3px solid #f96854;
}

.profile-message {
    display: inline-block;
    margin-left: 0.75rem;
    font-size: 0.8125rem;
    min-height: 1.2em;
}

.profile-msg-success {
    color: var(--success);
}

.profile-msg-error {
    color: var(--error);
}

#patreon-actions {
    margin-top: 0.75rem;
}

/* === Footer === */
footer {
    text-align: center;
    padding: 2.5rem 1rem;
    color: var(--text-tertiary);
    font-size: 0.75rem;
    border-top: 1px solid var(--border);
}

/* === App Two-Column Layout (Generate page) === */
.container-app-wide {
    max-width: 1400px;
    padding: 1.5rem 2rem;
}

.app-layout {
    display: flex;
    gap: 2rem;
    align-items: flex-start;
}

.app-main {
    flex: 1;
    min-width: 0;
    max-width: 780px;
}

.app-main header {
    text-align: left;
    margin-bottom: 1.5rem;
}

.app-main header h1 {
    font-size: 1.375rem;
    font-weight: 600;
    color: var(--text-primary);
    letter-spacing: -0.01em;
}

.app-main .subtitle {
    font-size: 0.8125rem;
    color: var(--text-tertiary);
}

.app-main .btn-generate {
    max-width: 500px;
    margin-left: auto;
    margin-right: auto;
}

.app-sidebar {
    width: 300px;
    flex-shrink: 0;
    position: sticky;
    top: 1rem;
    max-height: calc(100vh - 80px);
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: var(--border) transparent;
}

.app-sidebar::-webkit-scrollbar {
    width: 4px;
}

.app-sidebar::-webkit-scrollbar-thumb {
    background: var(--border);
    border-radius: 2px;
}

.app-sidebar .settings-card {
    margin-top: 0;
    padding: 1rem 1.25rem;
}

.app-sidebar .settings-row {
    margin-bottom: 1rem;
}

.app-sidebar .settings-row-pair {
    grid-template-columns: 1fr;
    gap: 0.85rem;
}

.app-sidebar .generation-summary {
    text-align: left;
    margin-top: 0.5rem;
    font-size: 0.75rem;
}

/* === Responsive === */
@media (max-width: 900px) {
    .pricing-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .pricing-categories-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .landing-pricing-strip {
        grid-template-columns: repeat(3, 1fr);
    }

    .app-sidebar {
        width: 260px;
    }
}

@media (max-width: 768px) {
    .app-layout {
        flex-direction: column;
    }

    .app-main {
        max-width: none;
        width: 100%;
    }

    .app-main .btn-generate {
        max-width: none;
    }

    .app-sidebar {
        width: 100%;
        position: static;
        max-height: none;
        overflow-y: visible;
    }

    .app-main header {
        text-align: center;
    }

    .app-main header h1 {
        font-size: 1.5rem;
    }

    .app-sidebar .settings-row-pair {
        grid-template-columns: 1fr 1fr;
    }

    .app-sidebar .generation-summary {
        text-align: center;
    }

    .landing-feature-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 600px) {
    .container,
    .container-app-wide {
        padding: 1rem;
    }

    header h1 {
        font-size: 1.375rem;
    }

    .app-sidebar .settings-row-pair {
        grid-template-columns: 1fr;
    }

    .drop-zone {
        padding: 2rem 1rem;
    }

    /* Stack speed/pitch sliders on mobile */
    .settings-row-pair {
        grid-template-columns: 1fr;
        gap: 1rem;
    }

    .top-nav {
        flex-wrap: wrap;
        gap: 0.4rem 0.5rem;
        padding: 0.5rem 0.75rem;
    }

    .nav-links {
        flex-wrap: wrap;
        gap: 0.15rem;
        order: 2;
        width: 100%;
        justify-content: center;
    }

    .nav-link {
        font-size: 0.75rem;
        padding: 0.25rem 0.5rem;
    }

    .nav-right {
        order: 1;
        margin-left: auto;
    }

    .nav-user {
        font-size: 0.75rem;
        max-width: 100px;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    .btn-logout {
        font-size: 0.6875rem;
        padding: 0.2rem 0.5rem;
    }

    .library-card-header,
    .text-card-header {
        flex-direction: column;
        gap: 0.2rem;
    }

    .library-card-actions,
    .text-card-actions {
        flex-wrap: wrap;
    }

    /* Landing page responsive */
    .landing-nav {
        padding: 0.75rem 1rem;
    }

    .landing-nav-brand {
        font-size: 0.9375rem;
    }

    .landing-nav-links {
        gap: 0.75rem;
    }

    .landing-title {
        font-size: 2rem;
    }

    .landing-tagline {
        font-size: 0.9375rem;
    }

    .landing-hero {
        min-height: auto;
        padding: 5rem 1rem 2rem;
    }

    .landing-feature-grid,
    .landing-steps-grid {
        grid-template-columns: 1fr;
        gap: 0.75rem;
    }

    .landing-section-title {
        font-size: 1.25rem;
    }

    .landing-final-cta h2 {
        font-size: 1.25rem;
    }

    .landing-pricing-strip {
        grid-template-columns: repeat(2, 1fr);
    }

    /* Pricing page responsive */
    .pricing-hero {
        padding: 5rem 1rem 1.5rem;
    }

    .pricing-grid {
        grid-template-columns: 1fr;
        max-width: 400px;
        margin: 0 auto;
    }

    .pricing-categories-grid {
        grid-template-columns: 1fr;
    }

    .pricing-card-price {
        font-size: 2rem;
    }

    /* Profile page responsive */
    .profile-info-row {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.2rem;
    }

    .profile-value {
        text-align: left;
    }

    .profile-message {
        display: block;
        margin-left: 0;
        margin-top: 0.5rem;
    }

    /* Voice modal: full-screen on mobile */
    .voice-modal {
        width: 100%;
        max-width: 100%;
        height: 100%;
        max-height: 100%;
        border-radius: 0;
    }

    .voice-card-grid {
        grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
        gap: 0.5rem;
    }

    /* Larger slider touch targets on mobile */
    input[type="range"]::-webkit-slider-thumb {
        width: 24px;
        height: 24px;
    }

    input[type="range"]::-moz-range-thumb {
        width: 24px;
        height: 24px;
    }

    /* Result actions stack */
    .result-actions {
        flex-direction: column;
        gap: 0.5rem;
    }

    /* Landing voice grid */
    .landing-voice-grid {
        grid-template-columns: 1fr;
    }

    /* Preset inline form */
    .preset-save-inline {
        flex-wrap: wrap;
    }

    /* Filter chips scroll on mobile */
    .voice-modal-filters {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    /* Admin stat cards stack on mobile */
    .admin-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    .admin-table {
        font-size: 0.6875rem;
    }
    .admin-table th, .admin-table td {
        padding: 0.3rem 0.5rem;
    }
}


/* ═══════════════════════════════════════════════════════════════
   Admin Panel
   ═══════════════════════════════════════════════════════════════ */

.container-admin {
    max-width: 1000px;
}

.admin-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 0.75rem;
    margin-bottom: 1.25rem;
}

.admin-stat-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 1.25rem;
    text-align: center;
}

.admin-stat-value {
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--accent);
    letter-spacing: -0.02em;
}

.admin-stat-label {
    font-size: 0.6875rem;
    font-weight: 500;
    color: var(--text-tertiary);
    margin-top: 0.25rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.admin-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.8125rem;
}

.admin-table th {
    text-align: left;
    color: var(--text-tertiary);
    font-weight: 500;
    font-size: 0.6875rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    padding: 0.5rem 0.75rem;
    border-bottom: 1px solid var(--border);
}

.admin-table td {
    padding: 0.5rem 0.75rem;
    border-bottom: 1px solid var(--border);
    color: var(--text-primary);
}

.admin-table tr:hover td {
    background: rgba(255, 255, 255, 0.02);
}

.admin-table code {
    background: var(--bg-elevated);
    padding: 0.15rem 0.4rem;
    border-radius: 3px;
    font-size: 0.75rem;
    color: var(--accent);
}

.admin-tier-select {
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-size: 0.75rem;
    padding: 0.2rem 0.4rem;
    cursor: pointer;
    transition: border-color var(--transition-fast);
}

.admin-tier-select:focus {
    outline: none;
    border-color: var(--accent);
}
.admin-tier-locked {
    color: #FFD700;
    font-weight: 600;
    font-size: 0.75rem;
}
.admin-help {
    color: var(--text-secondary);
    font-size: 0.8125rem;
    line-height: 1.5;
    margin-bottom: 1rem;
}
.admin-help ol {
    margin: 0.5rem 0 0.5rem 1.2rem;
    padding: 0;
}
.admin-help ol li {
    margin-bottom: 0.3rem;
}
.admin-help code {
    background: var(--bg-elevated);
    padding: 0.15rem 0.4rem;
    border-radius: 3px;
    font-size: 0.75rem;
}
.admin-help a {
    color: var(--accent);
}
.admin-stat-desc {
    color: var(--text-tertiary);
    font-size: 0.6875rem;
    margin-top: 0.2rem;
}
.admin-valid {
    color: var(--success);
    font-size: 0.75rem;
}
.admin-invalid {
    color: var(--error);
    font-size: 0.75rem;
}

.admin-search-bar {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1rem;
}

.admin-search-input {
    flex: 1;
    padding: 0.5rem 0.75rem;
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-size: 0.875rem;
    font-family: inherit;
    transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}

.admin-search-input:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 2px var(--accent-muted);
}

.admin-user-count {
    color: var(--text-tertiary);
    font-size: 0.8125rem;
    white-space: nowrap;
}

.admin-pagination {
    display: flex;
    gap: 0.25rem;
    margin-top: 1rem;
    justify-content: center;
}

.admin-hint {
    color: var(--text-secondary);
    font-size: 0.8125rem;
    margin-bottom: 0.75rem;
}

.admin-toggle {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
    font-size: 0.875rem;
}

.admin-toggle input[type="checkbox"] {
    width: 16px;
    height: 16px;
    cursor: pointer;
    accent-color: var(--accent);
}
