:root { --transition-speed: 0.35s; }

[data-theme="dark"] {
  --bg: #0e0d0b; --surface: #191714; --surface2: #222018; --surface3: #2a2720;
  --gold: #c9a84c; --gold-light: #e8c878; --gold-dim: rgba(201,168,76,0.15);
  --text: #f0e8d5; --text-secondary: #b8b0a0; --muted: #6b6356; --border: #2e2b24;
  --red: #c44b3a; --red-bg: rgba(196,75,58,0.08); --red-border: rgba(196,75,58,0.3);
  --green: #4a8c5c; --green-bg: rgba(74,140,92,0.1);
  --shadow: rgba(0,0,0,0.3); --overlay: rgba(0,0,0,0.7);
  --ad-bg: #1a1810; --ad-border: #2e2b24;
  --badge-free-bg: rgba(107,99,86,0.2); --badge-free-text: #8a8070;
  --badge-pro-bg: rgba(201,168,76,0.15); --badge-pro-text: #e8c878;
}
[data-theme="light"] {
  --bg: #f8f6f1; --surface: #ffffff; --surface2: #f0ede6; --surface3: #e8e4dc;
  --gold: #9a7b2e; --gold-light: #b8922e; --gold-dim: rgba(154,123,46,0.1);
  --text: #2a2520; --text-secondary: #5a5248; --muted: #8a8078; --border: #d8d2c8;
  --red: #c44b3a; --red-bg: rgba(196,75,58,0.06); --red-border: rgba(196,75,58,0.2);
  --green: #3a7a4c; --green-bg: rgba(58,122,76,0.08);
  --shadow: rgba(0,0,0,0.08); --overlay: rgba(0,0,0,0.5);
  --ad-bg: #f0ede6; --ad-border: #d8d2c8;
  --badge-free-bg: rgba(138,128,112,0.12); --badge-free-text: #8a8070;
  --badge-pro-bg: rgba(154,123,46,0.12); --badge-pro-text: #9a7b2e;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: 'Inter', 'DM Mono', sans-serif;
  background: var(--bg); color: var(--text);
  min-height: 100vh; display: flex; flex-direction: column; align-items: center;
  transition: background var(--transition-speed), color var(--transition-speed);
}

[data-theme="dark"] body::before {
  content: ''; position: fixed; inset: 0;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.04'/%3E%3C/svg%3E");
  pointer-events: none; z-index: -1; opacity: 0.4;
}

/* ===== TOP BAR ===== */
.top-bar { width: 100%; display: flex; justify-content: space-between; align-items: center; padding: 16px 24px; max-width: 860px; }
.top-bar-left { display: flex; align-items: center; gap: 12px; }
.usage-badge { display: inline-flex; align-items: center; gap: 6px; padding: 6px 14px; border-radius: 20px; font-size: 11px; font-weight: 500; transition: all 0.2s; }
.usage-badge.free { background: var(--badge-free-bg); color: var(--badge-free-text); border: 1px solid transparent; }
.usage-badge.pro { background: var(--badge-pro-bg); color: var(--badge-pro-text); border: 1px solid var(--gold); }
.usage-count { font-size: 11px; color: var(--muted); }
.top-bar-right { display: flex; align-items: center; gap: 8px; }
.theme-toggle { width: 44px; height: 24px; border-radius: 12px; background: var(--surface2); border: 1px solid var(--border); cursor: pointer; position: relative; transition: all 0.3s; flex-shrink: 0; }
.theme-toggle::after { content: ''; position: absolute; top: 2px; left: 2px; width: 18px; height: 18px; border-radius: 50%; background: var(--gold); transition: transform 0.3s ease; }
[data-theme="light"] .theme-toggle::after { transform: translateX(20px); }
.theme-icon { font-size: 13px; line-height: 1; }
.btn-upgrade { background: linear-gradient(135deg, var(--gold), var(--gold-light)); border: none; border-radius: 20px; color: #0e0d0b; font-family: 'Inter', sans-serif; font-size: 11px; font-weight: 600; padding: 8px 18px; cursor: pointer; transition: all 0.2s; }
.btn-upgrade:hover { transform: translateY(-1px); box-shadow: 0 4px 16px rgba(201,168,76,0.3); }

/* ===== HEADER ===== */
header { width: 100%; max-width: 860px; padding: 20px 24px 0; text-align: center; }
.eyebrow { font-size: 11px; letter-spacing: 0.3em; color: var(--gold); text-transform: uppercase; margin-bottom: 12px; font-weight: 500; }
h1 { font-family: 'Playfair Display', serif; font-size: clamp(2.4rem, 6vw, 3.8rem); font-weight: 700; line-height: 1.1; color: var(--text); }
h1 em { font-style: italic; color: var(--gold-light); }
.subtitle { font-size: 12px; color: var(--muted); margin-top: 14px; }
.hero-features { display: flex; justify-content: center; gap: 24px; margin-top: 16px; flex-wrap: wrap; }
.hero-feat { display: flex; align-items: center; gap: 6px; font-size: 11px; color: var(--text-secondary); }
.hero-feat span.icon { font-size: 14px; }
.divider { width: 60px; height: 1px; background: var(--gold); margin: 24px auto; opacity: 0.4; }

/* ===== MAIN ===== */
main { width: 100%; max-width: 860px; padding: 0 24px 80px; display: flex; flex-direction: column; gap: 18px; }
.card { background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 24px; transition: background var(--transition-speed), border-color 0.2s; box-shadow: 0 2px 8px var(--shadow); }
.card:hover { border-color: color-mix(in srgb, var(--border) 50%, var(--gold) 50%); }
.card-label { font-size: 11px; letter-spacing: 0.2em; text-transform: uppercase; color: var(--gold); margin-bottom: 16px; font-weight: 600; display: flex; align-items: center; gap: 8px; }
.step-num { display: inline-flex; align-items: center; justify-content: center; width: 22px; height: 22px; border-radius: 50%; background: var(--gold-dim); color: var(--gold); font-size: 11px; font-weight: 700; }

/* ===== INPUTS ===== */
.api-row { display: flex; gap: 10px; align-items: center; }
input[type="password"], input[type="text"], input[type="email"] { flex: 1; background: var(--bg); border: 1px solid var(--border); border-radius: 8px; color: var(--text); font-family: 'DM Mono', monospace; font-size: 12px; padding: 12px 16px; outline: none; transition: border-color 0.2s; }
input:focus { border-color: var(--gold); }
select { background: var(--bg); border: 1px solid var(--border); border-radius: 8px; color: var(--text); font-family: 'Inter', sans-serif; font-size: 12px; padding: 12px 16px; outline: none; cursor: pointer; transition: border-color 0.2s; -webkit-appearance: none; }
select:focus { border-color: var(--gold); }
.btn-show { background: var(--surface2); border: 1px solid var(--border); border-radius: 8px; color: var(--muted); font-family: 'Inter', sans-serif; font-size: 11px; font-weight: 500; padding: 12px 16px; cursor: pointer; transition: all 0.2s; white-space: nowrap; }
.btn-show:hover { border-color: var(--gold); color: var(--gold); }

/* ===== PROVIDER TABS ===== */
.provider-tabs { display: flex; gap: 6px; margin-bottom: 18px; flex-wrap: wrap; }
.provider-tab { padding: 10px 18px; border-radius: 10px; border: 1px solid var(--border); background: var(--bg); color: var(--muted); font-size: 12px; font-weight: 500; cursor: pointer; transition: all 0.2s; display: flex; align-items: center; gap: 8px; }
.provider-tab:hover { border-color: var(--gold); color: var(--text); }
.provider-tab.active { border-color: var(--gold); background: var(--gold-dim); color: var(--gold); }
.provider-tab .prov-icon { font-size: 14px; }
.provider-section { display: none; }
.provider-section.active { display: block; }

/* ===== UPLOAD ===== */
.upload-zone { border: 2px dashed var(--border); border-radius: 12px; padding: 48px 24px; text-align: center; cursor: pointer; transition: all 0.25s; }
.upload-zone:hover, .upload-zone.drag-over { border-color: var(--gold); background: var(--gold-dim); }
.upload-zone input { display: none; }
.upload-icon { font-size: 36px; margin-bottom: 14px; display: block; }
.upload-title { font-family: 'Playfair Display', serif; font-size: 1.1rem; color: var(--text); margin-bottom: 8px; }
.upload-hint { font-size: 11px; color: var(--muted); }
.file-badge { display: inline-flex; align-items: center; gap: 10px; background: var(--surface2); border: 1px solid var(--border); border-radius: 8px; padding: 10px 16px; font-size: 12px; color: var(--gold-light); margin-top: 14px; }
.text-preview { background: var(--bg); border: 1px solid var(--border); border-radius: 8px; padding: 16px; font-size: 12px; color: var(--muted); line-height: 1.7; min-height: 100px; max-height: 200px; overflow-y: auto; white-space: pre-wrap; word-break: break-word; font-family: 'DM Mono', monospace; }
.text-preview.has-text { color: var(--text); }
.text-input-area { background: var(--bg); border: 1px solid var(--border); border-radius: 8px; padding: 16px; font-size: 12px; color: var(--text); line-height: 1.7; min-height: 140px; max-height: 300px; overflow-y: auto; white-space: pre-wrap; word-break: break-word; font-family: 'DM Mono', monospace; width: 100%; resize: vertical; outline: none; transition: border-color 0.2s; }
.text-input-area:focus { border-color: var(--gold); }
.text-input-area::placeholder { color: var(--muted); }
.input-mode-tabs { display: flex; gap: 6px; margin-bottom: 12px; }
.input-mode-tab { padding: 8px 16px; border-radius: 8px; border: 1px solid var(--border); background: var(--bg); color: var(--muted); font-size: 11px; font-weight: 500; cursor: pointer; transition: all 0.2s; display: flex; align-items: center; gap: 6px; }
.input-mode-tab:hover { border-color: var(--gold); color: var(--text); }
.input-mode-tab.active { border-color: var(--gold); background: var(--gold-dim); color: var(--gold); }
.char-count { font-size: 11px; color: var(--muted); text-align: right; margin-top: 8px; }

/* ===== VOICE GRID ===== */
.voice-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; }
.voice-grid-message { grid-column: 1 / -1; text-align: center; padding: 24px; font-size: 11px; color: var(--muted); }
.voice-option { border: 1px solid var(--border); border-radius: 10px; padding: 14px; cursor: pointer; transition: all 0.2s; background: var(--bg); position: relative; overflow: hidden; }
.voice-option:hover { border-color: var(--gold); transform: translateY(-1px); box-shadow: 0 4px 12px var(--shadow); }
.voice-option.selected { border-color: var(--gold); background: var(--gold-dim); }
.voice-option.selected::before { content: '✓'; position: absolute; top: 8px; right: 10px; font-size: 11px; color: var(--gold); font-weight: 700; }
.voice-option.locked { opacity: 0.45; cursor: not-allowed; }
.voice-option.locked::after { content: '🔒 PRO'; position: absolute; top: 8px; right: 8px; font-size: 10px; background: var(--gold); color: #0e0d0b; padding: 2px 6px; border-radius: 4px; font-weight: 700; letter-spacing: 0.05em; }
.voice-option.locked:hover { transform: none; box-shadow: none; border-color: var(--border); }
.voice-name { font-size: 12px; color: var(--text); margin-bottom: 4px; font-weight: 600; }
.voice-desc { font-size: 11px; color: var(--muted); }

/* ===== TEMPERATURE ===== */
#tempSlider { -webkit-appearance: none; width: 100%; height: 4px; background: var(--border); border-radius: 4px; cursor: pointer; outline: none; }
#tempSlider::-webkit-slider-thumb { -webkit-appearance: none; width: 16px; height: 16px; border-radius: 50%; background: var(--gold); cursor: pointer; margin-top: -6px; box-shadow: 0 2px 6px rgba(201,168,76,0.3); }
#tempSlider::-webkit-slider-runnable-track { height: 4px; background: var(--border); border-radius: 4px; }

/* ===== BUTTONS ===== */
.btn-generate { width: 100%; background: linear-gradient(135deg, var(--gold), var(--gold-light)); border: none; border-radius: 12px; color: #0e0d0b; font-family: 'Inter', sans-serif; font-size: 12px; font-weight: 600; letter-spacing: 0.1em; text-transform: uppercase; padding: 20px; cursor: pointer; transition: all 0.25s; box-shadow: 0 4px 16px rgba(201,168,76,0.2); }
.btn-generate:hover:not(:disabled) { transform: translateY(-2px); box-shadow: 0 8px 28px rgba(201,168,76,0.35); }
.btn-generate:disabled { opacity: 0.35; cursor: not-allowed; transform: none; box-shadow: none; }
.btn-download { background: var(--surface); border: 1px solid var(--gold); border-radius: 10px; color: var(--gold); font-family: 'Inter', sans-serif; font-size: 11px; font-weight: 600; letter-spacing: 0.1em; text-transform: uppercase; padding: 14px 24px; cursor: pointer; transition: all 0.2s; width: 100%; }
.btn-download:hover { background: var(--gold-dim); transform: translateY(-1px); }

/* ===== PROGRESS ===== */
.progress-bar { height: 4px; background: var(--border); border-radius: 4px; overflow: hidden; margin-top: 12px; display: none; }
.progress-fill { height: 100%; background: linear-gradient(90deg, var(--gold), var(--gold-light)); width: 0%; transition: width 0.4s ease; border-radius: 4px; }
.progress-label { font-size: 11px; color: var(--muted); text-align: center; margin-top: 10px; display: none; font-weight: 500; }

/* ===== PLAYER ===== */
.audio-section { display: none; flex-direction: column; gap: 14px; }
.player-box { background: var(--bg); border: 1px solid var(--gold); border-radius: 12px; padding: 24px; }
.player-controls { display: flex; align-items: center; gap: 16px; }
.btn-play { width: 48px; height: 48px; border-radius: 50%; background: linear-gradient(135deg, var(--gold), var(--gold-light)); border: none; color: #0e0d0b; font-size: 16px; cursor: pointer; display: flex; align-items: center; justify-content: center; flex-shrink: 0; transition: all 0.2s; }
.btn-play:hover { transform: scale(1.08); }
.player-progress { flex: 1; display: flex; flex-direction: column; gap: 6px; }
.seek-bar { width: 100%; -webkit-appearance: none; height: 4px; background: var(--border); border-radius: 4px; cursor: pointer; outline: none; }
.seek-bar::-webkit-slider-thumb { -webkit-appearance: none; width: 14px; height: 14px; border-radius: 50%; background: var(--gold); cursor: pointer; }
.time-row { display: flex; justify-content: space-between; font-size: 11px; color: var(--muted); }

/* ===== ADS, WARNINGS, ERRORS ===== */
.ad-banner { background: var(--ad-bg); border: 1px solid var(--ad-border); border-radius: 10px; padding: 14px 20px; text-align: center; font-size: 11px; color: var(--muted); display: flex; align-items: center; justify-content: center; gap: 10px; min-height: 64px; position: relative; }
.ad-banner .ad-label { font-size: 10px; letter-spacing: 0.15em; text-transform: uppercase; color: var(--muted); opacity: 0.6; position: absolute; top: 6px; right: 10px; }
.ad-banner .ad-text { font-size: 12px; color: var(--text-secondary); }
.ad-banner .ad-cta { color: var(--gold); cursor: pointer; font-weight: 600; text-decoration: underline; text-underline-offset: 2px; }
.ad-banner.hidden { display: none; }
.warning { background: var(--red-bg); border: 1px solid var(--red-border); border-radius: 10px; padding: 14px 18px; font-size: 11px; color: #e07060; line-height: 1.6; }
.error-box { display: none; background: var(--red-bg); border: 1px solid var(--red-border); border-radius: 10px; padding: 14px 18px; font-size: 12px; color: #e07060; line-height: 1.6; }
.chunk-info { font-size: 11px; color: var(--muted); text-align: center; }

/* ===== MODAL ===== */
.limit-overlay { display: none; position: fixed; inset: 0; background: var(--overlay); z-index: 999; justify-content: center; align-items: center; backdrop-filter: blur(8px); }
.limit-overlay.show { display: flex; }
.limit-modal { background: var(--surface); border: 1px solid var(--border); border-radius: 16px; padding: 40px; max-width: 440px; width: 90%; text-align: center; box-shadow: 0 24px 64px rgba(0,0,0,0.4); position: relative; max-height: 90vh; overflow-y: auto; }
.limit-modal h2 { font-family: 'Playfair Display', serif; font-size: 1.4rem; color: var(--text); margin-bottom: 12px; }
.limit-modal p { font-size: 12px; color: var(--muted); margin-bottom: 28px; line-height: 1.6; }
.plan-cards { display: flex; flex-direction: column; gap: 12px; margin-bottom: 20px; }
.plan-card { border: 1px solid var(--border); border-radius: 12px; padding: 20px; text-align: left; transition: all 0.2s; cursor: pointer; }
.plan-card:hover { border-color: var(--gold); }
.plan-card.recommended { border-color: var(--gold); background: var(--gold-dim); position: relative; }
.plan-card.recommended::after { content: 'RECOMMENDED'; position: absolute; top: -9px; right: 16px; font-size: 10px; font-weight: 700; letter-spacing: 0.15em; background: var(--gold); color: #0e0d0b; padding: 3px 10px; border-radius: 4px; }
.plan-card .plan-name { font-weight: 700; font-size: 13px; color: var(--text); margin-bottom: 4px; }
.plan-card .plan-price { font-size: 20px; font-weight: 700; color: var(--gold); margin-bottom: 8px; }
.plan-card .plan-price span { font-size: 12px; font-weight: 400; color: var(--muted); }
.plan-features { list-style: none; font-size: 11px; color: var(--text-secondary); line-height: 1.8; }
.plan-features li::before { content: '✓ '; color: var(--gold); font-weight: 700; }
.plan-features li.no::before { content: '✕ '; color: var(--red); }
.btn-close-modal { background: none; border: none; color: var(--muted); font-size: 18px; cursor: pointer; position: absolute; top: 16px; right: 16px; width: 32px; height: 32px; display: flex; align-items: center; justify-content: center; border-radius: 8px; transition: all 0.2s; }
.btn-close-modal:hover { background: var(--surface2); color: var(--text); }
.btn-subscribe { width: 100%; background: linear-gradient(135deg, var(--gold), var(--gold-light)); border: none; border-radius: 10px; color: #0e0d0b; font-family: 'Inter', sans-serif; font-size: 12px; font-weight: 600; padding: 16px; cursor: pointer; transition: all 0.2s; margin-top: 8px; }
.btn-subscribe:hover { transform: translateY(-1px); box-shadow: 0 6px 20px rgba(201,168,76,0.35); }
.btn-continue-free { background: none; border: none; color: var(--muted); font-family: 'Inter', sans-serif; font-size: 11px; cursor: pointer; margin-top: 12px; text-decoration: underline; text-underline-offset: 2px; }

/* ===== ADMIN PANEL ===== */
.admin-overlay { display: none; position: fixed; inset: 0; background: var(--overlay); z-index: 1001; justify-content: center; align-items: flex-start; padding-top: 40px; backdrop-filter: blur(8px); overflow-y: auto; }
.admin-overlay.show { display: flex; }
.admin-panel { background: var(--surface); border: 1px solid var(--gold); border-radius: 16px; padding: 32px; max-width: 900px; width: 95%; box-shadow: 0 24px 64px rgba(0,0,0,0.5); position: relative; margin-bottom: 40px; }
.admin-panel h2 { font-family: 'Playfair Display', serif; color: var(--gold); margin-bottom: 6px; }
.admin-panel .admin-subtitle { font-size: 11px; color: var(--muted); margin-bottom: 24px; }

.admin-tabs-nav { display: flex; gap: 8px; margin-bottom: 20px; border-bottom: 1px solid var(--border); padding-bottom: 12px; }
.admin-tab-btn { padding: 8px 16px; border: none; background: transparent; color: var(--muted); font-size: 12px; cursor: pointer; font-family: 'Inter', sans-serif; transition: color 0.2s; }
.admin-tab-btn:hover { color: var(--text); }
.admin-tab-btn.active { color: var(--gold); border-bottom: 2px solid var(--gold); font-weight: 600; }

.admin-stats { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 12px; margin-bottom: 24px; }
.stat-card { background: var(--bg); border: 1px solid var(--border); border-radius: 10px; padding: 16px; text-align: center; }
.stat-card .stat-value { font-size: 26px; font-weight: 700; color: var(--gold); }
.stat-card .stat-label { font-size: 11px; color: var(--muted); margin-top: 4px; text-transform: uppercase; letter-spacing: 0.1em; }
.admin-table-wrap { overflow-x: auto; }
.admin-table { width: 100%; border-collapse: collapse; font-size: 11px; }
.admin-table th { text-align: left; padding: 10px 12px; border-bottom: 2px solid var(--border); color: var(--gold); font-weight: 600; text-transform: uppercase; letter-spacing: 0.1em; font-size: 10px; white-space: nowrap; }
.admin-table td { padding: 10px 12px; border-bottom: 1px solid var(--border); color: var(--text-secondary); vertical-align: top; max-width: 300px; }
.admin-table td.text-col { max-width: 250px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; cursor: pointer; }
.admin-table td.text-col:hover { white-space: normal; word-break: break-word; }
.admin-table tr:hover td { background: var(--gold-dim); }
.admin-actions { display: flex; gap: 10px; margin-bottom: 20px; flex-wrap: wrap; }
.admin-btn { padding: 8px 16px; border-radius: 8px; border: 1px solid var(--border); background: var(--bg); color: var(--text-secondary); font-size: 11px; cursor: pointer; font-family: 'Inter', sans-serif; transition: all 0.2s; }
.admin-btn:hover { border-color: var(--gold); color: var(--gold); }
.admin-btn.danger { border-color: var(--red-border); color: #e07060; }
.admin-btn.danger:hover { background: var(--red-bg); }

/* Admin Feedback & Users */
.feedback-list { display: flex; flex-direction: column; gap: 12px; }
.feedback-item { background: var(--bg); border: 1px solid var(--border); border-radius: 8px; padding: 16px; display: flex; flex-direction: column; gap: 8px; cursor: pointer; }
.feedback-item.unread { border-left: 3px solid var(--gold); }
.feedback-header { display: flex; justify-content: space-between; font-size: 11px; color: var(--muted); }
.feedback-body { font-size: 12px; color: var(--text); }
.pagination { display: flex; gap: 8px; margin-top: 16px; justify-content: flex-end; }
.page-btn { padding: 6px 12px; border: 1px solid var(--border); background: var(--bg); color: var(--text); cursor: pointer; border-radius: 4px; font-size: 11px; }

/* ===== TOAST ===== */
.toast { position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%) translateY(100px); background: var(--surface); border: 1px solid var(--gold); border-radius: 12px; padding: 14px 24px; font-size: 12px; color: var(--text); box-shadow: 0 8px 32px var(--shadow); z-index: 1000; transition: transform 0.4s ease; display: flex; align-items: center; gap: 10px; }
.toast.show { transform: translateX(-50%) translateY(0); }
.toast.error { border-color: var(--red); color: var(--red); }
.toast.success { border-color: var(--green); color: var(--green); }

.footer { width: 100%; max-width: 860px; padding: 0 24px 40px; text-align: center; font-size: 11px; color: var(--muted); }
.footer a { color: var(--gold); text-decoration: none; cursor: pointer; }
.footer-links { display: flex; justify-content: center; gap: 20px; margin-top: 10px; flex-wrap: wrap; }
.footer-links a { color: var(--muted); font-size: 11px; transition: color 0.2s; }
.footer-links a:hover { color: var(--gold); }

/* ===== PAGE MODAL (Privacy, About, Contact, Profile) ===== */
.page-overlay { display: none; position: fixed; inset: 0; background: var(--overlay); z-index: 998; justify-content: center; align-items: flex-start; padding: 40px 20px; backdrop-filter: blur(8px); overflow-y: auto; }
.page-overlay.show { display: flex; }
.page-modal { background: var(--surface); border: 1px solid var(--border); border-radius: 16px; padding: 40px; max-width: 640px; width: 100%; box-shadow: 0 24px 64px rgba(0,0,0,0.4); position: relative; margin-bottom: 40px; }
.page-modal h2 { font-family: 'Playfair Display', serif; font-size: 1.4rem; color: var(--text); margin-bottom: 20px; }
.page-modal h3 { font-size: 12px; color: var(--gold); margin-top: 20px; margin-bottom: 8px; font-weight: 600; }
.page-modal p, .page-modal li { font-size: 12px; color: var(--text-secondary); line-height: 1.8; margin-bottom: 8px; }
.page-modal ul { padding-left: 18px; margin-bottom: 12px; }
.page-modal .last-updated { font-size: 11px; color: var(--muted); margin-bottom: 20px; font-style: italic; }
.contact-form { display: flex; flex-direction: column; gap: 12px; }
.contact-form input, .contact-form textarea { background: var(--bg); border: 1px solid var(--border); border-radius: 8px; color: var(--text); font-family: 'Inter', sans-serif; font-size: 12px; padding: 12px 16px; outline: none; transition: border-color 0.2s; }
.contact-form input:focus, .contact-form textarea:focus { border-color: var(--gold); }
.contact-form textarea { min-height: 100px; resize: vertical; }
.contact-form button { align-self: flex-start; }

::-webkit-scrollbar { width: 5px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 4px; }
@keyframes pulse { 0%,100%{opacity:1} 50%{opacity:0.5} }
.pulsing { animation: pulse 1.5s infinite; }
@keyframes fadeIn { from { opacity:0; transform:translateY(10px); } to { opacity:1; transform:translateY(0); } }
.fade-in { animation: fadeIn 0.4s ease forwards; }

/* ===== AUTH STYLES ===== */
.btn-login { background: var(--surface2); border: 1px solid var(--border); border-radius: 20px; color: var(--text); font-family: 'Inter', sans-serif; font-size: 11px; font-weight: 500; padding: 8px 16px; cursor: pointer; transition: all 0.2s; display: flex; align-items: center; gap: 6px; }
.btn-login:hover { border-color: var(--gold); color: var(--gold); }
.user-menu { position: relative; display: flex; align-items: center; gap: 8px; }
.user-avatar { width: 32px; height: 32px; border-radius: 50%; background: linear-gradient(135deg, var(--gold), var(--gold-light)); display: flex; align-items: center; justify-content: center; font-size: 12px; font-weight: 700; color: #0e0d0b; cursor: pointer; border: 2px solid transparent; transition: all 0.2s; }
.user-avatar:hover { border-color: var(--gold); }
.user-dropdown { position: absolute; top: 40px; right: 0; background: var(--surface); border: 1px solid var(--border); border-radius: 10px; padding: 8px 0; min-width: 180px; box-shadow: 0 8px 24px var(--shadow); z-index: 100; display: none; }
.user-dropdown.show { display: block; }
.user-dropdown-item { padding: 10px 16px; font-size: 12px; color: var(--text-secondary); cursor: pointer; transition: all 0.15s; display: flex; align-items: center; gap: 8px; }
.user-dropdown-item:hover { background: var(--gold-dim); color: var(--gold); }
.user-dropdown-divider { height: 1px; background: var(--border); margin: 4px 0; }
.user-dropdown-header { padding: 10px 16px 6px; font-size: 11px; color: var(--muted); font-weight: 500; }

.auth-overlay { display: none; position: fixed; inset: 0; background: var(--overlay); z-index: 1000; justify-content: center; align-items: center; backdrop-filter: blur(8px); }
.auth-overlay.show { display: flex; }
.auth-modal { background: var(--surface); border: 1px solid var(--border); border-radius: 16px; padding: 36px; max-width: 400px; width: 90%; box-shadow: 0 24px 64px rgba(0,0,0,0.4); position: relative; }
.auth-modal h2 { font-family: 'Playfair Display', serif; font-size: 1.4rem; color: var(--text); margin-bottom: 6px; text-align: center; }
.auth-modal .auth-subtitle { font-size: 12px; color: var(--muted); text-align: center; margin-bottom: 24px; }
.auth-tabs { display: flex; gap: 4px; margin-bottom: 20px; background: var(--bg); border-radius: 10px; padding: 4px; }
.auth-tab { flex: 1; padding: 10px; border-radius: 8px; border: none; background: transparent; color: var(--muted); font-family: 'Inter', sans-serif; font-size: 12px; font-weight: 500; cursor: pointer; transition: all 0.2s; text-align: center; }
.auth-tab.active { background: var(--surface); color: var(--gold); box-shadow: 0 2px 6px var(--shadow); }
.auth-form { display: flex; flex-direction: column; gap: 12px; }
.auth-form input { background: var(--bg); border: 1px solid var(--border); border-radius: 8px; color: var(--text); font-family: 'Inter', sans-serif; font-size: 12px; padding: 12px 16px; outline: none; transition: border-color 0.2s; }
.auth-form input:focus { border-color: var(--gold); }
.auth-form .auth-error { font-size: 11px; color: #e07060; display: none; margin-bottom: -4px; }
.btn-auth { width: 100%; background: linear-gradient(135deg, var(--gold), var(--gold-light)); border: none; border-radius: 10px; color: #0e0d0b; font-family: 'Inter', sans-serif; font-size: 12px; font-weight: 600; padding: 14px; cursor: pointer; transition: all 0.2s; }
.btn-auth:hover { transform: translateY(-1px); box-shadow: 0 4px 16px rgba(201,168,76,0.3); }
.auth-divider { display: flex; align-items: center; gap: 12px; margin: 16px 0; font-size: 11px; color: var(--muted); }
.auth-divider::before, .auth-divider::after { content: ''; flex: 1; height: 1px; background: var(--border); }
.btn-google { width: 100%; background: var(--surface); border: 1px solid var(--border); border-radius: 10px; color: var(--text); font-family: 'Inter', sans-serif; font-size: 12px; font-weight: 500; padding: 12px; cursor: pointer; transition: all 0.2s; display: flex; align-items: center; justify-content: center; gap: 10px; }
.btn-google:hover { border-color: var(--gold); background: var(--gold-dim); }
.btn-google svg { width: 18px; height: 18px; }
.word-limit-notice { background: var(--gold-dim); border: 1px solid rgba(201,168,76,0.3); border-radius: 8px; padding: 10px 14px; font-size: 11px; color: var(--text-secondary); line-height: 1.5; margin-top: 8px; }
.word-limit-notice strong { color: var(--gold); }

/* Password Form overrides */
.password-form { margin-top: 16px; padding-top: 16px; border-top: 1px solid var(--border); }

@media (max-width: 600px) {
  .top-bar { flex-wrap: wrap; justify-content: center; row-gap: 10px; padding: 14px 16px; }
  .top-bar-left, .top-bar-right { flex-wrap: wrap; justify-content: center; }
  header { padding: 20px 16px 0; }
  main { padding: 0 16px 60px; gap: 14px; }
  .card { padding: 18px; }
  .voice-grid { grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); }
  .provider-tabs { gap: 4px; }
  .provider-tab { padding: 8px 12px; font-size: 11px; }
  .hero-features { gap: 12px; }
  .hero-feat { font-size: 10px; }
  .admin-stats { grid-template-columns: repeat(2, 1fr); }
  .upload-zone { padding: 32px 16px; }
  .limit-modal, .page-modal, .auth-modal { padding: 24px 20px; }
  .admin-panel { padding: 20px 16px; }
  .admin-tabs-nav { flex-wrap: wrap; gap: 6px; }
  .admin-actions { justify-content: center; }
  .plan-cards { gap: 10px; }
  .toast { max-width: 90vw; padding: 12px 18px; font-size: 11px; }
  .api-row { flex-wrap: wrap; }
  .api-row input { min-width: 0; width: 100%; }
  .footer-links { gap: 12px 16px; }
}

@media (max-width: 380px) {
  h1 { font-size: 2rem; }
  .top-bar { gap: 8px; }
  .usage-count { display: none; }
  .btn-upgrade, .btn-login { font-size: 10px; padding: 8px 12px; }
}
