/* ========================================
   Stream - Modern ASR & Summarization UI
   ======================================== */

/* CSS Variables */
:root {
    /* Color Palette - Wave theme (default) - Warm white with teal/mint accents */
    --bg-primary: #FCFBF9;
    --bg-secondary: #F7F6F3;
    --bg-tertiary: #EFEDE9;
    --bg-elevated: #E5E3DE;
    --bg-hover: #DBD9D3;
    
    --text-primary: #1A1A1A;
    --text-secondary: #4A4A4A;
    --text-muted: #7A7A7A;
    --text-accent: #0A7B71;
    
    --accent-primary: #0D9488;
    --accent-secondary: #10B981;
    --accent-success: #059669;
    --accent-warning: #D97706;
    --accent-danger: #DC2626;
    --accent-info: #0891B2;
    
    --border-color: #D4D2CC;
    --border-subtle: #E5E3DE;
    
    /* Gradients */
    --gradient-primary: linear-gradient(135deg, #0D9488 0%, #10B981 100%);
    --gradient-accent: linear-gradient(135deg, #10B981 0%, #059669 100%);
    --gradient-glow: radial-gradient(circle at 50% 50%, rgba(13, 148, 136, 0.1) 0%, transparent 70%);
    
    /* Typography */
    --font-primary: 'Outfit', -apple-system, BlinkMacSystemFont, sans-serif;
    --font-mono: 'JetBrains Mono', 'Fira Code', monospace;
    
    /* Spacing */
    --spacing-xs: 4px;
    --spacing-sm: 8px;
    --spacing-md: 16px;
    --spacing-lg: 24px;
    --spacing-xl: 32px;
    --spacing-2xl: 48px;
    
    /* Borders */
    --radius-sm: 6px;
    --radius-md: 10px;
    --radius-lg: 16px;
    --radius-xl: 24px;
    --radius-full: 9999px;
    
    /* Shadows */
    --shadow-sm: 0 2px 4px rgba(0, 0, 0, 0.06);
    --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.08);
    --shadow-lg: 0 8px 24px rgba(0, 0, 0, 0.1);
    --shadow-glow: 0 0 20px rgba(13, 148, 136, 0.15);
    
    /* Transitions */
    --transition-fast: 150ms ease;
    --transition-base: 250ms ease;
    --transition-slow: 400ms ease;
    
    /* Layout */
    --sidebar-width: 280px;
    --toolbar-height: 72px;
    --header-height: 60px;
}

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

/* Material Symbols */
.material-symbols-rounded {
    font-family: 'Material Symbols Rounded';
    font-weight: normal;
    font-style: normal;
    font-size: 1.2em;
    line-height: 1;
    letter-spacing: normal;
    text-transform: none;
    display: inline-block;
    white-space: nowrap;
    word-wrap: normal;
    direction: ltr;
    font-feature-settings: 'liga';
    -webkit-font-smoothing: antialiased;
    vertical-align: middle;
}

html {
    font-size: 16px;
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-primary);
    background: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
    display: flex;
    overflow: hidden;
}

/* Selection */
::selection {
    background: var(--accent-primary);
    color: var(--bg-primary);
}

/* Scrollbar */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: var(--bg-secondary);
}

::-webkit-scrollbar-thumb {
    background: var(--bg-hover);
    border-radius: var(--radius-full);
}

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

/* ========================================
   Sidebar
   ======================================== */
.sidebar {
    width: var(--sidebar-width);
    height: 100vh;
    background: var(--bg-secondary);
    border-right: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    position: relative;
    z-index: 100;
}

.sidebar::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 200px;
    background: var(--gradient-glow);
    pointer-events: none;
}

.sidebar-header {
    padding: var(--spacing-lg);
    border-bottom: 1px solid var(--border-subtle);
}

.logo {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--spacing-sm);
}

.logo-icon-svg {
    color: var(--accent-primary);
    filter: drop-shadow(0 0 4px rgba(122, 162, 247, 0.3));
    transition: color var(--transition-base), filter var(--transition-base);
}

.logo-icon {
    font-size: 1.75rem;
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: pulse-glow 2s ease-in-out infinite;
}

@keyframes pulse-glow {
    0%, 100% { filter: drop-shadow(0 0 4px rgba(122, 162, 247, 0.5)); }
    50% { filter: drop-shadow(0 0 12px rgba(122, 162, 247, 0.8)); }
}

.logo-text {
    font-size: 1.25rem;
    font-weight: 600;
    letter-spacing: -0.02em;
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    transition: background var(--transition-base);
}

.sidebar-actions {
    padding: var(--spacing-md);
}

.btn-new-memo {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--spacing-sm);
}

/* Memo List */
.memo-list-container {
    flex: 1;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.memo-list-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: var(--spacing-md);
    padding-bottom: var(--spacing-sm);
}

.memo-list-title {
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--text-muted);
}

.memo-count {
    font-size: 0.7rem;
    font-weight: 500;
    background: var(--bg-hover);
    color: var(--text-secondary);
    padding: 2px 8px;
    border-radius: var(--radius-full);
}

.memo-list {
    flex: 1;
    overflow-y: auto;
    padding: 0 var(--spacing-sm) var(--spacing-md);
}

/* Memo Item */
.memo-item {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-xs);
    padding: var(--spacing-md);
    margin-bottom: var(--spacing-xs);
    background: transparent;
    border: 1px solid transparent;
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all var(--transition-base);
    position: relative;
}

.memo-item:hover {
    background: var(--bg-hover);
    border-color: var(--border-color);
}

.memo-item.active {
    background: var(--bg-elevated);
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 1px var(--accent-primary), var(--shadow-glow);
}

.memo-item-title {
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.memo-item-meta {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    font-size: 0.75rem;
    color: var(--text-muted);
}

.memo-item-badges {
    display: flex;
    gap: var(--spacing-xs);
    margin-left: auto;
}

.memo-badge {
    display: inline-flex;
    align-items: center;
    padding: 2px 6px;
    font-size: 0.65rem;
    font-weight: 500;
    border-radius: var(--radius-sm);
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.memo-badge.has-transcript {
    background: rgba(122, 162, 247, 0.15);
    color: var(--accent-primary);
}

.memo-badge.has-summary {
    background: rgba(187, 154, 247, 0.15);
    color: var(--accent-secondary);
}

/* Badge abbreviation: hide short variants by default */
.badge-short {
    display: none;
}

/* Memo List Header Actions */
.memo-list-header-actions {
    display: flex;
    align-items: center;
    gap: var(--spacing-xs);
}

.btn-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border: none;
    background: transparent;
    color: var(--text-muted);
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all var(--transition-base);
    padding: 0;
}

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

/* Directory Styles */
.memo-directory {
    margin-bottom: var(--spacing-xs);
    border-radius: var(--radius-md);
    transition: all var(--transition-base);
}

.memo-directory-header {
    display: flex;
    align-items: center;
    gap: var(--spacing-xs);
    padding: var(--spacing-sm) var(--spacing-md);
    cursor: pointer;
    border-radius: var(--radius-md);
    transition: all var(--transition-base);
    user-select: none;
    position: relative;
}

.memo-directory-header:hover {
    background: var(--bg-hover);
}

.memo-directory-header:hover .memo-directory-actions {
    opacity: 1;
}

.memo-directory-chevron {
    font-size: 18px;
    color: var(--text-muted);
    transition: transform 0.2s ease;
    flex-shrink: 0;
}

.memo-directory-header.collapsed .memo-directory-chevron {
    transform: rotate(-90deg);
}

.memo-directory-icon {
    font-size: 18px;
    color: var(--accent-primary);
    flex-shrink: 0;
}

.memo-directory-name {
    flex: 1;
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.memo-directory-count {
    font-size: 0.65rem;
    font-weight: 500;
    background: var(--bg-hover);
    color: var(--text-muted);
    padding: 1px 6px;
    border-radius: var(--radius-full);
    flex-shrink: 0;
}

.memo-directory-actions {
    display: flex;
    align-items: center;
    gap: 2px;
    opacity: 0;
    transition: opacity var(--transition-base);
    flex-shrink: 0;
}

.btn-icon-sm {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    border: none;
    background: transparent;
    color: var(--text-muted);
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all var(--transition-base);
    padding: 0;
}

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

.btn-icon-sm .material-symbols-rounded {
    font-size: 16px;
}

.memo-directory-items {
    padding-left: var(--spacing-md);
    overflow: hidden;
    transition: max-height 0.25s ease;
}

.memo-directory-items.collapsed {
    display: none;
}

/* Root area */
.memo-root-area {
    min-height: 4px;
}

/* Drag and Drop */
.memo-item.dragging {
    opacity: 0.4;
}

.memo-directory.dragging {
    opacity: 0.4;
}

.memo-directory.drag-over .memo-directory-header {
    background: var(--bg-hover);
    outline: 2px dashed var(--accent-primary);
    outline-offset: -2px;
}

.memo-root-area.drag-over {
    background: var(--bg-hover);
    border-radius: var(--radius-md);
    outline: 2px dashed var(--accent-primary);
    outline-offset: -2px;
    min-height: 40px;
}

/* Reorder indicators */
.memo-item.reorder-above {
    box-shadow: 0 -2px 0 0 var(--accent-primary);
}

.memo-item.reorder-below {
    box-shadow: 0 2px 0 0 var(--accent-primary);
}

/* Sort button active state */
.btn-sort-memos.active {
    background: var(--bg-hover);
    color: var(--accent-primary);
}

/* Delete button in modals */
.btn-danger {
    background: #e55561;
    color: #fff;
    border: none;
}

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

/* Empty State */
.memo-empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: var(--spacing-2xl) var(--spacing-md);
    color: var(--text-muted);
}

.empty-icon {
    font-size: 2.5rem;
    margin-bottom: var(--spacing-md);
    opacity: 0.5;
    color: var(--accent-primary);
}

.memo-empty-state p {
    font-weight: 500;
    color: var(--text-secondary);
    margin-bottom: var(--spacing-xs);
}

.memo-empty-state span {
    font-size: 0.85rem;
}

/* Sidebar Footer */
.sidebar-footer {
    padding: var(--spacing-md);
    border-top: 1px solid var(--border-subtle);
}

.user-info {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
}

.user-avatar {
    width: 32px;
    height: 32px;
    background: var(--gradient-primary);
    border-radius: var(--radius-full);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 0.85rem;
    color: var(--bg-primary);
}

.user-name {
    font-size: 0.9rem;
    font-weight: 500;
}

/* ========================================
   Main Content
   ======================================== */
.main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    height: 100vh;
    position: relative;
    background: var(--bg-primary);
    overflow: hidden;
    max-width: 100%;
}

/* Welcome Screen */
.welcome-screen {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: var(--spacing-2xl);
    background: 
        radial-gradient(ellipse at 20% 20%, rgba(122, 162, 247, 0.08) 0%, transparent 50%),
        radial-gradient(ellipse at 80% 80%, rgba(187, 154, 247, 0.08) 0%, transparent 50%),
        var(--bg-primary);
}

.welcome-content {
    max-width: 800px;
    text-align: center;
    width: 100%;
    overflow: visible;
    padding-top: var(--spacing-md);
}

.welcome-icon {
    font-size: 4rem;
    margin-bottom: var(--spacing-lg);
    animation: float 3s ease-in-out infinite;
    color: var(--accent-primary);
    display: inline-block;
}

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

.welcome-content h1 {
    font-size: 2.5rem;
    font-weight: 700;
    letter-spacing: -0.03em;
    margin-bottom: var(--spacing-md);
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.welcome-content > p {
    font-size: 1.1rem;
    color: var(--text-secondary);
    margin-bottom: var(--spacing-2xl);
}

.features-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: var(--spacing-lg);
}

.feature-card {
    background: var(--bg-elevated);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: var(--spacing-xl);
    text-align: center;
    transition: all var(--transition-base);
}

.feature-card:hover {
    transform: translateY(-4px);
    border-color: var(--accent-primary);
    box-shadow: var(--shadow-lg), var(--shadow-glow);
}

.feature-icon {
    font-size: 2.5rem;
    display: block;
    margin-bottom: var(--spacing-md);
    color: var(--accent-primary);
}

.feature-card h3 {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: var(--spacing-sm);
    color: var(--text-primary);
}

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

/* ========================================
   Memo View
   ======================================== */
.memo-view {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

/* Memo Header */
.memo-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: var(--spacing-md) var(--spacing-xl);
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border-color);
    min-height: var(--header-height);
}

.memo-title-container {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.memo-title-input {
    font-family: var(--font-primary);
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text-primary);
    background: transparent;
    border: none;
    outline: none;
    padding: var(--spacing-xs) 0;
    width: 100%;
    max-width: 400px;
}

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

.memo-title-input:focus {
    border-bottom: 2px solid var(--accent-primary);
}

.memo-date {
    font-size: 0.8rem;
    color: var(--text-muted);
}

.memo-actions {
    display: flex;
    gap: var(--spacing-xs);
}

.memo-actions .btn-ghost {
    background: transparent;
    border: none;
    padding: var(--spacing-xs);
    color: var(--text-muted);
}

.memo-actions .btn-ghost:hover {
    background: transparent;
    color: var(--accent-primary);
}

.memo-actions #btnDeleteMemo:hover {
    color: var(--accent-danger);
}

/* ========================================
   Panels
   ======================================== */
.panels-container {
    flex: 1;
    display: flex;
    overflow: hidden;
}

.panel {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-width: 300px;
    overflow: hidden;
}

.panel-left {
    border-right: 1px solid var(--border-color);
}

.panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: var(--spacing-md) var(--spacing-lg);
    background: var(--bg-tertiary);
    border-bottom: 1px solid var(--border-subtle);
}

.panel-title {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text-primary);
}

.panel-icon {
    font-size: 1.1rem;
    color: var(--accent-primary);
}

.panel-status {
    display: flex;
    align-items: center;
    gap: var(--spacing-xs);
    font-size: 0.75rem;
    color: var(--text-muted);
}

.status-dot {
    width: 8px;
    height: 8px;
    border-radius: var(--radius-full);
    background: var(--text-muted);
}

.panel-status.recording .status-dot {
    background: var(--accent-danger);
    animation: pulse 1s ease-in-out infinite;
}

.panel-status.processing .status-dot {
    background: var(--accent-warning);
    animation: pulse 1s ease-in-out infinite;
}

.panel-status.success .status-dot {
    background: var(--accent-success);
}

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

.panel-header-right {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
}

.btn-header-action {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    padding: 0;
    background: transparent;
    border: none;
    border-radius: var(--radius-sm);
    color: var(--text-muted);
    cursor: pointer;
    transition: all var(--transition-base);
}

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

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

.panel-toggle-icon {
    display: none;
    color: var(--text-muted);
    transition: transform var(--transition-base);
}

.panel.collapsed .panel-toggle-icon {
    transform: rotate(-90deg);
}

.panel-content {
    flex: 1;
    overflow-y: auto;
    padding: var(--spacing-lg);
    position: relative;
}

/* Transcript & Summary Containers */
.transcript-container,
.summary-container {
    height: 100%;
}

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

.placeholder-icon {
    font-size: 3rem;
    margin-bottom: var(--spacing-md);
    opacity: 0.5;
    color: var(--accent-primary);
}

.transcript-placeholder p,
.summary-placeholder p {
    font-weight: 500;
    color: var(--text-secondary);
    margin-bottom: var(--spacing-xs);
}

.transcript-placeholder span,
.summary-placeholder span {
    font-size: 0.85rem;
}

.transcript-content,
.summary-content {
    font-family: var(--font-primary);
    line-height: 1.8;
}

/* Speech Header (separator between recordings in transcript) */
.speech-header {
    display: flex;
    align-items: center;
    gap: var(--spacing-md);
    margin: var(--spacing-xl) 0 var(--spacing-lg);
    padding: var(--spacing-sm) 0;
}

.speech-header:first-child {
    margin-top: 0;
}

.speech-header-line {
    flex: 1;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--border-color), transparent);
}

.speech-header-label {
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted);
    white-space: nowrap;
    padding: var(--spacing-xs) var(--spacing-sm);
    background: var(--bg-tertiary);
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-subtle);
}

/* Utterance Styling */
.utterance {
    margin-bottom: var(--spacing-lg);
    padding: var(--spacing-md);
    background: var(--bg-elevated);
    border-radius: var(--radius-md);
    border-left: 3px solid var(--accent-primary);
    transition: all var(--transition-base);
}

/* Utterance Reference Highlight (when clicked from summary) */
.utterance.ref-highlight {
    background: rgba(125, 207, 255, 0.15);
    border-left-color: var(--accent-info);
    box-shadow: 0 0 0 2px var(--accent-info), 
                0 4px 20px rgba(125, 207, 255, 0.3);
    animation: ref-highlight-pulse 0.6s ease-out;
}

@keyframes ref-highlight-pulse {
    0% {
        box-shadow: 0 0 0 0 var(--accent-info), 
                    0 0 0 rgba(125, 207, 255, 0.6);
    }
    50% {
        box-shadow: 0 0 0 4px rgba(125, 207, 255, 0.4), 
                    0 4px 30px rgba(125, 207, 255, 0.5);
    }
    100% {
        box-shadow: 0 0 0 2px var(--accent-info), 
                    0 4px 20px rgba(125, 207, 255, 0.3);
    }
}

.utterance-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: var(--spacing-sm);
}

.speaker-tag {
    display: inline-flex;
    align-items: center;
    gap: var(--spacing-xs);
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--accent-primary);
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.speaker-tag::before {
    content: '';
    width: 8px;
    height: 8px;
    background: var(--accent-primary);
    border-radius: var(--radius-full);
}

.utterance-header-right {
    display: flex;
    align-items: center;
    gap: var(--spacing-xs);
}

.utterance-time {
    font-size: 0.75rem;
    font-family: var(--font-mono);
    color: var(--text-muted);
}

.utterance-copy-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    padding: 0;
    background: transparent;
    border: none;
    border-radius: var(--radius-sm);
    color: var(--text-muted);
    cursor: pointer;
    opacity: 0;
    transition: opacity var(--transition-fast), background var(--transition-fast), color var(--transition-fast);
}

.utterance:hover .utterance-copy-btn {
    opacity: 1;
}

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

.utterance-text {
    color: var(--text-primary);
    font-size: 0.95rem;
}

/* Speaker color variations */
.utterance[data-speaker="1"] { border-left-color: var(--accent-primary); }
.utterance[data-speaker="1"] .speaker-tag { color: var(--accent-primary); }
.utterance[data-speaker="1"] .speaker-tag::before { background: var(--accent-primary); }

.utterance[data-speaker="2"] { border-left-color: var(--accent-secondary); }
.utterance[data-speaker="2"] .speaker-tag { color: var(--accent-secondary); }
.utterance[data-speaker="2"] .speaker-tag::before { background: var(--accent-secondary); }

.utterance[data-speaker="3"] { border-left-color: var(--accent-success); }
.utterance[data-speaker="3"] .speaker-tag { color: var(--accent-success); }
.utterance[data-speaker="3"] .speaker-tag::before { background: var(--accent-success); }

.utterance[data-speaker="4"] { border-left-color: var(--accent-warning); }
.utterance[data-speaker="4"] .speaker-tag { color: var(--accent-warning); }
.utterance[data-speaker="4"] .speaker-tag::before { background: var(--accent-warning); }

/* Live Transcript */
/* Live Recording Section */
.live-recording-section {
    margin-top: var(--spacing-lg);
    padding-top: var(--spacing-lg);
    border-top: 1px dashed var(--border-color);
    animation: fadeInUp 0.3s ease-out;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.live-speech-header {
    border-left-color: var(--accent-danger);
}

.live-speech-header .speech-header-icon {
    background: var(--accent-danger);
    animation: pulse-glow 2s ease-in-out infinite;
}

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

.live-speech-header .speech-header-info {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
}

.live-badge {
    display: inline-flex;
    align-items: center;
    gap: var(--spacing-xs);
    padding: 2px var(--spacing-sm);
    background: var(--accent-danger);
    color: white;
    font-size: 0.65rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    border-radius: var(--radius-sm);
    animation: pulse-badge 1.5s ease-in-out infinite;
}

@keyframes pulse-badge {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.7; }
}

.live-utterances-container {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-md);
}

/* Live utterance cards */
.live-utterance {
    background: var(--bg-elevated);
    border-radius: var(--radius-md);
    padding: var(--spacing-md);
    border-left: 3px solid var(--accent-info);
    opacity: 0.7;
    transition: all var(--transition-base);
    position: relative;
}

.live-utterance.current {
    opacity: 1;
    border-left-color: var(--accent-danger);
    background: linear-gradient(135deg, var(--bg-elevated) 0%, rgba(255, 107, 107, 0.08) 100%);
}

.live-utterance.waiting {
    opacity: 0.6;
}

.live-utterance.waiting .utterance-text {
    color: var(--text-muted);
    font-style: italic;
}

.live-utterance .utterance-text {
    color: var(--text-primary);
    font-size: 0.95rem;
    line-height: 1.5;
    padding-right: var(--spacing-xl);
}

.live-utterance .live-indicator {
    position: absolute;
    top: var(--spacing-sm);
    right: var(--spacing-sm);
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 2px 6px;
    background: var(--accent-danger);
    color: white;
    font-size: 0.6rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    border-radius: var(--radius-xs);
}

.live-indicator {
    display: inline-flex;
    align-items: center;
    gap: var(--spacing-xs);
}

.live-indicator .pulse {
    width: 6px;
    height: 6px;
    background: white;
    border-radius: var(--radius-full);
    animation: pulse 1s ease-in-out infinite;
}

/* Summary Content */
.summary-content {
    color: var(--text-primary);
}

.summary-content h2 {
    font-size: 1.2rem;
    font-weight: 600;
    color: var(--accent-primary);
    margin: var(--spacing-lg) 0 var(--spacing-md);
    padding-bottom: var(--spacing-sm);
    border-bottom: 1px solid var(--border-color);
}

.summary-content h2:first-child {
    margin-top: 0;
}

.summary-content ul {
    list-style: none;
    padding-left: var(--spacing-md);
}

.summary-content li {
    position: relative;
    padding-left: var(--spacing-md);
    margin-bottom: var(--spacing-sm);
}

.summary-content li::before {
    content: '→';
    position: absolute;
    left: 0;
    color: var(--accent-secondary);
}

.summary-content p {
    margin-bottom: var(--spacing-md);
}

.summary-content[contenteditable="true"] {
    outline: none;
    padding: var(--spacing-sm);
    border-radius: var(--radius-sm);
    transition: background-color var(--transition-base);
    cursor: text;
}

.summary-content[contenteditable="true"]:focus {
    background-color: var(--bg-hover);
    box-shadow: inset 0 0 0 1px var(--border-color);
}

.summary-content[data-is-editing="true"] {
    background-color: var(--bg-hover);
    font-family: var(--font-mono, 'Courier New', monospace);
    white-space: pre-wrap;
    padding: var(--spacing-md);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    min-height: 100px;
}

/* Summary Reference Links */
.summary-ref-link {
    display: inline-flex;
    align-items: center;
    gap: 2px;
    padding: 2px 6px;
    margin-left: 4px;
    background: var(--bg-elevated);
    border: 1px solid var(--accent-info);
    border-radius: var(--radius-sm);
    font-size: 0.7rem;
    font-weight: 600;
    color: var(--accent-info);
    text-decoration: none;
    cursor: pointer;
    transition: all var(--transition-fast);
    vertical-align: middle;
}

.summary-ref-link:hover {
    background: var(--accent-info);
    color: var(--bg-primary);
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(125, 207, 255, 0.3);
}

.summary-ref-link.summary-ref-range {
    background: linear-gradient(135deg, var(--bg-elevated) 0%, rgba(125, 207, 255, 0.1) 100%);
    border-color: var(--accent-secondary);
    color: var(--accent-secondary);
}

.summary-ref-link.summary-ref-range:hover {
    background: var(--accent-secondary);
    color: var(--bg-primary);
    box-shadow: 0 2px 8px rgba(187, 154, 247, 0.3);
}

.summary-ref-link:active {
    transform: translateY(0);
}

.summary-ref-link .ref-icon {
    font-size: 0.65rem;
}

.summary-ref-link .ref-number {
    font-family: var(--font-mono);
}

.summary-ref-badge {
    display: inline-flex;
    align-items: center;
    padding: 2px 6px;
    margin-left: 4px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    font-size: 0.7rem;
    font-weight: 500;
    color: var(--text-muted);
    vertical-align: middle;
}

/* Summary Loading Animation */
.summary-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    height: 100%;
    padding: var(--spacing-2xl);
}

.summary-loader {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--spacing-lg);
}

.summary-loader-icon {
    width: 64px;
    height: 64px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.summary-loader-icon svg {
    width: 48px;
    height: 48px;
    color: var(--accent-secondary);
    animation: summary-star-pulse 2s ease-in-out infinite;
}

@keyframes summary-star-pulse {
    0%, 100% {
        transform: scale(1) rotate(0deg);
        opacity: 0.7;
        filter: drop-shadow(0 0 8px rgba(187, 154, 247, 0.4));
    }
    50% {
        transform: scale(1.15) rotate(15deg);
        opacity: 1;
        filter: drop-shadow(0 0 16px rgba(187, 154, 247, 0.8));
    }
}

.summary-loader-text {
    font-size: 1rem;
    font-weight: 500;
    color: var(--text-primary);
    background: var(--gradient-accent);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.summary-loader-dots {
    display: flex;
    gap: 6px;
}

.summary-loader-dots span {
    width: 8px;
    height: 8px;
    background: var(--accent-secondary);
    border-radius: var(--radius-full);
    animation: summary-dots-bounce 1.4s ease-in-out infinite;
}

.summary-loader-dots span:nth-child(1) { animation-delay: 0s; }
.summary-loader-dots span:nth-child(2) { animation-delay: 0.2s; }
.summary-loader-dots span:nth-child(3) { animation-delay: 0.4s; }

@keyframes summary-dots-bounce {
    0%, 80%, 100% {
        transform: scale(0.6);
        opacity: 0.4;
    }
    40% {
        transform: scale(1);
        opacity: 1;
    }
}

/* Transcript Loading Animation */
.transcript-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    height: 100%;
    padding: var(--spacing-2xl);
}

.transcript-loader {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--spacing-lg);
}

.transcript-loader-icon {
    width: 64px;
    height: 64px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.transcript-loader-icon svg {
    width: 48px;
    height: 48px;
    color: var(--accent-primary);
    animation: transcript-mic-pulse 2s ease-in-out infinite;
}

@keyframes transcript-mic-pulse {
    0%, 100% {
        transform: scale(1);
        opacity: 0.7;
        filter: drop-shadow(0 0 8px rgba(122, 162, 247, 0.4));
    }
    50% {
        transform: scale(1.15);
        opacity: 1;
        filter: drop-shadow(0 0 16px rgba(122, 162, 247, 0.8));
    }
}

.transcript-loader-text {
    font-size: 1rem;
    font-weight: 500;
    color: var(--text-primary);
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.transcript-loader-dots {
    display: flex;
    gap: 6px;
}

.transcript-loader-dots span {
    width: 8px;
    height: 8px;
    background: var(--accent-primary);
    border-radius: var(--radius-full);
    animation: transcript-dots-bounce 1.4s ease-in-out infinite;
}

.transcript-loader-dots span:nth-child(1) { animation-delay: 0s; }
.transcript-loader-dots span:nth-child(2) { animation-delay: 0.2s; }
.transcript-loader-dots span:nth-child(3) { animation-delay: 0.4s; }

@keyframes transcript-dots-bounce {
    0%, 80%, 100% {
        transform: scale(0.6);
        opacity: 0.4;
    }
    40% {
        transform: scale(1);
        opacity: 1;
    }
}

/* ========================================
   Audio Section (Selector + Viewer)
   ======================================== */
.audio-section {
    display: flex;
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border-color);
}

/* Audio Selector Panel */
.audio-selector {
    width: 220px;
    min-width: 180px;
    max-width: 280px;
    border-right: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    background: var(--bg-tertiary);
}

.audio-selector-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: var(--spacing-sm) var(--spacing-md);
    border-bottom: 1px solid var(--border-subtle);
}

.audio-selector-title {
    display: flex;
    align-items: center;
    gap: var(--spacing-xs);
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted);
}

.audio-selector-title svg {
    color: var(--accent-primary);
}

.speech-count {
    font-size: 0.7rem;
    font-weight: 500;
    background: var(--bg-hover);
    color: var(--text-secondary);
    padding: 2px 8px;
    border-radius: var(--radius-full);
}

.speech-list {
    flex: 1;
    overflow-y: auto;
    max-height: 140px;
    padding: var(--spacing-xs);
}

.speech-empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: var(--spacing-md);
    color: var(--text-muted);
}

.speech-empty-state .empty-icon {
    font-size: 1.5rem;
    margin-bottom: var(--spacing-xs);
    opacity: 0.5;
    color: var(--accent-primary);
}

.speech-empty-state p {
    font-size: 0.75rem;
    color: var(--text-muted);
}

/* Speech Item in Selector */
.speech-item {
    display: flex;
    flex-direction: column;
    gap: 2px;
    padding: var(--spacing-sm) var(--spacing-sm);
    margin-bottom: var(--spacing-xs);
    background: transparent;
    border: 1px solid transparent;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all var(--transition-fast);
}

.speech-item:hover {
    background: var(--bg-hover);
    border-color: var(--border-color);
}

.speech-item.active {
    background: var(--bg-elevated);
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 1px var(--accent-primary);
}

.speech-item-date {
    font-size: 0.75rem;
    font-weight: 500;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: var(--spacing-xs);
    overflow: hidden;
}

.speech-item-date span {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.speech-item-date svg {
    width: 12px;
    height: 12px;
    color: var(--accent-primary);
}

.speech-item-meta {
    display: flex;
    align-items: center;
    gap: var(--spacing-xs);
    font-size: 0.65rem;
    color: var(--text-muted);
}

.speech-item-utterances {
    background: rgba(122, 162, 247, 0.1);
    color: var(--accent-primary);
    padding: 1px 4px;
    border-radius: var(--radius-sm);
    font-weight: 500;
}

/* ========================================
   Audio Viewer
   ======================================== */
.audio-viewer {
    flex: 1;
    min-width: 0;
    background: var(--bg-secondary);
    padding: var(--spacing-sm) var(--spacing-md);
    position: relative;
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

/* Audio Viewer Loading Overlay */
.audio-viewer-loading {
    position: absolute;
    inset: 0;
    background: var(--bg-secondary);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
    border-radius: var(--radius-md);
}

.audio-loader {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--spacing-md);
}

.audio-loader-wave {
    display: flex;
    align-items: center;
    gap: 4px;
    height: 40px;
}

.audio-loader-wave span {
    width: 4px;
    height: 100%;
    background: var(--accent-primary);
    border-radius: var(--radius-full);
    animation: audio-wave 1.2s ease-in-out infinite;
}

.audio-loader-wave span:nth-child(1) { animation-delay: 0s; }
.audio-loader-wave span:nth-child(2) { animation-delay: 0.1s; }
.audio-loader-wave span:nth-child(3) { animation-delay: 0.2s; }
.audio-loader-wave span:nth-child(4) { animation-delay: 0.3s; }
.audio-loader-wave span:nth-child(5) { animation-delay: 0.4s; }

@keyframes audio-wave {
    0%, 100% {
        transform: scaleY(0.3);
        opacity: 0.5;
    }
    50% {
        transform: scaleY(1);
        opacity: 1;
    }
}

.audio-loader-text {
    font-size: 0.85rem;
    color: var(--text-secondary);
    font-weight: 500;
}

.audio-time {
    font-family: var(--font-mono);
    font-size: 0.8rem;
    color: var(--text-secondary);
    white-space: nowrap;
}

.audio-time-separator {
    margin: 0 2px;
    color: var(--text-muted);
}

.waveform-container {
    position: relative;
    width: 100%;
    max-width: 100%;
    height: 80px;
    background: var(--bg-tertiary);
    border-radius: var(--radius-md);
    overflow: hidden;
    cursor: pointer;
    margin-bottom: var(--spacing-sm);
    box-sizing: border-box;
}

#waveformCanvas {
    max-width: 100%;
    height: 100%;
    display: block;
}

.waveform-playhead {
    position: absolute;
    top: 0;
    bottom: 0;
    width: 2px;
    background: var(--accent-primary);
    box-shadow: 0 0 8px var(--accent-primary);
    pointer-events: none;
    z-index: 2;
    left: 0;
    transition: left 0.05s linear;
}

.waveform-highlight {
    position: absolute;
    top: 0;
    bottom: 0;
    background: rgba(122, 162, 247, 0.2);
    border-left: 2px solid var(--accent-primary);
    border-right: 2px solid var(--accent-primary);
    pointer-events: none;
    z-index: 1;
    display: none;
}

.waveform-highlight.active {
    display: block;
}

.audio-controls {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--spacing-sm);
    position: relative;
}

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

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

.audio-btn-play {
    width: 48px;
    height: 48px;
    background: var(--gradient-primary);
    color: white;
}

.audio-btn-play:hover {
    background: var(--gradient-primary);
    transform: scale(1.05);
    color: white;
}

.audio-speed {
    position: absolute;
    left: var(--spacing-xs);
}

.audio-controls-right {
    position: absolute;
    right: var(--spacing-xs);
    display: flex;
    align-items: center;
    gap: var(--spacing-xs);
}

.audio-btn-download {
    width: 30px;
    height: 30px;
    opacity: 0.6;
}

.audio-btn-download:hover {
    opacity: 1;
}

.audio-speed-btn {
    padding: var(--spacing-xs) var(--spacing-sm);
    background: var(--bg-hover);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    font-family: var(--font-mono);
    font-size: 0.75rem;
    cursor: pointer;
    transition: all var(--transition-fast);
}

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

/* Utterance clickable styling */
.utterance {
    cursor: pointer;
    transition: all var(--transition-fast);
}

.utterance:hover {
    transform: translateX(4px);
    box-shadow: var(--shadow-md);
}

.utterance.playing {
    border-left-width: 4px;
    box-shadow: 0 0 0 1px var(--accent-primary), var(--shadow-glow);
}

.utterance.playing .speaker-tag {
    animation: pulse 1s ease-in-out infinite;
}

/* Panel Resizer */
.panel-resizer {
    width: 4px;
    background: var(--border-color);
    cursor: col-resize;
    transition: background var(--transition-fast);
}

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

/* ========================================
   Floating Toolbar
   ======================================== */
.floating-toolbar {
    position: fixed;
    bottom: var(--spacing-xl);
    left: var(--sidebar-width);
    right: 0;
    display: flex;
    justify-content: center;
    pointer-events: none;
    z-index: 1000;
}

.floating-toolbar .toolbar-container {
    pointer-events: auto;
}

.toolbar-container {
    display: flex;
    align-items: center;
    gap: var(--spacing-md);
    padding: var(--spacing-sm) var(--spacing-md);
    background: var(--bg-elevated);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-lg);
    backdrop-filter: blur(12px);
}

.toolbar-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 48px;
    padding: var(--spacing-sm);
    background: transparent;
    border: none;
    border-radius: var(--radius-md);
    color: var(--text-secondary);
    cursor: pointer;
    transition: all var(--transition-base);
    position: relative;
}

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

.toolbar-btn svg,
.toolbar-btn .material-symbols-rounded {
    transition: transform var(--transition-base);
    font-size: 1.5rem;
}

.toolbar-btn:hover svg,
.toolbar-btn:hover .material-symbols-rounded {
    transform: scale(1.1);
}

/* ASR Button (Main) */
.btn-asr {
    width: 64px;
    height: 64px;
    background: var(--gradient-primary);
    border-radius: var(--radius-full);
    color: white;
    margin: -8px var(--spacing-sm);
    box-shadow: var(--shadow-glow);
}

.btn-asr:hover {
    background: var(--gradient-primary);
    transform: scale(1.05);
}

.asr-btn-content {
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Recording State */
.btn-asr.recording {
    background: var(--accent-danger);
    animation: recording-pulse 1.5s ease-in-out infinite;
}

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

.btn-asr.recording .stop-icon {
    display: block !important;
}

.recording-pulse {
    position: absolute;
    inset: -4px;
    border-radius: var(--radius-full);
    border: 2px solid var(--accent-danger);
    opacity: 0;
    pointer-events: none;
}

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

@keyframes recording-pulse {
    0%, 100% { box-shadow: 0 0 20px rgba(247, 118, 142, 0.5); }
    50% { box-shadow: 0 0 40px rgba(247, 118, 142, 0.8); }
}

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

/* Upload Button */
.btn-upload:hover {
    color: var(--accent-info);
}

/* Summarize Button */
.btn-summarize:hover {
    color: var(--accent-secondary);
}

.btn-summarize.processing {
    color: var(--accent-secondary);
    animation: pulse 1s ease-in-out infinite;
}

/* ========================================
   Buttons
   ======================================== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--spacing-sm);
    padding: var(--spacing-sm) var(--spacing-md);
    font-family: var(--font-primary);
    font-size: 0.9rem;
    font-weight: 500;
    border: none;
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all var(--transition-base);
}

.btn-primary {
    background: var(--gradient-primary);
    color: white;
    box-shadow: var(--shadow-sm);
}

.btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: var(--shadow-md), var(--shadow-glow);
}

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

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

.btn-ghost.active {
    background: rgba(122, 162, 247, 0.15);
    color: var(--accent-primary);
    border-color: var(--accent-primary);
}

.btn-ghost.active:hover {
    background: rgba(122, 162, 247, 0.25);
    color: var(--accent-primary);
    border-color: var(--accent-primary);
}

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

/* ========================================
   Modal
   ======================================== */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2000;
    animation: fade-in 200ms ease;
}

@keyframes fade-in {
    from { opacity: 0; }
    to { opacity: 1; }
}

.modal {
    width: 100%;
    max-width: 440px;
    background: var(--bg-elevated);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    animation: slide-up 300ms ease;
}

@keyframes slide-up {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

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

.modal-header h3 {
    font-size: 1.1rem;
    font-weight: 600;
}

.modal-close {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: none;
    color: var(--text-muted);
    font-size: 1.5rem;
    cursor: pointer;
    border-radius: var(--radius-md);
    transition: all var(--transition-fast);
}

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

.modal-body {
    padding: var(--spacing-lg);
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-sm);
}

.form-group label {
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--text-secondary);
}

.form-group textarea,
.form-group input {
    font-family: var(--font-primary);
    font-size: 0.95rem;
    padding: var(--spacing-md);
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    resize: vertical;
    transition: all var(--transition-fast);
}

.form-group textarea:focus,
.form-group input:focus {
    outline: none;
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 3px rgba(122, 162, 247, 0.15);
}

.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: var(--spacing-sm);
    padding: var(--spacing-lg);
    border-top: 1px solid var(--border-subtle);
}

/* ========================================
   Toast Notifications
   ======================================== */
.toast-container {
    position: fixed;
    top: var(--spacing-lg);
    right: var(--spacing-lg);
    display: flex;
    flex-direction: column;
    gap: var(--spacing-sm);
    z-index: 3000;
}

.toast {
    display: flex;
    align-items: center;
    gap: var(--spacing-md);
    padding: var(--spacing-md) var(--spacing-lg);
    background: var(--bg-elevated);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-md);
    min-width: 280px;
    max-width: 400px;
    animation: toast-in 300ms ease;
}

@keyframes toast-in {
    from {
        opacity: 0;
        transform: translateX(100%);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.toast.toast-out {
    animation: toast-out 200ms ease forwards;
}

@keyframes toast-out {
    to {
        opacity: 0;
        transform: translateX(100%);
    }
}

.toast-icon {
    font-size: 1.25rem;
}

.toast-content {
    flex: 1;
}

.toast-title {
    font-weight: 600;
    font-size: 0.9rem;
    margin-bottom: 2px;
}

.toast-message {
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.toast-close {
    background: transparent;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: var(--spacing-xs);
}

.toast.success {
    border-left: 3px solid var(--accent-success);
}

.toast.error {
    border-left: 3px solid var(--accent-danger);
}

.toast.warning {
    border-left: 3px solid var(--accent-warning);
}

.toast.info {
    border-left: 3px solid var(--accent-info);
}

/* ========================================
   Loading Overlay
   ======================================== */
.loading-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 3000;
}

.loading-spinner {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--spacing-md);
}

.spinner {
    width: 48px;
    height: 48px;
    border: 3px solid var(--bg-elevated);
    border-top-color: var(--accent-primary);
    border-radius: var(--radius-full);
    animation: spin 1s linear infinite;
}

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

.loading-spinner span {
    font-size: 0.9rem;
    color: var(--text-secondary);
}

/* ========================================
   Sidebar Toggle (Mobile)
   ======================================== */
.sidebar-toggle-btn {
    display: none;
    position: fixed;
    top: var(--spacing-md);
    left: var(--spacing-md);
    z-index: 90;
    width: 44px;
    height: 44px;
    background: transparent;
    border: none;
    border-radius: var(--radius-md);
    color: var(--text-primary);
    cursor: pointer;
    align-items: center;
    justify-content: center;
    transition: all var(--transition-fast);
}

.sidebar-toggle-btn:hover {
    color: var(--accent-primary);
}

.sidebar-close-btn {
    display: none;
    position: absolute;
    top: var(--spacing-md);
    right: var(--spacing-md);
    z-index: 110;
    width: 36px;
    height: 36px;
    background: transparent;
    border: none;
    border-radius: var(--radius-md);
    color: var(--text-muted);
    cursor: pointer;
    align-items: center;
    justify-content: center;
    transition: all var(--transition-fast);
}

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

.sidebar-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(2px);
    z-index: 95;
    opacity: 0;
    transition: opacity var(--transition-base);
}

.sidebar-overlay.active {
    opacity: 1;
}

/* ========================================
   Audio Section Toggle (Mobile)
   ======================================== */
.audio-section-toggle {
    display: none;
    width: 100%;
    padding: var(--spacing-sm) var(--spacing-md);
    background: var(--bg-tertiary);
    border: none;
    border-bottom: 1px solid var(--border-color);
    color: var(--text-primary);
    cursor: pointer;
    align-items: center;
    justify-content: space-between;
    font-family: var(--font-primary);
    font-size: 0.85rem;
    font-weight: 600;
    transition: all var(--transition-fast);
}

.audio-section-toggle:hover {
    background: var(--bg-hover);
}

.audio-section-toggle-title {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
}

.audio-section-toggle-title svg {
    color: var(--accent-primary);
}

.audio-section-toggle-title .speech-count {
    font-size: 0.7rem;
    font-weight: 500;
    background: var(--bg-hover);
    color: var(--text-secondary);
    padding: 2px 8px;
    border-radius: var(--radius-full);
}

.audio-section-toggle-icon {
    color: var(--text-muted);
    transition: transform var(--transition-base);
}

.audio-section.collapsed .audio-section-toggle-icon {
    transform: rotate(-90deg);
}

.audio-section-content {
    display: flex;
    width: 100%;
    flex-direction: row;
}

/* ========================================
   Responsive Design
   ======================================== */
@media (max-width: 1024px) {
    .features-grid {
        grid-template-columns: 1fr;
        gap: var(--spacing-md);
        max-width: 100%;
        overflow-x: hidden;
    }
    
    .welcome-screen {
        padding: var(--spacing-lg);
        overflow-x: hidden;
    }
    
    .welcome-content {
        max-width: 100%;
        width: 100%;
    }
    
    .feature-card {
        padding: var(--spacing-lg);
    }
    
    .panels-container {
        flex-direction: column;
    }
    
    .panel {
        min-width: 0;
        min-height: 300px;
    }
    
    .panel-left {
        border-right: none;
        border-bottom: 1px solid var(--border-color);
    }
    
    .panel-resizer {
        width: 100%;
        height: 4px;
        cursor: row-resize;
    }
}

@media (max-width: 768px) {
    /* Show mobile toggle button - floating over content */
    .sidebar-toggle-btn {
        display: flex;
        position: fixed;
        top: var(--spacing-sm);
        left: var(--spacing-sm);
        z-index: 90;
        width: 40px;
        height: 40px;
    }
    
    .sidebar-close-btn {
        display: flex;
    }
    
    .sidebar-overlay {
        display: block;
        pointer-events: none;
    }
    
    .sidebar-overlay.active {
        pointer-events: auto;
    }
    
    /* Sidebar: fixed overlay style, hidden by default */
    .sidebar {
        position: fixed;
        top: 0;
        left: 0;
        width: 280px;
        max-width: 85vw;
        height: 100vh;
        height: 100dvh;
        z-index: 100;
        transform: translateX(-100%);
        transition: transform var(--transition-base);
        border-right: 1px solid var(--border-color);
        display: flex;
        flex-direction: column;
    }
    
    .sidebar.open {
        transform: translateX(0);
    }
    
    /* Main content takes full width - no extra padding needed now */
    .main-content {
        width: 100%;
        padding-top: 0;
    }
    
    /* Sidebar footer stays at bottom */
    .sidebar-footer {
        margin-top: auto;
    }
    
    /* Memo list container flexible */
    .memo-list-container {
        flex: 1;
        min-height: 0;
        overflow: hidden;
    }
    
    .memo-list {
        max-height: none;
        overflow-y: auto;
    }
    
    /* Floating toolbar: centered, below sidebar on mobile */
    .floating-toolbar {
        left: 0;
        right: 0;
        bottom: var(--spacing-md);
        display: flex;
        justify-content: center;
        z-index: 50; /* Below sidebar (z-index: 100) on mobile */
    }
    
    .toolbar-container {
        padding: var(--spacing-xs) var(--spacing-sm);
    }
    
    .btn-asr {
        width: 56px;
        height: 56px;
        margin: -4px var(--spacing-xs);
    }
    
    .toolbar-btn {
        width: 40px;
        height: 40px;
    }
    
    /* Audio section responsive - collapsible */
    .audio-section {
        flex-direction: column;
        width: 100%;
    }
    
    .audio-section-toggle {
        display: flex;
    }
    
    .audio-section-content {
        flex-direction: column;
        width: 100%;
        max-height: 300px;
        overflow: hidden;
        transition: max-height var(--transition-base), opacity var(--transition-base);
    }
    
    .audio-section.collapsed .audio-section-content {
        max-height: 0;
        opacity: 0;
    }
    
    .audio-selector {
        width: 100%;
        max-width: none;
        border-right: none;
        border-bottom: 1px solid var(--border-color);
    }
    
    /* Hide desktop audio selector header on mobile (using toggle instead) */
    .audio-selector-header {
        display: none;
    }
    
    .speech-list {
        max-height: 80px;
        padding: var(--spacing-xs);
    }
    
    .audio-viewer {
        width: 100%;
        flex: 1;
        padding: var(--spacing-sm) var(--spacing-md);
    }
    
    .audio-filename {
        max-width: 200px;
    }
    
    .waveform-container {
        height: 60px;
    }
    
    /* Panels container - accordion style on mobile */
    .panels-container {
        flex: 1;
        min-height: 0;
        display: flex;
        flex-direction: column;
        overflow: hidden;
    }
    
    /* Panel accordion behavior */
    .panel {
        display: flex;
        flex-direction: column;
        min-height: 0;
        transition: flex var(--transition-base);
    }
    
    /* Expanded panel takes available space */
    .panel.expanded {
        flex: 1;
    }
    
    /* Collapsed panel shows only header */
    .panel.collapsed {
        flex: 0 0 auto;
    }
    
    .panel.collapsed .panel-content {
        display: none;
    }
    
    .panel-header {
        cursor: pointer;
        transition: background var(--transition-fast);
    }
    
    .panel-header:hover {
        background: var(--bg-hover);
    }
    
    .panel-header:active {
        background: var(--bg-elevated);
    }
    
    .panel-toggle-icon {
        display: block;
    }
    
    .panel-content {
        flex: 1;
        min-height: 0;
        overflow-y: auto;
    }
    
    .panel-left {
        border-bottom: 1px solid var(--border-color);
    }
    
    /* Hide panel resizer on mobile */
    .panel-resizer {
        display: none;
    }
    
    /* Welcome screen adjustments - add top padding for floating toggle button */
    .welcome-screen {
        padding-top: calc(40px + var(--spacing-md) + var(--spacing-lg));
        position: relative;
    }
    
    /* Blur backdrop behind welcome header on mobile */
    .welcome-content {
        position: relative;
    }
    
    .welcome-content::before {
        content: '';
        position: absolute;
        top: -40px;
        left: 50%;
        transform: translateX(-50%);
        width: 300px;
        height: 220px;
        background: radial-gradient(ellipse at center, var(--accent-primary) 0%, transparent 65%);
        opacity: 0.25;
        filter: blur(50px);
        pointer-events: none;
    }
    
    .welcome-content h1 {
        font-size: 1.8rem;
    }
    
    .welcome-content > p {
        font-size: 1rem;
    }
    
    /* Memo header responsive - add left padding for floating toggle button */
    .memo-header {
        padding: var(--spacing-sm) var(--spacing-md);
        padding-left: calc(40px + var(--spacing-sm) * 2 + var(--spacing-md));
        min-height: 48px;
        position: relative;
    }
    
    /* Shared view: no sidebar toggle button, so no extra left padding needed */
    .shared-view .memo-header {
        padding-left: var(--spacing-md);
    }
    
    .memo-title-input {
        max-width: 100%;
        font-size: 1.1rem;
    }
    
    /* Compact horizontal feature cards on mobile */
    .features-grid {
        display: flex;
        flex-direction: row;
        flex-wrap: wrap;
        justify-content: center;
        gap: var(--spacing-sm);
        max-width: 100%;
    }
    
    .feature-card {
        display: flex;
        flex-direction: row;
        align-items: center;
        gap: var(--spacing-sm);
        padding: var(--spacing-sm) var(--spacing-md);
        border-radius: var(--radius-full);
        background: var(--bg-tertiary);
        border: 1px solid var(--border-subtle);
        min-width: auto;
        flex: 0 0 auto;
    }
    
    .feature-card:hover {
        transform: none;
        border-color: var(--accent-primary);
        box-shadow: var(--shadow-sm);
    }
    
    .feature-card p {
        display: none;
    }
    
    .feature-icon {
        font-size: 1.25rem;
        margin-bottom: 0;
    }
    
    .feature-card h3 {
        font-size: 0.85rem;
        margin-bottom: 0;
        white-space: nowrap;
    }
    
    /* Reduce panel header height on mobile */
    .panel-header {
        padding: var(--spacing-sm) var(--spacing-md);
    }
    
    .panel-title {
        font-size: 0.85rem;
    }
    
    .panel-icon {
        font-size: 1rem;
    }
    
    /* Reduce font sizes in transcript and summary content on mobile */
    .transcript-content,
    .summary-content {
        font-size: 0.85rem;
        line-height: 1.6;
    }
    
    .utterance-text {
        font-size: 0.85rem;
    }
    
    .summary-content h2 {
        font-size: 1rem;
    }
    
    .summary-content li,
    .summary-content p {
        font-size: 0.85rem;
    }
    
    .speaker-tag {
        font-size: 0.7rem;
    }
    
    .utterance-time {
        font-size: 0.65rem;
    }
    
    /* Reduce audio selector header height on mobile */
    .audio-selector-header {
        padding: var(--spacing-xs) var(--spacing-sm);
    }
    
    .audio-selector-title {
        font-size: 0.75rem;
    }
    
    .audio-section-toggle {
        padding: var(--spacing-xs) var(--spacing-md);
        font-size: 0.8rem;
    }
    
    /* Features grid mobile - pill style */
    .features-grid {
        gap: var(--spacing-xs);
        padding: 0;
    }
    
    .feature-card {
        padding: var(--spacing-xs) var(--spacing-md);
    }
    
    .feature-card h3 {
        font-size: 0.8rem;
    }
    
    .feature-icon {
        font-size: 1.1rem;
    }
    
    .welcome-icon {
        font-size: 3rem;
        margin-bottom: var(--spacing-md);
    }
    
    /* Sidebar: abbreviate badges on mobile */
    .badge-full {
        display: none;
    }

    .badge-short {
        display: inline;
    }

    /* Theme switcher mobile - colorways only */
    .theme-switcher {
        grid-template-columns: repeat(3, 1fr);
        gap: var(--spacing-xs);
    }
    
    .theme-btn {
        padding: var(--spacing-xs);
        min-width: 0;
    }
    
    .theme-name {
        display: none;
    }
    
    .theme-preview {
        width: 100%;
        min-width: 32px;
        height: 32px;
    }
}

/* ========================================
   Authentication Page
   ======================================== */
.auth-page {
    position: fixed;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: 
        radial-gradient(ellipse at 30% 20%, rgba(122, 162, 247, 0.12) 0%, transparent 50%),
        radial-gradient(ellipse at 70% 80%, rgba(187, 154, 247, 0.12) 0%, transparent 50%),
        radial-gradient(ellipse at 50% 50%, rgba(247, 118, 142, 0.05) 0%, transparent 60%),
        var(--bg-primary);
    z-index: 5000;
    overflow-y: auto;
    overflow-x: hidden;
    padding: var(--spacing-lg);
    box-sizing: border-box;
}

.auth-container {
    width: 100%;
    max-width: 420px;
    animation: auth-fade-in 500ms ease;
}

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

.auth-header {
    text-align: center;
    margin-bottom: var(--spacing-2xl);
}

.logo-large {
    justify-content: center;
    margin-bottom: var(--spacing-md);
}

.logo-large .logo-icon {
    font-size: 2.5rem;
}

.logo-large .logo-text {
    font-size: 2rem;
}

.auth-subtitle {
    color: var(--text-secondary);
    font-size: 1rem;
}

.auth-form {
    background: var(--bg-elevated);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: var(--spacing-xl);
    margin-bottom: var(--spacing-lg);
    box-shadow: var(--shadow-lg);
}

.auth-form h2 {
    font-size: 1.5rem;
    font-weight: 600;
    margin-bottom: var(--spacing-lg);
    text-align: center;
    color: var(--text-primary);
}

.auth-form .form-group {
    margin-bottom: var(--spacing-md);
}

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

.auth-form .form-group input {
    width: 100%;
    font-family: var(--font-primary);
    font-size: 1rem;
    padding: var(--spacing-md);
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    transition: all var(--transition-fast);
}

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

.auth-form .form-group input:focus {
    outline: none;
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 3px rgba(122, 162, 247, 0.15);
}

.form-error {
    background: rgba(247, 118, 142, 0.1);
    border: 1px solid var(--accent-danger);
    border-radius: var(--radius-md);
    padding: var(--spacing-sm) var(--spacing-md);
    margin-bottom: var(--spacing-md);
    color: var(--accent-danger);
    font-size: 0.9rem;
    text-align: center;
}

.btn-full {
    width: 100%;
    padding: var(--spacing-md);
    font-size: 1rem;
    margin-top: var(--spacing-sm);
}

.auth-switch {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--spacing-sm);
    margin-top: var(--spacing-lg);
    padding-top: var(--spacing-lg);
    border-top: 1px solid var(--border-subtle);
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.btn-link {
    background: none;
    border: none;
    color: var(--accent-primary);
    font-family: var(--font-primary);
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    transition: color var(--transition-fast);
}

.btn-link:hover {
    color: var(--accent-secondary);
    text-decoration: underline;
}

.btn-link-inline {
    display: inline;
    padding: 0;
    font-size: inherit;
    vertical-align: baseline;
}

/* Checkbox styling */
.form-group-checkbox {
    margin-bottom: var(--spacing-md);
}

.checkbox-label {
    display: flex;
    align-items: flex-start;
    gap: var(--spacing-sm);
    cursor: pointer;
    font-size: 0.9rem;
    color: var(--text-secondary);
    line-height: 1.4;
    user-select: none;
}

.checkbox-label input[type="checkbox"] {
    display: none;
}

.checkbox-custom {
    display: inline-block;
    flex-shrink: 0;
    min-width: 18px;
    width: 18px;
    min-height: 18px;
    height: 18px;
    border: 2px solid var(--border-color);
    border-radius: var(--radius-sm);
    background: var(--bg-tertiary);
    transition: all var(--transition-fast);
    position: relative;
    margin-top: 1px;
}

.checkbox-label input[type="checkbox"]:checked + .checkbox-custom {
    background: var(--accent-primary);
    border-color: var(--accent-primary);
}

.checkbox-label input[type="checkbox"]:checked + .checkbox-custom::after {
    content: '';
    position: absolute;
    top: 2px;
    left: 5px;
    width: 5px;
    height: 9px;
    border: solid var(--bg-elevated);
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}

.checkbox-label:hover .checkbox-custom {
    border-color: var(--accent-primary);
}

/* Terms and Conditions page */
.terms-form {
    max-width: 480px;
}

.terms-header {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    margin-bottom: var(--spacing-lg);
}

.terms-header h2 {
    margin-bottom: 0;
    text-align: left;
    flex: 1;
}

.btn-back {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border: none;
    background: var(--bg-tertiary);
    border-radius: var(--radius-md);
    color: var(--text-secondary);
    cursor: pointer;
    transition: all var(--transition-fast);
    flex-shrink: 0;
}

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

.terms-content {
    max-height: 400px;
    overflow-y: auto;
    padding-right: var(--spacing-sm);
    margin-bottom: var(--spacing-lg);
    scrollbar-width: thin;
    scrollbar-color: var(--border-color) transparent;
}

.terms-content::-webkit-scrollbar {
    width: 6px;
}

.terms-content::-webkit-scrollbar-track {
    background: transparent;
}

.terms-content::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: 3px;
}

.terms-content h3 {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-top: var(--spacing-lg);
    margin-bottom: var(--spacing-xs);
}

.terms-content h3:first-of-type {
    margin-top: 0;
}

.terms-content p {
    font-size: 0.88rem;
    color: var(--text-secondary);
    line-height: 1.6;
    margin-bottom: var(--spacing-sm);
}

.terms-updated {
    font-size: 0.8rem !important;
    color: var(--text-muted) !important;
    font-style: italic;
    margin-bottom: var(--spacing-md) !important;
}

.terms-footer {
    border-top: 1px solid var(--border-subtle);
    padding-top: var(--spacing-md);
}

.auth-features {
    display: flex;
    justify-content: center;
    gap: var(--spacing-xl);
    color: var(--text-muted);
    font-size: 0.85rem;
}

.auth-feature {
    display: flex;
    align-items: center;
    gap: var(--spacing-xs);
}

.auth-feature span:first-child {
    font-size: 1.1rem;
}

/* App Container */
.app-container {
    display: flex;
    width: 100%;
    height: 100vh;
    overflow: hidden;
}

/* Sidebar Footer - Clickable User Info */
.sidebar-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.user-info-clickable {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    flex: 1;
    padding: var(--spacing-sm);
    margin: calc(-1 * var(--spacing-sm));
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all var(--transition-fast);
}

.user-info-clickable:hover {
    background: var(--bg-hover);
}

.user-info-clickable:hover .settings-gear {
    opacity: 1;
    transform: rotate(45deg);
}

.settings-gear {
    margin-left: auto;
    color: var(--text-muted);
    opacity: 0.5;
    transition: all var(--transition-base);
}

.btn-signout {
    padding: var(--spacing-sm);
    opacity: 0.6;
    transition: all var(--transition-fast);
}

.btn-signout:hover {
    opacity: 1;
    color: var(--accent-danger);
}

/* Auth page responsive */
@media (max-width: 480px) {
    .auth-page {
        padding: var(--spacing-md);
        align-items: center;
        justify-content: center;
    }
    
    .auth-container {
        max-width: 100%;
        width: 100%;
    }
    
    .auth-header {
        margin-bottom: var(--spacing-lg);
    }
    
    .logo-large .logo-text {
        font-size: 1.5rem;
    }
    
    .auth-subtitle {
        font-size: 0.85rem;
    }
    
    .auth-form {
        padding: var(--spacing-md);
        margin-bottom: var(--spacing-md);
    }
    
    .auth-form h2 {
        font-size: 1.25rem;
        margin-bottom: var(--spacing-md);
    }
    
    .auth-form .form-group input {
        padding: var(--spacing-sm) var(--spacing-md);
        font-size: 0.95rem;
    }
    
    .btn-full {
        padding: var(--spacing-sm) var(--spacing-md);
    }
    
    .auth-switch {
        padding-top: var(--spacing-md);
        margin-top: var(--spacing-md);
        flex-wrap: wrap;
        gap: var(--spacing-xs);
    }
    
    .auth-features {
        flex-direction: row;
        flex-wrap: wrap;
        justify-content: center;
        gap: var(--spacing-sm) var(--spacing-md);
    }
    
    .auth-feature {
        font-size: 0.75rem;
    }
    
    .auth-feature span:first-child {
        font-size: 0.95rem;
    }
}

/* ========================================
   Settings Modal
   ======================================== */
.settings-modal {
    max-width: 520px;
}

.settings-body {
    padding: 0 !important;
    max-height: 70vh;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
}

.settings-section {
    padding: var(--spacing-lg);
    border-bottom: 1px solid var(--border-subtle);
}

.settings-section:last-child {
    border-bottom: none;
}

.settings-section-title {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: var(--spacing-lg);
}

.settings-section-title svg {
    color: var(--accent-primary);
}

.settings-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: var(--spacing-md) 0;
    border-bottom: 1px solid var(--border-subtle);
}

.settings-item:last-child {
    border-bottom: none;
}

.settings-item-action {
    justify-content: flex-start;
    padding-top: var(--spacing-lg);
}

.settings-item-info {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.settings-item-label {
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--text-primary);
}

.settings-item-description {
    font-size: 0.8rem;
    color: var(--text-muted);
}

.settings-item-value {
    font-size: 0.85rem;
    color: var(--text-secondary);
    font-family: var(--font-mono);
}

.settings-signout {
    padding: var(--spacing-lg);
    border-top: 1px solid var(--border-subtle);
    margin-top: auto;
}

.btn-signout-settings {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    color: var(--accent-danger);
    border-color: var(--accent-danger);
}

.btn-signout-settings:hover {
    background: rgba(247, 118, 142, 0.1);
    color: var(--accent-danger);
}

/* Language Select */
.language-select {
    padding: var(--spacing-sm) var(--spacing-md);
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-size: 0.9rem;
    cursor: pointer;
    transition: all var(--transition-fast);
    min-width: 150px;
}

.language-select:hover {
    border-color: var(--accent-primary);
}

.language-select:focus {
    outline: none;
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 3px rgba(122, 162, 247, 0.1);
}

.language-select option {
    background: var(--bg-secondary);
    color: var(--text-primary);
}

/* Toggle Switch */
.toggle-switch {
    position: relative;
    display: inline-block;
    width: 48px;
    height: 26px;
    flex-shrink: 0;
}

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

.toggle-slider {
    position: absolute;
    cursor: pointer;
    inset: 0;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-full);
    transition: all var(--transition-fast);
}

.toggle-slider::before {
    position: absolute;
    content: "";
    height: 18px;
    width: 18px;
    left: 3px;
    bottom: 3px;
    background: var(--text-muted);
    border-radius: var(--radius-full);
    transition: all var(--transition-fast);
}

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

.toggle-switch input:checked + .toggle-slider::before {
    background: white;
    transform: translateX(22px);
}

.toggle-switch input:focus + .toggle-slider {
    box-shadow: 0 0 0 3px rgba(122, 162, 247, 0.2);
}

/* Theme Switcher */
.theme-switcher {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: var(--spacing-sm);
    margin-top: var(--spacing-md);
}

.theme-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--spacing-xs);
    padding: var(--spacing-sm);
    background: var(--bg-tertiary);
    border: 2px solid var(--border-color);
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all var(--transition-fast);
}

.theme-btn:hover {
    border-color: var(--text-muted);
    transform: translateY(-2px);
}

.theme-btn.active {
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 2px rgba(122, 162, 247, 0.2);
}

.theme-preview {
    width: 100%;
    height: 32px;
    border-radius: var(--radius-sm);
    display: flex;
    overflow: hidden;
}

.theme-name {
    font-size: 0.7rem;
    font-weight: 500;
    color: var(--text-secondary);
}

/* Theme Previews */
.nord-preview {
    background: linear-gradient(90deg, #2e3440 0%, #2e3440 33%, #88c0d0 33%, #88c0d0 66%, #81a1c1 66%, #81a1c1 100%);
}

.tokyo-night-preview {
    background: linear-gradient(90deg, #1a1b26 0%, #1a1b26 33%, #7aa2f7 33%, #7aa2f7 66%, #bb9af7 66%, #bb9af7 100%);
}

.wave-preview {
    background: linear-gradient(90deg, #FCFBF9 0%, #FCFBF9 33%, #0D9488 33%, #0D9488 66%, #10B981 66%, #10B981 100%);
}

.rose-pine-dawn-preview {
    background: linear-gradient(90deg, #FAF4ED 0%, #FAF4ED 33%, #D7827E 33%, #D7827E 66%, #EA9D34 66%, #EA9D34 100%);
}

.solarized-light-preview {
    background: linear-gradient(90deg, #fdf6e3 0%, #fdf6e3 33%, #268bd2 33%, #268bd2 66%, #859900 66%, #859900 100%);
}

.catppuccin-preview {
    background: linear-gradient(90deg, #1e1e2e 0%, #1e1e2e 33%, #cba6f7 33%, #cba6f7 66%, #f5c2e7 66%, #f5c2e7 100%);
}

/* ========================================
   Template Manager (Settings)
   ======================================== */

.settings-templates {
    position: relative;
}

.templates-layout {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-md);
}

.template-list-panel {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-sm);
}

.template-list {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-sm);
    max-height: 280px;
    overflow-y: auto;
}

.template-list:empty::after {
    content: 'No custom templates yet';
    display: block;
    text-align: center;
    padding: var(--spacing-lg);
    color: var(--text-muted);
    font-size: 0.85rem;
}

.template-card {
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: var(--spacing-md);
    background: var(--bg-tertiary);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all var(--transition-fast);
}

.template-card:hover {
    border-color: var(--accent-primary);
    background: var(--bg-hover);
}

.template-card-header {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    min-width: 0;
}

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

.template-card-badge {
    display: inline-block;
    font-size: 0.6rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 2px 6px;
    background: var(--accent-primary);
    color: white;
    border-radius: var(--radius-sm);
    flex-shrink: 0;
    line-height: 1.3;
}

.template-card-actions {
    display: flex;
    gap: var(--spacing-xs);
    flex-shrink: 0;
    margin-left: auto;
}

.template-card-meta {
    font-size: 0.75rem;
    color: var(--text-muted);
}

.template-card-actions button {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    padding: 0;
    background: transparent;
    border: none;
    border-radius: var(--radius-sm);
    color: var(--text-muted);
    cursor: pointer;
    transition: all var(--transition-fast);
}

.template-card-actions button:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
}

.template-card-actions button.btn-delete-template:hover {
    color: var(--accent-danger);
}

.btn-new-template {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--spacing-xs);
    width: 100%;
    padding: var(--spacing-sm) var(--spacing-md);
    font-size: 0.85rem;
}

/* Template Editor */
.template-editor {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-md);
    border-top: 1px solid var(--border-subtle);
    padding-top: var(--spacing-md);
}

.template-editor-header {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
}

.template-editor-back {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    padding: 0;
    background: transparent;
    border: none;
    border-radius: var(--radius-sm);
    color: var(--text-muted);
    cursor: pointer;
    transition: all var(--transition-fast);
}

.template-editor-back:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
}

.template-editor-title {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text-primary);
}

.template-editor-content {
    font-family: var(--font-mono);
    font-size: 0.85rem;
    line-height: 1.6;
    min-height: 300px;
    resize: vertical;
}

.template-editor-actions {
    display: flex;
    justify-content: flex-end;
    gap: var(--spacing-sm);
}

.template-card.is-editing {
    border-color: var(--accent-primary);
    background: var(--bg-hover);
}

/* ASR Config Inline Editor */
.asr-config-inline-editor {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-md);
    padding: var(--spacing-md);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    background: var(--bg-secondary);
    margin-top: var(--spacing-xs);
    margin-bottom: var(--spacing-xs);
}

/* Language Chips */
.lang-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.lang-chip {
    padding: 4px 12px;
    border-radius: 999px;
    font-size: 0.8rem;
    border: 1px solid var(--border-color);
    background: var(--bg-tertiary);
    color: var(--text-secondary);
    cursor: pointer;
    transition: all var(--transition-fast);
}

.lang-chip:hover {
    border-color: var(--accent-primary);
    color: var(--accent-primary);
}

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

.lang-chip:disabled {
    opacity: 0.6;
    cursor: default;
}

/* Key-Value Rows */
.kv-row {
    display: flex;
    gap: 6px;
    align-items: center;
    margin-bottom: 6px;
}

.kv-row .kv-key,
.kv-row .kv-value {
    flex: 1;
    padding: 6px 10px;
    font-size: 0.85rem;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    background: var(--bg-primary);
    color: var(--text-primary);
}

.kv-row .kv-remove {
    flex-shrink: 0;
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    background: var(--bg-tertiary);
    color: var(--text-muted);
    cursor: pointer;
    font-size: 1rem;
    line-height: 1;
    transition: all var(--transition-fast);
}

.kv-row .kv-remove:hover {
    background: var(--error-bg, #fee);
    border-color: var(--error-color, #e53e3e);
    color: var(--error-color, #e53e3e);
}

/* ASR Context Section */
.asr-context-section {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-md);
}

.asr-context-header {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-secondary);
}

.asr-context-divider {
    border: none;
    border-top: 1px solid var(--border-subtle);
    margin: 0;
}

.asr-context-textarea {
    font-family: var(--font-mono);
    font-size: 0.85rem;
    line-height: 1.6;
    resize: vertical;
}

/* ========================================
   Template Selector (Summary Panel Header)
   ======================================== */

.template-select {
    padding: 4px 8px;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    font-size: 0.8rem;
    font-family: var(--font-primary);
    cursor: pointer;
    transition: all var(--transition-fast);
    max-width: 160px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.template-select:hover {
    border-color: var(--accent-primary);
}

.template-select:focus {
    outline: none;
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 2px rgba(122, 162, 247, 0.1);
}

.template-select option {
    background: var(--bg-secondary);
    color: var(--text-primary);
}

@media (max-width: 767px) {
    .template-select {
        max-width: 110px;
        font-size: 0.75rem;
    }
}

/* ========================================
   ASR Config Selector (Transcript Panel Header)
   ======================================== */

.asr-config-select {
    padding: 4px 8px;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    font-size: 0.8rem;
    font-family: var(--font-primary);
    cursor: pointer;
    transition: all var(--transition-fast);
    max-width: 160px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.asr-config-select:hover {
    border-color: var(--accent-primary);
}

.asr-config-select:focus {
    outline: none;
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 2px rgba(122, 162, 247, 0.1);
}

.asr-config-select option {
    background: var(--bg-secondary);
    color: var(--text-primary);
}

@media (max-width: 767px) {
    .asr-config-select {
        max-width: 110px;
        font-size: 0.75rem;
    }
}

/* ========================================
   Language Bubble Popover
   ======================================== */

.lang-bubble-wrapper {
    position: relative;
}

.lang-bubble {
    display: none;
    position: absolute;
    top: calc(100% + 6px);
    right: 0;
    z-index: 100;
    min-width: 170px;
    padding: var(--spacing-sm) 0;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.25);
}

.lang-bubble.active {
    display: block;
}

.lang-bubble-title {
    padding: var(--spacing-xs) var(--spacing-md);
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--text-muted);
}

.lang-bubble-options {
    display: flex;
    flex-direction: column;
}

.lang-bubble-option {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    padding: 6px var(--spacing-md);
    cursor: pointer;
    font-size: 0.85rem;
    color: var(--text-secondary);
    transition: background var(--transition-fast), color var(--transition-fast);
}

.lang-bubble-option:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
}

.lang-bubble-option input[type="radio"] {
    accent-color: var(--accent-primary);
    margin: 0;
}

.lang-bubble-option input[type="radio"]:checked + span {
    color: var(--text-primary);
    font-weight: 500;
}

/* ========================================
   Theme Variations
   ======================================== */

/* Nord Theme */
[data-theme="nord"] {
    --bg-primary: #2e3440;
    --bg-secondary: #272c36;
    --bg-tertiary: #3b4252;
    --bg-elevated: #434c5e;
    --bg-hover: #4c566a;
    
    --text-primary: #eceff4;
    --text-secondary: #d8dee9;
    --text-muted: #7b88a1;
    --text-accent: #88c0d0;
    
    --accent-primary: #88c0d0;
    --accent-secondary: #81a1c1;
    --accent-success: #a3be8c;
    --accent-warning: #ebcb8b;
    --accent-danger: #bf616a;
    --accent-info: #5e81ac;
    
    --border-color: #4c566a;
    --border-subtle: #3b4252;
    
    --gradient-primary: linear-gradient(135deg, #88c0d0 0%, #81a1c1 100%);
    --gradient-accent: linear-gradient(135deg, #81a1c1 0%, #5e81ac 100%);
    --gradient-glow: radial-gradient(circle at 50% 50%, rgba(136, 192, 208, 0.15) 0%, transparent 70%);
    
    --shadow-sm: 0 2px 4px rgba(0, 0, 0, 0.3);
    --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.4);
    --shadow-lg: 0 8px 24px rgba(0, 0, 0, 0.5);
    --shadow-glow: 0 0 20px rgba(136, 192, 208, 0.3);
}

/* Tokyo Night Theme */
[data-theme="tokyo-night"] {
    --bg-primary: #1a1b26;
    --bg-secondary: #16161e;
    --bg-tertiary: #1f2335;
    --bg-elevated: #24283b;
    --bg-hover: #292e42;
    
    --text-primary: #c0caf5;
    --text-secondary: #9aa5ce;
    --text-muted: #565f89;
    --text-accent: #7aa2f7;
    
    --accent-primary: #7aa2f7;
    --accent-secondary: #bb9af7;
    --accent-success: #9ece6a;
    --accent-warning: #e0af68;
    --accent-danger: #f7768e;
    --accent-info: #7dcfff;
    
    --border-color: #292e42;
    --border-subtle: #1f2335;
    
    --gradient-primary: linear-gradient(135deg, #7aa2f7 0%, #bb9af7 100%);
    --gradient-accent: linear-gradient(135deg, #bb9af7 0%, #f7768e 100%);
    --gradient-glow: radial-gradient(circle at 50% 50%, rgba(122, 162, 247, 0.15) 0%, transparent 70%);
    
    --shadow-glow: 0 0 20px rgba(122, 162, 247, 0.3);
}

/* Rosé Pine Dawn Theme - Soft warm whites with rose accents */
[data-theme="rose-pine-dawn"] {
    --bg-primary: #FAF4ED;
    --bg-secondary: #FFFAF3;
    --bg-tertiary: #F2E9E1;
    --bg-elevated: #E8DED5;
    --bg-hover: #DFD7CF;
    
    --text-primary: #575279;
    --text-secondary: #6E6A86;
    --text-muted: #9893A5;
    --text-accent: #D7827E;
    
    --accent-primary: #D7827E;
    --accent-secondary: #EA9D34;
    --accent-success: #56949F;
    --accent-warning: #EA9D34;
    --accent-danger: #B4637A;
    --accent-info: #286983;
    
    --border-color: #DFD7CF;
    --border-subtle: #F2E9E1;
    
    --gradient-primary: linear-gradient(135deg, #D7827E 0%, #EA9D34 100%);
    --gradient-accent: linear-gradient(135deg, #EA9D34 0%, #B4637A 100%);
    --gradient-glow: radial-gradient(circle at 50% 50%, rgba(215, 130, 126, 0.1) 0%, transparent 70%);
    
    --shadow-sm: 0 2px 4px rgba(0, 0, 0, 0.06);
    --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.08);
    --shadow-lg: 0 8px 24px rgba(0, 0, 0, 0.1);
    --shadow-glow: 0 0 20px rgba(215, 130, 126, 0.15);
}

/* Solarized Light Theme */
[data-theme="solarized-light"] {
    --bg-primary: #fdf6e3;
    --bg-secondary: #eee8d5;
    --bg-tertiary: #f5efdc;
    --bg-elevated: #fff;
    --bg-hover: #e8e2cf;
    
    --text-primary: #073642;
    --text-secondary: #586e75;
    --text-muted: #93a1a1;
    --text-accent: #268bd2;
    
    --accent-primary: #268bd2;
    --accent-secondary: #6c71c4;
    --accent-success: #859900;
    --accent-warning: #b58900;
    --accent-danger: #dc322f;
    --accent-info: #2aa198;
    
    --border-color: #d3cbb8;
    --border-subtle: #e8e2cf;
    
    --gradient-primary: linear-gradient(135deg, #268bd2 0%, #6c71c4 100%);
    --gradient-accent: linear-gradient(135deg, #6c71c4 0%, #d33682 100%);
    --gradient-glow: radial-gradient(circle at 50% 50%, rgba(38, 139, 210, 0.1) 0%, transparent 70%);
    
    --shadow-sm: 0 2px 4px rgba(0, 0, 0, 0.08);
    --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 8px 24px rgba(0, 0, 0, 0.12);
    --shadow-glow: 0 0 20px rgba(38, 139, 210, 0.2);
}

/* Catppuccin (Mocha) Theme */
[data-theme="catppuccin"] {
    --bg-primary: #1e1e2e;
    --bg-secondary: #181825;
    --bg-tertiary: #313244;
    --bg-elevated: #45475a;
    --bg-hover: #585b70;
    
    --text-primary: #cdd6f4;
    --text-secondary: #bac2de;
    --text-muted: #6c7086;
    --text-accent: #cba6f7;
    
    --accent-primary: #cba6f7;
    --accent-secondary: #f5c2e7;
    --accent-success: #a6e3a1;
    --accent-warning: #f9e2af;
    --accent-danger: #f38ba8;
    --accent-info: #89dceb;
    
    --border-color: #45475a;
    --border-subtle: #313244;
    
    --gradient-primary: linear-gradient(135deg, #cba6f7 0%, #f5c2e7 100%);
    --gradient-accent: linear-gradient(135deg, #f5c2e7 0%, #f38ba8 100%);
    --gradient-glow: radial-gradient(circle at 50% 50%, rgba(203, 166, 247, 0.15) 0%, transparent 70%);
    
    --shadow-glow: 0 0 20px rgba(203, 166, 247, 0.3);
}

/* Theme transition animation */
* {
    transition: background-color var(--transition-base),
                border-color var(--transition-base),
                color var(--transition-fast);
}

/* ========================================
   Share Modal
   ======================================== */
.share-modal-overlay {
    z-index: 10000;
}

.share-modal-overlay.closing {
    animation: fade-out 200ms ease forwards;
}

@keyframes fade-out {
    from { opacity: 1; }
    to { opacity: 0; }
}

.share-modal {
    max-width: 480px;
    overflow: hidden;
}

.share-modal.closing {
    animation: slide-down 200ms ease forwards;
}

@keyframes slide-down {
    from {
        opacity: 1;
        transform: translateY(0);
    }
    to {
        opacity: 0;
        transform: translateY(20px);
    }
}

.share-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: var(--spacing-lg) var(--spacing-xl);
    background: linear-gradient(135deg, rgba(122, 162, 247, 0.1) 0%, rgba(187, 154, 247, 0.1) 100%);
    border-bottom: 1px solid var(--border-subtle);
}

.share-modal-title {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
}

.share-modal-title .share-icon {
    color: var(--accent-primary);
    filter: drop-shadow(0 0 6px rgba(122, 162, 247, 0.4));
}

.share-modal-title h3 {
    margin: 0;
    font-size: 1.2rem;
    font-weight: 600;
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.share-modal-close {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: none;
    color: var(--text-muted);
    font-size: 1.5rem;
    cursor: pointer;
    border-radius: var(--radius-md);
    transition: all var(--transition-fast);
}

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

.share-modal-body {
    padding: var(--spacing-xl);
}

.share-status {
    text-align: center;
    margin-bottom: var(--spacing-xl);
}

.share-status-indicator {
    display: inline-flex;
    align-items: center;
    gap: var(--spacing-sm);
    padding: var(--spacing-sm) var(--spacing-lg);
    background: rgba(158, 206, 106, 0.1);
    border: 1px solid rgba(158, 206, 106, 0.3);
    border-radius: var(--radius-full);
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--accent-success);
    margin-bottom: var(--spacing-md);
}

.share-status-dot {
    width: 8px;
    height: 8px;
    background: var(--accent-success);
    border-radius: var(--radius-full);
    animation: pulse 2s ease-in-out infinite;
    box-shadow: 0 0 8px var(--accent-success);
}

.share-description {
    color: var(--text-secondary);
    font-size: 0.9rem;
    margin: 0;
}

.share-url-container {
    margin-top: var(--spacing-lg);
}

.share-url-box {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    padding: var(--spacing-md) var(--spacing-lg);
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all var(--transition-fast);
    position: relative;
    overflow: hidden;
}

.share-url-box:hover {
    border-color: var(--accent-primary);
    background: var(--bg-hover);
    box-shadow: 0 0 0 3px rgba(122, 162, 247, 0.1);
}

.share-url-box:hover .share-url-copy-hint {
    opacity: 1;
    transform: translateX(0);
}

.share-url-box.copied {
    border-color: var(--accent-success);
    background: rgba(158, 206, 106, 0.1);
}

.share-url-box.copied .share-url-copy-hint {
    opacity: 1;
    transform: translateX(0);
    background: var(--accent-success);
}

.share-url-icon {
    color: var(--accent-info);
    flex-shrink: 0;
}

.share-url-text {
    flex: 1;
    font-family: var(--font-mono);
    font-size: 0.8rem;
    color: var(--text-secondary);
    word-break: break-all;
    line-height: 1.4;
}

.share-url-copy-hint {
    display: flex;
    align-items: center;
    gap: var(--spacing-xs);
    padding: var(--spacing-xs) var(--spacing-sm);
    background: var(--accent-primary);
    border-radius: var(--radius-sm);
    color: white;
    font-size: 0.75rem;
    font-weight: 600;
    flex-shrink: 0;
    opacity: 0;
    transform: translateX(10px);
    transition: all var(--transition-fast);
}

.share-url-copy-hint svg {
    color: white;
}

.share-modal-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: var(--spacing-lg) var(--spacing-xl);
    background: var(--bg-tertiary);
    border-top: 1px solid var(--border-subtle);
}

.share-footer-actions {
    display: flex;
    gap: var(--spacing-sm);
}

.share-btn-disable {
    color: var(--accent-danger);
    border-color: transparent;
}

.share-btn-disable:hover {
    background: rgba(247, 118, 142, 0.1);
    color: var(--accent-danger);
    border-color: rgba(247, 118, 142, 0.3);
}

.share-btn-disable svg {
    color: var(--accent-danger);
}

.share-btn-copy {
    gap: var(--spacing-xs);
}

.share-btn-copy svg {
    color: white;
}

/* ========================================
   Confirm Modal
   ======================================== */
.confirm-modal-overlay {
    z-index: 10001;
}

.confirm-modal-overlay.closing {
    animation: fade-out 200ms ease forwards;
}

.confirm-modal {
    max-width: 400px;
    text-align: center;
}

.confirm-modal.closing {
    animation: slide-down 200ms ease forwards;
}

.confirm-modal-header {
    flex-direction: column;
    gap: var(--spacing-md);
    padding: var(--spacing-xl) var(--spacing-xl) var(--spacing-md);
    border-bottom: none;
}

.confirm-modal-icon {
    width: 56px;
    height: 56px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(247, 118, 142, 0.1);
    border: 1px solid rgba(247, 118, 142, 0.2);
    border-radius: var(--radius-full);
}

.confirm-modal-icon svg {
    color: var(--accent-danger);
}

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

.confirm-modal-body {
    padding: 0 var(--spacing-xl) var(--spacing-lg);
}

.confirm-modal-body p {
    color: var(--text-secondary);
    font-size: 0.9rem;
    line-height: 1.6;
    margin: 0;
}

.confirm-modal-footer {
    justify-content: center;
    gap: var(--spacing-md);
    background: transparent;
    border-top: 1px solid var(--border-subtle);
}

.btn-danger {
    background: var(--accent-danger);
    color: white;
    border: none;
    box-shadow: var(--shadow-sm);
}

.btn-danger:hover {
    background: #e5677a;
    transform: translateY(-1px);
    box-shadow: var(--shadow-md), 0 0 20px rgba(247, 118, 142, 0.3);
}

/* Share Modal Responsive */
@media (max-width: 480px) {
    .share-modal {
        max-width: calc(100% - var(--spacing-lg) * 2);
        margin: var(--spacing-lg);
    }
    
    .share-modal-header,
    .share-modal-body,
    .share-modal-footer {
        padding: var(--spacing-md);
    }
    
    .share-modal-footer {
        flex-direction: column;
        gap: var(--spacing-md);
    }
    
    .share-footer-actions {
        width: 100%;
        justify-content: flex-end;
    }
    
    .share-btn-disable {
        width: 100%;
        justify-content: center;
    }
    
    .confirm-modal {
        max-width: calc(100% - var(--spacing-lg) * 2);
        margin: var(--spacing-lg);
    }
}

/* Very small screens (iPhone SE, small Android, etc.) */
@media (max-width: 375px) {
    .auth-page {
        padding: var(--spacing-sm);
    }
    
    .auth-form {
        padding: var(--spacing-sm);
    }
    
    .auth-form h2 {
        font-size: 1.1rem;
    }
    
    .auth-form .form-group input {
        padding: var(--spacing-xs) var(--spacing-sm);
        font-size: 0.9rem;
    }
    
    .auth-features {
        gap: var(--spacing-xs) var(--spacing-sm);
    }
    
    .auth-feature {
        font-size: 0.7rem;
    }
    
    .feature-card {
        padding: var(--spacing-xs) var(--spacing-sm);
    }
    
    .feature-icon {
        font-size: 1rem;
    }
    
    .feature-card h3 {
        font-size: 0.75rem;
    }
    
    .welcome-content h1 {
        font-size: 1.4rem;
    }
    
    .welcome-content::before {
        width: 220px;
        height: 160px;
        opacity: 0.3;
    }
    
    .welcome-content > p {
        font-size: 0.85rem;
    }
    
    .panel-header {
        padding: var(--spacing-xs) var(--spacing-sm);
    }

    .audio-section-toggle {
        padding: var(--spacing-xs) var(--spacing-sm);
    }
    
    .panel-title {
        font-size: 0.8rem;
        gap: var(--spacing-xs);
    }
    
    .panel-content {
        padding: var(--spacing-sm);
    }
    
    .toolbar-container {
        padding: var(--spacing-xs);
        gap: var(--spacing-xs);
    }
    
    .toolbar-btn {
        width: 36px;
        height: 36px;
    }
    
    .btn-asr {
        width: 48px;
        height: 48px;
        margin: -2px var(--spacing-xs);
    }
}
