* { margin: 0; padding: 0; box-sizing: border-box; }
:root { --primary: #1a1a2e; --accent: #e94560; --text: #333; --text-light: #666; --bg: #f8f9fa; --white: #ffffff; --border: #e0e0e0; }
body { font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif; background: var(--bg); color: var(--text); min-height: 100vh; line-height: 1.6; }
.container { max-width: 680px; margin: 0 auto; padding: 60px 24px; }
header { text-align: center; margin-bottom: 48px; }
header h1 { font-size: 2rem; font-weight: 700; color: var(--primary); margin-bottom: 8px; }
header p { color: var(--text-light); font-size: 0.9375rem; }
.card { background: var(--white); border-radius: 16px; padding: 28px; box-shadow: 0 1px 3px rgba(0,0,0,0.08); margin-bottom: 20px; }
.form-group { margin-bottom: 20px; }
label { display: block; font-size: 0.8125rem; font-weight: 600; color: var(--text); margin-bottom: 8px; text-transform: uppercase; letter-spacing: 0.03em; }
textarea { width: 100%; min-height: 120px; padding: 14px; border: 1px solid var(--border); border-radius: 10px; font-size: 0.9375rem; resize: vertical; }
textarea:focus, input[type="text"]:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px rgba(233, 69, 96, 0.08); }
.char-count { text-align: right; font-size: 0.75rem; color: var(--text-light); margin-top: 6px; }

/* Mode tabs */
.mode-selector { display: flex; gap: 4px; margin-bottom: 20px; background: var(--bg); padding: 4px; border-radius: 10px; }
.mode-btn { flex: 1; padding: 10px 16px; border: none; background: transparent; color: var(--text-light); font-size: 0.8125rem; font-weight: 500; cursor: pointer; border-radius: 8px; transition: all 0.2s; display: flex; align-items: center; justify-content: center; gap: 8px; }
.mode-btn.active { background: var(--white); color: var(--primary); box-shadow: 0 1px 2px rgba(0,0,0,0.08); }

/* Mode panels */
.mode-panel { display: none; }
.mode-panel.active { display: block; }

/* Voice grid */
.voice-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.voice-btn { padding: 16px 8px; border: 1.5px solid var(--border); border-radius: 10px; cursor: pointer; text-align: center; transition: all 0.15s; background: var(--white); }
.voice-btn:hover { border-color: var(--accent); }
.voice-btn.active { border-color: var(--accent); background: rgba(233, 69, 96, 0.04); }
.voice-btn i { font-size: 1.25rem; color: var(--accent); margin-bottom: 6px; display: block; }
.voice-btn span { font-size: 0.75rem; font-weight: 500; }

/* File upload */
.file-box { border: 1.5px dashed var(--border); border-radius: 10px; padding: 28px; text-align: center; cursor: pointer; transition: border-color 0.2s; }
.file-box:hover { border-color: var(--accent); }
.file-box i { font-size: 1.75rem; color: var(--text-light); margin-bottom: 10px; }
.file-box p { color: var(--text-light); font-size: 0.8125rem; }
.file-tag { display: none; align-items: center; gap: 10px; padding: 10px 14px; background: var(--bg); border-radius: 8px; margin-top: 10px; }
.file-tag.show { display: flex; }
.file-tag i { color: var(--accent); font-size: 0.875rem; }
.file-tag span { font-size: 0.8125rem; flex: 1; }

/* Buttons */
.btn-row { display: flex; gap: 10px; margin-top: 24px; }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 12px 24px; border: none; border-radius: 10px; font-size: 0.875rem; font-weight: 600; cursor: pointer; }
.btn-main { background: var(--accent); color: var(--white); }
.btn-main:hover { background: #d63d56; }
.btn-main:disabled { opacity: 0.5; cursor: not-allowed; }
.btn-alt { background: transparent; color: var(--text-light); border: 1px solid var(--border); }
.btn-alt:hover { background: var(--bg); color: var(--text); }

/* Status & result */
.msg { display: none; margin-top: 16px; padding: 12px 16px; border-radius: 8px; font-size: 0.8125rem; align-items: center; gap: 8px; }
.msg.show { display: flex; }
.msg.ok { background: #d4edda; color: #155724; }
.msg.err { background: #f8d7da; color: #721c24; }
.msg.load { background: #fff3cd; color: #856404; }

.result-box { display: none; margin-top: 20px; padding: 20px; background: var(--bg); border-radius: 10px; }
.result-box.show { display: block; }
.result-box h4 { font-size: 0.75rem; font-weight: 600; color: var(--text); margin-bottom: 12px; text-transform: uppercase; letter-spacing: 0.03em; }
audio { width: 100%; border-radius: 8px; }
.result-actions { display: flex; align-items: center; gap: 16px; margin-top: 12px; flex-wrap: wrap; }
.dl-link { display: inline-flex; align-items: center; gap: 6px; color: var(--accent); text-decoration: none; font-size: 0.8125rem; font-weight: 500; }
.btn-azura { background: #1a3a5c; color: #fff; font-size: 0.8125rem; padding: 9px 18px; border-radius: 8px; }
.btn-azura:hover:not(:disabled) { background: #14304f; }
.btn-azura:disabled { opacity: 0.5; cursor: not-allowed; }

/* Gain grid */
.gain-grid { display: flex; gap: 8px; }
.gain-btn { flex: 1; padding: 10px 8px; border: 1.5px solid var(--border); border-radius: 10px; cursor: pointer; text-align: center; background: var(--white); font-size: 0.875rem; font-weight: 600; color: var(--text); transition: all 0.15s; }
.gain-btn:hover { border-color: var(--accent); }
.gain-btn.active { border-color: var(--accent); background: rgba(233, 69, 96, 0.04); color: var(--accent); }

.spin { width: 16px; height: 16px; border: 2px solid currentColor; border-top-color: transparent; border-radius: 50%; animation: spin 1s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* Recording section */
.record-section { text-align: center; padding: 20px 0; }
.record-hint { color: var(--text-light); font-size: 0.875rem; margin-bottom: 20px; }
.record-controls { display: flex; align-items: center; justify-content: center; gap: 16px; flex-wrap: wrap; }
.record-btn { width: 70px; height: 70px; border-radius: 50%; border: none; background: var(--accent); color: var(--white); font-size: 1.5rem; cursor: pointer; transition: all 0.2s; box-shadow: 0 4px 15px rgba(233, 69, 96, 0.3); }
.record-btn:hover { transform: scale(1.05); }
.record-btn.recording { background: #dc3545; animation: pulse 1.5s infinite; }
@keyframes pulse { 0%, 100% { box-shadow: 0 0 0 0 rgba(220, 53, 69, 0.4); } 50% { box-shadow: 0 0 0 15px rgba(220, 53, 69, 0); } }
.record-status { font-size: 0.875rem; color: var(--text-light); font-weight: 500; }
.record-preview { margin-top: 24px; padding: 20px; background: var(--bg); border-radius: 10px; }
.record-preview audio { margin-bottom: 16px; }
.record-save { display: flex; gap: 10px; flex-wrap: wrap; justify-content: center; }
.record-save input { flex: 1; min-width: 200px; padding: 12px 14px; border: 1px solid var(--border); border-radius: 10px; font-size: 0.9375rem; }
.record-save input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px rgba(233, 69, 96, 0.08); }

/* Recorded voices list */
.recorded-voices { margin-top: 28px; padding-top: 24px; border-top: 1px solid var(--border); }
.recorded-voices > label { margin-bottom: 16px; }
.voices-list { display: flex; flex-direction: column; gap: 10px; }
.no-voices { color: var(--text-light); font-size: 0.875rem; text-align: center; padding: 20px; }
.voice-item { display: flex; align-items: center; justify-content: space-between; padding: 12px 16px; background: var(--bg); border-radius: 10px; }
.voice-name { font-size: 0.875rem; font-weight: 500; color: var(--text); }
.voice-actions { display: flex; gap: 8px; }
.voice-actions button { width: 32px; height: 32px; border: none; border-radius: 8px; background: var(--white); color: var(--text-light); cursor: pointer; transition: all 0.15s; }
.voice-actions button:hover { background: var(--accent); color: var(--white); }
.voice-actions button:last-child:hover { background: #dc3545; }
