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

:root {
    --primary: #2563eb;
    --primary-hover: #1d4ed8;
    --success: #10b981;
    --success-hover: #059669;
    --warning: #f59e0b;
    --error: #ef4444;
    --btn-active-bg: #f3f4f6;
    --btn-active-border: #f3f4f6;
    --btn-active-text: var(--gray-900);
    --gray-50: #f9fafb;
    --gray-100: #f3f4f6;
    --gray-200: #e5e7eb;
    --gray-300: #d1d5db;
    --gray-400: #9ca3af;
    --gray-500: #6b7280;
    --gray-600: #4b5563;
    --gray-700: #374151;
    --gray-800: #1f2937;
    --gray-900: #111827;
    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    --shadow: 0 1px 3px 0 rgb(0 0 0 / 0.1), 0 1px 2px -1px rgb(0 0 0 / 0.1);
    --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
    --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
    --radius: 12px;
    --radius-sm: 8px;
    --highlight-yellow: rgba(250, 204, 21, 0.28);
    --highlight-green: rgba(74, 222, 128, 0.28);
    --highlight-blue: rgba(96, 165, 250, 0.28);
    --highlight-pink: rgba(244, 114, 182, 0.28);
    --highlight-toolbar-bg: rgba(15, 23, 42, 0.95);
    --highlight-toolbar-border: rgba(148, 163, 184, 0.25);
}

[data-theme="dark"] {
    --bg-primary: #0a0a0b;
    --bg-secondary: #111113;
    --bg-elevated: #18181b;
    --bg-hover: #222226;
    --text-primary: #f1f5f9;
    --text-secondary: #a1a1aa;
    --text-muted: #71717a;
    --border: rgba(255, 255, 255, 0.08);
    --border-strong: rgba(255, 255, 255, 0.12);
    --gray-50: #111113;
    --gray-100: #18181b;
    --gray-200: #27272a;
    --gray-300: #3f3f46;
    --gray-400: #52525b;
    --gray-500: #71717a;
    --gray-600: #a1a1aa;
    --gray-700: #d4d4d8;
    --gray-800: #e4e4e7;
    --gray-900: #f1f5f9;
    --btn-active-bg: #16161a;
    --btn-active-border: #232329;
    --btn-active-text: #f1f5f9;
}

html {
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
    background: var(--m-bg-primary);
    color: var(--gray-800);
    line-height: 1.6;
    min-height: 100vh;
    -webkit-text-size-adjust: 100%;
    text-size-adjust: 100%;
}

body[data-theme="dark"] {
    background: var(--bg-primary);
    color: var(--text-primary);
    --highlight-yellow: rgba(250, 204, 21, 0.28);
    --highlight-green: rgba(74, 222, 128, 0.28);
    --highlight-blue: rgba(96, 165, 250, 0.28);
    --highlight-pink: rgba(244, 114, 182, 0.28);
}

.hidden {
    display: none;
}

.container {
    max-width: 720px;
    margin: 0 auto;
    padding: 24px 16px;
}

/* Header */
.header {
    text-align: center;
    margin-bottom: 32px;
}

.logo {
    font-size: 28px;
    font-weight: 700;
    color: var(--gray-900);
    letter-spacing: -0.5px;
    display: inline-flex;
    align-items: center;
    gap: 10px;
}

.subtitle {
    font-size: 14px;
    color: var(--gray-500);
    margin-top: 4px;
}

.dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    display: inline-block;
    border: 1px solid var(--gray-200);
}

.dot-gray {
    background: var(--gray-300);
}

.dot-green {
    background: var(--success);
}

#recordBtn,
#recordBtnTop,
#importUrlBtn,
#myFilesBtn {
    font-size: 14px;
}

 .record-row {
    margin-bottom: 12px;
    display: flex;
    justify-content: flex-start;
    gap: 10px;
    align-items: center;
}


#recordBtn,
#recordBtnTop {
    position: relative;
    overflow: hidden;
    transition: padding 0.2s ease;
}

#recordBtn.recording,
#recordBtnTop.recording {
    padding-right: 85px;
    padding-left: 40px;
}

#recordBtnFolder.recording {
    border-color: var(--primary);
}

.record-emoji {
    font-size: 12px;
    line-height: 1;
}

.record-status {
    position: absolute;
    right: 16px;
    top: 50%;
    transform: translateY(-50%);
    display: inline-flex;
    align-items: center;
    gap: 10px;
    font-size: 12px;
    color: var(--gray-600);
    opacity: 0;
    transition: opacity 0.2s ease;
    pointer-events: none;
    white-space: nowrap;
}

.btn.recording .record-status {
    opacity: 1;
}

.record-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #22c55e;
    box-shadow: 0 0 0 3px rgba(34, 197, 94, 0.2);
    animation: pulse-dot 1.5s ease-in-out infinite;
    margin-right: -2px;
}

.record-timer {
    font-variant-numeric: tabular-nums;
    min-width: 36px;
}

@keyframes pulse-dot {
    0%, 100% {
        opacity: 1;
        box-shadow: 0 0 0 3px rgba(34, 197, 94, 0.2);
    }
    50% {
        opacity: 0.7;
        box-shadow: 0 0 0 5px rgba(34, 197, 94, 0.1);
    }
}

/* Card */
.card {
    background: #ffffff;
    border-radius: var(--radius);
    box-shadow: var(--shadow-md);
    border: 1px solid var(--gray-100);
    padding: 24px;
}

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

.upload-card {
    max-width: 580px;
    margin-left: auto;
    margin-right: auto;
}

/* Dropzone */
.dropzone {
    border: 2px dashed var(--gray-300);
    border-radius: var(--radius-sm);
    padding: 48px 24px;
    text-align: center;
    transition: all 0.2s ease;
    background: var(--gray-50);
}

.dropzone.collapsed {
    padding: 0;
    border: none;
    background: transparent;
}

.dropzone-content.hidden {
    display: none;
}

.dropzone:hover:not(.collapsed),
.dropzone.dragover {
    border-color: var(--primary);
    background: #eff6ff;
}

.dropzone-icon {
    width: 48px;
    height: 48px;
    color: var(--gray-400);
    margin-bottom: 16px;
}

.dropzone.dragover .dropzone-icon {
    color: var(--primary);
}

.dropzone-text {
    font-size: 16px;
    color: var(--gray-700);
    margin-bottom: 8px;
}

.dropzone-hint {
    font-size: 13px;
    color: var(--gray-400);
    margin-bottom: 16px;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 20px;
    font-size: 14px;
    font-weight: 500;
    border-radius: var(--radius-sm);
    border: none;
    cursor: pointer;
    transition: all 0.2s ease;
}
.btn.is-loading { pointer-events: none; }
.btn-spinner {
    width: 14px;
    height: 14px;
    border: 2px solid currentColor;
    border-right-color: transparent;
    border-radius: 50%;
    display: none;
    animation: btn-spin 0.8s linear infinite;
}
.btn.is-loading .btn-spinner { display: inline-block; }
.btn.is-loading .btn-text { opacity: 0.85; }
@keyframes btn-spin {
    to { transform: rotate(360deg); }
}

.btn-primary {
    background: var(--primary);
    color: white;
}

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

.btn-success {
    background: var(--success);
    color: white;
}

.btn-success:hover:not(:disabled) {
    background: var(--success-hover);
}

.btn-success:disabled {
    background: var(--gray-300);
    cursor: not-allowed;
}

/* Main-page start button: keep disabled/default behavior, but use blue when ready (enabled). */
#startBtn.btn-success:not(:disabled) {
    background: var(--primary);
}

#startBtn.btn-success:hover:not(:disabled) {
    background: var(--primary-hover);
}

.btn-large {
    width: 100%;
    padding: 14px 24px;
    font-size: 16px;
    margin-top: 20px;
}

.btn-icon {
    width: 18px;
    height: 18px;
}

.btn-icon-small {
    width: 14px;
    height: 14px;
}

.btn-small {
    padding: 6px 12px;
    font-size: 12px;
}

.btn-outline {
    background: transparent;
    border: 1px solid var(--gray-300);
    color: var(--gray-700);
}

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

.btn-ghost:hover {
    background: var(--gray-100);
    color: var(--gray-900);
}

.btn-outline.is-active {
    background: var(--btn-active-bg);
    border-color: var(--btn-active-border);
    color: var(--btn-active-text);
    box-shadow: 0 0 0 1px rgba(107, 114, 128, 0.08) inset;
}

.btn-check-icon {
    font-size: 12px;
    font-weight: 400;
    line-height: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.btn-check-icon svg {
    width: 12px;
    height: 12px;
    opacity: 0.8;
}

.timestamps-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.btn-timestamps.is-loading .timestamps-icon {
    animation: timestamp-spin 0.9s linear infinite, timestamp-pulse 1.2s ease-in-out infinite;
    transform-origin: 50% 50%;
}

.btn-summarize.is-loading .summarize-icon {
    animation: timestamp-spin 0.9s linear infinite, timestamp-pulse 1.2s ease-in-out infinite;
    transform-origin: 50% 50%;
}

@keyframes timestamp-spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

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


.btn-outline:hover {
    background: var(--gray-50);
    border-color: var(--gray-400);
}

/* Upload status */
.upload-status {
    margin-top: 14px;
    padding: 12px;
    border-radius: var(--radius-sm);
    background: var(--gray-50);
    border: 1px solid var(--gray-200);
}

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

.upload-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 13px;
    color: var(--gray-600);
    margin-bottom: 8px;
}

.upload-bar {
    height: 6px;
    background: var(--gray-200);
    border-radius: 999px;
    overflow: hidden;
}

#uploadBarFill {
    height: 100%;
    width: 0%;
    background: var(--primary);
    transition: width 0.2s ease;
}

/* File List */
.file-list {
    margin-top: 20px;
}

.file-list:empty {
    display: none;
}

.merge-controls {
    margin-top: 12px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

.merge-controls.hidden {
    display: none;
}

.btn-merge {
    background: var(--gray-100);
    border-color: var(--gray-300);
    color: var(--gray-700);
}

.btn-merge:hover:not(:disabled) {
    background: var(--gray-200);
    border-color: var(--gray-400);
}

.merge-status-text {
    font-size: 12px;
    color: var(--gray-500);
    white-space: nowrap;
}

.merge-status-text.hidden {
    display: none;
}

.merge-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    max-height: 260px;
    overflow-y: auto;
}

.merge-list-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    border: 1px solid var(--gray-200);
    border-radius: 10px;
    background: var(--gray-50);
}

.merge-list-index {
    min-width: 22px;
    height: 22px;
    border-radius: 999px;
    background: var(--gray-200);
    color: var(--gray-600);
    font-size: 11px;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.merge-list-name {
    flex: 1;
    min-width: 0;
    font-size: 13px;
    color: var(--gray-700);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.merge-list-actions {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.merge-shift-btn {
    width: 24px;
    height: 24px;
    border: 1px solid var(--gray-300);
    border-radius: 6px;
    background: #fff;
    color: var(--gray-600);
    font-size: 13px;
    line-height: 1;
    cursor: pointer;
}

.merge-shift-btn:hover:not(:disabled) {
    background: var(--gray-100);
    border-color: var(--gray-400);
}

.merge-shift-btn:disabled {
    opacity: 0.35;
    cursor: not-allowed;
}

.file-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    background: var(--gray-50);
    border-radius: var(--radius-sm);
    margin-bottom: 8px;
}

.file-icon {
    width: 36px;
    height: 36px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    position: relative;
}

.file-icon.audio {
    background: #dbeafe;
    color: var(--primary);
}

.file-icon.video {
    background: #fce7f3;
    color: #db2777;
}

.file-icon svg {
    width: 20px;
    height: 20px;
}

.file-preview-btn {
    position: absolute;
    inset: 0;
    border: none;
    background: rgba(255, 255, 255, 0.75);
    color: var(--gray-800);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    transition: background 0.15s ease, color 0.15s ease;
}

.file-preview-btn:hover {
    background: rgba(255, 255, 255, 0.9);
    color: var(--gray-900);
}

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

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

.file-name {
    font-size: 14px;
    font-weight: 500;
    color: var(--gray-800);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.file-meta {
    font-size: 12px;
    color: var(--gray-500);
}

.file-download {
    width: 28px;
    height: 28px;
    border-radius: 6px;
    color: var(--gray-400);
    display: flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    transition: all 0.2s;
}

.file-download:hover {
    background: var(--gray-200);
    color: var(--gray-700);
}

.file-download svg {
    width: 16px;
    height: 16px;
}

.file-remove {
    width: 28px;
    height: 28px;
    border-radius: 6px;
    border: none;
    background: transparent;
    color: var(--gray-400);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.file-remove:hover {
    background: var(--gray-200);
    color: var(--error);
}

.file-remove svg {
    width: 16px;
    height: 16px;
}

/* Sections */
.section-title {
    font-size: 16px;
    font-weight: 600;
    color: var(--gray-800);
    margin-bottom: 16px;
}

.drag-hint {
    font-size: 12px;
    font-weight: 400;
    color: var(--gray-400);
}

.jobs-section,
.results-section {
    margin-top: 32px;
    display: none;
}

.results-section {
    margin-top: 42px;
}

.jobs-section.visible,
.results-section.visible {
    display: block;
}

/* Jobs - Transcript Cards with drag support */
.jobs-list {
    min-height: 20px;
}

.job-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 16px;
    padding-right: 44px; /* Space for delete button */
    background: #ffffff;
    border: 1px solid var(--gray-200);
    border-radius: var(--radius-sm);
    margin-bottom: 8px;
    box-shadow: var(--shadow-sm);
    cursor: pointer;
    transition: all 0.15s ease;
    position: relative;
    user-select: none;
    max-width: 700px;
    margin-left: auto;
    margin-right: auto;
}

.job-item:hover {
    border-color: var(--primary);
    background: var(--gray-50);
}

.job-item.selected {
    border-color: var(--primary);
    background: #eff6ff;
}

/* Drag and drop styles */
.job-item.dragging {
    opacity: 0.5;
    transform: scale(1.02);
    box-shadow: var(--shadow-lg);
}

.job-item.drag-over {
    border-color: var(--primary);
    border-style: dashed;
    background: #eff6ff;
}

.job-item .drag-handle {
    cursor: grab;
    color: var(--gray-300);
    padding: 4px;
    margin-left: -8px;
    display: flex;
    align-items: center;
}

.job-item .drag-handle:active {
    cursor: grabbing;
}

.job-item .drag-handle svg {
    width: 16px;
    height: 16px;
}

.job-status-icon {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.job-status-icon svg {
    width: 16px;
    height: 16px;
}

.job-status-icon.queued {
    background: var(--gray-100);
    color: var(--gray-500);
}

.job-status-icon.processing {
    background: #dbeafe;
    color: var(--primary);
}

.job-status-icon.done {
    background: #d1fae5;
    color: var(--success);
}

.job-status-icon.failed {
    background: #fee2e2;
    color: var(--error);
}

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

.job-name {
    font-size: 14px;
    font-weight: 500;
    color: var(--gray-800);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.job-meta {
    font-size: 11px;
    color: var(--gray-400);
    margin-top: 2px;
}

.job-status-text {
    font-size: 12px;
    color: var(--gray-500);
}

/* Job delete button - FIX 1: always visible on mobile */
.job-delete {
    position: absolute;
    top: 50%;
    right: 10px;
    transform: translateY(-50%);
    width: 28px;
    height: 28px;
    border-radius: 6px;
    border: 1px solid var(--gray-200);
    background: white;
    color: var(--gray-400);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.15s;
    /* Always visible, not opacity: 0 */
}

.job-delete:hover {
    background: #fee2e2;
    color: var(--error);
    border-color: #fecaca;
}

.job-delete svg {
    width: 14px;
    height: 14px;
}

/* Job progress bar */
.job-progress-bar {
    height: 4px;
    background: var(--gray-200);
    border-radius: 2px;
    margin-top: 6px;
    overflow: hidden;
}

.job-progress-bar-fill {
    height: 100%;
    background: var(--primary);
    transition: width 0.3s ease;
}

/* Spinner - FIX 4: constrained size */
svg.spinner {
    animation: spin 1s linear infinite;
    width: 18px !important;
    height: 18px !important;
    flex-shrink: 0;
}

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

/* Results */
.result-item {
    background: #ffffff;
    border: 1px solid var(--gray-200);
    border-radius: var(--radius);
    padding: 20px;
    margin-bottom: 16px;
    box-shadow: var(--shadow-sm);
    display: none;
    position: relative;
}

.result-item.visible {
    display: block;
}

/* Shared transcript styling for results list */
.results-section {
    --share-accent: #2563EB;
    --share-accent-hover: #1D4ED8;
    --share-bg-secondary: #ffffff;
    --share-bg-elevated: #f3f4f6;
    --share-text-primary: #2b2b2b;
    --share-text-secondary: #4b5563;
    --share-text-muted: #8a8f98;
    --share-border: rgba(0, 0, 0, 0.08);
    --share-border-strong: rgba(0, 0, 0, 0.12);
    --share-radius-sm: 6px;
    --share-radius-md: 10px;
    --share-radius-lg: 14px;
    --share-player-bg: rgba(250, 250, 250, 0.68);
    --share-font-sans: 'Inter', 'DM Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    --share-font-mono: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, monospace;
    --share-transcript-font-size: 15.5px;
    --color-speaker-1: #4A7FA5;
    --color-speaker-2: #5A9E6F;
    --color-speaker-3: #B5763A;
    --color-speaker-4: #7B62A3;
    --color-speaker-5: #4E9E9B;
    --color-speaker-6: #C0575A;
    --color-speaker-7: #6A7EC2;
    --color-speaker-8: #B07BA0;
    --color-speaker-9: #A07840;
    --color-speaker-10: #5E8C61;
    --color-speaker-11: #7A9E8E;
    --color-speaker-12: #9E7A62;
    --color-speaker-13: #6E8FA3;
    --color-speaker-14: #A08C5B;
    --color-speaker-15: #8A7EC2;
    --speaker-text: #374151;
    --speaker-text-muted: #9ca3af;
    --speaker-border: #e5e7eb;
    --speaker-bg-alt: #f9fafb;
    --speaker-label-blue: #4b6bd6;
    --player-scale: 0.97;
    --btn-active-bg: var(--share-bg-elevated);
    --btn-active-border: var(--share-border-strong);
    --btn-active-text: var(--share-text-primary);
}

body[data-theme="dark"] .results-section {
    --share-bg-secondary: #111113;
    --share-bg-elevated: rgba(255, 255, 255, 0.06);
    --share-text-primary: #f3f4f6;
    --share-text-secondary: #cbd5e1;
    --share-text-muted: #9ca3af;
    --share-border: rgba(255, 255, 255, 0.12);
    --share-border-strong: rgba(255, 255, 255, 0.2);
    --share-player-bg: rgba(10, 10, 11, 0.75);
    --speaker-text: #e5e7eb;
    --speaker-text-muted: #a1a1aa;
    --speaker-border: rgba(255, 255, 255, 0.12);
    --speaker-bg-alt: rgba(255, 255, 255, 0.03);
    --speaker-label-blue: #8aa3ff;
    --color-speaker-1: #779FBC;
    --color-speaker-2: #83B693;
    --color-speaker-3: #C8986B;
    --color-speaker-4: #9C89BA;
    --color-speaker-5: #7AB6B4;
    --color-speaker-6: #D08183;
    --color-speaker-7: #8F9ED1;
    --color-speaker-8: #C49CB8;
    --color-speaker-9: #B89A70;
    --color-speaker-10: #86A988;
    --color-speaker-11: #9BB6AA;
    --color-speaker-12: #B69B89;
    --color-speaker-13: #92ABBA;
    --color-speaker-14: #B8A984;
    --color-speaker-15: #A79ED1;
}

@media (min-width: 1500px) {
    .results-section {
        --share-transcript-font-size: 16px;
    }
}

.results-section .results-list {
    font-family: var(--share-font-sans);
}

.results-section .result-item {
    background: transparent;
    border: none;
    padding: 0;
    margin-bottom: 32px;
    box-shadow: none;
}

.results-section .result-item.actions-side {
    width: 100%;
    max-width: 980px;
    margin-left: auto;
    margin-right: auto;
}

.results-section .result-item.actions-side .transcript-view-actions.transcript-actions {
    display: block;
    margin: 0 auto 12px;
    width: 100%;
    max-width: 760px;
    background: var(--share-bg-secondary);
    border: 1px solid var(--share-border);
    border-radius: 16px;
    padding: 10px;
}

.results-section .result-item.actions-side .transcript-view-content {
    width: 100%;
    max-width: 760px;
    margin: 0 auto;
}

.results-section .result-item.actions-side .transcript-box {
    width: 100%;
    max-width: 760px;
    margin: 0;
}

.results-section .result-header {
    margin-bottom: 12px;
    width: calc(100% - 50px);
    max-width: 680px;
    margin-left: auto;
    margin-right: auto;
}

.results-section .result-title .result-name {
    display: block;
    max-width: 100%;
    margin-left: 0;
    margin-right: 0;
}

.results-section .result-title {
    font-size: 18px;
    font-weight: 600;
    color: var(--share-text-primary);
}


.results-section .btn.btn-outline {
    background: transparent;
    border: 1px solid var(--share-border-strong);
    color: var(--share-text-secondary);
    border-radius: var(--share-radius-sm);
}

.results-section .btn.btn-outline:hover {
    background: var(--share-bg-elevated);
    border-color: var(--share-border-strong);
    color: var(--share-text-primary);
}

.results-section .btn.btn-outline.is-active {
    background: var(--btn-active-bg);
    border-color: var(--btn-active-border);
    color: var(--btn-active-text);
    box-shadow: 0 0 0 1px rgba(107, 114, 128, 0.08) inset;
}

.results-section .result-item.actions-side .action-bar {
    background: transparent;
    border-radius: 16px;
    border: 0;
    padding: 0;
    max-width: 760px;
}

.results-section .result-item.actions-side .action-bar-inner {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
    width: 100%;
    max-width: none;
}

.results-section .result-item.actions-side .action-copy { order: 1; }
.results-section .result-item.actions-side .action-export { order: 2; }
.results-section .result-item.actions-side .action-share { order: 3; }
.results-section .result-item.actions-side .action-summarize { order: 4; }
.results-section .result-item.actions-side .action-translate { order: 5; }
.results-section .result-item.actions-side .toggle-row { order: 7; }

.results-section .result-item.actions-side .action-btn {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 9px 16px;
    font-size: 14px;
    font-weight: 500;
    color: #374151;
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.15s ease;
    white-space: nowrap;
    box-shadow: none;
    width: auto;
    max-width: none;
}

.results-section .result-item.actions-side .action-btn:hover {
    background: #f9fafb;
    border-color: #d1d5db;
}

.results-section .result-item.actions-side .action-btn.is-active {
    background: #f9fafb;
    border-color: #d1d5db;
    color: #374151;
}

.results-section .result-item.actions-side .action-btn:active {
    background: #f3f4f6;
    transform: scale(0.98);
}

.results-section .result-item.actions-side .action-btn svg {
    width: 16px;
    height: 16px;
    stroke-width: 1.5;
    flex-shrink: 0;
}

.results-section .result-item.actions-side .action-btn .btn-text {
    display: inline;
}

/* Keep Ask AI visual weight identical to Export on main page */
body:not(.share-view) .results-section .result-item.actions-side .action-chat {
    color: #374151;
    opacity: 1;
}

body:not(.share-view) .results-section .result-item.actions-side .action-chat .btn-text {
    color: inherit;
    font-size: inherit;
    font-weight: inherit;
    opacity: 1;
}

body:not(.share-view) .results-section .result-item.actions-side .action-chat svg {
    color: currentColor;
    width: 16px;
    height: 16px;
    stroke-width: 1.5;
    opacity: 1;
}

/* Apply same Ask AI parity in all main transcript action layouts */
body:not(.share-view) .results-section .result-item .transcript-actions .action-chat {
    color: inherit;
    opacity: 1;
}

body:not(.share-view) .results-section .result-item .transcript-actions .action-chat .btn-text {
    color: inherit;
    font-family: inherit;
    font-size: inherit;
    font-weight: inherit;
    opacity: 1;
}

body:not(.share-view) .results-section .result-item .transcript-actions .action-chat svg {
    color: currentColor;
    width: 16px;
    height: 16px;
    stroke-width: 1.5;
    opacity: 1;
}

/* Strict Ask AI <-> Export parity on main transcript action bars */
body:not(.share-view) .results-section .result-item .transcript-actions .action-export,
body:not(.share-view) .results-section .result-item .transcript-actions .action-chat {
    color: #374151;
}

body:not(.share-view) .results-section .result-item .transcript-actions .action-export .btn-text,
body:not(.share-view) .results-section .result-item .transcript-actions .action-chat .btn-text {
    color: inherit;
    font-family: inherit;
    font-size: inherit;
    font-weight: inherit;
    opacity: 1;
}

body:not(.share-view) .results-section .result-item .transcript-actions .action-export svg,
body:not(.share-view) .results-section .result-item .transcript-actions .action-chat svg {
    color: currentColor;
    opacity: 1;
    width: 16px;
    height: 16px;
    stroke-width: 1.5;
}

body:not(.share-view) .results-section .result-item .transcript-actions .action-chat.is-active {
    color: #374151;
}

body[data-theme="dark"]:not(.share-view) .results-section .result-item .transcript-actions .action-export,
body[data-theme="dark"]:not(.share-view) .results-section .result-item .transcript-actions .action-chat {
    color: #e4e4e7;
}

body[data-theme="dark"]:not(.share-view) .results-section .result-item .transcript-actions .action-chat.is-active {
    color: #e4e4e7;
}

/* Hard-lock Ask AI + Export text/icon parity on main page */
body:not(.share-view) .results-section .result-item .transcript-actions .action-export,
body:not(.share-view) .results-section .result-item .transcript-actions .action-chat,
body:not(.share-view) .results-section .result-item .transcript-actions .action-export:hover,
body:not(.share-view) .results-section .result-item .transcript-actions .action-chat:hover,
body:not(.share-view) .results-section .result-item .transcript-actions .action-export.is-active,
body:not(.share-view) .results-section .result-item .transcript-actions .action-chat.is-active {
    color: #374151 !important;
}

body:not(.share-view) .results-section .result-item .transcript-actions .action-export .btn-text,
body:not(.share-view) .results-section .result-item .transcript-actions .action-chat .btn-text {
    color: inherit !important;
    opacity: 1 !important;
}

body:not(.share-view) .results-section .result-item .transcript-actions .action-export svg,
body:not(.share-view) .results-section .result-item .transcript-actions .action-chat svg {
    color: currentColor !important;
    opacity: 1 !important;
}

body[data-theme="dark"]:not(.share-view) .results-section .result-item .transcript-actions .action-export,
body[data-theme="dark"]:not(.share-view) .results-section .result-item .transcript-actions .action-chat,
body[data-theme="dark"]:not(.share-view) .results-section .result-item .transcript-actions .action-export:hover,
body[data-theme="dark"]:not(.share-view) .results-section .result-item .transcript-actions .action-chat:hover,
body[data-theme="dark"]:not(.share-view) .results-section .result-item .transcript-actions .action-export.is-active,
body[data-theme="dark"]:not(.share-view) .results-section .result-item .transcript-actions .action-chat.is-active {
    color: #e4e4e7 !important;
}

.results-section .result-item.actions-side .toggle-row {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-top: 10px;
}

.results-section .result-item.actions-side .toggle-item {
    display: flex;
    align-items: center;
    gap: 8px;
}

.results-section .result-item.actions-side .toggle-item.toggle-item-timestamps {
    position: relative;
    padding-bottom: 10px;
}

.results-section .result-item.actions-side .toggle-item.toggle-item-timestamps::after {
    content: '';
    position: absolute;
    left: 50%;
    bottom: 0;
    width: 3px;
    height: 3px;
    border-radius: 50%;
    transform: translateX(-50%);
    background: #d0d0d8;
    box-shadow: -9px 0 0 #d0d0d8, 9px 0 0 #d0d0d8;
}

.results-section .result-item.actions-side .toggle-row .toggle-divider {
    display: none;
    pointer-events: none;
    flex: 0 0 auto;
}

.results-section .result-item.actions-side .toggle-item.auto-scroll-item {
    display: none;
}

@media (min-width: 901px) {
    .results-section .result-item.actions-side .toggle-item.auto-scroll-item {
        display: flex;
    }

    .results-section .result-item.actions-side .toggle-row .toggle-divider {
        display: flex;
        align-items: center;
        width: 56px;
        padding: 0;
    }

    .results-section .result-item.actions-side .toggle-row .toggle-divider::after {
        content: '';
        display: block;
        width: 100%;
        height: 1px;
        background: radial-gradient(ellipse at center, rgba(0, 0, 0, 0.14) 0%, transparent 70%);
    }
}

.results-section .result-item.actions-side .toggle-label {
    font-size: 14px;
    font-weight: 500;
    color: #374151;
}

.results-section .result-item.actions-side .toggle-label-player .label-mobile {
    display: none;
}

.results-section .result-item.actions-side .toggle {
    width: 42px;
    height: 24px;
    background: #e5e7eb;
    border-radius: 12px;
    position: relative;
    cursor: pointer;
    transition: background 0.2s ease;
    flex-shrink: 0;
    border: none;
}

.results-section .result-item.actions-side .toggle.on {
    background: #2563EB;
}

.results-section .result-item.actions-side .toggle::after {
    content: '';
    position: absolute;
    width: 20px;
    height: 20px;
    background: #ffffff;
    border-radius: 50%;
    top: 2px;
    left: 2px;
    transition: transform 0.2s ease;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}

.results-section .result-item.actions-side .toggle.on::after {
    transform: translateX(18px);
}

@media (max-width: 640px) {
    .results-section .result-item.actions-side .toggle-row {
        width: 100%;
        flex-basis: 100%;
        display: flex;
        flex-wrap: nowrap;
        align-items: center;
        justify-content: space-between;
        gap: 6px;
        margin-top: 12px;
        font-size: clamp(10px, 2.8vw, 12px);
    }

    .results-section .result-item.actions-side .toggle-item {
        display: flex;
        align-items: center;
        gap: 4px;
        min-width: 0;
        width: auto;
    }

    .results-section .result-item.actions-side .toggle-label {
        min-width: 0;
        font-size: clamp(10px, 2.8vw, 12px);
        white-space: nowrap;
        overflow: visible;
        text-overflow: clip;
        text-align: left;
    }

    .results-section .result-item.actions-side .toggle {
        width: 34px;
        height: 20px;
        border-radius: 10px;
        flex-shrink: 0;
    }

    .results-section .result-item.actions-side .toggle::after {
        width: 16px;
        height: 16px;
    }

    .results-section .result-item.actions-side .toggle.on::after {
        transform: translateX(14px);
    }

    .results-section .result-item.actions-side .toggle-label-player .label-full {
        display: none;
    }

    .results-section .result-item.actions-side .toggle-label-player .label-mobile {
        display: inline;
    }

    .results-section .result-item.actions-side .action-bar {
        padding: 14px;
        border-radius: 14px;
    }

    .results-section .result-item.actions-side .action-bar-inner {
        gap: 6px;
        max-width: none;
        width: 100%;
    }

    .results-section .result-item.actions-side .action-btn {
        padding: 10px 0;
        font-size: 13px;
        border-radius: 8px;
        gap: 6px;
        width: calc((100% - 24px) / 5) !important;
        max-width: calc((100% - 24px) / 5) !important;
        min-width: 0;
        justify-content: center;
    }

    .results-section .result-item.actions-side .action-btn svg {
        width: 18px;
        height: 18px;
    }

    .results-section .result-item.actions-side .action-btn .btn-text {
        display: none;
    }
}

@media (min-width: 641px) and (max-width: 900px) {
    .results-section .result-item.actions-side .action-bar {
        padding: 14px;
        border-radius: 14px;
    }

    .results-section .result-item.actions-side .action-bar-inner {
        width: 100%;
        max-width: none;
        gap: 8px;
    }

    .results-section .result-item.actions-side .action-btn {
        width: calc((100% - 32px) / 5);
        max-width: calc((100% - 32px) / 5);
        min-width: 0;
        justify-content: center;
        padding: 9px 6px;
        font-size: 13px;
        gap: 6px;
    }

    .results-section .result-item.actions-side .toggle-row {
        width: 100%;
        flex-basis: 100%;
        margin-top: 12px;
    }

    .results-section .result-item.actions-side .toggle-label-player {
        white-space: nowrap;
    }
}

@media (min-width: 1160px) {
    .results-section .result-item.actions-side {
        display: grid;
        grid-template-columns: minmax(0, 760px) 175px;
        grid-template-areas: "content actions";
        column-gap: 24px;
        align-items: start;
        max-width: 980px;
    }

    .results-section .result-item.actions-side .transcript-view-content {
        grid-area: content;
        max-width: 760px;
        margin: 0;
    }

    .results-section .result-item.actions-side .transcript-view-actions.transcript-actions {
        grid-area: actions;
        width: 175px;
        max-width: 175px;
        margin: 0;
        position: sticky;
        top: 92px;
        align-self: start;
        justify-self: end;
    }

    .results-section .result-item.actions-side .action-bar {
        width: 100%;
        max-width: 100%;
    }

    .results-section .result-item.actions-side .action-bar-inner {
        flex-direction: column;
        align-items: stretch;
        flex-wrap: nowrap;
    }

    .results-section .result-item.actions-side .action-btn {
        width: 100%;
        justify-content: flex-start;
        padding: 8px 10px;
        font-size: 13px;
    }

    .results-section .result-item.actions-side .toggle-row,
    .results-section .result-item.actions-side .toggle-item,
    .results-section .result-item.actions-side .toggle-row .toggle-divider {
        width: 100%;
    }

    .results-section .result-item.actions-side .toggle-row {
        flex-direction: column;
        align-items: stretch;
        gap: 12px;
    }

    .results-section .result-item.actions-side .toggle-item {
        justify-content: space-between;
    }

    .results-section .result-item.actions-side .toggle-row .toggle-divider {
        padding: 0;
    }

    .results-section .result-item.actions-side .toggle-row .toggle-divider::after {
        width: 100%;
    }

    .results-section .result-item.actions-side .toggle-item.auto-scroll-item {
        display: flex;
    }

}

@media (min-width: 1160px) {
    .results-section .result-item.actions-side {
        grid-template-columns: 175px minmax(0, 760px) 175px;
        grid-template-areas: ". content actions";
        column-gap: 24px;
        max-width: 1158px;
    }

    .results-section .result-item.actions-side .transcript-view-content {
        justify-self: center;
    }

}

.results-section .transcript-box {
    --result-transcript-pad-x: 24px;
    --result-transcript-pad-y: 24px;
    --result-player-height: 84px;
    background: var(--share-bg-secondary);
    border: 1px solid var(--share-border);
    border-radius: var(--share-radius-lg);
    padding: var(--result-transcript-pad-y) var(--result-transcript-pad-x) 0;
    width: calc(100% - 50px);
    max-width: 760px;
    margin: 0 auto;
}

.results-section .transcript-text {
    padding-bottom: 30px;
}

.results-section .result-item.player-hidden .transcript-text {
    padding-bottom: 16px;
}

@media (max-width: 640px) {
    .results-section .transcript-box {
        --result-transcript-pad-x: 16px;
        --result-transcript-pad-y: 16px;
        --result-player-height: 80px;
        width: 100%;
        margin: 0;
    }
    .results-section .transcript-box .upgrade-banner {
        width: calc(100% + 32px);
        margin-left: -16px;
        margin-right: -16px;
        font-size: 14px;
    }
    .transcript-preview-gate {
        min-height: 220px;
    }
    .transcript-preview-blur {
        padding: 16px 14px 86px;
        font-size: 14px;
    }
    .audio-promo.audio-promo-gated {
        left: 10px;
        right: 10px;
        bottom: 10px;
        padding: 12px;
    }
    .results-section .custom-audio-player {
        width: 100%;
        margin: 0;
        max-width: none;
    }
    .results-section .custom-audio-player {
        padding: 12px 14px;
    }
    .results-section .audio-controls {
        flex-direction: row;
        align-items: center;
        gap: 10px;
    }
    .results-section .audio-time-row {
        flex: 1;
        min-width: 0;
    }
    .results-section .audio-time {
        font-size: 13px;
    }
    .results-section .play-btn {
        width: 40px;
        height: 40px;
    }
    .results-section .player-controls {
        gap: 8px;
    }
    .results-section .volume-button,
    .results-section .speed-button {
        width: 28px;
        height: 28px;
    }
    .results-section .audio-download-btn {
        width: 28px;
        height: 28px;
    }
}


.results-section .transcript-text {
    background: transparent;
    border: none;
    padding: 0;
    padding-bottom: 30px;
    margin: 0;
    font-family: var(--share-font-sans);
    font-size: var(--share-transcript-font-size);
    font-weight: 400;
    line-height: 1.7;
    letter-spacing: 0.002em;
    color: var(--share-text-primary);
    white-space: pre-wrap;
    word-break: break-word;
    max-width: none;
    width: auto;
    margin-left: 0;
    margin-right: 0;
}

.results-section .transcript-text::selection,
.results-section .transcript-text *::selection {
    background: rgba(59, 130, 246, 0.22);
    color: inherit;
}

.results-section .transcript-text .segment-token.segment-active {
    background: rgba(0, 113, 227, 0.11);
    box-shadow: 0 0 0 2.5px rgba(0, 113, 227, 0.11);
    border-radius: 2px;
}

.results-section .transcript-text .segment-token {
    transition: background-color 80ms ease-out, color 150ms ease;
}

body[data-theme="dark"] .results-section .transcript-text .segment-token.segment-active {
    background: rgba(96, 140, 210, 0.26);
    box-shadow: 0 0 0 2.5px rgba(96, 140, 210, 0.26);
}

.results-section .transcript-text.timestamps-mode .ts-time {
    font-family: var(--share-font-sans);
    font-variant-numeric: tabular-nums;
    font-size: 12px;
    font-weight: 400;
    color: #7B8392;
    background: transparent;
    border: none;
    padding: 0;
    border-radius: 0;
    text-decoration: none;
    transition: color 0.15s ease;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
}

.results-section .transcript-text.timestamps-mode .ts-text {
    display: block;
    margin-left: 0;
    margin-top: 1px;
    transition: background-color 80ms ease-out, color 150ms ease;
}

.results-section .transcript-text.speaker-mode {
    white-space: normal;
}

.results-section .transcript-text.speaker-mode .transcript-entry {
    --speaker-entry-color: var(--color-speaker-1);
    display: block;
    box-sizing: border-box;
    position: relative;
    z-index: 0;
    padding: 12px 16px;
    border-left: none;
    transition: background 0.15s ease;
    width: 100%;
    margin-bottom: 3px;
}

@media (min-width: 701px) {
    .results-section .transcript-text.speaker-mode .transcript-entry {
        padding-left: 8px;
        padding-right: 8px;
    }
}

.results-section .transcript-text.speaker-mode .transcript-entry.dropdown-open {
    z-index: 1100;
}

.results-section .transcript-text.speaker-mode .transcript-entry:last-child {
    margin-bottom: 0;
}

.results-section .transcript-text.speaker-mode .transcript-entry:hover {
    background: transparent;
}

.results-section .transcript-text.speaker-mode .transcript-entry[data-speaker="speaker-1"] {
    --speaker-entry-color: var(--color-speaker-1);
}

.results-section .transcript-text.speaker-mode .transcript-entry[data-speaker="speaker-2"] {
    --speaker-entry-color: var(--color-speaker-2);
}

.results-section .transcript-text.speaker-mode .transcript-entry[data-speaker="speaker-3"] {
    --speaker-entry-color: var(--color-speaker-3);
}

.results-section .transcript-text.speaker-mode .transcript-entry[data-speaker="speaker-4"] {
    --speaker-entry-color: var(--color-speaker-4);
}

.results-section .transcript-text.speaker-mode .transcript-entry[data-speaker="speaker-5"] {
    --speaker-entry-color: var(--color-speaker-5);
}

.results-section .transcript-text.speaker-mode .transcript-entry[data-speaker="speaker-6"] {
    --speaker-entry-color: var(--color-speaker-6);
}

.results-section .transcript-text.speaker-mode .transcript-entry[data-speaker="speaker-7"] {
    --speaker-entry-color: var(--color-speaker-7);
}

.results-section .transcript-text.speaker-mode .transcript-entry[data-speaker="speaker-8"] {
    --speaker-entry-color: var(--color-speaker-8);
}

.results-section .transcript-text.speaker-mode .transcript-entry[data-speaker="speaker-9"] {
    --speaker-entry-color: var(--color-speaker-9);
}

.results-section .transcript-text.speaker-mode .transcript-entry[data-speaker="speaker-10"] {
    --speaker-entry-color: var(--color-speaker-10);
}

.results-section .transcript-text.speaker-mode .transcript-entry[data-speaker="speaker-11"] {
    --speaker-entry-color: var(--color-speaker-11);
}

.results-section .transcript-text.speaker-mode .transcript-entry[data-speaker="speaker-12"] {
    --speaker-entry-color: var(--color-speaker-12);
}

.results-section .transcript-text.speaker-mode .transcript-entry[data-speaker="speaker-13"] {
    --speaker-entry-color: var(--color-speaker-13);
}

.results-section .transcript-text.speaker-mode .transcript-entry[data-speaker="speaker-14"] {
    --speaker-entry-color: var(--color-speaker-14);
}

.results-section .transcript-text.speaker-mode .transcript-entry[data-speaker="speaker-15"] {
    --speaker-entry-color: var(--color-speaker-15);
}

.results-section .transcript-text.speaker-mode .transcript-entry.is-playing {
    background: transparent;
}

body[data-theme="dark"] .results-section .transcript-text.speaker-mode .transcript-entry.is-playing {
    background: transparent;
}

.results-section .transcript-text.speaker-mode .speaker-line {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 2px;
}

.results-section .transcript-text.speaker-mode .speaker-wrapper {
    position: relative;
    display: inline-flex;
}

.results-section .transcript-text.speaker-mode .speaker-btn {
    background: none;
    border: none;
    padding: 0;
    font-family: var(--share-font-sans);
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    transition: opacity 0.15s;
    color: var(--speaker-entry-color);
}

.results-section .transcript-text.speaker-mode .speaker-btn:hover {
    opacity: 0.8;
}

.results-section .transcript-text.speaker-mode .speaker-btn .edit-icon {
    opacity: 0;
    transition: opacity 0.15s;
}

.results-section .transcript-text.speaker-mode .speaker-btn:hover .edit-icon {
    opacity: 0.6;
}

.results-section .transcript-text.speaker-mode .timestamp {
    font-family: var(--share-font-sans);
    font-variant-numeric: tabular-nums;
    font-size: 11px;
    font-weight: 400;
    color: #9ca3af;
    background: transparent;
    border: none;
    padding: 0;
    border-radius: 0;
    text-decoration: none;
    transition: color 0.15s ease;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
}

/* Keep speaker-mode timestamp typography exactly aligned with share pages */
.results-section .transcript-text.speaker-mode .timestamp {
    font-family: var(--share-font-sans);
    font-size: 11px;
    font-weight: 400;
    color: #9ca3af;
}

body[data-theme="dark"] .results-section .transcript-text.speaker-mode .timestamp {
    color: #9ca3af;
    background: transparent;
}

.results-section .transcript-text.speaker-mode .timestamp:hover {
    color: #4b5563;
}

body[data-theme="dark"] .results-section .transcript-text.speaker-mode .timestamp:hover {
    color: #cbd5e1;
}

.results-section .transcript-text.speaker-mode .transcript-entry .transcript-text {
    font-family: var(--share-font-sans);
    font-size: var(--share-transcript-font-size);
    line-height: 1.7;
    letter-spacing: 0.002em;
    color: var(--speaker-text);
    margin: 0;
    padding: 0;
}

.speaker-dropdown {
    position: absolute;
    top: calc(100% + 6px);
    left: 0;
    background: #fff;
    border: 1px solid var(--share-border);
    border-radius: 10px;
    box-shadow: 0 4px 16px rgba(0,0,0,0.12), 0 0 0 1px rgba(0,0,0,0.02);
    padding: 14px;
    min-width: 240px;
    z-index: 1000;
    display: none;
}

body[data-theme="dark"] .speaker-dropdown {
    background: #111113;
    border-color: var(--speaker-border);
    box-shadow: 0 4px 18px rgba(0, 0, 0, 0.5);
}

.speaker-dropdown.show {
    display: block;
    animation: dropIn 0.15s ease;
}

.results-section .transcript-text.speaker-mode .transcript-entry.dropdown-open .speaker-dropdown.show {
    z-index: 1101;
}

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

.dropdown-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
}

.dropdown-title {
    font-size: 12px;
    font-weight: 600;
    color: var(--share-text-primary);
}

.dropdown-close {
    background: none;
    border: none;
    padding: 4px;
    cursor: pointer;
    color: var(--share-text-muted);
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.dropdown-close:hover {
    background: #f3f4f6;
    color: #374151;
}

body[data-theme="dark"] .dropdown-close:hover {
    background: rgba(255, 255, 255, 0.08);
    color: #e5e7eb;
}

.dropdown-input {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--share-border);
    border-radius: 6px;
    font-size: 14px;
    font-family: var(--share-font-sans);
    outline: none;
    margin-bottom: 12px;
    transition: border-color 0.15s, box-shadow 0.15s;
    background: transparent;
    color: var(--share-text-primary);
}

.dropdown-input:focus {
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.18);
}

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

.dropdown-save {
    flex: 1;
    padding: 10px 14px;
    background: #3b82f6;
    border: none;
    border-radius: 6px;
    color: #fff;
    font-size: 13px;
    font-weight: 500;
    font-family: var(--share-font-sans);
    cursor: pointer;
    transition: background 0.15s;
}

.dropdown-save:hover {
    background: #2563eb;
}

.dropdown-cancel {
    padding: 10px 14px;
    background: #f3f4f6;
    border: none;
    border-radius: 6px;
    color: #6b7280;
    font-size: 13px;
    font-family: var(--share-font-sans);
    cursor: pointer;
    transition: background 0.15s;
}

.dropdown-cancel:hover {
    background: #e5e7eb;
}

body[data-theme="dark"] .dropdown-cancel {
    background: rgba(255, 255, 255, 0.08);
    color: #d4d4d8;
}

body[data-theme="dark"] .dropdown-cancel:hover {
    background: rgba(255, 255, 255, 0.14);
}

body[data-theme="dark"] .dropdown-title {
    color: #f3f4f6;
}

body[data-theme="dark"] .dropdown-input {
    background: rgba(255, 255, 255, 0.04);
    border-color: rgba(255, 255, 255, 0.16);
    color: #f3f4f6;
}

body[data-theme="dark"] .dropdown-input::placeholder {
    color: #8f96a9;
}

body[data-theme="dark"] .dropdown-save {
    background: #3557c4;
    border-color: #4165d3;
    color: #eef2ff;
}

body[data-theme="dark"] .dropdown-save:hover {
    background: #2d49a5;
    border-color: #3a57bd;
}

.dropdown-note {
    font-size: 11px;
    color: var(--share-text-muted);
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid #f3f4f6;
    display: flex;
    align-items: center;
    gap: 6px;
}

body[data-theme="dark"] .dropdown-note {
    border-top-color: rgba(255, 255, 255, 0.12);
}

.dropdown-overlay {
    position: fixed;
    inset: 0;
    z-index: 999;
    display: none;
}

.dropdown-overlay.show {
    display: block;
}


.results-section .audio-player {
    position: sticky;
    bottom: 0;
    z-index: 60;
    margin-top: 0;
    margin-left: calc(-1 * var(--result-transcript-pad-x));
    margin-right: calc(-1 * var(--result-transcript-pad-x));
    padding: 0;
    width: calc(100% + (2 * var(--result-transcript-pad-x)));
    max-width: none;
    min-width: 0;
    pointer-events: none;
}

.results-section .custom-audio-player {
    padding: 14px 18px;
    background: var(--share-player-bg);
    border: none;
    border-top: 1px solid var(--share-border);
    border-radius: 0 0 var(--share-radius-lg) var(--share-radius-lg);
    backdrop-filter: blur(8px);
    gap: 14px;
    width: 100%;
    margin: 0 auto;
    pointer-events: auto;
}

.results-section .audio-player.player-stuck .custom-audio-player {
    border-bottom-left-radius: 0 !important;
    border-bottom-right-radius: 0 !important;
}

.results-section .audio-player.player-stuck {
    border-bottom-left-radius: 0 !important;
    border-bottom-right-radius: 0 !important;
}

.results-section .play-btn {
    width: 44px;
    height: 44px;
    box-shadow: none;
    background: var(--share-accent);
}

.results-section .play-btn:hover {
    background: var(--share-accent-hover);
    box-shadow: none;
}

.results-section .audio-time {
    font-family: var(--share-font-mono);
    color: var(--share-text-muted);
}

.results-section .audio-controls {
    display: flex;
    align-items: center;
    gap: 14px;
    width: 100%;
}

.results-section .audio-time-row {
    margin-bottom: 0;
    flex: 1;
    min-width: 0;
    display: grid;
    grid-template-columns: 1fr 1fr;
    grid-template-areas:
        "bar bar"
        "cur dur";
    row-gap: 8px;
    column-gap: 10px;
}

.results-section .audio-seek-buttons {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin-top: 6px;
}

.results-section .audio-seek-btn {
    width: 28px;
    height: 28px;
    border-radius: 6px;
    border: 1px solid var(--share-border-strong);
    background: transparent;
    color: var(--share-text-secondary);
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.results-section .audio-seek-btn:hover {
    background: var(--share-bg-elevated);
    color: var(--share-text-primary);
}

@media (max-width: 640px) {
    .results-section .audio-seek-buttons {
        display: none;
    }
}
.results-section .audio-progress-wrapper {
    grid-area: bar;
}

.results-section .audio-time.current {
    grid-area: cur;
    text-align: left;
}

.results-section .audio-time.duration {
    grid-area: dur;
    text-align: right;
}

.results-section .audio-bottom-row {
    justify-content: flex-end;
    gap: 10px;
    margin-left: 0;
    width: auto;
    flex-shrink: 0;
}

.results-section .audio-progress-wrapper {
    background: #e5e7eb;
}

.results-section .audio-progress {
    background: #2563EB;
}

.results-section .speed-select,
.results-section .volume-btn,
.results-section .audio-download-btn {
    background: transparent;
    color: var(--share-text-secondary);
}

.results-section .speed-select {
    border: 1px solid var(--share-border-strong);
}

.results-section .audio-download-btn {
    width: 30px;
    height: 30px;
    border: 1px solid var(--share-border-strong);
    border-radius: var(--share-radius-sm);
}

.results-section .audio-download-btn svg {
    width: 14px;
    height: 14px;
}

.results-section .player-controls {
    display: flex;
    align-items: center;
    gap: 10px;
}

.results-section .volume-control {
    position: relative;
    display: flex;
    align-items: center;
}

.results-section .volume-button {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: 1px solid var(--share-border-strong);
    background: transparent;
    color: var(--share-text-secondary);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}

.results-section .volume-button svg {
    width: 16px;
    height: 16px;
}

.results-section .volume-slider {
    width: 90px;
    display: none;
    position: absolute;
    bottom: 78px;
    left: 50%;
    transform: translateX(-50%) rotate(-90deg);
    transform-origin: center;
    background: rgba(37, 99, 235, 0.24);
    accent-color: #2563EB;
}

.results-section .volume-slider.visible {
    display: block;
    background: rgba(37, 99, 235, 0.24);
    accent-color: #2563EB;
}

.results-section .speed-control {
    position: relative;
    display: flex;
    align-items: center;
}

.results-section .speed-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border: 1px solid var(--share-border-strong);
    background: transparent;
    color: var(--share-text-secondary);
    border-radius: var(--share-radius-sm);
    cursor: pointer;
}

.results-section .speed-button svg {
    width: 14px;
    height: 14px;
}

.results-section .speed-menu {
    position: absolute;
    bottom: 38px;
    right: 0;
    background: var(--share-bg-elevated);
    border: 1px solid var(--share-border-strong);
    border-radius: var(--share-radius-md);
    box-shadow: var(--shadow-md);
    display: none;
    min-width: 80px;
    z-index: 10;
}

.results-section .speed-control.open .speed-menu {
    display: block;
}

.results-section .speed-option {
    display: block;
    width: 100%;
    padding: 6px 10px;
    background: none;
    border: none;
    color: var(--share-text-secondary);
    text-align: left;
    cursor: pointer;
    font-size: 13px;
}

.results-section .speed-option:hover {
    background: var(--share-bg-elevated);
    color: var(--share-text-primary);
}

.results-section .volume-btn:hover,
.results-section .audio-download-btn:hover {
    background: var(--share-bg-elevated);
    color: var(--share-text-primary);
}

/* Result close button */

.result-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
    padding-right: 40px;
}

.result-title {
    font-size: 14px;
    font-weight: 600;
    color: var(--gray-800);
}

.result-title .title-text {
    display: inline;
}

.result-title .result-name {
    white-space: normal;
    font-size: 16px;
    font-weight: 500;
}

.result-title .result-rename-btn {
    margin-left: 6px;
    vertical-align: middle;
}

.result-name-input {
    font-size: inherit;
    font-weight: 600;
    padding: 4px 8px;
    border: 1px solid var(--gray-300);
    border-radius: 6px;
    width: 420px;
    max-width: 100%;
}

.results-section .result-name-input {
    font-size: calc(1em - 2px);
    font-weight: 500;
}

.result-rename-controls {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-left: 6px;
}

.result-rename-confirm,
.result-rename-cancel {
    width: 26px;
    height: 26px;
    border-radius: 6px;
    border: 1px solid var(--gray-200);
    background: white;
    color: var(--gray-600);
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.result-rename-confirm {
    color: #16a34a;
    border-color: rgba(34, 197, 94, 0.3);
}

.result-rename-cancel {
    color: #dc2626;
    border-color: rgba(239, 68, 68, 0.3);
}

.result-rename-confirm:hover {
    border-color: rgba(34, 197, 94, 0.6);
}

.result-rename-cancel:hover {
    border-color: rgba(239, 68, 68, 0.6);
}

.result-rename-controls svg {
    width: 14px;
    height: 14px;
}

@media (max-width: 640px) {
    .result-name-input {
        width: 280px;
        max-width: 100%;
    }
}

.result-title .result-rename-btn {
    border: none;
    background: transparent;
    color: var(--gray-500);
    cursor: pointer;
    padding: 2px;
    border-radius: 4px;
}

.result-title .result-rename-btn:hover {
    background: var(--gray-100);
    color: var(--gray-700);
}

.result-title .result-rename-btn svg {
    width: 14px;
    height: 14px;
}

.upgrade-banner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 10px 12px;
    border: 1px dashed var(--gray-200);
    border-radius: var(--radius-sm);
    background: #fff7ed;
    color: #9a3412;
    font-size: 13px;
    margin-bottom: 50px;
}

body[data-theme="dark"] .upgrade-banner {
    border-color: rgba(255, 255, 255, 0.18);
    background: rgba(234, 88, 12, 0.12);
    color: #fdba74;
}

body[data-theme="dark"] .upgrade-banner .upgrade-btn {
    background: #f97316;
}

body[data-theme="dark"] .upgrade-banner .upgrade-btn:hover {
    background: #ea580c;
}

.transcript-box .transcript-text + .upgrade-banner {
    margin-top: 30px;
}

@media (min-width: 641px) {
    .results-section .upgrade-banner {
        font-size: 14px;
    }
}

.upgrade-btn {
    background: #ea580c;
    color: white;
    text-decoration: none;
    padding: 6px 10px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 600;
    white-space: nowrap;
}

.upgrade-btn:hover {
    background: #c2410c;
}

/* Transcript actions */
.transcript-actions {
    display: grid;
    gap: 8px;
    margin-bottom: 32px;
    grid-template-columns: repeat(4, minmax(0, 1fr));
}

.transcript-actions > * {
    width: 100%;
}

.transcript-actions .btn {
    padding: 6px 10px;
    font-size: 14px;
    position: relative;
    width: 100%;
}

.transcript-actions .btn-copy {
    padding-left: 9px;
    padding-right: 9px;
}

.transcript-actions .btn-translate {
    padding-left: 11px;
    padding-right: 11px;
}

.transcript-actions .btn svg {
    width: 14px;
    height: 14px;
}

/* Download menu */
.download-menu-wrapper {
    position: relative;
    display: inline-block;
}

.transcript-actions .copy-menu-wrapper,
.transcript-actions .download-menu-wrapper {
    width: 100%;
    display: block;
}

.share-view:not(.share-view-only) .transcript-actions {
    display: flex;
    flex-direction: column;
    gap: 10px;
    overflow: visible;
    grid-template-columns: none;
}

.share-view:not(.share-view-only) .transcript-actions > * {
    width: 100%;
}

.share-view:not(.share-view-only) .transcript-actions .share-action-buttons {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
}

.share-view:not(.share-view-only) .transcript-actions .share-action-buttons .btn {
    width: auto;
}

.share-view:not(.share-view-only) .transcript-actions .copy-menu-wrapper,
.share-view:not(.share-view-only) .transcript-actions .download-menu-wrapper {
    width: auto;
}

.share-view:not(.share-view-only) .transcript-actions .share-toggle-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 12px 14px;
}

.share-view:not(.share-view-only) .transcript-actions .share-toggle-row .toggle-item {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.share-view:not(.share-view-only) .transcript-actions .share-toggle-row .toggle-label {
    font-size: 13px;
    font-weight: 400;
    color: var(--share-text-secondary);
    white-space: nowrap;
}

.share-view:not(.share-view-only) .transcript-actions .share-toggle-row .toggle-label-player .label-mobile {
    display: none;
}

.share-view:not(.share-view-only) .transcript-actions .share-toggle-row .toggle {
    --share-toggle-width: 42px;
    --share-toggle-height: 20.4px; /* 15% shorter than 24px */
    --share-toggle-pad: 2px;
    --share-toggle-knob: calc(var(--share-toggle-height) - (var(--share-toggle-pad) * 2));
    --share-toggle-shift: calc(var(--share-toggle-width) - var(--share-toggle-knob) - (var(--share-toggle-pad) * 2));
    width: 42px;
    height: var(--share-toggle-height);
    background: #e5e7eb;
    border-radius: calc(var(--share-toggle-height) / 2);
    position: relative;
    cursor: pointer;
    transition: background 0.2s ease;
    border: none;
    flex-shrink: 0;
}

.share-view:not(.share-view-only) .transcript-actions .share-toggle-row .toggle.on {
    background: #3b82f6;
}

.share-view:not(.share-view-only) .transcript-actions .share-toggle-row .toggle::after {
    content: '';
    position: absolute;
    width: var(--share-toggle-knob);
    height: var(--share-toggle-knob);
    background: #ffffff;
    border-radius: 50%;
    top: var(--share-toggle-pad);
    left: var(--share-toggle-pad);
    transition: transform 0.2s ease;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}

.share-view:not(.share-view-only) .transcript-actions .share-toggle-row .toggle.on::after {
    transform: translateX(var(--share-toggle-shift));
}

@media (max-width: 640px) {
    .share-view:not(.share-view-only) .transcript-actions .share-toggle-row .toggle-label-player .label-full {
        display: none;
    }

    .share-view:not(.share-view-only) .transcript-actions .share-toggle-row .toggle-label-player .label-mobile {
        display: inline;
    }
}


body.share-view:not(.share-view-only):not(.reader-mode):not(.reading-mode):not(.share-reader):not(.share-reader-mode):not([data-reader="true"]):not([data-reader-mode="true"]) .page-header,
body.share-view:not(.share-view-only):not(.reader-mode):not(.reading-mode):not(.share-reader):not(.share-reader-mode):not([data-reader="true"]):not([data-reader-mode="true"]) .page-header-content {
    text-align: left;
    justify-content: flex-start;
    align-items: flex-start;
}

.share-view-only .transcript-actions > *,
.share-view-only .action-buttons > * {
    display: none;
}

.share-view-only .transcript-actions .action-hide-player,
.share-view-only .action-buttons .action-hide-player {
    display: inline-flex;
}


.download-menu {
    position: absolute;
    top: 100%;
    left: 0;
    margin-top: 4px;
    background: white;
    border: 1px solid var(--gray-200);
    border-radius: var(--radius-sm);
    box-shadow: var(--shadow-lg);
    min-width: 150px;
    z-index: 100;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-4px);
    transition: all 0.15s ease;
}

.download-menu-divider {
    height: 1px;
    margin: 6px 8px;
    background: var(--gray-200);
}

.download-menu.visible {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.download-menu-item {
    display: block;
    width: 100%;
    padding: 8px 12px;
    font-size: 15px;
    color: var(--gray-700);
    background: none;
    border: none;
    text-align: left;
    cursor: pointer;
    transition: background 0.1s;
}

.download-menu-item:hover {
    background: var(--gray-50);
}

.download-menu-item:first-child {
    border-radius: var(--radius-sm) var(--radius-sm) 0 0;
}

.download-menu-item:last-child {
    border-radius: 0 0 var(--radius-sm) var(--radius-sm);
}

/* Copy menu */
.copy-menu-wrapper {
    position: relative;
    display: inline-block;
}

.copy-menu {
    position: absolute;
    top: 100%;
    left: 0;
    margin-top: 4px;
    background: white;
    border: 1px solid var(--gray-200);
    border-radius: var(--radius-sm);
    box-shadow: var(--shadow-lg);
    min-width: 200px;
    z-index: 100;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-4px);
    transition: all 0.15s ease;
}

.copy-menu.visible {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.copy-menu-item {
    display: block;
    width: 100%;
    padding: 8px 12px;
    font-size: 16px;
    color: var(--gray-700);
    background: none;
    border: none;
    text-align: left;
    cursor: pointer;
    transition: background 0.1s;
}

.copy-menu-item:hover {
    background: var(--gray-50);
}

.copy-menu-divider {
    height: 1px;
    background: var(--gray-200);
    margin: 6px 0;
}

.transcript-box {
    position: relative;
}

.transcript-text {
    background: var(--gray-50);
    border: 1px solid var(--gray-200);
    border-radius: var(--radius-sm);
    padding: 16px;
    font-size: 17px;
    line-height: 1.8;
    color: var(--gray-700);
    max-height: none;
    overflow: visible;
    white-space: pre-wrap;
    word-break: break-word;
}

.transcript-text p {
    margin: 0;
}

.transcript-text p:last-child {
    margin-bottom: 0;
}

.results-section .transcript-text:not(.speaker-mode):not(.timestamps-mode):not(.summary-mode) > p {
    margin: 0 0 19px;
}

.results-section .transcript-text:not(.speaker-mode):not(.timestamps-mode):not(.summary-mode) > p:last-child {
    margin-bottom: 0;
}

.results-section .transcript-text:not(.speaker-mode):not(.timestamps-mode):not(.summary-mode) > p + br {
    display: none;
}

.transcript-text .highlight-mark {
    background: var(--highlight-yellow);
    border-radius: 4px;
    padding: 0 2px;
    margin: 0 -2px;
}

.transcript-text .segment-token .highlight-mark,
.transcript-text .segment-token + .highlight-mark {
    padding: 0;
    margin: 0;
    border-radius: 0;
}

body[data-theme="dark"] .transcript-text .highlight-mark {
    color: var(--gray-800);
}

.transcript-text .highlight-mark[data-color="yellow"] {
    background: var(--highlight-yellow);
}

.transcript-text .highlight-mark[data-color="green"] {
    background: var(--highlight-green);
}

.transcript-text .highlight-mark[data-color="blue"] {
    background: var(--highlight-blue);
}

.transcript-text .highlight-mark[data-color="pink"] {
    background: var(--highlight-pink);
}

.highlight-toolbar {
    position: fixed;
    z-index: 50;
    display: inline-flex;
    gap: 6px;
    padding: 6px 8px;
    background: var(--highlight-toolbar-bg);
    border: 1px solid var(--highlight-toolbar-border);
    border-radius: 12px;
    box-shadow: var(--shadow-md);
    opacity: 0;
    pointer-events: none;
    transform: translate(-50%, -6px) scale(0.98);
    transition: opacity 0.12s ease, transform 0.12s ease;
}

.highlight-toolbar.visible {
    opacity: 1;
    pointer-events: auto;
    transform: translate(-50%, -12px) scale(1);
}

.highlight-btn {
    width: 22px;
    height: 22px;
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.28);
    background: transparent;
    cursor: pointer;
}

.highlight-btn[data-color="yellow"] {
    background: var(--highlight-yellow);
}

.highlight-btn[data-color="green"] {
    background: var(--highlight-green);
}

.highlight-btn[data-color="blue"] {
    background: var(--highlight-blue);
}

.highlight-btn[data-color="pink"] {
    background: var(--highlight-pink);
}

.highlight-btn.is-clear {
    color: #e2e8f0;
    font-size: 11px;
    font-weight: 600;
    background: rgba(148, 163, 184, 0.14);
    border-color: rgba(148, 163, 184, 0.45);
}

@media (min-width: 641px) {
    .transcript-text {
        font-size: 16px;
    }
}
.transcript-text.editing {
    outline: 2px solid var(--primary);
    background: #ffffff;
}

.results-section .transcript-text.editing {
    background: transparent;
    outline: none;
    box-shadow: none;
}

.transcript-text.timestamps-mode {
    line-height: 1.6;
}

.transcript-text.timestamps-mode .ts-line {
    margin-bottom: 11px;
}

.transcript-text.summary-mode {
    white-space: normal;
}

.transcript-text.summary-mode .summary-view-header {
    line-height: normal;
    margin-bottom: 20px;
}

.transcript-text.summary-mode .summary-view-segment {
    display: inline-flex;
    background: rgba(0, 0, 0, 0.04);
    border-radius: 10px;
    padding: 3px;
    gap: 2px;
}

.transcript-text.summary-mode .summary-view-toggle {
    appearance: none;
    border: 0;
    background: transparent;
    color: #999;
    border-radius: 8px;
    padding: 6px 20px;
    font-size: 13.5px;
    font-weight: 400;
    letter-spacing: -0.01em;
    line-height: 1.2;
    cursor: pointer;
    transition: all 0.16s ease;
}

.transcript-text.summary-mode .summary-view-toggle.is-active {
    background: #fff;
    color: #1a1a1a;
    font-weight: 600;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}

.transcript-text.summary-mode .summary-view-toggle.is-loading {
    opacity: 0.7;
    cursor: wait;
}

.transcript-text.summary-mode .summary-view-body {
    min-width: 0;
    margin: 0;
    padding: 0;
}

.transcript-text.summary-mode .summary-view-body-qa {
    display: grid;
    row-gap: 13px;
    margin: 0;
    padding: 0;
}

.transcript-text.summary-mode .summary-qa-item {
    border: 0;
    border-radius: 12px;
    overflow: hidden;
    background: var(--share-bg-secondary);
    margin: 0;
}

.transcript-text.summary-mode .summary-qa-row {
    display: flex;
    gap: 10px;
    align-items: start;
    padding: 14px 16px 12px;
    line-height: normal;
}

.transcript-text.summary-mode .summary-qa-answer {
    padding: 12px 16px 14px;
}

.transcript-text.summary-mode .summary-qa-divider {
    height: 1px;
    background: #f2f2f2;
    margin: 0 16px;
}

.transcript-text.summary-mode .summary-qa-badge {
    display: inline-flex;
    width: 20px;
    height: 20px;
    border-radius: 6px;
    align-items: center;
    justify-content: center;
    margin-top: 1px;
    font-size: 10px;
    font-weight: 700;
    line-height: 1;
}

.transcript-text.summary-mode .summary-qa-badge-q {
    background: #eef3ff;
    color: #3b6fe8;
}

.transcript-text.summary-mode .summary-qa-badge-a {
    background: #f5f5f5;
    color: #bbb;
}

.transcript-text.summary-mode .summary-qa-item-label {
    text-transform: uppercase;
}

.transcript-text.summary-mode .summary-qa-question-text {
    display: block;
    font-size: clamp(14px, 2.4vw, 15px) !important;
    font-weight: 600;
    font-family: inherit;
    color: #1a1a1a;
    line-height: 1.7;
    letter-spacing: 0.002em;
}

.transcript-text.summary-mode .summary-qa-question-timestamps {
    display: inline-flex;
    gap: 6px;
    flex-wrap: wrap;
    align-items: baseline;
    line-height: 1.7;
}

.transcript-text.summary-mode .summary-qa-question-timestamps .timestamp {
    font-family: var(--share-font-sans);
    font-variant-numeric: tabular-nums;
    font-size: 12px;
    font-weight: 400;
    color: #7B8392;
    background: transparent;
    border: none;
    padding: 0;
    border-radius: 0;
    text-decoration: none;
    transition: color 0.15s ease;
    cursor: pointer;
    user-select: none;
    display: inline-block;
    line-height: 1.7;
    vertical-align: baseline;
}

.transcript-text.summary-mode .summary-qa-answer-text {
    display: block;
    font-size: clamp(14px, 2.4vw, 15px) !important;
    font-family: inherit;
    color: #555;
    line-height: 1.7;
    letter-spacing: 0.002em;
}

.transcript-text.summary-mode .summary-qa-loading,
.transcript-text.summary-mode .summary-qa-empty {
    color: #777;
    font-size: 13.5px;
}

.transcript-text.summary-mode .summary-qa-more {
    display: flex;
    justify-content: center;
    padding-top: 4px;
}

.transcript-text.summary-mode .summary-qa-show-more {
    appearance: none;
    border: 1px solid #dadce0;
    border-radius: 999px;
    background: #fff;
    color: #374151;
    font-size: 12.5px;
    font-family: inherit;
    font-weight: 600;
    line-height: 1.2;
    padding: 7px 14px;
    cursor: pointer;
}

.transcript-text.summary-mode .summary-qa-show-more:hover {
    background: #f8fafc;
}

body[data-theme="dark"] .transcript-text.summary-mode .summary-view-segment {
    background: rgba(255, 255, 255, 0.08);
}

body[data-theme="dark"] .transcript-text.summary-mode .summary-view-toggle {
    color: #9ca3af;
}

body[data-theme="dark"] .transcript-text.summary-mode .summary-view-toggle.is-active {
    background: #1f2937;
    color: #f3f4f6;
    box-shadow: none;
}

body[data-theme="dark"] .transcript-text.summary-mode .summary-qa-item {
    border: 0;
    background: inherit;
}

body[data-theme="dark"] .transcript-text.summary-mode .summary-qa-badge-q {
    background: rgba(59, 130, 246, 0.22) !important;
    color: #bfdbfe !important;
}

body[data-theme="dark"] .transcript-text.summary-mode .summary-qa-badge-a {
    background: rgba(255, 255, 255, 0.08) !important;
    color: #d1d5db !important;
}

body[data-theme="dark"] .transcript-text.summary-mode .summary-qa-divider {
    background: rgba(255, 255, 255, 0.08) !important;
}

body[data-theme="dark"] .transcript-text.summary-mode .summary-qa-question-text {
    color: #f3f4f6 !important;
}

body[data-theme="dark"] .transcript-text.summary-mode .summary-qa-question-timestamps .timestamp {
    color: #667085;
    background: transparent;
}

.transcript-text.summary-mode .summary-qa-question-timestamps .timestamp:hover {
    color: #4b5563;
}

body[data-theme="dark"] .transcript-text.summary-mode .summary-qa-question-timestamps .timestamp:hover {
    color: #cbd5e1;
}

body[data-theme="dark"] .transcript-text.summary-mode .summary-qa-answer-text {
    color: #d1d5db !important;
}

body[data-theme="dark"] .transcript-text.summary-mode .summary-qa-show-more {
    border-color: rgba(255, 255, 255, 0.2);
    background: #111827;
    color: #e5e7eb;
}

.transcript-text.summary-mode .summary-line {
    margin-bottom: 10px;
}

.transcript-text.summary-mode .summary-line {
    display: grid;
    grid-template-columns: 8px 1fr;
    column-gap: 8px;
    row-gap: 6px;
    align-items: start;
}

.transcript-text.summary-mode .summary-line.summary-text-line,
.transcript-text.summary-mode .summary-line.summary-section-title {
    display: block;
}

.transcript-text.summary-mode .summary-line.summary-section-title {
    font-weight: 600;
    color: var(--gray-900);
    font-size: clamp(14.5px, 2.5vw, 15.5px);
    line-height: 1.45;
    letter-spacing: 0.004em;
}

.transcript-text.summary-mode .summary-line.summary-section-title:not(:first-child) {
    padding-top: 15px;
}

.transcript-text.summary-mode .summary-line .summary-bullet {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--primary-blue);
    opacity: 0.45;
    grid-row: 1 / span 2;
    margin-top: 0.35em;
}

.transcript-text.summary-mode .summary-line .summary-line-text {
    grid-column: 2;
    min-width: 0;
    font-size: clamp(14px, 2.4vw, 15px);
}

.transcript-text.summary-mode .summary-line .summary-detail {
    grid-column: 2;
}

.transcript-text.summary-mode .summary-detail {
    display: inline-flex;
    align-items: center;
}

.transcript-text.summary-mode .summary-detail summary {
    list-style: none;
    cursor: pointer;
    font-size: 11px;
    line-height: 1;
    color: var(--gray-600);
    border: 1px solid var(--gray-300);
    border-radius: 999px;
    padding: 3px 8px;
    background: var(--gray-50);
}

.transcript-text.summary-mode .summary-detail summary::-webkit-details-marker {
    display: none;
}

.transcript-text.summary-mode .summary-detail[open] summary {
    color: var(--gray-700);
    border-color: var(--gray-400);
    background: var(--gray-100);
}

.transcript-text.summary-mode .summary-detail span {
    margin-left: 6px;
    font-size: 12px;
    color: var(--gray-600);
}

.transcript-text.summary-mode .summary-line:last-child {
    margin-bottom: 0;
}

.transcript-text.timestamps-mode .ts-line:last-child {
    margin-bottom: 0;
}

.speaker-rename-menu {
    position: absolute;
    z-index: 1000;
    background: #fff;
    border: 1px solid rgba(15, 23, 42, 0.12);
    border-radius: 10px;
    padding: 6px;
    box-shadow: 0 12px 24px rgba(15, 23, 42, 0.12);
    display: none;
}
.speaker-rename-menu.visible { display: block; }
.speaker-rename-btn {
    background: #fff;
    border: 1px solid rgba(15, 23, 42, 0.12);
    border-radius: 8px;
    padding: 6px 10px;
    font-size: 13px;
    cursor: pointer;
}

.transcript-text.timestamps-mode .ts-time {
    font-family: var(--share-font-sans);
    font-variant-numeric: tabular-nums;
    font-size: 12px;
    font-weight: 400;
    color: #7B8392;
    background: transparent;
    border: none;
    padding: 0;
    border-radius: 0;
    text-decoration: none;
    transition: color 0.15s ease;
    cursor: pointer;
    user-select: none;
    display: inline-flex;
    align-items: center;
}

.transcript-text.timestamps-mode .ts-line {
    cursor: default;
}
.transcript-text.timestamps-mode .ts-text {
    cursor: text;
    margin-top: 1px;
    transition: background-color 80ms ease-out, color 150ms ease;
}

.transcript-text.timestamps-mode .ts-line.segment-active .ts-text {
    background: rgba(0, 113, 227, 0.11);
    box-shadow: 0 0 0 2.5px rgba(0, 113, 227, 0.11);
    border-radius: 2px;
}

[data-theme="dark"] .transcript-text.timestamps-mode .ts-time {
    color: #667085;
    background: transparent;
}

[data-theme="dark"] .transcript-text.timestamps-mode .ts-line.segment-active .ts-text {
    background: rgba(96, 140, 210, 0.26);
    box-shadow: 0 0 0 2.5px rgba(96, 140, 210, 0.26);
}

.transcript-text.timestamps-mode .ts-time:hover {
    color: #4b5563;
}

[data-theme="dark"] .transcript-text.timestamps-mode .ts-time:hover {
    color: #cbd5e1;
}

/* Custom Audio Player */
.audio-player {
    margin-top: 16px;
}

.audio-promo {
    margin-top: 12px;
    margin-bottom: 50px;
    text-align: center;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
}

.transcript-preview-gate {
    position: relative;
    margin-top: 14px;
    margin-bottom: 50px;
    border: 1px solid var(--share-border);
    border-radius: 14px;
    overflow: hidden;
    min-height: 240px;
    background: linear-gradient(180deg, rgba(15, 23, 42, 0.04), rgba(15, 23, 42, 0.08));
}

.transcript-preview-blur {
    padding: 20px 24px 92px;
    font-family: var(--share-font-sans);
    font-size: 15px;
    line-height: 1.7;
    color: var(--share-text-primary);
    opacity: 0.92;
    white-space: pre-wrap;
    user-select: none;
    pointer-events: none;
    filter: blur(9px);
}

.audio-promo.audio-promo-gated {
    position: absolute;
    left: 16px;
    right: 16px;
    bottom: 14px;
    margin: 0;
    padding: 14px 16px;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.96);
    border: 1px solid rgba(229, 231, 235, 0.95);
    box-shadow: 0 12px 28px rgba(15, 23, 42, 0.12);
    backdrop-filter: blur(6px);
}

.audio-promo-kicker {
    margin-top: 0;
    margin-bottom: 2px;
    font-weight: 600;
}

.audio-promo-title {
    font-size: 16px;
    font-weight: 600;
    color: var(--gray-900);
}

.audio-promo-subtitle {
    font-size: 13px;
    color: var(--gray-500);
    margin-top: 4px;
}

.audio-promo-btn {
    margin-top: 10px;
    padding: 10px 20px;
    font-size: 18px;
}

.custom-audio-player {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px;
    background: linear-gradient(135deg, var(--gray-50) 0%, #f0f4f8 100%);
    border-radius: var(--radius);
    border: 1px solid var(--gray-200);
}

body[data-theme="dark"] .upload-card,
body[data-theme="dark"] .dropzone,
body[data-theme="dark"] .download-menu,
body[data-theme="dark"] .copy-menu,
body[data-theme="dark"] .upload-status,
body[data-theme="dark"] .file-item,
body[data-theme="dark"] .result-item,
body[data-theme="dark"] .transcript-box,
body[data-theme="dark"] .transcript-text,
body[data-theme="dark"] .custom-audio-player {
    background: var(--bg-secondary);
    border-color: var(--border);
    color: var(--text-primary);
}

body[data-theme="dark"] .custom-audio-player {
    background: var(--bg-elevated);
}

body[data-theme="dark"] .audio-promo-title {
    color: var(--text-primary);
}

body[data-theme="dark"] .audio-promo-subtitle {
    color: var(--text-secondary);
}

body[data-theme="dark"] .transcript-preview-gate {
    border-color: rgba(255, 255, 255, 0.12);
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.03), rgba(255, 255, 255, 0.08));
}

body[data-theme="dark"] .transcript-preview-blur {
    color: rgba(228, 228, 231, 0.88);
}

body[data-theme="dark"] .audio-promo.audio-promo-gated {
    background: rgba(17, 24, 39, 0.94);
    border-color: rgba(255, 255, 255, 0.16);
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.4);
}

body[data-theme="dark"] .btn-outline:hover {
    background: var(--bg-hover);
    border-color: var(--border-strong);
    color: var(--text-primary);
}

body[data-theme="dark"] .dropzone:hover:not(.collapsed),
body[data-theme="dark"] .dropzone.dragover {
    background: var(--bg-hover);
    border-color: var(--border-strong);
}

body[data-theme="dark"] .dropzone {
    background: var(--bg-secondary);
    border-color: var(--border);
}

body[data-theme="dark"] .upload-card .btn-primary,
body[data-theme="dark"] #startBtn.btn-success:not(:disabled) {
    background: var(--m-accent);
    border-color: var(--m-accent);
    color: #fff;
}

body[data-theme="dark"] .upload-card .btn-primary:hover,
body[data-theme="dark"] #startBtn.btn-success:hover:not(:disabled) {
    background: var(--m-accent-hover);
    border-color: var(--m-accent-hover);
}

body[data-theme="dark"] .job-item {
    background: var(--bg-secondary);
    border-color: var(--border);
    color: var(--text-primary);
}

body[data-theme="dark"] .job-item:hover {
    background: var(--bg-hover);
    border-color: var(--border-strong);
}

body[data-theme="dark"] .job-item.selected,
body[data-theme="dark"] .job-item.drag-over {
    background: rgba(37, 99, 235, 0.18);
    border-color: rgba(59, 130, 246, 0.6);
}

body[data-theme="dark"] .job-name {
    color: #e4e4e7;
}

body[data-theme="dark"] .job-meta,
body[data-theme="dark"] .job-status-text {
    color: var(--text-muted);
}

body[data-theme="dark"] .job-status-icon.done {
    background: rgba(34, 197, 94, 0.18);
    color: #86efac;
}

body[data-theme="dark"] .btn-merge {
    background: var(--bg-secondary);
    border-color: var(--border-strong);
    color: var(--text-secondary);
}

body[data-theme="dark"] .btn-merge:hover:not(:disabled) {
    background: var(--bg-hover);
    color: var(--text-primary);
}

body[data-theme="dark"] .merge-status-text {
    color: var(--text-secondary);
}

body[data-theme="dark"] .merge-list-item {
    background: var(--bg-secondary);
    border-color: var(--border);
}

body[data-theme="dark"] .merge-list-index {
    background: rgba(255, 255, 255, 0.08);
    color: var(--text-secondary);
}

body[data-theme="dark"] .merge-list-name {
    color: var(--text-primary);
}

body[data-theme="dark"] .merge-shift-btn {
    background: var(--bg-secondary);
    border-color: var(--border-strong);
    color: var(--text-secondary);
}

body[data-theme="dark"] .merge-shift-btn:hover:not(:disabled) {
    background: var(--bg-hover);
    color: var(--text-primary);
}

body[data-theme="dark"] .result-title {
    color: var(--text-primary);
}

body[data-theme="dark"] .result-title .result-name {
    color: var(--text-secondary);
}

body[data-theme="dark"] .result-name-input {
    background: var(--bg-secondary);
    color: var(--text-primary);
    border-color: var(--border-strong);
}

body[data-theme="dark"] .result-name-input:focus {
    outline: 2px solid rgba(148, 163, 184, 0.4);
    outline-offset: 1px;
}

body[data-theme="dark"] .result-rename-confirm,
body[data-theme="dark"] .result-rename-cancel {
    background: var(--bg-secondary);
    border-color: var(--border-strong);
    color: var(--text-secondary);
}

body[data-theme="dark"] .result-rename-confirm:hover,
body[data-theme="dark"] .result-rename-cancel:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
}

body[data-theme="dark"] .result-title .result-rename-btn:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
}

body[data-theme="dark"] .transcript-actions .btn {
    color: #e4e4e7;
    border-color: var(--border-strong);
    background: var(--bg-secondary);
}

body[data-theme="dark"] .transcript-actions .btn:hover {
    background: var(--bg-hover);
    border-color: var(--border-strong);
    color: #f4f4f5;
}

body[data-theme="dark"] .transcript-actions .btn svg {
    color: currentColor;
}

body[data-theme="dark"] .transcript-actions .btn.is-active {
    background: #2b2b33;
    border-color: #464653;
    color: #f8fafc;
}

body[data-theme="dark"] .share-view:not(.share-view-only) .transcript-actions .share-toggle-row .toggle-label {
    color: #a1a1aa;
}

body[data-theme="dark"] .share-view:not(.share-view-only) .transcript-actions .share-toggle-row .toggle {
    background: #2f3542;
}

body[data-theme="dark"] .share-view:not(.share-view-only) .transcript-actions .share-toggle-row .toggle.on {
    background: #3d78df;
}

body[data-theme="dark"] .share-view:not(.share-view-only) .transcript-actions .share-toggle-row .toggle::after {
    background: #eef2ff;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.5);
}

body[data-theme="dark"] .audio-seek-btn {
    background: var(--bg-secondary);
    border: 1px solid var(--border-strong);
    color: var(--text-secondary);
}

body[data-theme="dark"] .audio-seek-btn:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
}

body[data-theme="dark"] .player-controls .volume-button,
body[data-theme="dark"] .player-controls .speed-button,
body[data-theme="dark"] .player-controls .audio-download-btn {
    background: var(--bg-secondary);
    border: 1px solid var(--border-strong);
    color: var(--text-secondary);
}

body[data-theme="dark"] .player-controls .volume-button:hover,
body[data-theme="dark"] .player-controls .speed-button:hover,
body[data-theme="dark"] .player-controls .audio-download-btn:hover {
    background: var(--bg-hover);
    border-color: var(--border-strong);
    color: var(--text-primary);
}

body[data-theme="dark"] .results-section .result-item.actions-side .action-bar {
    background: transparent;
    border-color: transparent;
}

body[data-theme="dark"] .results-section .result-item.actions-side {
    background: transparent;
    border-color: transparent;
    box-shadow: none;
}

body[data-theme="dark"] .results-section .result-item.actions-side .transcript-view-actions.transcript-actions {
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 10px;
}

body[data-theme="dark"] .results-section .transcript-box {
    background: #1B1B1B;
    border-color: var(--border);
}

body[data-theme="dark"] .results-section .result-item.actions-side .action-btn {
    background: transparent;
    border-color: var(--border-strong);
    color: var(--text-secondary);
}

body[data-theme="dark"] .results-section .result-item.actions-side .action-btn:hover {
    background: var(--bg-hover);
    border-color: var(--border-strong);
    color: var(--text-primary);
}

body[data-theme="dark"] .results-section .result-item.actions-side .action-btn.is-active {
    background: var(--bg-hover);
    border-color: var(--border-strong);
    color: var(--text-primary);
}

body[data-theme="dark"] .results-section .result-item.actions-side .toggle-label {
    color: var(--text-secondary);
}

body[data-theme="dark"] .results-section .result-item.actions-side .toggle-row .toggle-divider::after {
    background: radial-gradient(ellipse at center, rgba(255, 255, 255, 0.24) 0%, transparent 70%);
}

body[data-theme="dark"] .results-section .result-item.actions-side .toggle {
    background: rgba(255, 255, 255, 0.2);
}

body[data-theme="dark"] .results-section .result-item.actions-side .toggle.on {
    background: #1f55c6;
}

body[data-theme="dark"] .results-section .result-item.actions-side .toggle::after {
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.45);
}

body[data-theme="dark"] #exportModal .export-format-icon {
    background: var(--bg-secondary);
    border-color: var(--border-strong);
    color: var(--text-secondary);
}

body[data-theme="dark"] .transcript-text {
    color: #D1D5DB;
    text-shadow: none;
}

body[data-theme="dark"] .results-section .transcript-text,
body[data-theme="dark"] .results-section .transcript-text.editing {
    background: transparent;
}

body[data-theme="dark"] .results-section .transcript-text * {
    text-shadow: none;
}

body[data-theme="dark"] .lang-select {
    background: var(--bg-secondary);
    border-color: var(--border);
    color: var(--text-primary);
}

body[data-theme="dark"] .lang-select option {
    background: var(--bg-secondary);
    color: var(--text-primary);
}

body[data-theme="dark"] .url-input {
    background: var(--bg-secondary);
    border-color: var(--border);
    color: var(--text-primary);
}

body[data-theme="dark"] .url-remove {
    background: var(--bg-elevated);
    color: var(--text-secondary);
}

body[data-theme="dark"] .url-remove:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
}

body[data-theme="dark"] .job-delete {
    background: var(--bg-secondary);
    border-color: var(--border);
    color: var(--text-muted);
}

body[data-theme="dark"] .job-delete:hover {
    background: rgba(239, 68, 68, 0.18);
    border-color: rgba(239, 68, 68, 0.35);
    color: #fca5a5;
}


body[data-theme="dark"] .toast {
    background: var(--bg-elevated);
    color: var(--text-primary);
    border: 1px solid var(--border-strong);
}

body[data-theme="dark"] .toast.error {
    background: rgba(239, 68, 68, 0.2);
    color: #fecaca;
    border-color: rgba(239, 68, 68, 0.35);
}

body[data-theme="dark"] .modal-content,
body[data-theme="dark"] .rename-modal-content {
    background: var(--bg-secondary);
    border-color: var(--border);
    color: var(--text-primary);
}

body[data-theme="dark"] .modal-header h3,
body[data-theme="dark"] .rename-modal-content h3,
body[data-theme="dark"] .modal-body label {
    color: var(--text-secondary);
}

body[data-theme="dark"] .modal-note {
    color: var(--text-secondary);
}

/* Dark mode: calmer destructive buttons in modal dialogs */
body[data-theme="dark"] .modal .btn-danger {
    background: #7f1d1d;
    border-color: #991b1b;
    color: #fee2e2;
}

body[data-theme="dark"] .modal .btn-danger:hover {
    background: #991b1b;
    border-color: #b91c1c;
    color: #fff1f2;
}

body[data-theme="dark"] .modal .btn-danger:active {
    background: #6b1717;
    border-color: #7f1d1d;
}

body[data-theme="dark"] .audio-progress-wrapper {
    background: #2a2a2f;
}

body[data-theme="dark"] .audio-progress-wrapper:hover .audio-progress {
    background: #2b6ee8;
}

body[data-theme="dark"] .results-section .audio-progress-wrapper {
    background: #2a2a2f;
    border-color: rgba(255, 255, 255, 0.18);
}

body[data-theme="dark"] .results-section .audio-progress {
    background: #1f55c6;
}

body[data-theme="dark"] .results-section .audio-progress-wrapper:hover .audio-progress {
    background: #2b6ee8;
}

body[data-theme="dark"] .results-section .volume-slider,
body[data-theme="dark"] .results-section .volume-slider.visible {
    background: rgba(31, 85, 198, 0.32);
    accent-color: #1f55c6;
}

body[data-theme="dark"] .results-section .play-btn {
    background: #1f55c6;
}

body[data-theme="dark"] .results-section .play-btn:hover {
    background: #2b6ee8;
}

body[data-theme="dark"] .results-section .speed-button {
    background: rgba(255, 255, 255, 0.04);
    border-color: rgba(255, 255, 255, 0.2);
    color: #dbe3f4;
}

body[data-theme="dark"] .results-section .speed-button:hover {
    background: rgba(255, 255, 255, 0.1);
    color: #f8fafc;
}

body[data-theme="dark"] .results-section .speed-menu {
    background: #151821;
    border-color: rgba(255, 255, 255, 0.16);
    box-shadow: 0 10px 24px rgba(0, 0, 0, 0.48);
}

body[data-theme="dark"] .results-section .speed-option {
    color: #dbe3f4;
}

body[data-theme="dark"] .results-section .speed-option:hover {
    background: rgba(99, 102, 241, 0.2);
    color: #f8fafc;
}

.audio-element {
    position: absolute;
    left: -9999px;
    width: 1px;
    height: 1px;
    opacity: 0;
    pointer-events: none;
}

/* Big play button */
.play-btn {
    width: 52px;
    height: 52px;
    border-radius: 50%;
    border: none;
    background: #2563EB;
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: all 0.2s ease;
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.3);
}

.play-btn:hover {
    background: #1D4ED8;
    transform: scale(1.05);
    box-shadow: 0 6px 16px rgba(37, 99, 235, 0.4);
}

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

.play-btn svg {
    width: 24px;
    height: 24px;
}

.play-btn .play-icon {
    margin-left: 3px;
}

.play-btn .pause-icon {
    display: none;
}

.play-btn.playing .play-icon {
    display: none;
}

.play-btn.playing .pause-icon {
    display: block;
}

/* Audio controls */
.audio-controls {
    flex: 1;
    min-width: 0;
}

.audio-time-row {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
}

.audio-time {
    font-size: 12px;
    color: var(--gray-500);
    font-variant-numeric: tabular-nums;
    min-width: 40px;
}

.audio-time.current {
    text-align: right;
}

.audio-time.duration {
    text-align: left;
}

.audio-progress-wrapper {
    flex: 1;
    height: 6px;
    background: #e5e7eb;
    border-radius: 3px;
    cursor: pointer;
    position: relative;
}

.audio-progress {
    height: 100%;
    background: #2563EB;
    border-radius: 3px;
    width: 0%;
    transition: width 0.1s linear;
}

.audio-progress-wrapper:hover .audio-progress {
    background: #1D4ED8;
}

/* Bottom audio controls */
.audio-bottom-row {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    margin-left: 0;
}

/* Speed selector */
.speed-select {
    height: 28px;
    font-size: 13px;
    border: 1px solid var(--gray-200);
    border-radius: 8px;
    background: var(--gray-50);
    color: var(--gray-600);
    padding: 0 8px;
    cursor: pointer;
    transition: all 0.15s;
}

.speed-select option {
    font-size: 13px;
}

.speed-select:hover {
    background: var(--gray-100);
    border-color: var(--gray-300);
    color: var(--gray-700);
}

.speed-select:focus-visible {
    outline: 2px solid rgba(59, 130, 246, 0.35);
    outline-offset: 2px;
}

.volume-btn {
    width: 28px;
    height: 28px;
    border-radius: 6px;
    border: none;
    background: transparent;
    color: var(--gray-500);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.15s;
}

.volume-btn:hover {
    background: var(--gray-200);
    color: var(--gray-700);
}

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

.volume-popover {
    position: relative;
    display: inline-flex;
    align-items: center;
}

.volume-popover-panel {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    margin-top: 8px;
    background: white;
    border: 1px solid var(--gray-200);
    border-radius: 10px;
    box-shadow: var(--shadow-lg);
    padding: 10px;
    z-index: 200;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-4px);
    transition: all 0.15s ease;
}

.volume-popover-panel.visible {
    display: block;
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

/* slider size inside popover */
.volume-popover-panel .volume-slider {
    width: 140px;
}

.volume-slider {
    width: 80px;
    height: 4px;
    -webkit-appearance: none;
    appearance: none;
    background: rgba(37, 99, 235, 0.24);
    accent-color: #2563EB;
    border-radius: 2px;
    outline: none;
    cursor: pointer;
}

.volume-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: #2563EB;
    cursor: pointer;
    transition: transform 0.1s;
}

.volume-slider::-webkit-slider-thumb:hover {
    transform: scale(1.2);
}

.volume-slider::-moz-range-thumb {
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: #2563EB;
    cursor: pointer;
    border: none;
}

/* Audio download button */
.audio-download-btn {
    width: 30px;
    height: 30px;
    border-radius: var(--radius-sm);
    border: 1px solid transparent;
    background: var(--gray-50);
    color: var(--gray-500);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.15s;
    flex-shrink: 0;
}

.btn-danger {
    background: var(--error);
    color: white;
}

.btn-danger:hover {
    background: #dc2626; /* slightly darker red */
}

.audio-download-btn:hover {
    background: var(--gray-100);
    color: var(--gray-700);
    border-color: var(--gray-200);
}

.audio-download-btn:focus-visible {
    outline: 2px solid rgba(59, 130, 246, 0.35);
    outline-offset: 2px;
}

.audio-download-btn svg {
    width: 14px;
    height: 14px;
}

/* Audio loading - FIX 4: small spinner, not huge */
.audio-loading {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 16px;
    background: var(--gray-50);
    border-radius: var(--radius-sm);
    font-size: 13px;
    color: var(--gray-500);
}

.audio-loading svg {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
}

/* Error */
.error-box {
    background: #fef2f2;
    border: 1px solid #fecaca;
    border-radius: var(--radius-sm);
    padding: 16px;
    margin-top: 16px;
}

.error-title {
    font-size: 14px;
    font-weight: 600;
    color: var(--error);
    margin-bottom: 4px;
}

.error-detail {
    font-size: 13px;
    color: #991b1b;
}

/* Modal */
.modal {
    position: fixed;
    inset: 0;
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal.hidden {
    display: none;
}

.modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.4);
}

.modal-content {
    position: relative;
    background: white;
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
    width: 90%;
    max-width: 400px;
    padding: 20px;
}

.rename-modal-content {
    max-width: 320px;
    padding: 20px;
    border-radius: 16px;
    border: 1px solid var(--gray-200);
    box-shadow:
        0 4px 6px -1px rgba(0, 0, 0, 0.05),
        0 10px 15px -3px rgba(0, 0, 0, 0.08);
    background: white;
}

.rename-modal-content h3 {
    font-size: 15px;
    font-weight: 600;
    color: var(--gray-800);
    margin: 0 0 14px 0;
    text-align: center;
}

.rename-modal-content .modal-header {
    justify-content: center;
    position: relative;
}

.rename-modal-content .modal-close {
    position: absolute;
    right: 0;
}

.rename-modal-content input {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--gray-200);
    border-radius: 10px;
    font-size: 14px;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.rename-modal-content input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

#renameInput:focus {
    box-shadow: none;
}

.rename-modal-content .modal-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 16px;
}

.rename-modal-content .btn-cancel {
    padding: 8px 14px;
    font-size: 13px;
    border-radius: 8px;
    background: var(--gray-100);
    color: var(--gray-600);
    border: none;
    cursor: pointer;
    transition: background 0.15s ease;
}

.rename-modal-content .btn-cancel:hover {
    background: var(--gray-200);
}

.rename-modal-content .btn-save {
    padding: 8px 16px;
    font-size: 13px;
    font-weight: 500;
    border-radius: 8px;
    background: var(--primary);
    color: white;
    border: none;
    cursor: pointer;
    transition: background 0.15s ease;
}

.rename-modal-content .btn-save:hover {
    background: var(--primary-hover);
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
}

.modal-header h3 {
    font-size: 16px;
    font-weight: 600;
    color: var(--gray-800);
}

.modal-close {
    width: 28px;
    height: 28px;
    border: none;
    background: transparent;
    font-size: 20px;
    color: var(--gray-400);
    cursor: pointer;
    border-radius: 4px;
}

.modal-close:hover {
    background: var(--gray-100);
    color: var(--gray-600);
}

.modal-body label {
    display: block;
    font-size: 13px;
    color: var(--gray-600);
    margin-bottom: 6px;
}

.export-modal-content {
    max-width: 640px;
}

#exportModal .modal-note {
    font-size: 0.9375rem;
    color: var(--gray-600);
    margin-bottom: 20px;
}

#exportModal .modal-content {
    padding: 0;
    max-width: 480px;
    max-height: min(640px, calc(100vh - 48px));
    display: flex;
    flex-direction: column;
    overflow: hidden;
    border-radius: var(--radius-lg);
}

#exportModal .modal-header {
    padding: 20px 24px;
    border-bottom: 1px solid var(--gray-100);
    margin-bottom: 0;
}

#exportModal .modal-title {
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--gray-900);
}

#exportModal .modal-close-btn {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius);
    color: var(--gray-500);
    background: transparent;
    border: none;
    cursor: pointer;
    transition: all 0.2s ease;
}

#exportModal .modal-close-btn:hover {
    background: var(--gray-100);
    color: var(--gray-700);
}

#exportModal .modal-close-btn svg {
    width: 20px;
    height: 20px;
}

#exportModal .modal-body {
    padding: 24px;
    overflow-y: auto;
    flex: 1 1 auto;
    min-height: 0;
}

#exportModal .modal-description {
    font-size: 0.9375rem;
    color: var(--gray-600);
    margin-bottom: 20px;
}

#exportModal .modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    padding: 16px 24px;
    border-top: 1px solid var(--gray-100);
    background: var(--gray-50);
    border-radius: 0 0 var(--radius-lg) var(--radius-lg);
}

#exportModal .export-format-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
    margin-bottom: 20px;
}

#exportModal .export-format-option {
    cursor: pointer;
}

#exportModal .export-format-option input {
    position: absolute;
    opacity: 0;
}

#exportModal .export-format-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    padding: 16px 12px;
    background: var(--gray-50);
    border: 2px solid transparent;
    border-radius: var(--radius);
    transition: all 0.15s ease;
}

#exportModal .export-format-option:hover .export-format-card {
    background: var(--gray-100);
}

#exportModal .export-format-option input:checked + .export-format-card {
    background: rgba(99, 102, 241, 0.08);
    border-color: var(--primary);
}

#exportModal .export-format-icon {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: white;
    border: 1px solid var(--gray-200);
    border-radius: var(--radius);
    font-size: 0.6875rem;
    font-weight: 700;
    color: var(--gray-600);
}

#exportModal .export-format-icon--words {
    width: 44px;
    font-size: 0.625rem;
}

#exportModal .export-format-option input:checked + .export-format-card .export-format-icon {
    background: var(--primary);
    border-color: var(--primary);
    color: white;
}

#exportModal .export-format-label {
    font-size: 0.75rem;
    font-weight: 500;
    color: var(--gray-700);
    text-align: center;
}

#exportModal .export-options {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 20px;
}

#exportModal .checkbox-label {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 0.875rem;
    color: var(--gray-700);
    cursor: pointer;
}

#exportModal .checkbox-label input {
    width: 16px;
    height: 16px;
    accent-color: var(--primary);
}

.summary-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 140px;
    gap: 18px;
}

.summary-bars {
    display: flex;
    gap: 8px;
    align-items: flex-end;
    height: 32px;
}

.summary-bar {
    width: 3px;
    background: var(--gray-600);
    border-radius: 2px;
    animation: summary-pulse 1.2s ease-in-out infinite;
}

.summary-bar:nth-child(1) { height: 24px; animation-delay: 0s; }
.summary-bar:nth-child(2) { height: 16px; animation-delay: 0.1s; }
.summary-bar:nth-child(3) { height: 28px; animation-delay: 0.2s; }
.summary-bar:nth-child(4) { height: 12px; animation-delay: 0.3s; }
.summary-bar:nth-child(5) { height: 20px; animation-delay: 0.4s; }

@keyframes summary-pulse {
    0%, 100% { opacity: 0.3; transform: scaleY(0.6); }
    50% { opacity: 1; transform: scaleY(1); }
}

.summary-text {
    font-size: 14px;
    color: var(--gray-500);
    letter-spacing: 0.4px;
}

.summary-dots::after {
    content: '';
    display: inline-block;
    width: 20px;
    text-align: left;
    animation: summary-dots 1.5s steps(4, end) infinite;
}

@keyframes summary-dots {
    0% { content: ''; }
    25% { content: '.'; }
    50% { content: '..'; }
    75% { content: '...'; }
    100% { content: ''; }
}

.lang-select {
    width: 100%;
    padding: 10px 12px;
    font-size: 16px;
    border: 1px solid var(--gray-300);
    border-radius: var(--radius-sm);
    background: white;
    color: var(--gray-800);
}

.lang-select option {
    font-size: 16px;
}

.modal-note {
    margin-top: 16px;
    font-size: 12px;
    color: var(--gray-500);
    text-align: center;
}

.url-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 12px;
}

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

.url-input {
    flex: 1;
    padding: 10px 12px;
    border: 1px solid var(--gray-300);
    border-radius: var(--radius-sm);
    font-size: 14px;
}

.url-remove {
    width: 32px;
    height: 32px;
    border-radius: 6px;
    border: none;
    background: var(--gray-100);
    color: var(--gray-600);
    cursor: pointer;
}

.url-remove:hover {
    background: var(--gray-200);
    color: var(--gray-800);
}


@media (min-width: 900px) {
    .results-list {
        margin-left: -85px;
        margin-right: -85px;
    }
}


#micPermissionModal .modal-note {
    font-size: 13px;
}

#micPermissionText {
    font-size: 15px;
}

.modal-actions {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
    margin-top: 14px;
}

#youtubeImportPolicyModal .modal-note {
    font-size: 16px;
    line-height: 1.5;
}

#youtubeImportPolicyModal .modal-actions {
    width: 100%;
    justify-content: center;
}

/* Footer */
.footer {
    margin-top: 48px;
    text-align: center;
}

.privacy-note {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 12px;
    color: var(--gray-500);
    padding: 12px 16px;
    background: var(--gray-50);
    border-radius: var(--radius-sm);
}

.privacy-icon {
    width: 14px;
    height: 14px;
    flex-shrink: 0;
}

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

    .logo {
        font-size: 24px;
    }

    .card {
        padding: 16px;
    }

    .dropzone {
        padding: 32px 16px;
    }

    .dropzone-icon {
        width: 40px;
        height: 40px;
    }

    .dropzone-text {
        font-size: 14px;
    }

    .file-item {
        padding: 10px;
    }

    .merge-controls {
        flex-direction: column;
        align-items: flex-start;
    }

    .merge-status-text {
        white-space: normal;
    }

    #myFilesBtn {
        display: none;
    }

    .result-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }

    .result-title .result-name {
        font-size: 15px;
    }

    .transcript-actions {
        width: 100%;
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 8px;
    }

    .transcript-actions .btn {
        width: 100%;
        min-width: 0;
        padding: 8px 10px;
        white-space: normal;
        line-height: 1.1;
        text-align: center;
        flex-wrap: wrap;
    }

    .transcript-actions .download-menu-wrapper {
        width: 100%;
        display: block;
    }

    .share-view:not(.share-view-only) .transcript-actions {
        display: flex;
        flex-direction: column;
        gap: 8px;
    }

    .share-view:not(.share-view-only) .transcript-actions > * {
        width: 100%;
    }

    .share-view:not(.share-view-only) .transcript-actions .share-action-buttons {
        display: flex;
        flex-wrap: wrap;
        gap: 8px;
    }

    .share-view:not(.share-view-only) .transcript-actions .share-action-buttons .btn {
        width: auto;
    }

    .share-view:not(.share-view-only) .transcript-actions .share-toggle-row {
        gap: 10px 12px;
    }

    body:not(.share-view) .transcript-actions .action-copy { order: 1; }
    body:not(.share-view) .transcript-actions .action-timestamps { order: 2; }
    body:not(.share-view) .transcript-actions .action-export { order: 3; }
    body:not(.share-view) .transcript-actions .action-speakers { order: 4; }
    body:not(.share-view) .transcript-actions .action-share { order: 5; }
    body:not(.share-view) .transcript-actions .action-summarize { order: 6; }
    body:not(.share-view) .transcript-actions .action-edit { order: 7; }
    body:not(.share-view) .transcript-actions .action-translate { order: 8; }


    .custom-audio-player {
        flex-wrap: wrap;
        gap: 12px;
    }

    .audio-controls {
        width: 100%;
        order: 2;
    }

    .play-btn {
        width: 48px;
        height: 48px;
    }

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

    .audio-bottom-row {
        flex-wrap: wrap;
        justify-content: center;
        width: 100%;
        margin-left: 0; /* mobile: no extra indentation */
    }

    .audio-bottom-row .speed-select {
        order: 2;
    }

    .audio-bottom-row .volume-btn {
        order: 1;
    }

    .audio-bottom-row .audio-download-btn {
        order: 3;
        margin-left: 0;
    }

    .audio-bottom-row .volume-slider {
        order: 10;
        width: 100%;
        max-width: none;
        margin-top: 10px;
    }

    .volume-popover-panel .volume-slider {
        width: 180px;
    }

    .results-section .audio-player {
        width: calc(100% + (2 * var(--result-transcript-pad-x)));
        max-width: none;
        margin-left: calc(-1 * var(--result-transcript-pad-x));
        margin-right: calc(-1 * var(--result-transcript-pad-x));
    }

    .results-section .custom-audio-player {
        border-radius: 0 0 var(--share-radius-md) var(--share-radius-md);
    }

    .results-section .audio-player.player-stuck .custom-audio-player {
        border-bottom-left-radius: 0 !important;
        border-bottom-right-radius: 0 !important;
    }

    .results-section .audio-player.player-stuck {
        border-bottom-left-radius: 0 !important;
        border-bottom-right-radius: 0 !important;
    }

    /* Drag hint hidden on mobile - touch drag works differently */
    .drag-hint {
        display: none;
    }
}

/* Toast notifications */
.toast {
    position: fixed;
    bottom: 24px;
    left: 50%;
    transform: translateX(-50%);
    background: var(--gray-800);
    color: white;
    padding: 12px 20px;
    border-radius: var(--radius-sm);
    font-size: 14px;
    box-shadow: var(--shadow-lg);
    z-index: 1000;
    animation: slideUp 0.3s ease;
}

.toast.error {
    background: var(--error);
}

.toast.youtube-policy-toast {
    font-size: 16px;
    line-height: 1.45;
    max-width: min(92vw, 560px);
}

.toast.toast-mini {
    padding: 6px 10px;
    font-size: 12px;
    border-radius: 6px;
    box-shadow: var(--shadow-md);
    opacity: 0.95;
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateX(-50%) translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateX(-50%) translateY(0);
    }
}
.results-section .transcript-actions {
    width: 100%;
    margin-left: 0;
    margin-right: 0;
}

/* Keep main actions-side toggle row in sync with dashboard/transcripts */
.results-section .result-item.actions-side .transcript-view-actions .toggle-item.toggle-item-timestamps::after {
    content: none;
}

.results-section .result-item.actions-side .transcript-view-actions .toggle-item.toggle-item-timestamps {
    position: static;
    padding-bottom: 0;
}

.results-section .result-item.actions-side .transcript-view-actions .toggle-row {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
    margin-top: 10px;
}

.results-section .result-item.actions-side .transcript-view-actions .toggle-item {
    display: flex;
    align-items: center;
    gap: 8px;
}

.results-section .result-item.actions-side .transcript-view-actions .toggle-label {
    font-size: 14px;
    font-weight: 500;
    font-family: inherit;
    color: #374151;
}

.results-section .result-item.actions-side .transcript-view-actions .toggle-label-player .label-mobile {
    display: none;
}

.results-section .result-item.actions-side .transcript-view-actions .toggle {
    width: 36px;
    height: 20px;
    background: #e5e7eb;
    border-radius: 10px;
    position: relative;
    cursor: pointer;
    transition: background 0.2s ease;
    flex-shrink: 0;
    border: none;
}

.results-section .result-item.actions-side .transcript-view-actions .toggle.on {
    background: #2563EB;
}

.results-section .result-item.actions-side .transcript-view-actions .toggle::after {
    content: '';
    position: absolute;
    width: 17px;
    height: 17px;
    background: #ffffff;
    border-radius: 50%;
    top: 1.5px;
    left: 1.5px;
    transition: transform 0.2s ease;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}

.results-section .result-item.actions-side .transcript-view-actions .toggle.on::after {
    transform: translateX(16px);
}

.results-section .result-item.actions-side .transcript-view-actions .toggle-item.auto-scroll-item {
    display: none;
}

@media (min-width: 800px) {
    .results-section .result-item.actions-side .transcript-view-actions .toggle-item.auto-scroll-item {
        display: flex;
    }
}

@media (min-width: 1160px) {
    .results-section .result-item.actions-side .transcript-view-actions .divider,
    .results-section .result-item.actions-side .transcript-view-actions .toggle-row,
    .results-section .result-item.actions-side .transcript-view-actions .toggle-item,
    .results-section .result-item.actions-side .transcript-view-actions .toggle-row .toggle-divider {
        width: 100%;
    }

    .results-section .result-item.actions-side .transcript-view-actions .toggle-row {
        flex-direction: column;
        align-items: stretch;
        gap: 10px;
    }

    .results-section .result-item.actions-side .transcript-view-actions .toggle-item {
        justify-content: space-between;
    }
}

.results-section .result-item.actions-side .transcript-view-actions .toggle-row .toggle-divider {
    display: none !important;
    width: 44px;
    height: 12px;
    padding: 0 !important;
    pointer-events: none;
    flex: 0 0 auto;
    align-self: center;
}

.results-section .result-item.actions-side .transcript-view-actions .toggle-row .toggle-divider::after {
    content: none;
}

.results-section .result-item.actions-side .transcript-view-actions .toggle-row .toggle-divider span {
    display: none;
}

body[data-theme="dark"] .results-section .result-item.actions-side .transcript-view-actions .toggle-label {
    color: #d1d5db;
}

body[data-theme="dark"] .results-section .result-item.actions-side .transcript-view-actions .toggle {
    background: #2a2a2f;
}

body[data-theme="dark"] .results-section .result-item.actions-side .transcript-view-actions .toggle.on {
    background: #1f55c6;
}

body[data-theme="dark"] .results-section .result-item.actions-side .transcript-view-actions .toggle::after {
    background: #f8fafc;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.5);
}

@media (max-width: 640px) {
    .results-section .result-item.actions-side .transcript-view-actions .toggle-label-player .label-full {
        display: none;
    }

    .results-section .result-item.actions-side .transcript-view-actions .toggle-label-player .label-mobile {
        display: inline;
    }

    .results-section .result-item.actions-side .transcript-view-actions .toggle-row {
        flex-direction: row;
        align-items: center;
        gap: 10px;
        flex-wrap: nowrap;
        overflow-x: auto;
        overflow-y: hidden;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
        padding-bottom: 2px;
    }

    .results-section .result-item.actions-side .transcript-view-actions .toggle-row::-webkit-scrollbar {
        display: none;
    }

    .results-section .result-item.actions-side .transcript-view-actions .toggle-item {
        flex: 0 0 auto;
    }

    .results-section .result-item.actions-side .transcript-view-actions .toggle {
        width: 36px;
        height: 20px;
    }

    .results-section .result-item.actions-side .transcript-view-actions .toggle::after {
        width: 17px;
        height: 17px;
        top: 1.5px;
        left: 1.5px;
    }

    .results-section .result-item.actions-side .transcript-view-actions .toggle.on::after {
        transform: translateX(16px);
    }
}

@media (min-width: 400px) and (max-width: 640px) {
    .results-section .result-item.actions-side .transcript-view-actions .toggle-row {
        justify-content: center;
    }
}

@media (min-width: 641px) and (max-width: 900px) {
    .results-section .result-item.actions-side .transcript-view-actions .toggle-row .toggle-label {
        font-size: 13px;
    }
}

@media (min-width: 701px) and (max-width: 880px) {
    .results-section .result-item.actions-side .transcript-view-actions .toggle-row .toggle-label {
        font-size: 12px;
    }
}

@media (max-width: 380px) {
    .results-section .result-item.actions-side .transcript-view-actions .toggle-row {
        gap: 8px;
    }

    .results-section .result-item.actions-side .transcript-view-actions .toggle-label {
        font-size: 11px;
    }
}

@media (min-width: 1201px) {
    .results-section .result-item.actions-side .transcript-view-actions .toggle-row {
        gap: 13px;
    }

    .results-section .result-item.actions-side .transcript-view-actions .toggle {
        width: 38px;
        height: 21px;
        border-radius: 11px;
    }

    .results-section .result-item.actions-side .transcript-view-actions .toggle::after {
        width: 18px;
        height: 18px;
        transform: translateX(0);
    }

    .results-section .result-item.actions-side .transcript-view-actions .toggle.on::after {
        transform: translateX(17px);
    }
}

.transcript-chat-overlay {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.22);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease;
    z-index: 1400;
}

.transcript-chat-overlay.is-open {
    opacity: 1;
    pointer-events: auto;
}

.transcript-chat-panel {
    position: fixed;
    top: 16px;
    right: 6px;
    width: min(380px, calc(100vw - 24px));
    height: calc(100vh - 32px);
    max-height: 820px;
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    box-shadow: -10px 0 30px rgba(15, 23, 42, 0.14);
    transform: translateX(100%);
    transition: transform 0.24s ease;
    z-index: 1401;
    display: none;
    flex-direction: column;
    pointer-events: none;
}

.transcript-chat-panel.is-open {
    display: flex;
    transform: translateX(0);
    pointer-events: auto;
}

@media (min-width: 1440px) {
    .transcript-chat-panel {
        top: 20px;
        height: calc(100vh - 40px);
        max-height: 860px;
    }
}

@media (max-width: 1279px) {
    .transcript-chat-panel {
        top: 14px;
        height: calc(100vh - 28px);
        max-height: 780px;
    }
}

@media (max-height: 900px) {
    .transcript-chat-panel {
        top: 10px;
        height: calc(100vh - 20px);
        max-height: none;
    }
}

/* iPad portrait */
@media (min-width: 768px) and (max-width: 1024px) {
    .transcript-chat-panel {
        --chat-ideal-height: min(72vh, 640px);
        right: 6px;
        width: 320px;
        top: max(24px, calc((100vh - var(--chat-ideal-height)) / 2));
        height: var(--chat-ideal-height);
        max-height: none;
        border-radius: 14px;
        box-shadow: 0 8px 32px rgba(0, 0, 0, 0.12);
    }
}

/* iPad landscape */
@media (min-width: 1024px) and (max-width: 1180px) {
    .transcript-chat-panel {
        --chat-ideal-height: min(75vh, 680px);
        right: 6px;
        width: 300px;
        top: max(20px, calc((100vh - var(--chat-ideal-height)) / 2));
        height: var(--chat-ideal-height);
        max-height: none;
        border-radius: 12px;
        box-shadow: 0 4px 24px rgba(0, 0, 0, 0.10);
    }
}

/* iPad Pro 12.9 portrait */
@media (min-width: 1024px) and (max-width: 1024px) and (min-height: 1300px) {
    .transcript-chat-panel {
        --chat-ideal-height: min(65vh, 720px);
        width: 320px;
        top: max(28px, calc((100vh - var(--chat-ideal-height)) / 2));
    }
}

.transcript-chat-header {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 12px 14px;
    border-bottom: 1px solid #edf0f4;
}

.transcript-chat-header-text {
    min-width: 0;
    flex: 1;
}

.transcript-chat-title {
    font-size: 14px;
    font-weight: 600;
    color: #111827;
    line-height: 1.3;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.transcript-chat-subtitle {
    font-size: 12px;
    color: #9aa3b2;
    margin-top: 2px;
}

.transcript-chat-close {
    width: 28px;
    height: 28px;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    background: #f8fafc;
    color: #6b7280;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    cursor: pointer;
    flex: 0 0 auto;
}

.transcript-chat-close svg {
    width: 18px;
    height: 18px;
}

.transcript-chat-messages {
    flex: 1;
    overflow: auto;
    padding: 12px 10px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.transcript-chat-empty {
    padding: 8px 4px;
}

.transcript-chat-empty-title {
    font-size: 13px;
    color: #6b7280;
    margin-bottom: 8px;
}

.transcript-chat-suggestions {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.transcript-chat-suggestion {
    text-align: left;
    border: 1px solid #e5e7eb;
    background: #f8fafc;
    border-radius: 10px;
    padding: 8px 11px;
    color: #1f2937;
    font-size: 13px;
    line-height: 1.4;
    cursor: pointer;
}

.transcript-chat-message {
    display: flex;
}

.transcript-chat-message-user {
    justify-content: flex-end;
}

.transcript-chat-message-assistant {
    justify-content: flex-start;
}

.transcript-chat-bubble {
    max-width: 86%;
    border-radius: 12px;
    font-size: 13px;
    line-height: 1.5;
    padding: 8px 10px;
    white-space: pre-wrap;
    word-break: break-word;
}

.transcript-chat-message-user .transcript-chat-bubble {
    background: #2563eb;
    color: #fff;
    border-bottom-right-radius: 4px;
}

.transcript-chat-message-assistant .transcript-chat-bubble {
    background: #f3f4f6;
    color: #111827;
    border-bottom-left-radius: 4px;
}

.transcript-chat-citations {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 8px;
}

.transcript-chat-citation {
    border: 1px solid #dbe2eb;
    background: #fff;
    color: #4b5563;
    border-radius: 999px;
    font-size: 11px;
    line-height: 1.2;
    padding: 4px 8px;
    cursor: pointer;
}

.transcript-chat-citation-speaker {
    opacity: 0.75;
}

.transcript-chat-bubble-loading {
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.transcript-chat-bubble-loading span {
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background: #9aa3b2;
    animation: transcript-chat-bounce 1.1s ease-in-out infinite;
}

.transcript-chat-bubble-loading span:nth-child(2) {
    animation-delay: 0.12s;
}

.transcript-chat-bubble-loading span:nth-child(3) {
    animation-delay: 0.24s;
}

.transcript-chat-composer {
    border-top: 1px solid #edf0f4;
    padding: 10px;
    display: flex;
    align-items: flex-end;
    gap: 8px;
}

.transcript-chat-input {
    flex: 1;
    min-height: 36px;
    max-height: 132px;
    resize: none;
    border-radius: 12px;
    border: 1px solid #dbe2eb;
    background: #f8fafc;
    color: #111827;
    font-size: 13px;
    line-height: 1.4;
    padding: 8px 10px;
    outline: none;
}

.transcript-chat-send {
    width: 34px;
    height: 34px;
    border-radius: 999px;
    border: none;
    background: #2563eb;
    color: #fff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    cursor: pointer;
}

.transcript-chat-send svg {
    width: 15px;
    height: 15px;
}

.transcript-chat-send:disabled {
    background: #cbd5e1;
    cursor: default;
}

@keyframes transcript-chat-bounce {
    0%, 80%, 100% { transform: translateY(0); opacity: 0.45; }
    40% { transform: translateY(-4px); opacity: 1; }
}

body[data-theme="dark"] .transcript-chat-panel {
    background: #111827;
    border-color: #334155;
    box-shadow: -10px 0 28px rgba(0, 0, 0, 0.38);
}

body[data-theme="dark"] .transcript-chat-header,
body[data-theme="dark"] .transcript-chat-composer {
    border-color: #243041;
}

body[data-theme="dark"] .transcript-chat-title {
    color: #f8fafc;
}

body[data-theme="dark"] .transcript-chat-subtitle,
body[data-theme="dark"] .transcript-chat-empty-title {
    color: #94a3b8;
}

body[data-theme="dark"] .transcript-chat-close {
    border-color: #334155;
    background: #1f2937;
    color: #cbd5e1;
}

body[data-theme="dark"] .transcript-chat-suggestion {
    background: #1f2937;
    border-color: #334155;
    color: #e5e7eb;
}

body[data-theme="dark"] .transcript-chat-message-assistant .transcript-chat-bubble {
    background: #1f2937;
    color: #e5e7eb;
}

body[data-theme="dark"] .transcript-chat-citation {
    background: #0f172a;
    border-color: #334155;
    color: #cbd5e1;
}

body[data-theme="dark"] .transcript-chat-input {
    background: #0f172a;
    border-color: #334155;
    color: #f8fafc;
}

body[data-theme="dark"] .transcript-chat-send:disabled {
    background: #334155;
}

@media (max-width: 760px) {
    .transcript-chat-panel {
        width: 100%;
        max-width: none;
        height: min(76vh, 600px);
        max-height: none;
        top: auto;
        right: 0;
        bottom: 0;
        border-left: none;
        border-right: none;
        border-bottom: none;
        border-top: 1px solid #e5e7eb;
        border-radius: 14px 14px 0 0;
        transform: translateY(100%);
    }

    .transcript-chat-panel.is-open {
        transform: translateY(0);
    }
}

/* Mobile + iPad action order and compact sizing */
@media (max-width: 1200px) {
    .results-section .result-item.actions-side .action-chat {
        order: 6;
    }

    .results-section .result-item.actions-side .toggle-row {
        order: 7;
        flex-basis: 100%;
        width: 100%;
    }

    .share-view:not(.share-view-only) .transcript-actions .share-action-buttons .action-translate {
        order: 4;
    }

    .share-view:not(.share-view-only) .transcript-actions .share-action-buttons .action-chat {
        order: 5;
    }
}

@media (max-width: 640px) {
    .results-section .result-item.actions-side .action-btn {
        width: calc((100% - 30px) / 6) !important;
        max-width: calc((100% - 30px) / 6) !important;
    }

    .share-view:not(.share-view-only) .transcript-actions .share-action-buttons {
        flex-wrap: nowrap;
        gap: 6px;
    }

    .share-view:not(.share-view-only) .transcript-actions .share-action-buttons .btn {
        width: auto;
        min-width: 0;
        flex: 1 1 0;
        justify-content: center;
        white-space: nowrap;
        flex-wrap: nowrap;
        padding: 8px 6px;
        font-size: 12px;
        gap: 4px;
    }
}

@media (min-width: 641px) and (max-width: 1200px) {
    .results-section .result-item.actions-side .action-bar-inner {
        gap: 8px;
    }

    .results-section .result-item.actions-side .action-btn {
        width: calc((100% - 40px) / 6) !important;
        max-width: calc((100% - 40px) / 6) !important;
        min-width: 0;
        justify-content: center;
        padding: 9px 4px;
        gap: 6px;
    }

    .results-section .result-item.actions-side .action-btn .btn-text {
        display: none;
    }

    .results-section .result-item.actions-side .action-btn svg {
        width: 17px;
        height: 17px;
    }

    .share-view:not(.share-view-only) .transcript-actions .share-action-buttons {
        flex-wrap: nowrap;
        gap: 8px;
    }

    .share-view:not(.share-view-only) .transcript-actions .share-action-buttons .btn {
        width: auto;
        min-width: 0;
        flex: 1 1 0;
        justify-content: center;
        white-space: nowrap;
        flex-wrap: nowrap;
        padding: 8px 8px;
        font-size: 13px;
        gap: 5px;
    }
}
