/* === 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;
    --bg-input: #161720;

    /* Text */
    --text-primary: #e8e8ec;
    --text-secondary: #8e8fa1;
    --text-tertiary: #8b8c9e;
    --text-muted: #838495;

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

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

    /* Tier badge colors */
    --tier-gold: #FFD700;
    --tier-scribe: #3498db;
    --tier-bard: #bb7fe2;

    /* Text on colored backgrounds */
    --text-on-accent: #fff;

    /* 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 — cubic-bezier for natural, polished feel */
    --transition-fast: 150ms cubic-bezier(0.4, 0, 0.2, 1);
    --transition-base: 200ms cubic-bezier(0.4, 0, 0.2, 1);

    /* Glow tokens */
    --glow-accent: 0 0 20px rgba(201, 162, 103, 0.15);
    --glow-accent-strong: 0 0 30px rgba(201, 162, 103, 0.25);
}

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:focus-visible {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 2px var(--accent-muted);
}

.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:focus-visible {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 2px var(--accent-muted);
}

.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:focus-visible {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 2px var(--accent-muted);
}

.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; }

/* === Settings Select (mood dropdown) === */
.settings-select {
    width: 100%;
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 0.5rem 0.625rem;
    color: var(--text-primary);
    font-size: 0.8125rem;
    font-family: inherit;
    cursor: pointer;
    color-scheme: dark;
}

.settings-select:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.settings-select optgroup {
    font-weight: 600;
    color: var(--text-secondary);
    background: var(--bg-card);
}

.settings-select option {
    color: var(--text-primary);
    background: var(--bg-card);
    padding: 0.25rem 0.5rem;
}

.settings-select option:disabled {
    color: var(--text-secondary);
    opacity: 0.5;
}

.settings-input {
    width: 100%;
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 0.5rem 0.625rem;
    color: var(--text-primary);
    font-size: 0.8125rem;
    font-family: inherit;
}

.settings-hint {
    display: block;
    color: var(--text-secondary);
    font-size: 0.75rem;
    margin-top: 0.25rem;
}

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);
    box-shadow: 0 0 0 2px var(--accent-muted);
}

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:focus-visible {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 2px var(--accent-muted);
}

.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;
    line-height: 1.2;
    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:focus-visible {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 2px var(--accent-muted);
}

.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);
    background: transparent;
    border: 1px solid transparent;
    padding: 0.3rem 0.625rem;
    border-radius: var(--radius-sm);
    font-size: 0.8125rem;
}

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


/* === 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 === */
/* Subscription gate */
.subscription-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;
}

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

.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-bar-fill.indeterminate {
    width: 100% !important;
    background: linear-gradient(
        90deg,
        var(--border-hover) 0%,
        var(--accent) 30%,
        var(--accent-hover) 50%,
        var(--accent) 70%,
        var(--border-hover) 100%
    );
    background-size: 200% 100%;
    animation: progress-shimmer 2s ease-in-out infinite;
}

@keyframes progress-shimmer {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

.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-separator {
    color: var(--border);
    font-size: 0.875rem;
    user-select: none;
    padding: 0 0.125rem;
}
.nav-separator::before {
    content: '│';
}

.nav-chevron {
    vertical-align: middle;
    margin-left: 0.25rem;
    opacity: 0.6;
    transition: transform 0.2s;
}
.nav-dropdown.open .nav-chevron {
    transform: rotate(180deg);
}

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

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

/* === Nav Dropdowns === */
.nav-dropdown {
    position: relative;
}

.nav-dropdown-toggle {
    background: none;
    border: none;
    cursor: pointer;
    font-family: inherit;
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
}

.nav-dropdown-menu {
    display: none;
    position: absolute;
    top: calc(100% + 0.25rem);
    left: 0;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 0.25rem;
    min-width: 160px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
    z-index: 100;
    animation: nav-dropdown-anim 0.15s ease;
}

.nav-dropdown-menu-right {
    left: auto;
    right: 0;
}

.nav-dropdown.open .nav-dropdown-menu {
    display: block;
}

@keyframes nav-dropdown-anim {
    from { opacity: 0; transform: translateY(-4px); }
    to { opacity: 1; transform: translateY(0); }
}

.nav-dropdown-item {
    display: block;
    padding: 0.5rem 0.75rem;
    color: var(--text-secondary);
    text-decoration: none;
    border-radius: calc(var(--radius-md) - 2px);
    font-size: 0.85rem;
    white-space: nowrap;
    cursor: pointer;
    transition: background 0.15s, color 0.15s;
}

.nav-dropdown-item:hover {
    background: var(--bg-elevated);
    color: var(--text-primary);
}

.nav-dropdown-item.active {
    color: var(--accent);
}

.nav-dropdown-divider {
    height: 1px;
    background: var(--border);
    margin: 0.25rem 0;
}

.nav-dropdown-form {
    margin: 0;
}

.nav-dropdown-logout {
    width: 100%;
    text-align: left;
    background: none;
    border: none;
    font-family: inherit;
    color: #e07070;
}

.nav-dropdown-logout:hover {
    background: var(--bg-elevated);
}

.nav-user-toggle {
    font-size: 0.85rem;
}

@media (max-width: 768px) {
    .nav-separator {
        display: none;
    }

    .nav-dropdown-menu {
        position: static;
        box-shadow: none;
        border: none;
        padding: 0 0 0 1rem;
        background: transparent;
        animation: none;
    }

    .nav-dropdown.open .nav-dropdown-menu {
        display: block;
    }

    .nav-dropdown-menu-right {
        left: 0;
        right: auto;
    }

    .nav-user-dropdown {
        width: 100%;
        border-top: 1px solid var(--border);
        margin-top: 0.5rem;
        padding-top: 0.5rem;
    }
}

/* === Library Tab Bar === */
.library-tabs {
    display: flex;
    gap: 0;
    border-bottom: 1px solid var(--border);
    margin-bottom: 1.5rem;
}

.library-tab {
    padding: 0.75rem 1.25rem;
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 0.8125rem;
    font-weight: 500;
    border-bottom: 2px solid transparent;
    transition: color var(--transition-fast), border-color var(--transition-fast);
}

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

.library-tab.active {
    color: var(--text-primary);
    border-bottom-color: var(--accent);
}

.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: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.75rem;
}

.library-list .empty-state,
.texts-list .empty-state {
    grid-column: 1 / -1;
}

.library-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 1rem;
    transition: border-color var(--transition-fast), box-shadow var(--transition-fast), transform var(--transition-fast);
    display: flex;
    flex-direction: column;
}

.library-card:hover {
    border-color: var(--border-hover);
    box-shadow: var(--shadow-md);
    transform: translateY(-1px);
}

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

.library-card-title {
    font-size: 0.8125rem;
    font-weight: 500;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    min-width: 0;
}

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

.library-card-meta {
    font-size: 0.6875rem;
    color: var(--text-tertiary);
    margin-bottom: 0.5rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

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

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

.audio-player audio {
    color-scheme: dark;
}

.library-card-actions {
    display: flex;
    gap: 0.25rem;
    align-items: center;
    margin-top: auto;
}

.library-card-actions .btn-small {
    font-size: 0.6875rem;
    padding: 0.2rem 0.5rem;
}

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

/* Library/Texts toolbar (count + sort) */
.library-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    font-size: 0.8125rem;
    color: var(--text-tertiary);
}

.library-search-input {
    background: var(--bg-surface);
    color: var(--text-primary);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 0.4rem 0.75rem;
    font-size: 0.8125rem;
    font-family: inherit;
    flex: 1;
    max-width: 260px;
    transition: border-color var(--transition-fast);
}

.library-search-input::placeholder {
    color: var(--text-muted);
}

.library-search-input:focus {
    outline: none;
    border-color: var(--accent);
}

.sort-select {
    background: var(--bg-surface);
    color: var(--text-secondary);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 0.3rem 0.5rem;
    font-size: 0.75rem;
    font-family: inherit;
    cursor: pointer;
}

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

/* Pagination */
.pagination {
    display: flex;
    gap: 0.25rem;
    margin-top: 1.5rem;
    justify-content: center;
    align-items: center;
    flex-wrap: wrap;
}

.pagination .btn-small {
    min-width: 2rem;
    text-align: center;
}

.pagination .btn-small.btn-primary {
    pointer-events: none;
}

.pagination .page-ellipsis {
    color: var(--text-tertiary);
    padding: 0 0.25rem;
    font-size: 0.75rem;
    user-select: none;
}

/* === Texts Page === */
.texts-list {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.75rem;
}

.text-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 1rem;
    transition: border-color var(--transition-fast), box-shadow var(--transition-fast), transform var(--transition-fast);
    display: flex;
    flex-direction: column;
}

.text-card:hover {
    border-color: var(--border-hover);
    box-shadow: var(--shadow-md);
    transform: translateY(-1px);
}

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

.text-card-title {
    font-size: 0.8125rem;
    font-weight: 500;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    min-width: 0;
}

.text-card-date {
    font-size: 0.6875rem;
    color: var(--text-tertiary);
    flex-shrink: 0;
}

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

.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.25rem;
    align-items: center;
    flex-wrap: wrap;
    margin-top: auto;
}

.text-card-actions .btn-small {
    font-size: 0.6875rem;
    padding: 0.2rem 0.5rem;
}

.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);
}


.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;
}

/* Text Editor Modal */
.text-editor-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
}

.text-editor-modal {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    width: 100%;
    max-width: 700px;
    max-height: 80vh;
    display: flex;
    flex-direction: column;
}

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

.text-editor-modal-header h3 {
    font-size: 0.9375rem;
    font-weight: 500;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    min-width: 0;
}

.text-editor-modal-close {
    background: none;
    border: none;
    color: var(--text-secondary);
    font-size: 1.25rem;
    cursor: pointer;
    padding: 0.25rem;
    line-height: 1;
    flex-shrink: 0;
}

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

.text-editor-modal-body {
    padding: 1.25rem;
    flex: 1;
    overflow-y: auto;
}

.text-editor-modal .text-editor-area {
    min-height: 300px;
}

.text-editor-modal-footer {
    display: flex;
    gap: 0.5rem;
    justify-content: flex-end;
    padding: 1rem 1.25rem;
    border-top: 1px solid var(--border);
}

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

.empty-state-rich {
    text-align: center;
    padding: 3rem 1.5rem;
    grid-column: 1 / -1;
}

.empty-state-icon {
    font-size: 2.5rem;
    margin-bottom: 0.75rem;
    opacity: 0.5;
}

.empty-state-title {
    font-size: 1rem;
    font-weight: 500;
    color: var(--text-primary);
    margin-bottom: 0.35rem;
}

.empty-state-desc {
    font-size: 0.875rem;
    color: var(--text-tertiary);
    margin-bottom: 1.25rem;
}

.empty-state-cta {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.5rem 1.25rem;
    background: var(--accent);
    color: var(--bg-primary);
    border: none;
    border-radius: var(--radius-md);
    font-size: 0.875rem;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
    transition: background var(--transition-fast);
}

.empty-state-cta:hover {
    background: var(--accent-hover);
}

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

/* --- Hero Section --- */
.landing-hero {
    min-height: auto;
    display: flex;
    align-items: center;
    padding: 7rem 2rem 5rem;
    position: relative;
    overflow: hidden;
    background: var(--bg-primary);
}

/* Background atmosphere */
.hero-atmosphere {
    position: absolute;
    inset: 0;
    pointer-events: none;
}

.hero-grid-pattern {
    position: absolute;
    inset: 0;
    background:
        repeating-linear-gradient(
            45deg,
            transparent, transparent 50px,
            rgba(201, 162, 103, 0.018) 50px,
            rgba(201, 162, 103, 0.018) 51px
        ),
        repeating-linear-gradient(
            -45deg,
            transparent, transparent 50px,
            rgba(201, 162, 103, 0.018) 50px,
            rgba(201, 162, 103, 0.018) 51px
        );
    -webkit-mask-image: radial-gradient(ellipse at 60% 40%, black 20%, transparent 70%);
    mask-image: radial-gradient(ellipse at 60% 40%, black 20%, transparent 70%);
}

.hero-glow {
    position: absolute;
    border-radius: 50%;
    pointer-events: none;
}

.hero-glow--warm {
    width: 800px;
    height: 800px;
    right: -15%;
    top: -15%;
    background: radial-gradient(circle, rgba(201, 162, 103, 0.06) 0%, transparent 60%);
}

.hero-glow--cool {
    width: 500px;
    height: 500px;
    left: -10%;
    bottom: -15%;
    background: radial-gradient(circle, rgba(80, 100, 180, 0.03) 0%, transparent 60%);
}

/* Hero layout grid */
.hero-layout {
    max-width: 1120px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4rem;
    align-items: center;
    position: relative;
    z-index: 1;
    width: 100%;
}

/* Left: Text content */
.hero-content {
    text-align: left;
}

.hero-content .landing-cta-group {
    justify-content: flex-start;
}

/* Eyebrow badge */
.hero-eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.375rem 1rem 0.375rem 0.625rem;
    background: rgba(201, 162, 103, 0.06);
    border: 1px solid rgba(201, 162, 103, 0.15);
    border-radius: var(--radius-full);
    font-size: 0.75rem;
    font-weight: 500;
    color: var(--accent);
    letter-spacing: 0.03em;
    margin-bottom: 1.75rem;
    animation: hero-enter 0.7s cubic-bezier(0.16, 1, 0.3, 1) both;
}

.hero-eyebrow-icon {
    font-size: 0.875rem;
}

/* Hero title — Cinzel serif for TTRPG gravitas */
.landing-title {
    font-family: 'Cinzel', serif;
    font-size: 3.25rem;
    font-weight: 700;
    line-height: 1.12;
    letter-spacing: -0.015em;
    margin-bottom: 1.5rem;
}

.landing-title-line {
    display: block;
    color: var(--text-primary);
    animation: hero-enter 0.7s cubic-bezier(0.16, 1, 0.3, 1) both;
    animation-delay: 0.1s;
}

.landing-title-line--accent {
    color: var(--accent);
    animation-delay: 0.2s;
}

/* Tagline */
.landing-tagline {
    font-size: 1.0625rem;
    color: var(--text-secondary);
    line-height: 1.7;
    margin-bottom: 2rem;
    max-width: 480px;
    animation: hero-enter 0.7s cubic-bezier(0.16, 1, 0.3, 1) both;
    animation-delay: 0.3s;
}

/* CTA entrance */
.hero-content .landing-cta-group {
    animation: hero-enter 0.7s cubic-bezier(0.16, 1, 0.3, 1) both;
    animation-delay: 0.4s;
}

/* Proof stats row */
.hero-proof {
    display: flex;
    align-items: center;
    gap: 1.25rem;
    margin-top: 2.5rem;
    animation: hero-enter 0.7s cubic-bezier(0.16, 1, 0.3, 1) both;
    animation-delay: 0.55s;
}

.hero-proof-item {
    display: flex;
    align-items: baseline;
    gap: 0.35rem;
}

.hero-proof-num {
    font-family: 'Cinzel', serif;
    font-size: 1.375rem;
    font-weight: 700;
    color: var(--accent);
}

.hero-proof-label {
    font-size: 0.6875rem;
    color: var(--text-tertiary);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    font-weight: 500;
}

.hero-proof-sep {
    width: 4px;
    height: 4px;
    border-radius: 50%;
    background: var(--border-hover);
}

/* Right: Visual demo */
.hero-visual {
    position: relative;
    display: flex;
    justify-content: center;
    animation: hero-enter 0.8s cubic-bezier(0.16, 1, 0.3, 1) both;
    animation-delay: 0.3s;
}

/* Demo transformation card */
.hero-demo {
    width: 100%;
    max-width: 380px;
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    padding: 2rem;
    position: relative;
    box-shadow:
        0 0 80px rgba(201, 162, 103, 0.04),
        0 8px 32px rgba(0, 0, 0, 0.3),
        0 1px 2px rgba(0, 0, 0, 0.2);
}

/* Gradient border shimmer */
.hero-demo::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: var(--radius-lg);
    padding: 1px;
    background: linear-gradient(
        135deg,
        rgba(201, 162, 103, 0.35) 0%,
        rgba(201, 162, 103, 0.08) 30%,
        transparent 50%,
        rgba(201, 162, 103, 0.05) 80%,
        rgba(201, 162, 103, 0.2) 100%
    );
    -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
    mask-composite: exclude;
    pointer-events: none;
}

.hero-demo-section {
    padding: 0.25rem 0;
}

.hero-demo-label {
    font-size: 0.625rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--text-tertiary);
    margin-bottom: 0.875rem;
}

/* Text lines with shimmer effect */
.hero-demo-lines {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.hero-demo-line {
    height: 8px;
    border-radius: 4px;
    background: var(--bg-elevated);
    position: relative;
    overflow: hidden;
}

.hero-demo-line:nth-child(1) { width: 88%; }
.hero-demo-line:nth-child(2) { width: 100%; }
.hero-demo-line:nth-child(3) { width: 62%; }
.hero-demo-line:nth-child(4) { width: 84%; }

.hero-demo-line::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(
        90deg,
        transparent 0%,
        rgba(201, 162, 103, 0.12) 50%,
        transparent 100%
    );
    animation: hero-shimmer 3s ease-in-out infinite;
    transform: translateX(-100%);
}

.hero-demo-line:nth-child(2)::after { animation-delay: 0.2s; }
.hero-demo-line:nth-child(3)::after { animation-delay: 0.4s; }
.hero-demo-line:nth-child(4)::after { animation-delay: 0.6s; }

@keyframes hero-shimmer {
    0%   { transform: translateX(-100%); }
    50%  { transform: translateX(100%); }
    100% { transform: translateX(100%); }
}

/* Golden divider */
.hero-demo-divider {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 1.25rem 0;
}

.hero-demo-divider-line {
    flex: 1;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(201, 162, 103, 0.25), transparent);
}

.hero-demo-divider-gem {
    color: var(--accent);
    font-size: 0.75rem;
    animation: hero-gem-pulse 2.5s ease-in-out infinite;
}

@keyframes hero-gem-pulse {
    0%, 100% { opacity: 0.4; transform: scale(1); }
    50%      { opacity: 1; transform: scale(1.15); }
}

/* Waveform bars */
.hero-demo-wave {
    display: flex;
    align-items: flex-end;
    justify-content: center;
    gap: 3px;
    height: 48px;
    margin-bottom: 1rem;
}

.hero-bar {
    width: 3px;
    background: var(--accent);
    border-radius: 1.5px;
    animation: hero-bar-pulse 1.8s ease-in-out infinite;
    opacity: 0.65;
}

.hero-bar:nth-child(1)  { height: 20%; animation-delay: 0s; }
.hero-bar:nth-child(2)  { height: 45%; animation-delay: 0.06s; }
.hero-bar:nth-child(3)  { height: 65%; animation-delay: 0.12s; }
.hero-bar:nth-child(4)  { height: 85%; animation-delay: 0.18s; }
.hero-bar:nth-child(5)  { height: 55%; animation-delay: 0.24s; }
.hero-bar:nth-child(6)  { height: 95%; animation-delay: 0.3s; }
.hero-bar:nth-child(7)  { height: 70%; animation-delay: 0.36s; }
.hero-bar:nth-child(8)  { height: 100%; animation-delay: 0.42s; }
.hero-bar:nth-child(9)  { height: 80%; animation-delay: 0.48s; }
.hero-bar:nth-child(10) { height: 60%; animation-delay: 0.54s; }
.hero-bar:nth-child(11) { height: 90%; animation-delay: 0.6s; }
.hero-bar:nth-child(12) { height: 40%; animation-delay: 0.66s; }
.hero-bar:nth-child(13) { height: 75%; animation-delay: 0.72s; }
.hero-bar:nth-child(14) { height: 50%; animation-delay: 0.78s; }
.hero-bar:nth-child(15) { height: 30%; animation-delay: 0.84s; }
.hero-bar:nth-child(16) { height: 15%; animation-delay: 0.9s; }

@keyframes hero-bar-pulse {
    0%, 100% { transform: scaleY(0.35); opacity: 0.4; }
    50%      { transform: scaleY(1); opacity: 0.75; }
}

/* Voice + mood meta */
.hero-demo-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.hero-demo-voice {
    font-size: 0.75rem;
    color: var(--text-secondary);
    font-weight: 500;
}

.hero-demo-mood-tag {
    font-size: 0.625rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--accent);
    background: var(--accent-muted);
    padding: 0.25rem 0.625rem;
    border-radius: var(--radius-full);
}

/* Floating mood badges */
.hero-float {
    position: absolute;
    padding: 0.375rem 0.75rem;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-full);
    font-size: 0.6875rem;
    font-weight: 500;
    color: var(--text-secondary);
    white-space: nowrap;
    box-shadow: var(--shadow-md);
    animation: hero-float 5s ease-in-out infinite;
}

.hero-float--1 {
    top: -12px;
    right: 0;
    animation-delay: 0s;
}

.hero-float--2 {
    top: 45%;
    left: -20px;
    animation-delay: 1.7s;
}

.hero-float--3 {
    bottom: -12px;
    right: 10%;
    animation-delay: 3.3s;
}

@keyframes hero-float {
    0%, 100% { transform: translateY(0); }
    50%      { transform: translateY(-10px); }
}

/* Entrance animation */
@keyframes hero-enter {
    from {
        opacity: 0;
        transform: translateY(24px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Accessibility: reduce motion */
@media (prefers-reduced-motion: reduce) {
    .hero-demo-line::after,
    .hero-bar,
    .hero-demo-divider-gem,
    .hero-float,
    .hero-eyebrow,
    .landing-title-line,
    .landing-tagline,
    .hero-content .landing-cta-group,
    .hero-proof,
    .hero-visual {
        animation: none !important;
    }
    .hero-bar {
        opacity: 0.6;
    }
}

.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-family: 'Cinzel', serif;
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 3rem;
    letter-spacing: 0;
}

/* 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;
}

.landing-feature-card-wide {
    grid-column: 1 / -1;
    border-color: var(--accent);
    background: var(--accent-muted);
}

/* === Trust Section === */
.landing-trust {
    padding: 5rem 0;
}

.landing-trust-lead {
    text-align: center;
    color: var(--text-secondary);
    font-size: 0.9375rem;
    line-height: 1.7;
    max-width: 700px;
    margin: -1.5rem auto 3rem;
}

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

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

.landing-trust-item:hover {
    border-color: var(--border-hover);
}

.landing-trust-icon {
    color: var(--accent);
    margin-bottom: 1rem;
}

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

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

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

/* === Footer Ethics Line === */
.footer-ethics {
    margin-top: 0.25rem;
    font-size: 0.6875rem;
    color: var(--text-tertiary);
    letter-spacing: 0.03em;
}

@media (max-width: 768px) {
    .landing-trust-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
}

/* 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;
}

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

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

.landing-testimonial {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 1.75rem;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}

.landing-testimonial:hover {
    border-color: var(--border-hover);
    box-shadow: var(--shadow-md);
}

.landing-testimonial-text {
    font-size: 0.875rem;
    color: var(--text-secondary);
    line-height: 1.7;
    margin-bottom: 1.5rem;
    font-style: italic;
}

.landing-testimonial-author {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.landing-testimonial-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--accent-muted);
    color: var(--accent);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8125rem;
    font-weight: 700;
    flex-shrink: 0;
}

.landing-testimonial-name {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text-primary);
}

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

/* 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;
}

/* Hamburger + divider: hidden on desktop */
.landing-nav-hamburger {
    display: none;
}
.landing-nav-divider {
    display: none;
}

/* === 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(7, 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;
}

/* Free tier CTA strip — sits above the paid grid */
.pricing-free-cta {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1.5rem;
    padding: 1rem 1.75rem;
    margin-bottom: 2rem;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
}

.pricing-free-cta-current {
    border-color: var(--text-tertiary);
}

.pricing-free-text {
    font-size: 0.9375rem;
    color: var(--text-secondary);
    margin: 0;
}

.pricing-free-text strong {
    color: var(--text-primary);
}

.pricing-free-btn {
    flex-shrink: 0;
    display: inline-block;
    padding: 0.5rem 1.25rem;
    border-radius: var(--radius-md);
    font-size: 0.8125rem;
    font-weight: 600;
    text-decoration: none;
    background: transparent;
    color: var(--accent);
    border: 1px solid var(--accent);
    transition: background var(--transition-fast);
    white-space: nowrap;
}

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

/* Paid tiers — clean 3×2 grid */
.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;
}

/* ── Pricing: How Your Subscription Works ── */
.pricing-lifecycle {
    padding: 4rem 0;
    border-top: 1px solid var(--border);
}

.pricing-lifecycle-subtitle {
    text-align: center;
    color: var(--text-secondary);
    font-size: 0.9375rem;
    margin-top: -1.5rem;
    margin-bottom: 2.5rem;
    max-width: 620px;
    margin-left: auto;
    margin-right: auto;
    line-height: 1.6;
}

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

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

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

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

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

.pricing-lifecycle-card-icon {
    color: var(--accent);
    margin-bottom: 0.75rem;
}

.pricing-lifecycle-card h3 {
    font-size: 1.0625rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 0.625rem;
}

.pricing-lifecycle-card > p {
    font-size: 0.8125rem;
    color: var(--text-secondary);
    line-height: 1.7;
    margin-bottom: 0.75rem;
}

.pricing-lifecycle-list {
    list-style: none;
    padding: 0;
    margin: 0.5rem 0 0.75rem;
}

.pricing-lifecycle-list li {
    font-size: 0.8125rem;
    color: var(--text-secondary);
    line-height: 1.6;
    padding: 0.25rem 0 0.25rem 1.25rem;
    position: relative;
}

.pricing-lifecycle-list li::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0.65rem;
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background: var(--accent);
    opacity: 0.6;
}

.pricing-lifecycle-list li strong {
    color: var(--text-primary);
}

.pricing-lifecycle-note {
    font-size: 0.75rem;
    color: var(--text-tertiary);
    font-style: italic;
    line-height: 1.6;
    margin-top: 0.5rem;
}

.pricing-lifecycle-examples {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.5rem;
    margin: 0.75rem 0;
}

.pricing-lifecycle-example {
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 0.625rem 0.75rem;
    text-align: center;
}

.pricing-lifecycle-example-num {
    display: block;
    font-size: 1.125rem;
    font-weight: 700;
    color: var(--accent);
    line-height: 1;
    margin-bottom: 0.2rem;
}

.pricing-lifecycle-example-label {
    display: block;
    font-size: 0.6875rem;
    font-weight: 600;
    color: var(--text-primary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 0.3rem;
}

.pricing-lifecycle-example-desc {
    display: block;
    font-size: 0.6875rem;
    color: var(--text-tertiary);
    line-height: 1.4;
}

/* === Features Page === */
.features-hero {
    text-align: center;
    padding: 5rem 1.5rem 3rem;
    max-width: 800px;
    margin: 0 auto;
}
.features-hero .landing-tagline,
.pricing-hero .landing-tagline {
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}

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

.features-section {
    padding: 3.5rem 0;
}

.features-section-alt {
    background: var(--bg-card);
}

.features-block {
    display: flex;
    gap: 2.5rem;
    align-items: flex-start;
}

.features-block-reverse {
    flex-direction: row-reverse;
}

.features-icon {
    flex-shrink: 0;
    width: 72px;
    height: 72px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(201, 162, 103, 0.1);
    border: 1px solid rgba(201, 162, 103, 0.2);
    border-radius: var(--radius-lg);
    color: var(--accent);
}

.features-content h2 {
    font-size: 1.375rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 0.75rem;
}

.features-content > p {
    color: var(--text-secondary);
    line-height: 1.7;
    margin-bottom: 1.25rem;
    font-size: 0.9375rem;
}

.features-list {
    list-style: none;
    padding: 0;
    margin: 0 0 1.25rem;
}

.features-list li {
    position: relative;
    padding-left: 1.25rem;
    margin-bottom: 0.625rem;
    color: var(--text-secondary);
    font-size: 0.875rem;
    line-height: 1.6;
}

.features-list li::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0.55em;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--accent);
}

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

.features-tier-badge {
    display: inline-block;
    padding: 0.3rem 0.75rem;
    background: rgba(201, 162, 103, 0.08);
    border: 1px solid rgba(201, 162, 103, 0.15);
    border-radius: var(--radius-md);
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--accent);
    letter-spacing: 0.02em;
}

/* ── Features: NPC Chat Hero Highlight ── */
.features-section-hero-feature {
    padding: 3.5rem 0;
    background: var(--accent-muted);
    border-top: 2px solid var(--accent);
    border-bottom: 1px solid var(--border);
}

.features-hero-label {
    display: inline-block;
    padding: 0.2rem 0.625rem;
    background: var(--accent);
    color: var(--bg-primary);
    font-size: 0.625rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    border-radius: var(--radius-full);
    margin-bottom: 0.625rem;
}

.features-npc-limits {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 1.25rem;
    margin: 1rem 0;
}

.features-npc-limits h4 {
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--accent);
    text-transform: uppercase;
    letter-spacing: 0.06em;
    margin-bottom: 0.75rem;
}

.features-npc-tiers {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.625rem;
    margin-bottom: 0.75rem;
}

.features-npc-tier {
    text-align: center;
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 0.75rem 0.5rem;
}

.features-npc-tier-name {
    display: block;
    font-size: 0.6875rem;
    font-weight: 600;
    color: var(--text-primary);
    text-transform: uppercase;
    letter-spacing: 0.04em;
    margin-bottom: 0.3rem;
}

.features-npc-tier-val {
    display: block;
    font-size: 1.125rem;
    font-weight: 700;
    color: var(--accent);
    line-height: 1;
    margin-bottom: 0.2rem;
}

.features-npc-tier-sessions {
    display: block;
    font-size: 0.625rem;
    color: var(--text-tertiary);
}

.features-npc-limits-note {
    font-size: 0.75rem;
    color: var(--text-tertiary);
    line-height: 1.5;
}

.landing-nav-active {
    color: var(--accent) !important;
}

@media (max-width: 768px) {
    .features-hero {
        padding: 3.5rem 1.25rem 2rem;
    }

    .features-block,
    .features-block-reverse {
        flex-direction: column;
        gap: 1.25rem;
    }

    .features-icon {
        width: 56px;
        height: 56px;
    }

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

    .features-content h2 {
        font-size: 1.2rem;
    }

    .features-npc-tiers {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 400px) {
    .features-npc-tiers {
        grid-template-columns: 1fr;
    }
}

/* === Audience Page (Who Is This For?) === */
.audience-hero {
    text-align: center;
    padding: 5rem 1.5rem 2.5rem;
    max-width: 800px;
    margin: 0 auto;
}
.audience-hero .landing-tagline {
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}

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

.audience-section {
    padding: 1rem 0 4rem;
}

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

/* ── Persona card ── */
.audience-card {
    --card-accent: var(--accent);
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 1.75rem;
    position: relative;
    overflow: hidden;
    transition: border-color var(--transition-base), box-shadow var(--transition-base);
}
.audience-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--card-accent), transparent 85%);
    opacity: 0.85;
}
.audience-card:hover {
    border-color: color-mix(in srgb, var(--card-accent) 25%, var(--border));
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

.audience-card-header {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1rem;
}

.audience-card-icon {
    flex-shrink: 0;
    width: 52px;
    height: 52px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-md);
    background: color-mix(in srgb, var(--card-accent) 10%, transparent);
    border: 1px solid color-mix(in srgb, var(--card-accent) 18%, transparent);
    color: var(--card-accent);
}

.audience-card-title {
    font-family: 'Cinzel', serif;
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--text-primary);
    line-height: 1.25;
}

.audience-card-archetype {
    display: block;
    font-size: 0.6875rem;
    color: var(--text-tertiary);
    margin-top: 0.2rem;
    font-style: italic;
    letter-spacing: 0.01em;
}

.audience-card-description {
    font-size: 0.8125rem;
    color: var(--text-secondary);
    line-height: 1.7;
    margin-bottom: 1.25rem;
}

.audience-card-uses-title {
    font-size: 0.6875rem;
    font-weight: 600;
    color: var(--card-accent);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    margin-bottom: 0.5rem;
}

.audience-card-uses {
    list-style: none;
    padding: 0;
    margin: 0 0 1.25rem;
}
.audience-card-uses li {
    font-size: 0.8125rem;
    color: var(--text-secondary);
    line-height: 1.6;
    padding: 0.3rem 0 0.3rem 1.25rem;
    position: relative;
}
.audience-card-uses li::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0.7rem;
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background: var(--card-accent);
    opacity: 0.6;
}

.audience-card-highlight {
    background: color-mix(in srgb, var(--card-accent) 6%, var(--bg-primary));
    border: 1px solid color-mix(in srgb, var(--card-accent) 12%, transparent);
    border-radius: var(--radius-md);
    padding: 0.75rem 1rem;
    font-size: 0.8125rem;
    color: var(--text-secondary);
    line-height: 1.55;
}

.audience-card-highlight-label {
    display: block;
    font-size: 0.625rem;
    font-weight: 700;
    color: var(--card-accent);
    text-transform: uppercase;
    letter-spacing: 0.1em;
    margin-bottom: 0.3rem;
}

/* ── Closing statement ── */
.audience-closing {
    text-align: center;
    padding: 3.5rem 1.5rem;
    border-top: 1px solid var(--border);
}

.audience-closing-title {
    font-family: 'Cinzel', serif;
    font-size: 1.35rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 0.75rem;
}

.audience-closing-text {
    font-size: 0.9375rem;
    color: var(--text-secondary);
    line-height: 1.7;
    max-width: 600px;
    margin: 0 auto;
}

/* ── Audience responsive ── */
@media (max-width: 768px) {
    .audience-hero {
        padding: 3.5rem 1.25rem 2rem;
    }
    .audience-grid {
        grid-template-columns: 1fr;
    }
    .audience-card {
        padding: 1.25rem;
    }
    .audience-card-title {
        font-size: 1.05rem;
    }
    .audience-closing {
        padding: 2.5rem 1.25rem;
    }

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

/* === 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: var(--tier-gold);
    border: 1px solid rgba(255, 215, 0, 0.3);
}

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

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

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

.profile-badge-verified {
    background: rgba(39, 174, 96, 0.1);
    color: #27ae60;
    border: 1px solid rgba(39, 174, 96, 0.3);
}

.profile-badge-unverified {
    background: rgba(232, 168, 56, 0.1);
    color: var(--warning-muted);
    border: 1px solid rgba(232, 168, 56, 0.3);
}

.btn-tiny {
    display: inline-block;
    padding: 0.15rem 0.5rem;
    font-size: 0.7rem;
    border-radius: var(--radius-sm);
    border: none;
    cursor: pointer;
    font-weight: 500;
    transition: opacity 0.15s;
}

.btn-tiny:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.btn-tiny.btn-primary {
    background: var(--accent);
    color: var(--text-on-accent);
}

/* === Message & Success Pages === */
.message-card {
    text-align: center;
    padding: 2rem;
    color: var(--text-secondary);
    font-size: 0.95rem;
    line-height: 1.6;
}

.success-banner {
    background: rgba(39, 174, 96, 0.1);
    border: 1px solid rgba(39, 174, 96, 0.3);
    color: #27ae60;
    padding: 0.75rem 1rem;
    border-radius: var(--radius-sm);
    margin-bottom: 1rem;
    font-size: 0.875rem;
}

/* === 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);
}

.subscription-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);
}

#subscription-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);
}

/* === Library/Texts wider container (3-col grid) === */
.container-library {
    max-width: 1100px;
}

/* === 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) {
    .library-list,
    .texts-list {
        grid-template-columns: repeat(2, 1fr);
    }

    .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);
    }

    .landing-testimonials-grid {
        grid-template-columns: 1fr;
        max-width: 480px;
        margin: 0 auto;
    }

    .hero-layout {
        grid-template-columns: 1fr;
        gap: 3rem;
        max-width: 640px;
    }

    .hero-content {
        text-align: center;
    }

    .hero-content .landing-cta-group {
        justify-content: center;
    }

    .landing-tagline {
        margin-left: auto;
        margin-right: auto;
    }

    .hero-proof {
        justify-content: center;
    }

    .hero-demo {
        max-width: 340px;
        margin: 0 auto;
    }

    .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;
    }

    .library-list,
    .texts-list {
        grid-template-columns: 1fr;
    }

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

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

    .text-editor-overlay {
        padding: 1rem;
    }

    .text-editor-modal {
        max-height: 90vh;
    }

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

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

    /* Hamburger button — hidden on desktop, shown on mobile */
    .landing-nav-hamburger {
        display: flex;
        align-items: center;
        justify-content: center;
        background: none;
        border: 1px solid var(--border);
        color: var(--text-secondary);
        cursor: pointer;
        padding: 0.4rem;
        border-radius: var(--radius-sm);
        transition: color var(--transition-fast), border-color var(--transition-fast), background var(--transition-fast);
        -webkit-tap-highlight-color: transparent;
    }
    .landing-nav-hamburger:hover,
    .landing-nav-hamburger[aria-expanded="true"] {
        color: var(--accent);
        border-color: var(--accent);
        background: var(--accent-muted);
    }
    .landing-nav-hamburger svg { display: block; }

    /* Mobile dropdown panel */
    .landing-nav-links {
        display: none;
        flex-direction: column;
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        background: var(--bg-secondary);
        border-bottom: 1px solid var(--border);
        padding: 0.5rem 0.75rem 0.75rem;
        z-index: 200;
        gap: 0.125rem;
        box-shadow: 0 12px 32px rgba(0, 0, 0, 0.5);
    }

    .landing-nav-links.landing-nav-open {
        display: flex;
        animation: landing-nav-dropdown 0.22s ease-out;
    }

    @keyframes landing-nav-dropdown {
        from { opacity: 0; transform: translateY(-6px); }
        to   { opacity: 1; transform: translateY(0); }
    }

    .landing-nav-links .landing-nav-link {
        display: block;
        padding: 0.6rem 0.75rem;
        font-size: 0.875rem;
        border-radius: var(--radius-sm);
        transition: background var(--transition-fast);
    }
    .landing-nav-links .landing-nav-link:hover {
        background: rgba(255, 255, 255, 0.05);
    }

    /* Active link gets a subtle gold left accent in mobile */
    .landing-nav-links .landing-nav-active {
        background: var(--accent-muted);
        border-left: 2px solid var(--accent);
        padding-left: calc(0.75rem - 2px);
    }

    /* CTA button in mobile dropdown — full width, prominent */
    .landing-nav-links .landing-btn-sm {
        margin-top: 0.5rem;
        text-align: center;
        font-size: 0.875rem;
        padding: 0.6rem 1rem;
    }

    /* Divider before CTA */
    .landing-nav-links .landing-nav-divider {
        display: block;
        height: 1px;
        background: var(--border);
        margin: 0.375rem 0;
    }

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

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

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

    .hero-proof {
        gap: 0.875rem;
    }

    .hero-proof-num {
        font-size: 1.125rem;
    }

    .hero-float {
        display: none;
    }

    .hero-demo {
        padding: 1.5rem;
    }

    .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-free-cta {
        flex-direction: column;
        text-align: center;
        gap: 0.75rem;
    }

    .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 Panel — Command Codex
   ═══════════════════════════════════════════════════════════════ */

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

/* ── Stat Card Grid ── */
.admin-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 0.75rem;
    margin-bottom: 1.5rem;
}

.admin-stat-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 1.25rem 1rem;
    text-align: center;
    position: relative;
    overflow: hidden;
    transition: transform var(--transition-fast), box-shadow var(--transition-fast), border-color var(--transition-fast);
}
.admin-stat-card::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 2px;
    background: linear-gradient(90deg, transparent 5%, var(--accent) 50%, transparent 95%);
    opacity: 0.6;
}
.admin-stat-card:hover {
    transform: translateY(-1px);
    border-color: var(--border-hover);
    box-shadow: 0 4px 20px rgba(201, 162, 103, 0.08);
}

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

.admin-stat-label {
    font-size: 0.625rem;
    font-weight: 600;
    color: var(--text-tertiary);
    margin-top: 0.35rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

.admin-stat-subtitle {
    font-size: 0.625rem;
    color: var(--text-tertiary);
    margin-top: 0.15rem;
    min-height: 0.875rem;
}

/* Stat card alert/good/warn states */
.admin-stat-alert {
    border-color: rgba(229, 72, 77, 0.4);
    background: rgba(229, 72, 77, 0.06);
}
.admin-stat-alert::before { background: linear-gradient(90deg, transparent 5%, var(--error) 50%, transparent 95%); opacity: 0.8; }
.admin-stat-alert .admin-stat-value { color: var(--error); }

.admin-stat-good {
    border-color: rgba(48, 164, 108, 0.4);
    background: rgba(48, 164, 108, 0.06);
}
.admin-stat-good::before { background: linear-gradient(90deg, transparent 5%, var(--success) 50%, transparent 95%); opacity: 0.8; }
.admin-stat-good .admin-stat-value { color: var(--success); }

.admin-stat-warn {
    border-color: rgba(240, 173, 78, 0.4);
    background: rgba(240, 173, 78, 0.06);
}
.admin-stat-warn::before { background: linear-gradient(90deg, transparent 5%, #f0ad4e 50%, transparent 95%); opacity: 0.8; }
.admin-stat-warn .admin-stat-value { color: #f0ad4e; }

.admin-stat-desc {
    color: var(--text-tertiary);
    font-size: 0.6875rem;
    margin-top: 0.2rem;
}

/* ── Section Headers ── */
.admin-section-title {
    font-size: 0.6875rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--text-tertiary);
    padding-left: 0.75rem;
    border-left: 2px solid var(--accent);
    margin-bottom: 0.75rem;
}

/* ── Tables ── */
.admin-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    font-size: 0.8125rem;
}

.admin-table th {
    text-align: left;
    color: var(--text-tertiary);
    font-weight: 600;
    font-size: 0.625rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    padding: 0.6rem 0.75rem;
    border-bottom: 1px solid var(--border);
    background: rgba(255, 255, 255, 0.015);
}

.admin-table td {
    padding: 0.55rem 0.75rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.03);
    color: var(--text-primary);
    transition: background var(--transition-fast);
}

.admin-table tbody tr:nth-child(even) td {
    background: rgba(255, 255, 255, 0.012);
}

.admin-table tr:hover td {
    background: rgba(201, 162, 103, 0.04);
}

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

/* ── Tier Badges (per-tier colors) ── */
.admin-tier-badge {
    display: inline-block;
    padding: 0.15rem 0.55rem;
    border-radius: var(--radius-full);
    font-size: 0.6875rem;
    font-weight: 600;
    letter-spacing: 0.02em;
    text-transform: capitalize;
    background: rgba(142, 143, 161, 0.12);
    color: var(--text-secondary);
    border: 1px solid rgba(142, 143, 161, 0.25);
}
.admin-tier-badge.tier-scribe {
    background: rgba(52, 152, 219, 0.12);
    color: var(--tier-scribe);
    border-color: rgba(52, 152, 219, 0.3);
}
.admin-tier-badge.tier-bard {
    background: rgba(187, 127, 226, 0.12);
    color: var(--tier-bard);
    border-color: rgba(187, 127, 226, 0.3);
}
.admin-tier-badge.tier-gold {
    background: rgba(255, 215, 0, 0.12);
    color: var(--tier-gold);
    border-color: rgba(255, 215, 0, 0.3);
}
.admin-tier-badge.tier-owner {
    background: rgba(255, 215, 0, 0.15);
    color: var(--tier-gold);
    border-color: rgba(255, 215, 0, 0.35);
    box-shadow: 0 0 8px rgba(255, 215, 0, 0.08);
}

/* ── Form Controls ── */
.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.3rem 0.5rem;
    cursor: pointer;
    transition: border-color var(--transition-fast);
}
.admin-tier-select:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 2px var(--accent-muted);
}

.admin-tier-locked {
    color: var(--tier-gold);
    font-weight: 600;
    font-size: 0.75rem;
}

/* ── Help Text ── */
.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-valid { color: var(--success); font-size: 0.75rem; }
.admin-invalid { color: var(--error); font-size: 0.75rem; }

/* ── Search Bar ── */
.admin-search-bar {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1rem;
}
.admin-search-input {
    flex: 1;
    padding: 0.55rem 0.85rem;
    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;
}

/* ── Pagination ── */
.admin-pagination {
    display: flex;
    gap: 0.3rem;
    margin-top: 1.25rem;
    justify-content: center;
    align-items: center;
}
.admin-pagination button {
    min-width: 2rem;
    height: 2rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
    background: var(--bg-card);
    color: var(--text-secondary);
    font-size: 0.75rem;
    font-family: inherit;
    cursor: pointer;
    transition: all var(--transition-fast);
}
.admin-pagination button:hover:not(:disabled) {
    border-color: var(--accent);
    color: var(--accent);
    background: rgba(201, 162, 103, 0.06);
}
.admin-pagination button.pg-active {
    background: var(--accent);
    color: var(--bg-primary);
    border-color: var(--accent);
    font-weight: 600;
    pointer-events: none;
}
.admin-pagination button:disabled {
    opacity: 0.35;
    cursor: not-allowed;
}
.admin-pagination .pg-label {
    font-size: 0.6875rem;
    color: var(--text-tertiary);
    padding: 0 0.35rem;
}
.admin-pagination button.pg-nav {
    min-width: auto;
    padding: 0 0.5rem;
    font-size: 0.6875rem;
    letter-spacing: 0.02em;
}

/* ── Misc Controls ── */
.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);
}

/* ── Health/Margin Utilities ── */
.admin-margin-good { color: var(--success); }
.admin-margin-warn { color: #f0ad4e; }
.admin-margin-bad { color: var(--error); }

.admin-health-dot {
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    margin-right: 6px;
    vertical-align: middle;
}
.admin-health-green { background: var(--success); box-shadow: 0 0 4px rgba(48, 164, 108, 0.5); }
.admin-health-yellow { background: #f0ad4e; box-shadow: 0 0 4px rgba(240, 173, 78, 0.5); }
.admin-health-red { background: var(--error); box-shadow: 0 0 4px rgba(229, 72, 77, 0.5); }

/* ── Margin Banner (Billing) ── */
.admin-margin-banner {
    padding: 0.75rem 1rem;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    margin-bottom: 1.5rem;
    font-size: 0.875rem;
    position: relative;
    overflow: hidden;
}
.admin-margin-banner::before {
    content: '';
    position: absolute;
    left: 0; top: 0; bottom: 0;
    width: 3px;
    background: var(--accent);
}

/* ── Stripe Quick Links ── */
.admin-quick-links {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}
.admin-quick-links a {
    text-decoration: none;
    border-color: rgba(106, 115, 255, 0.3);
    color: #7c83ff;
}
.admin-quick-links a:hover {
    border-color: rgba(106, 115, 255, 0.5);
    background: rgba(106, 115, 255, 0.06);
    color: #9ea3ff;
}

/* ═══════════════════════════════════════════════════════════════
   Admin User Detail Modal
   ═══════════════════════════════════════════════════════════════ */
.admin-modal-overlay {
    position: fixed;
    inset: 0;
    z-index: 1000;
    background: rgba(0, 0, 0, 0.75);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1.5rem;
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
}
.admin-modal {
    width: 100%;
    max-width: 560px;
    max-height: 85vh;
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    box-shadow: 0 24px 48px rgba(0, 0, 0, 0.5), 0 0 0 1px rgba(201, 162, 103, 0.06);
    animation: modal-enter 0.2s ease-out;
}
@keyframes modal-enter {
    from { opacity: 0; transform: translateY(8px) scale(0.98); }
    to   { opacity: 1; transform: translateY(0) scale(1); }
}

/* Modal header with tier-colored accent */
.admin-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid var(--border);
    background: var(--bg-card);
    position: relative;
    overflow: hidden;
}
.admin-modal-header::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 3px;
    background: linear-gradient(90deg, transparent 0%, var(--modal-accent, var(--accent)) 30%, var(--modal-accent, var(--accent)) 70%, transparent 100%);
}
.admin-modal-header h3 {
    font-size: 1.0625rem;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0;
}

/* Modal body */
.admin-modal-body {
    padding: 1.25rem 1.5rem;
    overflow-y: auto;
    flex: 1;
}

/* Modal section cards */
.admin-modal-section {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 1rem 1.125rem;
    margin-bottom: 0.75rem;
}
.admin-modal-section:last-child {
    margin-bottom: 0;
}
.admin-modal-section-title {
    font-size: 0.5625rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--text-tertiary);
    margin-bottom: 0.75rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.04);
}

/* Modal info rows */
.admin-modal-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.3rem 0;
    font-size: 0.8125rem;
}
.admin-modal-row + .admin-modal-row {
    border-top: 1px solid rgba(255, 255, 255, 0.025);
}
.admin-modal-label {
    color: var(--text-tertiary);
    font-size: 0.75rem;
}
.admin-modal-value {
    color: var(--text-primary);
    font-weight: 500;
    font-size: 0.8125rem;
    text-align: right;
}

/* Modal usage bars — RPG-style */
.admin-usage-row {
    margin-bottom: 0.875rem;
}
.admin-usage-row:last-child {
    margin-bottom: 0;
}
.admin-usage-header {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    margin-bottom: 0.35rem;
}
.admin-usage-label {
    font-size: 0.75rem;
    color: var(--text-secondary);
    font-weight: 500;
}
.admin-usage-values {
    font-size: 0.6875rem;
    color: var(--text-tertiary);
    font-variant-numeric: tabular-nums;
}
.admin-usage-track {
    height: 6px;
    background: var(--bg-primary);
    border-radius: 3px;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.04);
}
.admin-usage-fill {
    height: 100%;
    border-radius: 2px;
    transition: width 0.6s cubic-bezier(0.22, 1, 0.36, 1);
    background: linear-gradient(90deg, var(--accent), var(--accent-hover));
}
.admin-usage-fill.usage-warn {
    background: linear-gradient(90deg, #e8a838, #f5c661);
}
.admin-usage-fill.usage-danger {
    background: linear-gradient(90deg, var(--error), #ff7b7b);
}
.admin-usage-fill.usage-unlimited {
    width: 0% !important;
    background: transparent;
}

/* Modal content counts grid */
.admin-content-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.5rem;
}
.admin-content-item {
    text-align: center;
    padding: 0.625rem 0.5rem;
    background: var(--bg-primary);
    border-radius: var(--radius-sm);
    border: 1px solid rgba(255, 255, 255, 0.03);
}
.admin-content-value {
    font-size: 1.125rem;
    font-weight: 700;
    color: var(--accent);
    line-height: 1.2;
}
.admin-content-sub {
    font-size: 0.5625rem;
    color: var(--text-tertiary);
    margin-top: 0.1rem;
}
.admin-content-label {
    font-size: 0.5625rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--text-tertiary);
    margin-top: 0.2rem;
}

/* Modal action buttons */
.admin-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: 0.5rem;
}

.admin-action-btn {
    padding: 0.4rem 0.75rem;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
    background: var(--bg-elevated);
    color: var(--text-primary);
    font-size: 0.75rem;
    font-weight: 500;
    font-family: inherit;
    cursor: pointer;
    transition: all var(--transition-fast);
}
.admin-action-btn:hover {
    border-color: var(--accent);
    background: rgba(201, 162, 103, 0.08);
}
.admin-action-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.admin-action-btn.action-verify {
    border-color: rgba(48, 164, 108, 0.35);
    color: var(--success);
}
.admin-action-btn.action-verify:hover {
    background: rgba(48, 164, 108, 0.08);
    border-color: rgba(48, 164, 108, 0.5);
}

.admin-action-btn.action-reset {
    border-color: rgba(240, 173, 78, 0.35);
    color: #f0ad4e;
}
.admin-action-btn.action-reset:hover {
    background: rgba(240, 173, 78, 0.08);
    border-color: rgba(240, 173, 78, 0.5);
}

/* Tier change in modal */
.admin-tier-change {
    margin-top: 0.75rem;
    padding-top: 0.75rem;
    border-top: 1px solid rgba(255, 255, 255, 0.04);
}
.admin-tier-change label {
    font-size: 0.6875rem;
    color: var(--text-tertiary);
    font-weight: 500;
}
.admin-tier-note {
    color: var(--text-tertiary);
    font-size: 0.625rem;
    font-style: italic;
    margin-top: 0.3rem;
    opacity: 0.8;
}

/* Legacy compat — modal body sections */
.admin-modal-body .profile-section {
    padding: 0 0 0.75rem 0;
    margin-bottom: 0.75rem;
}
.admin-modal-body .profile-section:last-child {
    margin-bottom: 0;
    padding-bottom: 0;
}

/* ── Admin Responsive ── */
@media (max-width: 768px) {
    .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-modal {
        max-width: 100%;
        max-height: 95vh;
        margin: 0;
        border-radius: var(--radius-md);
    }
    .admin-content-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* === Multi-Speaker Page === */

.tier-gate-banner {
    display: flex;
    align-items: center;
    gap: 1rem;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 1.25rem 1.5rem;
    margin-bottom: 1.5rem;
}

.tier-gate-icon {
    flex-shrink: 0;
    color: var(--accent);
}

.tier-gate-text {
    flex: 1;
}

.tier-gate-text strong {
    display: block;
    color: var(--text-primary);
    font-size: 0.9375rem;
    margin-bottom: 0.25rem;
}

.tier-gate-text p {
    color: var(--text-secondary);
    font-size: 0.8125rem;
    margin: 0;
}

.ms-format-help {
    margin-bottom: 0.75rem;
}

.btn-format-help {
    font-size: 0.8125rem;
    color: var(--accent);
    background: transparent;
    border: 1px solid var(--accent-muted);
    border-radius: var(--radius-sm);
    padding: 0.25rem 0.75rem;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.btn-format-help:hover {
    background: var(--accent-muted);
}

.format-help-content {
    margin-top: 0.75rem;
    padding: 1rem;
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    font-size: 0.8125rem;
    color: var(--text-secondary);
    line-height: 1.6;
}

.format-help-content p {
    margin-bottom: 0.5rem;
}

.format-help-content p:last-child {
    margin-bottom: 0;
}

.format-help-content pre {
    background: var(--bg-card);
    padding: 0.75rem 1rem;
    border-radius: var(--radius-sm);
    font-size: 0.8125rem;
    color: var(--text-primary);
    overflow-x: auto;
    line-height: 1.7;
    margin: 0.5rem 0;
    white-space: pre-wrap;
    font-family: 'Courier New', monospace;
}

/* Speaker detection section */
.ms-speakers-section {
    margin-top: 1.25rem;
    margin-bottom: 0.5rem;
}

.ms-speakers-heading {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 0.75rem;
}

.ms-speakers-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
}

.ms-speaker-card {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 0.5rem 0.75rem;
    min-width: 200px;
}

.ms-speaker-badge {
    font-size: 0.8125rem;
    font-weight: 600;
    padding: 0.2rem 0.6rem;
    border-radius: var(--radius-full);
    border: 1px solid;
    white-space: nowrap;
}

.ms-voice-select {
    flex: 1;
    padding: 0.3rem 0.5rem;
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-size: 0.8125rem;
    cursor: pointer;
    min-width: 0;
}

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

.ms-speaker-warning {
    font-size: 0.8125rem;
    color: var(--warning);
    margin-bottom: 0.5rem;
    padding: 0.5rem 0.75rem;
    background: rgba(245, 166, 35, 0.08);
    border: 1px solid rgba(245, 166, 35, 0.2);
    border-radius: var(--radius-sm);
}

@media (max-width: 768px) {
    .tier-gate-banner {
        flex-direction: column;
        text-align: center;
    }

    .ms-speakers-grid {
        flex-direction: column;
    }

    .ms-speaker-card {
        min-width: 100%;
    }
}


/* ═══════════════════════════════════════════════════════════════
   NPC CHAT
   ═══════════════════════════════════════════════════════════════ */

/* -- Profile toolbar -- */
.npc-profile-toolbar {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 1.25rem;
    padding: 0.75rem;
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
}

.npc-profile-toolbar select {
    flex: 1;
    min-width: 0;
}

.npc-profile-actions {
    display: flex;
    gap: 0.35rem;
    flex-shrink: 0;
}

.npc-knowledge-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 0.35rem;
}

/* btn-sm moved to button system section at end of file */

.btn-danger-outline {
    background: transparent;
    border: 1px solid var(--danger, #e74c3c);
    color: var(--danger, #e74c3c);
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: background 0.15s, color 0.15s;
}

.btn-danger-outline:hover {
    background: var(--danger, #e74c3c);
    color: var(--text-on-accent);
}

.btn-save-success {
    background: var(--success, #2d8a4e) !important;
    border-color: var(--success, #2d8a4e) !important;
    color: var(--text-on-accent) !important;
    transition: background 0.2s, border-color 0.2s, color 0.2s;
}

/* -- Setup fields -- */
.npc-field {
    margin-bottom: 1.25rem;
}

.npc-field label {
    display: block;
    font-weight: 600;
    margin-bottom: 0.4rem;
    color: var(--text-primary);
}

.npc-label-hint {
    font-weight: 400;
    color: var(--text-muted);
    font-size: 0.85rem;
}

#npc-knowledge {
    width: 100%;
    min-height: 340px;
    resize: vertical;
    font-family: inherit;
    font-size: 0.92rem;
    line-height: 1.6;
    padding: 0.75rem;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--bg-input);
    color: var(--text-primary);
    transition: border-color 0.15s;
}

#npc-knowledge:focus {
    border-color: var(--accent);
    outline: none;
}

#npc-name {
    width: 100%;
    max-width: 400px;
    padding: 0.55rem 0.75rem;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--bg-input);
    color: var(--text-primary);
    font-size: 0.95rem;
}

#npc-name:focus {
    border-color: var(--accent);
    outline: none;
}

/* -- Start Conversation button (matches .btn-generate style) -- */
.btn-start-conversation {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    width: 100%;
    max-width: 500px;
    margin: 1.5rem auto 0;
    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-start-conversation:hover:not(:disabled) {
    background: var(--accent-hover);
}

.btn-start-conversation:focus-visible {
    outline: none;
    box-shadow: 0 0 0 3px var(--accent-muted);
}

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

.btn-start-conversation.connecting {
    opacity: 0.7;
    pointer-events: none;
}

/* -- Compatibility note -- */
.npc-budget-indicator {
    margin-top: 0.5rem;
    padding: 0.4rem 0.75rem;
    font-size: 0.82rem;
    color: var(--text-secondary);
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 6px;
    display: inline-block;
}
.npc-budget-indicator.npc-budget-warning {
    color: var(--error);
    border-color: var(--error);
}

.npc-compat-note {
    margin-top: 0.75rem;
    padding: 0.5rem 0.75rem;
    font-size: 0.78rem;
    color: var(--text-muted);
    line-height: 1.4;
}

/* -- Conversation phase -- */
.npc-active-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.75rem 1rem;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 10px;
    margin-bottom: 1.5rem;
}

.npc-active-info h2 {
    font-size: 1.2rem;
    margin: 0 0 0.15rem;
    color: var(--text-primary);
}

.npc-active-detail {
    display: inline-block;
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-right: 0.75rem;
}

.npc-session-timer {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    font-size: 0.95rem;
    font-variant-numeric: tabular-nums;
    color: var(--text-primary);
    font-weight: 500;
}

.npc-timer-max {
    color: var(--text-muted);
    font-weight: 400;
}

/* -- State indicator -- */
.npc-state-container {
    display: flex;
    justify-content: center;
    padding: 3rem 0;
}

.npc-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1.25rem;
}

.npc-state-visual {
    position: relative;
    width: 140px;
    height: 140px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.npc-mic-icon {
    position: relative;
    z-index: 2;
    color: var(--text-muted);
    transition: color 0.3s;
}

.npc-state-visual.listening .npc-mic-icon {
    color: var(--accent);
}

.npc-state-visual.speaking .npc-mic-icon {
    color: var(--text-muted);
    opacity: 0.4;
}

.npc-state-label {
    font-size: 1.1rem;
    font-weight: 500;
    color: var(--text-secondary);
    text-align: center;
}

/* -- Pulse rings (listening animation) -- */
.npc-pulse-rings {
    position: absolute;
    inset: 0;
    display: none;
}

.npc-state-visual.listening .npc-pulse-rings {
    display: block;
}

.npc-pulse-ring {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 60px;
    height: 60px;
    margin: -30px 0 0 -30px;
    border: 2px solid var(--accent);
    border-radius: 50%;
    opacity: 0;
    animation: npc-pulse 2.4s ease-out infinite;
}

.npc-pulse-ring:nth-child(2) {
    animation-delay: 0.8s;
}

.npc-pulse-ring:nth-child(3) {
    animation-delay: 1.6s;
}

@keyframes npc-pulse {
    0% {
        transform: scale(1);
        opacity: 0.5;
    }
    100% {
        transform: scale(2.5);
        opacity: 0;
    }
}

/* -- Waveform bars (speaking animation) -- */
.npc-waveform {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
}

.npc-wave-bar {
    width: 5px;
    height: 20px;
    background: var(--accent);
    border-radius: 3px;
    animation: npc-wave 0.8s ease-in-out infinite alternate;
}

.npc-wave-bar:nth-child(1) { animation-delay: 0s;    height: 16px; }
.npc-wave-bar:nth-child(2) { animation-delay: 0.15s;  height: 28px; }
.npc-wave-bar:nth-child(3) { animation-delay: 0.3s;   height: 40px; }
.npc-wave-bar:nth-child(4) { animation-delay: 0.15s;  height: 28px; }
.npc-wave-bar:nth-child(5) { animation-delay: 0s;     height: 16px; }

@keyframes npc-wave {
    0%   { transform: scaleY(0.4); }
    100% { transform: scaleY(1.6); }
}

/* -- Connection status -- */
.npc-connection-status {
    text-align: center;
    padding: 0.5rem;
    font-size: 0.85rem;
    color: var(--warning, #e6a700);
}

/* -- End conversation button -- */
.btn-end-conversation {
    display: block;
    margin: 1.5rem auto 0;
    padding: 0.65rem 2rem;
    border: 1px solid var(--danger, #e74c3c);
    border-radius: 8px;
    background: transparent;
    color: var(--danger, #e74c3c);
    font-size: 0.95rem;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.15s, color 0.15s;
}

.btn-end-conversation:hover {
    background: var(--danger, #e74c3c);
    color: var(--text-on-accent);
}

/* -- NPC Chat responsive -- */
@media (max-width: 768px) {
    .npc-active-header {
        flex-direction: column;
        gap: 0.5rem;
        text-align: center;
    }

    .npc-state-visual {
        width: 110px;
        height: 110px;
    }

    .npc-mic-icon svg {
        width: 36px;
        height: 36px;
    }
}

/* ============================================
   Support / Help Page
   ============================================ */

.container-support {
    max-width: 860px;
}

/* Quick-nav pill bar */
.support-nav {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 2rem;
    padding: 1rem 0;
    border-bottom: 1px solid var(--border);
}

.support-nav-pill {
    display: inline-block;
    padding: 0.4rem 0.9rem;
    font-size: 0.82rem;
    font-weight: 500;
    color: var(--text-secondary);
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-full);
    text-decoration: none;
    transition: var(--transition-fast);
    white-space: nowrap;
}

.support-nav-pill:hover {
    color: var(--accent);
    border-color: var(--accent);
    background: var(--accent-muted);
}

/* Section cards */
.support-section {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 1.75rem;
    margin-bottom: 1.5rem;
    scroll-margin-top: 5rem;
}

.support-section-title {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    font-size: 1.2rem;
    font-weight: 600;
    color: var(--accent);
    margin-bottom: 0.75rem;
}

.support-section-title svg {
    flex-shrink: 0;
    color: var(--accent);
}

.support-section > p {
    color: var(--text-secondary);
    font-size: 0.92rem;
    line-height: 1.6;
    margin-bottom: 1rem;
}

/* Sub-headings within sections */
.support-subheading {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text-primary);
    margin: 1.25rem 0 0.5rem;
}

/* Numbered step lists */
.support-steps {
    list-style: none;
    counter-reset: support-step;
    padding: 0;
    margin: 0.5rem 0 1rem;
}

.support-steps li {
    counter-increment: support-step;
    position: relative;
    padding-left: 2.2rem;
    margin-bottom: 0.75rem;
    font-size: 0.9rem;
    color: var(--text-primary);
    line-height: 1.6;
}

.support-steps li::before {
    content: counter(support-step);
    position: absolute;
    left: 0;
    top: 0.1em;
    width: 1.5rem;
    height: 1.5rem;
    background: var(--accent-muted);
    color: var(--accent);
    border-radius: 50%;
    font-size: 0.78rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
}

.support-steps li strong {
    color: var(--text-primary);
}

/* Bullet lists */
.support-list {
    list-style: none;
    padding: 0;
    margin: 0.5rem 0 1rem;
}

.support-list li {
    position: relative;
    padding-left: 1.2rem;
    margin-bottom: 0.6rem;
    font-size: 0.9rem;
    color: var(--text-primary);
    line-height: 1.6;
}

.support-list li::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0.6em;
    width: 5px;
    height: 5px;
    background: var(--accent);
    border-radius: 50%;
}

.support-list li strong {
    color: var(--text-primary);
}

/* Tip / callout boxes */
.support-tip {
    background: var(--bg-surface);
    border-left: 3px solid var(--accent);
    border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
    padding: 0.75rem 1rem;
    margin: 1rem 0;
    font-size: 0.85rem;
    color: var(--text-secondary);
    line-height: 1.6;
}

.support-tip strong {
    color: var(--accent);
}

/* Code example block */
.support-code-example {
    background: var(--bg-primary);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 1rem 1.25rem;
    margin: 0.75rem 0 1rem;
    font-family: 'Courier New', monospace;
    font-size: 0.85rem;
    color: var(--text-primary);
    line-height: 1.7;
    overflow-x: auto;
}

.support-code-example code {
    background: none;
    padding: 0;
    font-size: inherit;
    color: inherit;
}

/* Tier reference table */
.support-table-wrap {
    overflow-x: auto;
    margin: 1rem 0;
}

.support-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.85rem;
}

.support-table th {
    text-align: left;
    padding: 0.6rem 0.75rem;
    font-weight: 600;
    color: var(--accent);
    border-bottom: 2px solid var(--border);
    white-space: nowrap;
}

.support-table td {
    padding: 0.6rem 0.75rem;
    color: var(--text-primary);
    border-bottom: 1px solid var(--border);
    white-space: nowrap;
}

.support-table tbody tr:hover {
    background: var(--bg-surface);
}

/* FAQ items */
.support-faq-item {
    padding: 1rem 0;
    border-bottom: 1px solid var(--border);
}

.support-faq-item:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.support-faq-question {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.4rem;
}

.support-faq-item p {
    font-size: 0.88rem;
    color: var(--text-secondary);
    line-height: 1.6;
}

.support-faq-item code {
    background: var(--bg-primary);
    padding: 0.15rem 0.4rem;
    border-radius: var(--radius-sm);
    font-size: 0.82rem;
    color: var(--accent);
}

/* Support page responsive */
@media (max-width: 768px) {
    .support-section {
        padding: 1.25rem;
    }

    .support-nav {
        gap: 0.4rem;
    }

    .support-nav-pill {
        font-size: 0.78rem;
        padding: 0.35rem 0.7rem;
    }

    .support-table {
        font-size: 0.78rem;
    }

    .support-table th,
    .support-table td {
        padding: 0.4rem 0.5rem;
    }
}

/* ═══════════════════════════════════════════════════════════
   LEGAL PAGES (Terms, Privacy)
   ═══════════════════════════════════════════════════════════ */

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

.legal-title {
    font-size: 2rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 0.25rem;
}

.legal-updated {
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin-bottom: 2rem;
}

.legal-section {
    margin-bottom: 2rem;
}

.legal-section h2 {
    font-size: 1.15rem;
    font-weight: 600;
    color: var(--accent);
    margin-bottom: 0.75rem;
}

.legal-section p {
    color: var(--text-secondary);
    line-height: 1.7;
    margin-bottom: 0.75rem;
}

.legal-section ul {
    list-style: none;
    padding: 0;
    margin: 0 0 0.75rem;
}

.legal-section ul li {
    position: relative;
    padding-left: 1.25rem;
    color: var(--text-secondary);
    line-height: 1.7;
    margin-bottom: 0.35rem;
}

.legal-section ul li::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0.65em;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--accent);
}

.legal-section a {
    color: var(--accent);
    text-decoration: underline;
}

.legal-section a:hover {
    color: var(--text-primary);
}

.legal-footer {
    text-align: center;
    padding: 1.5rem;
    font-size: 0.8rem;
    color: var(--text-secondary);
    border-top: 1px solid var(--border);
}

.footer-legal {
    margin-top: 0.35rem;
    font-size: 0.78rem;
}

.footer-legal a {
    color: var(--text-secondary);
    text-decoration: none;
}

.footer-legal a:hover {
    color: var(--accent);
    text-decoration: underline;
}

@media (max-width: 768px) {
    .legal-container {
        padding: 4.5rem 1rem 1.5rem;
    }

    .legal-title {
        font-size: 1.5rem;
    }
}

/* ═══════════════════════════════════════════════════════════
   PROFILE DANGER ZONE (Account Deletion)
   ═══════════════════════════════════════════════════════════ */

.profile-danger-zone {
    border: 1px solid #6b2020;
    background: rgba(107, 32, 32, 0.08);
}

.profile-danger-zone .profile-section-title {
    color: #e85454;
}

.profile-danger-warning {
    color: var(--text-secondary);
    font-size: 0.88rem;
    line-height: 1.6;
    margin-bottom: 1rem;
}

.btn-danger {
    background: #c0392b;
    color: var(--text-on-accent);
    border: none;
    padding: 0.5rem 1.25rem;
    border-radius: var(--border-radius);
    font-size: 0.85rem;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.2s;
}

.btn-danger:hover {
    background: #e74c3c;
}

.btn-danger:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.btn-export {
    background: var(--bg-tertiary);
    color: var(--text-primary);
    border: 1px solid var(--border);
    padding: 0.5rem 1.25rem;
    border-radius: var(--border-radius);
    font-size: 0.85rem;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.2s, border-color 0.2s;
}

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

.btn-export:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* ═══════════════════════════════════════════════════════════
   PRIORITY 4A — SKELETON LOADING STATES
   ═══════════════════════════════════════════════════════════ */

@keyframes skeleton-shimmer {
    0% { background-position: -200% 0; }
    100% { background-position: 200% 0; }
}

.skeleton-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 1.25rem;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.skeleton-line {
    height: 0.75rem;
    border-radius: var(--radius-sm);
    background: linear-gradient(
        90deg,
        var(--bg-elevated) 25%,
        rgba(255, 255, 255, 0.06) 50%,
        var(--bg-elevated) 75%
    );
    background-size: 200% 100%;
    animation: skeleton-shimmer 1.8s ease-in-out infinite;
}

.skeleton-line--title {
    width: 65%;
    height: 1rem;
}

.skeleton-line--short {
    width: 40%;
}

.skeleton-line--medium {
    width: 55%;
}

.skeleton-line--full {
    width: 100%;
    height: 2.5rem;
    border-radius: var(--radius-md);
}

.skeleton-line--actions {
    display: flex;
    gap: 0.5rem;
    margin-top: 0.25rem;
}

.skeleton-line--btn {
    width: 4.5rem;
    height: 1.75rem;
    border-radius: var(--radius-sm);
    background: linear-gradient(
        90deg,
        var(--bg-elevated) 25%,
        rgba(255, 255, 255, 0.06) 50%,
        var(--bg-elevated) 75%
    );
    background-size: 200% 100%;
    animation: skeleton-shimmer 1.8s ease-in-out infinite;
}

/* Stagger shimmer timing for each skeleton card */
.skeleton-card:nth-child(2) .skeleton-line,
.skeleton-card:nth-child(2) .skeleton-line--btn { animation-delay: 0.15s; }
.skeleton-card:nth-child(3) .skeleton-line,
.skeleton-card:nth-child(3) .skeleton-line--btn { animation-delay: 0.3s; }
.skeleton-card:nth-child(4) .skeleton-line,
.skeleton-card:nth-child(4) .skeleton-line--btn { animation-delay: 0.45s; }
.skeleton-card:nth-child(5) .skeleton-line,
.skeleton-card:nth-child(5) .skeleton-line--btn { animation-delay: 0.6s; }
.skeleton-card:nth-child(6) .skeleton-line,
.skeleton-card:nth-child(6) .skeleton-line--btn { animation-delay: 0.75s; }

@media (prefers-reduced-motion: reduce) {
    .skeleton-line,
    .skeleton-line--btn {
        animation: none;
    }
}

/* ═══════════════════════════════════════════════════════════
   PRIORITY 4B — MICRO-ANIMATIONS
   ═══════════════════════════════════════════════════════════ */

/* Slide-in for error/success banners */
@keyframes banner-slide-in {
    from {
        opacity: 0;
        transform: translateY(-0.5rem);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.error-banner,
.success-banner {
    animation: banner-slide-in 0.3s ease-out;
}

/* Fade-in for tab content switching */
.tab-content.active {
    animation: tab-fade-in 0.25s ease-out;
}

@keyframes tab-fade-in {
    from { opacity: 0; transform: translateY(4px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Smooth card entrance for library/text cards */
@keyframes card-enter {
    from {
        opacity: 0;
        transform: translateY(8px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.library-card,
.text-card {
    animation: card-enter 0.3s ease-out both;
}

.library-card:nth-child(2), .text-card:nth-child(2) { animation-delay: 0.03s; }
.library-card:nth-child(3), .text-card:nth-child(3) { animation-delay: 0.06s; }
.library-card:nth-child(4), .text-card:nth-child(4) { animation-delay: 0.09s; }
.library-card:nth-child(5), .text-card:nth-child(5) { animation-delay: 0.12s; }
.library-card:nth-child(6), .text-card:nth-child(6) { animation-delay: 0.15s; }
.library-card:nth-child(n+7), .text-card:nth-child(n+7) { animation-delay: 0.18s; }

@media (prefers-reduced-motion: reduce) {
    .error-banner,
    .success-banner,
    .tab-content.active,
    .library-card,
    .text-card {
        animation: none;
    }
}

/* ═══════════════════════════════════════════════════════════
   PRIORITY 4C — MOBILE HAMBURGER NAV
   ═══════════════════════════════════════════════════════════ */

.nav-hamburger {
    display: none;
    background: none;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 0.25rem;
    border-radius: var(--radius-sm);
    transition: color var(--transition-fast);
}

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

.nav-hamburger svg {
    display: block;
}

@media (max-width: 768px) {
    .nav-hamburger {
        display: block;
        order: 0;
    }

    .top-nav {
        flex-wrap: nowrap;
        gap: 0.5rem;
        padding: 0.6rem 0.75rem;
        position: relative;
    }

    .nav-links {
        display: none;
        flex-direction: column;
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        background: var(--bg-secondary);
        border-bottom: 1px solid var(--border);
        padding: 0.5rem;
        z-index: 100;
        gap: 0.15rem;
        box-shadow: var(--shadow-lg);
        animation: nav-dropdown 0.2s ease-out;
    }

    @keyframes nav-dropdown {
        from { opacity: 0; transform: translateY(-4px); }
        to { opacity: 1; transform: translateY(0); }
    }

    .nav-links.nav-open {
        display: flex;
    }

    .nav-links .nav-link {
        padding: 0.5rem 0.75rem;
        font-size: 0.8125rem;
        border-radius: var(--radius-sm);
        width: 100%;
    }

    .nav-links .nav-link:hover {
        background: rgba(255, 255, 255, 0.06);
    }

    .nav-right {
        order: 2;
        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;
    }
}

/* ═══════════════════════════════════════════════════════════
   PRIORITY 4D — PRICING CURRENT PLAN INDICATOR
   ═══════════════════════════════════════════════════════════ */

.pricing-current-plan {
    cursor: default;
    background: transparent !important;
    border: 2px solid var(--accent) !important;
    color: var(--accent) !important;
    position: relative;
    font-weight: 600;
}

.pricing-card-current {
    border-color: var(--accent);
    box-shadow: 0 0 0 1px var(--accent), 0 0 20px rgba(201, 162, 103, 0.1);
}

/* ═══════════════════════════════════════════════════════════
   PRIORITY 4E — BUTTON SIZE SYSTEM
   Normalized: size (default/small/tiny) × variant (default/primary/danger)
   ═══════════════════════════════════════════════════════════ */

/* btn-sm now inherits from btn-small for consistency */
.btn-sm {
    padding: 0.3rem 0.625rem;
    font-size: 0.8125rem;
    font-weight: 500;
    line-height: 1.2;
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    background: transparent;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    cursor: pointer;
    text-decoration: none;
    transition: all var(--transition-fast);
    white-space: nowrap;
}

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

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

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

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

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

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

/* ═══════════════════════════════════════════════════════════
   POLISH — Scrollbar, Selection, Glow, Depth
   ═══════════════════════════════════════════════════════════ */

/* Custom scrollbar — dark theme */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}
::-webkit-scrollbar-track {
    background: var(--bg-primary);
}
::-webkit-scrollbar-thumb {
    background: var(--border-hover);
    border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
    background: #3a3b4d;
}
/* Firefox */
* {
    scrollbar-width: thin;
    scrollbar-color: var(--border-hover) var(--bg-primary);
}

/* Text selection — gold accent */
::selection {
    background: rgba(201, 162, 103, 0.3);
    color: var(--text-primary);
}

/* Generate button — ambient glow */
.btn-generate {
    box-shadow: var(--shadow-sm), var(--glow-accent);
}
.btn-generate:hover {
    box-shadow: var(--shadow-md), var(--glow-accent-strong);
}
.btn-generate:active {
    transform: translateY(1px);
    box-shadow: var(--shadow-sm);
}

/* Start Conversation button — same glow treatment */
.btn-start-conversation {
    box-shadow: var(--shadow-sm), var(--glow-accent);
}
.btn-start-conversation:hover {
    box-shadow: var(--shadow-md), var(--glow-accent-strong);
}
.btn-start-conversation:active {
    transform: translateY(1px);
    box-shadow: var(--shadow-sm);
}

/* Landing CTA — glow */
.landing-btn-primary {
    box-shadow: var(--glow-accent);
}
.landing-btn-primary:hover {
    box-shadow: var(--glow-accent-strong);
}

/* Nav active indicator — subtle gold underline */
.nav-link.active {
    position: relative;
}
.nav-link.active::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 50%;
    transform: translateX(-50%);
    width: 60%;
    height: 2px;
    background: var(--accent);
    border-radius: 1px;
    opacity: 0.7;
}

/* Card hover — warm inner glow for depth */
.library-card:hover,
.text-card:hover,
.landing-feature-card:hover,
.landing-testimonial:hover,
.landing-trust-item:hover,
.pricing-card:hover {
    box-shadow: var(--shadow-md), inset 0 1px 0 rgba(201, 162, 103, 0.06);
}

/* Settings card — subtle top-edge highlight */
.settings-card {
    box-shadow: inset 0 1px 0 rgba(201, 162, 103, 0.08);
}

/* Voice card selected — glow */
.voice-card.selected {
    box-shadow: 0 0 12px rgba(201, 162, 103, 0.12);
}

/* Focus ring — enhanced outer glow */
textarea:focus,
input[type="text"]:focus,
select:focus,
.voice-search:focus,
.library-search-input:focus,
.new-text-title-input:focus,
.text-editor-area:focus {
    box-shadow: 0 0 0 2px var(--accent-muted), 0 0 12px rgba(201, 162, 103, 0.08);
}

/* Range slider — accent track fill (WebKit) */
input[type="range"] {
    background: linear-gradient(to right,
        var(--accent) 0%,
        var(--accent) var(--range-progress, 50%),
        var(--border-hover) var(--range-progress, 50%),
        var(--border-hover) 100%
    );
}

/* Range slider thumb — subtle glow on hover */
input[type="range"]::-webkit-slider-thumb {
    transition: box-shadow 150ms cubic-bezier(0.4, 0, 0.2, 1);
}
input[type="range"]::-webkit-slider-thumb:hover {
    box-shadow: 0 0 8px rgba(201, 162, 103, 0.4);
}
input[type="range"]::-moz-range-thumb:hover {
    box-shadow: 0 0 8px rgba(201, 162, 103, 0.4);
}

/* === Dashboard === */
.dashboard-container {
    max-width: 800px;
}

.dashboard {
    padding: 2rem 0;
}

.dashboard-header {
    text-align: center;
    margin-bottom: 2rem;
}

.dashboard-header h1 {
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 0.25rem;
}

.dashboard-header p {
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.dashboard-tools {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
    margin-bottom: 2rem;
}

.dashboard-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 1.5rem;
    text-align: center;
    text-decoration: none;
    transition: border-color 0.2s;
    cursor: pointer;
}

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

.dashboard-card-icon {
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
}

.dashboard-card-title {
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.25rem;
}

.dashboard-card-desc {
    color: var(--text-secondary);
    font-size: 0.75rem;
}

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

.dashboard-stat {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 1rem;
}

.dashboard-stat-label {
    color: var(--text-secondary);
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 0.5rem;
}

.dashboard-stat-value {
    color: var(--text-primary);
    font-size: 1.1rem;
    font-weight: 600;
}

.dashboard-stat-bar {
    height: 3px;
    background: var(--border-hover);
    border-radius: 2px;
    margin-top: 0.5rem;
    overflow: hidden;
}

.dashboard-stat-fill {
    height: 100%;
    background: var(--accent);
    border-radius: 2px;
    transition: width 0.3s ease;
    width: 0;
}

.flash-banner {
    background: rgba(201, 162, 103, 0.1);
    border: 1px solid var(--accent);
    border-radius: var(--radius-md);
    padding: 0.75rem 1rem;
    color: var(--accent);
    text-align: center;
    margin-bottom: 1.5rem;
    font-size: 0.875rem;
}

@media (max-width: 600px) {
    .dashboard-tools,
    .dashboard-stats {
        grid-template-columns: 1fr;
    }
}

/* Progress bar fill — ambient glow */
.progress-bar-fill {
    box-shadow: 0 0 8px rgba(201, 162, 103, 0.3);
}

/* Usage bar fill — glow matching bar color */
.usage-bar-fill.usage-green {
    box-shadow: 0 0 6px rgba(48, 164, 108, 0.3);
}
.usage-bar-fill.usage-orange {
    box-shadow: 0 0 6px rgba(245, 166, 35, 0.3);
}
.usage-bar-fill.usage-red {
    box-shadow: 0 0 6px rgba(229, 72, 77, 0.3);
}

/* Modal overlay — slightly stronger backdrop blur */
.voice-modal-overlay,
.text-editor-overlay {
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
}

/* Modal entrance animation */
.voice-modal,
.text-editor-modal {
    animation: modal-enter 200ms cubic-bezier(0.16, 1, 0.3, 1);
}
@keyframes modal-enter {
    from {
        opacity: 0;
        transform: scale(0.96) translateY(8px);
    }
    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

/* Error banner — subtle left accent border */
.error-banner {
    border-left: 3px solid var(--error);
}

/* Flash banner — subtle left accent border */
.flash-banner {
    border-left: 3px solid var(--success);
}

/* Tier upgrade banner — subtle left accent */
.tier-upgrade-banner {
    border-left: 3px solid var(--accent);
}

/* Skeleton shimmer — polished loading */
@keyframes skeleton-shimmer {
    0% { background-position: -200% 0; }
    100% { background-position: 200% 0; }
}
.skeleton-card {
    background: linear-gradient(
        90deg,
        var(--bg-card) 25%,
        var(--bg-elevated) 50%,
        var(--bg-card) 75%
    );
    background-size: 200% 100%;
    animation: skeleton-shimmer 1.8s ease-in-out infinite;
}

/* Active chip — subtle glow */
.category-chip.active,
.filter-chip.active {
    box-shadow: 0 0 8px rgba(201, 162, 103, 0.2);
}

/* Voice trigger Browse badge — subtle pulse on first render */
.voice-trigger-action {
    transition: background var(--transition-fast), box-shadow var(--transition-fast);
}
.voice-trigger:hover .voice-trigger-action {
    box-shadow: 0 0 8px rgba(201, 162, 103, 0.2);
}

/* Pricing current plan card — enhanced glow */
.pricing-card-current {
    box-shadow: 0 0 0 1px var(--accent), 0 0 24px rgba(201, 162, 103, 0.12);
}

/* Smooth page transitions for links */
.nav-link,
.landing-nav-link {
    transition: color var(--transition-fast), background var(--transition-fast);
}

/* Tooltip-style title on tier badges */
.tier-badge {
    transition: transform var(--transition-fast);
}
.tier-badge:hover {
    transform: scale(1.05);
}

/* Footer — subtle top border glow */
footer {
    border-top: 1px solid var(--border);
    position: relative;
}
footer::before {
    content: '';
    position: absolute;
    top: -1px;
    left: 10%;
    right: 10%;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(201, 162, 103, 0.15), transparent);
    pointer-events: none;
}

/* Accessible reduced-motion: disable all polish animations */
@media (prefers-reduced-motion: reduce) {
    .voice-modal,
    .text-editor-modal {
        animation: none !important;
    }
    .skeleton-card {
        animation: none !important;
    }
    .btn-generate:active,
    .btn-start-conversation:active {
        transform: none !important;
    }
}

/* === NPC List === */
.npc-list {
    display: flex;
    flex-direction: column;
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    overflow: hidden;
}

.npc-list:empty {
    border: none;
}

.npc-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.75rem 1rem;
    border-bottom: 1px solid var(--border);
    transition: background 0.15s;
}

.npc-row:last-child {
    border-bottom: none;
}

.npc-row:hover {
    background: var(--bg-elevated);
}

.npc-info {
    min-width: 0;
    flex: 1;
}

.npc-name {
    color: var(--text-primary);
    font-weight: 500;
    font-size: 0.9rem;
}

.npc-meta {
    color: var(--text-secondary);
    font-size: 0.75rem;
    margin-top: 0.125rem;
}

.npc-actions {
    display: flex;
    gap: 0.5rem;
    flex-shrink: 0;
    margin-left: 1rem;
}

.btn-action {
    padding: 0.3rem 0.6rem;
    border-radius: var(--radius-md);
    font-size: 0.75rem;
    border: none;
    cursor: pointer;
    font-family: inherit;
    text-decoration: none;
    transition: opacity 0.15s;
}

.btn-action.btn-accent {
    color: var(--accent);
    background: rgba(201, 162, 103, 0.1);
}

.btn-action.btn-accent:hover {
    background: rgba(201, 162, 103, 0.2);
}

.btn-action.btn-danger {
    color: #e07070;
    background: rgba(224, 112, 112, 0.1);
}

.btn-action.btn-danger:hover {
    background: rgba(224, 112, 112, 0.2);
}

.no-results {
    padding: 2rem;
    text-align: center;
    color: var(--text-secondary);
}
