/* Live Transcriber - Modern Clean Design */
* { margin: 0; padding: 0; box-sizing: border-box; }

:root {
    --bg-primary: #0a0a0f;
    --bg-secondary: #12121a;
    --bg-card: #1a1a25;
    --bg-hover: #252535;
    --text-primary: #ffffff;
    --text-secondary: #8888a0;
    --text-muted: #555566;
    --accent: #00d4ff;
    --accent-glow: rgba(0, 212, 255, 0.3);
    --accent-secondary: #00ff88;
    --danger: #ff4466;
    --danger-glow: rgba(255, 68, 102, 0.3);
    --border: rgba(255, 255, 255, 0.08);
    --shadow: rgba(0, 0, 0, 0.5);
    --radius: 16px;
    --radius-sm: 10px;
}

[data-theme="light"] {
    --bg-primary: #f5f5f8;
    --bg-secondary: #ffffff;
    --bg-card: #ffffff;
    --bg-hover: #f0f0f5;
    --text-primary: #1a1a25;
    --text-secondary: #666680;
    --text-muted: #9999aa;
    --accent: #0099cc;
    --accent-glow: rgba(0, 153, 204, 0.2);
    --border: rgba(0, 0, 0, 0.08);
    --shadow: rgba(0, 0, 0, 0.1);
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    min-height: 100vh;
    min-height: 100dvh;
    overflow: hidden;
    /* iPhone safe areas */
    padding-top: env(safe-area-inset-top);
    padding-left: env(safe-area-inset-left);
    padding-right: env(safe-area-inset-right);
}

/* App Container */
.app-container {
    display: flex;
    flex-direction: column;
    height: 100vh;
    height: 100dvh;
    max-width: 800px;
    margin: 0 auto;
    position: relative;
}

/* Header - Compact */
.header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 16px;
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border);
}

.logo {
    display: flex;
    align-items: center;
    gap: 8px;
}

.logo-icon {
    font-size: 20px;
    color: var(--accent);
}

.logo h1 {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-primary);
}

.header-actions {
    display: flex;
    gap: 8px;
}

.header-btn {
    width: 40px;
    height: 40px;
    border: none;
    background: transparent;
    color: var(--text-secondary);
    cursor: pointer;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.header-btn:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
}

.header-btn svg {
    width: 22px;
    height: 22px;
}

.theme-icon {
    font-size: 20px;
}

/* Search Bar */
.search-bar {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 20px;
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border);
}

.search-bar.hidden {
    display: none;
}

.search-bar input {
    flex: 1;
    padding: 10px 16px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-size: 15px;
}

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

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

.search-results {
    color: var(--text-secondary);
    font-size: 13px;
    min-width: 60px;
}

.search-nav, .search-clear {
    width: 32px;
    height: 32px;
    border: none;
    background: var(--bg-card);
    color: var(--text-secondary);
    border-radius: 8px;
    cursor: pointer;
    font-size: 14px;
}

.search-nav:disabled {
    opacity: 0.3;
    cursor: not-allowed;
}

/* Session Recovery Modal */
.session-modal {
    max-width: 340px;
    text-align: center;
}

.session-modal-body {
    padding: 30px 24px;
}

.session-icon {
    font-size: 48px;
    margin-bottom: 16px;
}

.session-modal-body p {
    margin: 0;
    color: var(--text-primary);
    font-size: 15px;
}

.session-hint {
    color: var(--text-secondary) !important;
    font-size: 13px !important;
    margin-top: 8px !important;
}

.session-modal-footer {
    flex-direction: row !important;
    justify-content: center;
    gap: 12px;
}

.session-modal-footer .btn {
    min-width: 120px;
    padding: 12px 20px;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.session-modal-footer .btn-primary {
    background: var(--accent);
    color: var(--bg-primary);
}

.session-modal-footer .btn-primary:hover {
    background: #00b8d9;
}

.session-modal-footer .btn-secondary {
    background: var(--bg-hover);
    color: var(--text-secondary);
}

.session-modal-footer .btn-secondary:hover {
    background: var(--danger);
    color: white;
}

/* Transcript Area */
.transcript-wrapper {
    flex: 1;
    overflow: hidden;
    padding: 20px;
}

.transcript-container {
    height: 100%;
    overflow-y: auto;
    background: var(--bg-secondary);
    border-radius: var(--radius);
    padding: 24px;
}

.transcript {
    font-size: 18px;
    line-height: 1.7;
    color: var(--text-primary);
    min-height: 100%;
}

.transcript:focus {
    outline: none;
}

/* Placeholder */
.placeholder-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    text-align: center;
    color: var(--text-muted);
}

.placeholder-icon {
    font-size: 64px;
    margin-bottom: 20px;
    opacity: 0.5;
}

.placeholder-text {
    font-size: 18px;
    color: var(--text-secondary);
    margin-bottom: 8px;
}

.placeholder-hint {
    font-size: 14px;
    color: var(--text-muted);
}

/* Transcript text styles */
.transcript .final {
    color: var(--text-primary);
}

.transcript .interim {
    color: var(--accent);
    opacity: 0.8;
}

.transcript .timestamp {
    font-size: 12px;
    color: var(--text-muted);
    margin-right: 8px;
}

.transcript p {
    margin-bottom: 16px;
}

/* Status Bar - Compact */
.status-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 6px 16px;
    background: var(--bg-secondary);
    border-top: 1px solid var(--border);
}

.status-left, .status-right {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 100px;
}

.status-right {
    justify-content: flex-end;
}

.status-center {
    flex: 1;
    display: flex;
    justify-content: center;
}

.duration {
    font-size: 14px;
    font-variant-numeric: tabular-nums;
    font-weight: 500;
    color: var(--text-secondary);
}

.word-count {
    font-size: 13px;
    color: var(--text-secondary);
}

/* Connection Indicator */
.connection-indicator {
    display: flex;
    align-items: center;
}

.connection-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--text-muted);
    transition: background 0.3s;
}

.connection-indicator.connecting .connection-dot {
    background: #ffa500;
    animation: pulse-dot 1s ease-in-out infinite;
}

.connection-indicator.connected .connection-dot {
    background: var(--accent-secondary);
}

.connection-indicator.error .connection-dot {
    background: var(--danger);
}

@keyframes pulse-dot {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.4; }
}

/* Mic Level Meter */
.mic-level-container {
    width: 120px;
}

.mic-level {
    height: 6px;
    background: var(--bg-card);
    border-radius: 3px;
    overflow: hidden;
}

.mic-level-fill {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, var(--accent), var(--accent-secondary));
    border-radius: 3px;
    transition: width 0.1s ease;
}

/* Action Bar */
.action-bar {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 20px;
    padding: 12px 20px;
    padding-bottom: calc(12px + env(safe-area-inset-bottom));
    background: var(--bg-secondary);
    border-top: 1px solid var(--border);
}

.action-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    padding: 8px 16px;
    background: transparent;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    border-radius: var(--radius-sm);
    transition: all 0.2s;
}

.action-btn:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
}

.action-btn svg {
    width: 22px;
    height: 22px;
}

.action-btn span {
    font-size: 11px;
    font-weight: 500;
}

/* Record Button - Always Visible */
.record-btn {
    position: relative;
}

.record-btn .rec-icon {
    color: var(--danger);
}

.record-btn .stop-rec-icon {
    display: none;
}

.record-btn.recording {
    background: var(--danger) !important;
    color: white !important;
    animation: pulse-record 1.2s ease-in-out infinite;
}

.record-btn.recording .rec-icon {
    display: none;
}

.record-btn.recording .stop-rec-icon {
    display: block;
    color: white;
}

.record-btn.recording:hover {
    background: #ff2244 !important;
}

@keyframes pulse-record {
    0%, 100% { box-shadow: 0 0 0 0 rgba(255, 68, 102, 0.4); }
    50% { box-shadow: 0 0 0 8px rgba(255, 68, 102, 0); }
}

/* Mic Button */
.mic-btn {
    position: relative;
    width: 56px;
    height: 56px;
    border: none;
    background: linear-gradient(135deg, var(--accent), #0088cc);
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 20px var(--accent-glow);
    transition: all 0.3s ease;
    flex-shrink: 0;
}

.mic-btn:hover {
    transform: scale(1.05);
    box-shadow: 0 6px 30px var(--accent-glow);
}

.mic-btn:active {
    transform: scale(0.98);
}

.mic-btn-inner {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.mic-btn svg {
    width: 32px;
    height: 32px;
    color: white;
}

.mic-btn .stop-icon {
    display: none;
}

.mic-btn.listening {
    background: linear-gradient(135deg, var(--accent-secondary), #00cc66);
    box-shadow: 0 4px 25px rgba(0, 255, 136, 0.5);
    animation: pulse-listening 0.8s ease-in-out infinite;
}

.mic-btn.listening .mic-icon {
    display: none;
}

.mic-btn.listening .stop-icon {
    display: block;
}

@keyframes pulse-listening {
    0%, 100% {
        transform: scale(1);
        box-shadow: 0 4px 25px rgba(0, 255, 136, 0.5);
    }
    50% {
        transform: scale(1.08);
        box-shadow: 0 4px 35px rgba(0, 255, 136, 0.8), 0 0 60px rgba(0, 255, 136, 0.4);
    }
}

.mic-btn.recording {
    background: linear-gradient(135deg, var(--danger), #cc0033);
    box-shadow: 0 4px 20px var(--danger-glow);
    animation: pulse-recording 1.5s ease-in-out infinite;
}

.mic-btn.recording .mic-icon {
    display: none;
}

.mic-btn.recording .stop-icon {
    display: block;
}

.mic-pulse {
    position: absolute;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    background: var(--accent);
    opacity: 0;
    pointer-events: none;
}

.mic-btn.recording .mic-pulse {
    animation: pulse-ring 1.5s ease-out infinite;
}

@keyframes pulse-recording {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.02); }
}

@keyframes pulse-ring {
    0% { transform: scale(1); opacity: 0.4; }
    100% { transform: scale(1.5); opacity: 0; }
}

/* Context Actions - Now inline in action bar */
.context-actions {
    display: flex;
    gap: 4px;
    padding: 8px 12px;
    background: var(--bg-card);
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
}

.context-actions.hidden {
    display: none;
}

.context-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    background: transparent;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    border-radius: 8px;
    transition: all 0.2s;
}

.context-btn:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
}

.context-btn.danger:hover {
    background: rgba(255, 68, 102, 0.1);
    color: var(--danger);
}

.context-btn svg {
    width: 18px;
    height: 18px;
}

.context-btn span {
    display: none;
}

/* Recording Indicator */
.recording-indicator {
    position: fixed;
    top: 80px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    background: var(--danger);
    color: white;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 600;
    z-index: 100;
    animation: fade-in 0.3s ease;
}

.recording-indicator.hidden {
    display: none;
}

.rec-dot {
    width: 8px;
    height: 8px;
    background: white;
    border-radius: 50%;
    animation: blink 1s ease-in-out infinite;
}

@keyframes blink {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.3; }
}

@keyframes fade-in {
    from { opacity: 0; transform: translateX(-50%) translateY(-10px); }
    to { opacity: 1; transform: translateX(-50%) translateY(0); }
}

/* Transcription Progress Indicator */
.transcribe-progress {
    position: fixed;
    top: 80px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 20px;
    background: linear-gradient(135deg, var(--accent), #0088cc);
    color: white;
    border-radius: 16px;
    font-size: 14px;
    font-weight: 600;
    z-index: 200;
    animation: fade-in 0.3s ease;
    box-shadow: 0 4px 20px rgba(0, 212, 255, 0.4);
    min-width: 200px;
}

.transcribe-progress.hidden {
    display: none;
}

.transcribe-spinner {
    width: 20px;
    height: 20px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    flex-shrink: 0;
}

.transcribe-info {
    display: flex;
    flex-direction: column;
    gap: 6px;
    flex: 1;
}

.transcribe-bar {
    width: 100%;
    height: 6px;
    background: rgba(255, 255, 255, 0.3);
    border-radius: 3px;
    overflow: hidden;
}

.transcribe-bar-fill {
    height: 100%;
    width: 0%;
    background: white;
    border-radius: 3px;
    transition: width 0.3s ease;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Settings Panel */
.settings-panel {
    position: fixed;
    top: 0;
    right: -100%;
    width: 100%;
    max-width: 400px;
    height: 100%;
    background: var(--bg-secondary);
    z-index: 1000;
    transition: right 0.3s ease;
    overflow-y: auto;
}

.settings-panel:not(.hidden) {
    right: 0;
}

.settings-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 999;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s;
}

.settings-overlay:not(.hidden) {
    opacity: 1;
    pointer-events: auto;
}

.settings-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 24px;
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    background: var(--bg-secondary);
    z-index: 10;
}

.settings-header h3 {
    font-size: 20px;
    font-weight: 600;
}

.close-btn {
    width: 36px;
    height: 36px;
    border: none;
    background: var(--bg-card);
    color: var(--text-secondary);
    border-radius: 50%;
    font-size: 24px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

.close-btn:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
}

.settings-content {
    padding: 16px 24px;
    position: relative;
    z-index: 1;
}

.settings-section {
    margin-bottom: 32px;
}

.settings-section h4 {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 16px;
}

.setting-group {
    margin-bottom: 16px;
}

.setting-group > label {
    display: block;
    font-size: 15px;
    color: var(--text-primary);
    margin-bottom: 8px;
}

.setting-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 0;
}

.setting-row label {
    font-size: 15px;
    color: var(--text-primary);
}

.setting-desc {
    display: block;
    font-size: 13px;
    color: var(--text-muted);
    margin-top: 2px;
}

.keywords-input {
    margin-top: 12px;
}

.keywords-input.hidden {
    display: none;
}

.keywords-input input {
    width: 100%;
    padding: 10px 14px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-size: 14px;
}

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

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

/* Keyword highlighting in transcript */
.keyword-highlight {
    background: linear-gradient(120deg, rgba(255, 200, 0, 0.3) 0%, rgba(255, 150, 0, 0.3) 100%);
    padding: 1px 4px;
    border-radius: 3px;
    color: #ffcc00;
    font-weight: 500;
}

[data-theme="light"] .keyword-highlight {
    background: linear-gradient(120deg, rgba(255, 200, 0, 0.4) 0%, rgba(255, 150, 0, 0.4) 100%);
    color: #cc8800;
}

.setting-group select {
    width: 100%;
    padding: 12px 16px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-size: 15px;
    cursor: pointer;
}

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

.font-controls {
    display: flex;
    align-items: center;
    gap: 12px;
}

.font-btn {
    width: 40px;
    height: 40px;
    border: 1px solid var(--border);
    background: var(--bg-card);
    color: var(--text-primary);
    border-radius: var(--radius-sm);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
}

.font-btn:hover {
    background: var(--bg-hover);
}

#fontSizeDisplay {
    font-size: 15px;
    color: var(--text-secondary);
    min-width: 50px;
    text-align: center;
}

/* Toggle Switch */
.toggle {
    position: relative;
    width: 48px;
    height: 28px;
    flex-shrink: 0;
}

.toggle input {
    opacity: 0;
    width: 0;
    height: 0;
}

.toggle-slider {
    position: absolute;
    inset: 0;
    background: var(--bg-card);
    border-radius: 28px;
    cursor: pointer;
    transition: all 0.3s;
    border: 1px solid var(--border);
}

.toggle-slider::before {
    content: '';
    position: absolute;
    width: 22px;
    height: 22px;
    left: 3px;
    top: 50%;
    transform: translateY(-50%);
    background: var(--text-secondary);
    border-radius: 50%;
    transition: all 0.3s;
}

.toggle input:checked + .toggle-slider {
    background: var(--accent);
    border-color: var(--accent);
}

.toggle input:checked + .toggle-slider::before {
    transform: translateY(-50%) translateX(20px);
    background: white;
}

.settings-action-btn {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 14px 20px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-size: 15px;
    cursor: pointer;
    transition: all 0.2s;
}

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

.settings-action-btn svg {
    width: 20px;
    height: 20px;
}

/* Export Menu */
.export-menu {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    padding: 20px;
    pointer-events: none;
}

.export-menu:not(.hidden) {
    pointer-events: auto;
}

.export-menu-content {
    max-width: 400px;
    margin: 0 auto;
    background: var(--bg-card);
    border-radius: var(--radius);
    padding: 20px;
    box-shadow: 0 -8px 32px var(--shadow);
    border: 1px solid var(--border);
    transform: translateY(100%);
    transition: transform 0.3s ease;
}

.export-menu:not(.hidden) .export-menu-content {
    transform: translateY(0);
}

.export-menu h4 {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 16px;
    text-align: center;
    color: var(--text-secondary);
}

.export-option {
    width: 100%;
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 14px 16px;
    background: transparent;
    border: none;
    color: var(--text-primary);
    font-size: 15px;
    cursor: pointer;
    border-radius: var(--radius-sm);
    transition: all 0.2s;
}

.export-option:hover {
    background: var(--bg-hover);
}

.export-option:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.export-option svg {
    width: 22px;
    height: 22px;
    color: var(--text-secondary);
}

.export-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 999;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s;
}

.export-overlay:not(.hidden) {
    opacity: 1;
    pointer-events: auto;
}

/* Toast */
.toast {
    position: fixed;
    bottom: 160px;
    left: 50%;
    transform: translateX(-50%);
    padding: 12px 24px;
    background: var(--bg-card);
    color: var(--text-primary);
    border-radius: var(--radius-sm);
    font-size: 14px;
    box-shadow: 0 8px 32px var(--shadow);
    border: 1px solid var(--border);
    z-index: 2000;
    animation: toast-in 0.3s ease;
}

.toast.hidden {
    display: none;
}

@keyframes toast-in {
    from { opacity: 0; transform: translateX(-50%) translateY(20px); }
    to { opacity: 1; transform: translateX(-50%) translateY(0); }
}

/* Modal */
.modal {
    position: fixed;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.7);
    z-index: 2000;
    padding: 20px;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s;
}

.modal:not(.hidden) {
    opacity: 1;
    pointer-events: auto;
}

.modal-content {
    width: 100%;
    max-width: 480px;
    max-height: 90vh;
    background: var(--bg-secondary);
    border-radius: var(--radius);
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

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

.modal-header h3 {
    font-size: 18px;
    font-weight: 600;
}

.modal-body {
    padding: 24px;
    overflow-y: auto;
}

.modal-footer {
    padding: 20px 24px;
    border-top: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
}

/* Save Recording Modal */
.save-recording-modal {
    max-width: 320px;
    text-align: center;
}

.save-recording-body {
    padding: 30px 24px;
}

.save-recording-icon {
    font-size: 48px;
    margin-bottom: 16px;
    animation: pulse-icon 1.5s ease-in-out infinite;
}

@keyframes pulse-icon {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.1); }
}

.save-recording-body p {
    margin: 0;
    color: var(--text-primary);
    font-size: 15px;
}

.save-recording-hint {
    color: var(--text-secondary) !important;
    font-size: 13px !important;
    margin-top: 8px !important;
}

.save-recording-footer {
    flex-direction: row !important;
    justify-content: center;
    gap: 12px;
}

.save-recording-footer .btn {
    min-width: 120px;
    padding: 12px 20px;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.save-recording-footer .btn-primary {
    background: var(--accent);
    color: var(--bg-primary);
}

.save-recording-footer .btn-primary:hover {
    background: #00b8d9;
}

.save-recording-footer .btn-secondary {
    background: var(--bg-hover);
    color: var(--text-secondary);
}

.save-recording-footer .btn-secondary:hover {
    background: var(--danger);
    color: white;
}

/* Upload Zone */
.upload-zone {
    border: 2px dashed var(--border);
    border-radius: var(--radius);
    padding: 40px 20px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s;
}

.upload-zone:hover, .upload-zone.dragover {
    border-color: var(--accent);
    background: rgba(0, 212, 255, 0.05);
}

.upload-icon {
    font-size: 48px;
    margin-bottom: 16px;
}

.upload-zone p {
    color: var(--text-secondary);
    margin-bottom: 8px;
}

.upload-hint {
    font-size: 14px;
    color: var(--text-muted);
}

.upload-formats {
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 12px;
}

.upload-file-info {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px;
    background: var(--bg-card);
    border-radius: var(--radius-sm);
    margin-top: 16px;
}

.upload-file-info.hidden {
    display: none;
}

.file-icon {
    font-size: 24px;
}

.file-name {
    flex: 1;
    font-size: 14px;
    color: var(--text-primary);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.file-size {
    font-size: 13px;
    color: var(--text-muted);
}

.remove-file {
    width: 28px;
    height: 28px;
    border: none;
    background: var(--danger);
    color: white;
    border-radius: 50%;
    font-size: 18px;
    cursor: pointer;
}

/* Batch Upload Queue */
.upload-queue {
    margin-top: 16px;
    background: var(--bg-card);
    border-radius: var(--radius-sm);
    overflow: hidden;
}

.upload-queue.hidden {
    display: none;
}

.queue-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 16px;
    background: var(--bg-hover);
    font-size: 13px;
    color: var(--text-secondary);
}

.clear-queue-btn {
    background: none;
    border: none;
    color: var(--danger);
    font-size: 12px;
    cursor: pointer;
}

.queue-list {
    max-height: 150px;
    overflow-y: auto;
}

.queue-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 16px;
    border-top: 1px solid var(--border);
    font-size: 13px;
}

.queue-item .file-name {
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.queue-item .file-size {
    color: var(--text-muted);
    font-size: 12px;
}

.queue-item .queue-status {
    font-size: 11px;
    padding: 2px 8px;
    border-radius: 10px;
    background: var(--bg-hover);
    color: var(--text-muted);
}

.queue-item .queue-status.processing {
    background: var(--accent-glow);
    color: var(--accent);
}

.queue-item .queue-status.done {
    background: rgba(0, 255, 136, 0.15);
    color: var(--accent-secondary);
}

.queue-item .queue-status.error {
    background: var(--danger-glow);
    color: var(--danger);
}

.queue-item .remove-queue-item {
    width: 20px;
    height: 20px;
    border: none;
    background: transparent;
    color: var(--text-muted);
    font-size: 16px;
    cursor: pointer;
    opacity: 0.5;
}

.queue-item .remove-queue-item:hover {
    opacity: 1;
    color: var(--danger);
}

.upload-options {
    margin-top: 20px;
}

.upload-option label {
    display: block;
    font-size: 14px;
    color: var(--text-secondary);
    margin-bottom: 8px;
}

.upload-option select {
    width: 100%;
    padding: 12px 16px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-size: 15px;
}

.upload-progress {
    margin-top: 20px;
}

.upload-progress.hidden {
    display: none;
}

.progress-bar {
    height: 6px;
    background: var(--bg-card);
    border-radius: 3px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--accent), var(--accent-secondary));
    width: 0%;
    transition: width 0.3s;
}

.upload-status {
    font-size: 14px;
    color: var(--text-secondary);
    margin-top: 12px;
    text-align: center;
}

.upload-estimate {
    font-size: 13px;
    color: var(--text-muted);
    text-align: center;
    margin-top: 4px;
}

.upload-server-status {
    margin-top: 16px;
    text-align: center;
}

.server-status {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    color: var(--text-muted);
}

.server-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--danger);
}

.server-status.connected .server-dot {
    background: var(--accent-secondary);
}

.btn {
    padding: 14px 32px;
    border: none;
    border-radius: var(--radius-sm);
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-start {
    background: linear-gradient(135deg, var(--accent), #0088cc);
    color: white;
    min-width: 160px;
}

.btn-start:hover {
    transform: scale(1.02);
    box-shadow: 0 4px 20px var(--accent-glow);
}

.btn-start:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

.btn-secondary {
    background: var(--bg-card);
    color: var(--text-primary);
    border: 1px solid var(--border);
}

.btn-secondary.hidden {
    display: none;
}

.btn-link {
    background: none;
    border: none;
    color: var(--accent);
    padding: 8px;
    font-size: 14px;
    cursor: pointer;
    text-decoration: underline;
}

.server-hint {
    font-size: 13px;
    color: var(--text-muted);
}

.server-hint code {
    background: var(--bg-card);
    padding: 2px 8px;
    border-radius: 4px;
    font-family: monospace;
}

/* Setup Guide */
.setup-guide {
    max-width: 550px;
}

.setup-intro {
    color: var(--text-secondary);
    margin-bottom: 24px;
    line-height: 1.6;
}

.setup-step {
    display: flex;
    gap: 16px;
    margin-bottom: 20px;
    padding: 16px;
    background: var(--bg-card);
    border-radius: var(--radius-sm);
}

.step-number {
    width: 32px;
    height: 32px;
    background: linear-gradient(135deg, var(--accent), #0088cc);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    color: white;
    flex-shrink: 0;
}

.step-content h4 {
    font-size: 15px;
    margin-bottom: 8px;
}

.step-content p {
    font-size: 14px;
    color: var(--text-secondary);
    margin-bottom: 4px;
}

.step-content a {
    color: var(--accent);
}

.step-content .command {
    display: block;
    background: var(--bg-primary);
    padding: 10px 14px;
    border-radius: 6px;
    font-family: 'Consolas', monospace;
    font-size: 13px;
    color: var(--accent-secondary);
    margin: 8px 0;
    user-select: all;
}

.step-note {
    font-size: 12px !important;
    color: var(--text-muted) !important;
    font-style: italic;
}

.step-note code {
    background: var(--bg-primary);
    padding: 2px 6px;
    border-radius: 3px;
}

.setup-done {
    background: linear-gradient(135deg, rgba(0, 212, 255, 0.1), rgba(0, 255, 136, 0.1));
    border: 1px solid var(--accent);
    border-radius: var(--radius-sm);
    padding: 16px;
    text-align: center;
}

.setup-done p {
    color: var(--accent);
    font-weight: 500;
}

/* Transcription Badge */
.transcription-badge {
    position: fixed;
    top: 80px;
    right: 20px;
    padding: 10px 16px;
    background: var(--bg-card);
    border-radius: var(--radius-sm);
    font-size: 13px;
    color: var(--text-secondary);
    box-shadow: 0 4px 20px var(--shadow);
    border: 1px solid var(--border);
    z-index: 100;
}

.transcription-badge.done {
    background: var(--accent-secondary);
    color: var(--bg-primary);
    border-color: var(--accent-secondary);
}

/* Responsive */
@media (max-width: 600px) {
    .header {
        padding: 12px 16px;
    }

    .logo h1 {
        font-size: 1.1rem;
    }

    .transcript-wrapper {
        padding: 12px;
    }

    .transcript-container {
        padding: 16px;
    }

    .transcript {
        font-size: 16px;
    }

    .action-bar {
        padding: 10px 12px;
        padding-bottom: calc(10px + env(safe-area-inset-bottom));
        gap: 8px;
        justify-content: space-around;
    }

    .mic-btn {
        width: 56px;
        height: 56px;
        flex-shrink: 0;
    }

    .mic-btn svg {
        width: 26px;
        height: 26px;
    }

    .action-btn {
        padding: 8px 10px;
        min-width: auto;
    }

    .action-btn svg {
        width: 20px;
        height: 20px;
    }

    .record-btn {
        padding: 8px 10px;
    }

    /* Context actions - compact on mobile */
    .context-actions {
        gap: 2px;
        padding: 6px 8px;
    }

    .context-btn {
        width: 32px;
        height: 32px;
    }

    .context-btn svg {
        width: 16px;
        height: 16px;
    }

    .settings-panel {
        max-width: 100%;
    }

    .modal-content {
        max-height: 85vh;
    }

    .placeholder-icon {
        font-size: 48px;
    }

    .placeholder-text {
        font-size: 16px;
    }
}

/* Extra small screens (iPhone SE, small phones) */
@media (max-width: 380px) {
    .action-bar {
        gap: 6px;
        padding: 8px 8px;
        padding-bottom: calc(8px + env(safe-area-inset-bottom));
    }

    .mic-btn {
        width: 50px;
        height: 50px;
    }

    .action-btn {
        padding: 6px 8px;
    }

    .context-actions {
        padding: 4px 6px;
    }

    .context-btn {
        width: 28px;
        height: 28px;
    }
}

/* Hide scrollbar but keep functionality */
.transcript-container::-webkit-scrollbar {
    width: 6px;
}

.transcript-container::-webkit-scrollbar-track {
    background: transparent;
}

.transcript-container::-webkit-scrollbar-thumb {
    background: var(--border);
    border-radius: 3px;
}

.transcript-container::-webkit-scrollbar-thumb:hover {
    background: var(--text-muted);
}

/* Utility */
.hidden {
    display: none !important;
}
