:root {
    /* Color Palette - Premium Dark */
    --accent-primary: #6366f1;
    --accent-secondary: #8b5cf6;
    --accent-hover: #4f46e5;
    --bg-main: #0f172a;
    --bg-sidebar: #1e293b;
    --bg-card: rgba(30, 41, 59, 0.7);
    --text-main: #f8fafc;
    --text-muted: #94a3b8;
    --border-color: rgba(255, 255, 255, 0.1);
    --glass-bg: rgba(255, 255, 255, 0.05);
    --glass-border: rgba(255, 255, 255, 0.1);

    /* Status Colors */
    --status-online: #10b981;
    --status-offline: #ef4444;
    --status-working: #f59e0b;

    /* Spacing & Radii */
    --radius-lg: 16px;
    --radius-md: 12px;
    --radius-sm: 8px;
    --shadow-xl: 0 20px 25px -5px rgb(0 0 0 / 0.1), 0 8px 10px -6px rgb(0 0 0 / 0.1);
}

.light-theme {
    --bg-main: #f1f5f9;
    --bg-sidebar: #ffffff;
    --bg-card: rgba(255, 255, 255, 0.8);
    --text-main: #0f172a;
    --text-muted: #64748b;
    --border-color: rgba(0, 0, 0, 0.1);
    --glass-bg: rgba(0, 0, 0, 0.02);
    --glass-border: rgba(0, 0, 0, 0.05);
}

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

body {
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    background-color: var(--bg-main);
    color: var(--text-main);
    line-height: 1.5;
    height: 100vh;
    overflow: hidden;
    /* Main container handles scroll */
    transition: background-color 0.3s ease, color 0.3s ease;
}

h1,
h2,
h3 {
    font-family: 'Outfit', sans-serif;
    font-weight: 600;
}

/* Layout Container */
.app-container {
    display: flex;
    height: 100vh;
    width: 100vw;
}

/* Sidebar */
.sidebar {
    width: 260px;
    background-color: var(--bg-sidebar);
    border-right: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    padding: 24px 16px;
    z-index: 100;
}

.logo {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 0 12px 32px;
}

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

.logo-text {
    font-family: 'Outfit', sans-serif;
    font-size: 20px;
    font-weight: 800;
    letter-spacing: -0.5px;
}

.nav-links {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.nav-item {
    width: 100%;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    border: none;
    background: transparent;
    color: var(--text-muted);
    border-radius: var(--radius-md);
    cursor: pointer;
    font-size: 15px;
    font-weight: 500;
    transition: all 0.2s ease;
    text-align: left;
    position: relative;
}

.nav-item:hover,
.nav-item:focus {
    background-color: var(--glass-bg);
    color: var(--text-main);
}

.nav-item:focus-visible {
    outline: 2px solid var(--accent-primary);
    outline-offset: -2px;
}

.nav-item.active {
    background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
    color: white;
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.3);
}

.nav-item .shortcut {
    margin-left: auto;
    font-size: 11px;
    opacity: 0.5;
    background: rgba(0, 0, 0, 0.2);
    padding: 2px 6px;
    border-radius: 4px;
    text-transform: uppercase;
}

/* Main Content */
.main-content {
    flex: 1;
    overflow-y: auto;
    padding: 40px 60px;
    background: radial-gradient(circle at top right, rgba(99, 102, 241, 0.05), transparent 40%),
        radial-gradient(circle at bottom left, rgba(139, 92, 246, 0.05), transparent 40%);
}

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

.api-status-indicator {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 12px;
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: 100px;
    font-size: 13px;
}

.status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background-color: var(--status-offline);
    box-shadow: 0 0 8px var(--status-offline);
}

.status-dot.online {
    background-color: var(--status-online);
    box-shadow: 0 0 8px var(--status-online);
}

/* Cards */
.card {
    background: var(--bg-card);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-lg);
    padding: 32px;
    box-shadow: var(--shadow-xl);
    margin-bottom: 24px;
    transition: transform 0.2s ease;
}

/* Forms */
.input-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 24px;
}

label {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-muted);
}

textarea {
    width: 100%;
    min-height: 180px;
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 16px;
    color: var(--text-main);
    font-family: inherit;
    font-size: 16px;
    resize: vertical;
    transition: border-color 0.2s ease;
}

textarea:focus {
    outline: none;
    border-color: var(--accent-primary);
    background: rgba(0, 0, 0, 0.3);
}

.controls-grid,
.advanced-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 24px;
    margin-bottom: 24px;
}

.control-item {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

select,
input[type="text"],
input[type="url"] {
    padding: 10px 14px;
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    color: var(--text-main);
    font-size: 14px;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 20px;
    border-radius: var(--radius-md);
    border: none;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-primary {
    background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
    color: white;
}

.btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.4);
}

.btn-large {
    padding: 16px 32px;
    font-size: 17px;
    width: 100%;
}

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

.btn-secondary:hover {
    background: var(--glass-border);
}

/* Audio Player (Custom) */
.audio-player-container {
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-md);
    padding: 20px;
    margin-top: 16px;
}

#result-waveform {
    width: 100%;
    margin-bottom: 16px;
}

.audio-controls-row {
    display: flex;
    align-items: center;
    gap: 16px;
}

#audio-time-display {
    font-family: monospace;
    color: var(--text-muted);
    font-size: 14px;
}

.spacer {
    flex: 1;
}

.btn-icon-only {
    padding: 10px;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Table */
.table-container {
    overflow-x: auto;
}

table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 16px;
}

th {
    text-align: left;
    padding: 12px;
    border-bottom: 2px solid var(--border-color);
    color: var(--text-muted);
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

th.sortable {
    cursor: pointer;
    transition: background-color 0.2s;
    user-select: none;
    position: relative;
    padding-right: 25px;
}

th.sortable:hover {
    background-color: var(--glass-bg);
    color: var(--text-main);
}

.sort-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    position: absolute;
    right: 8px;
    top: 50%;
    transform: translateY(-50%);
    width: 14px;
    height: 14px;
    opacity: 0.3;
}

th.asc .sort-icon::before {
    content: "↑";
    opacity: 1;
}

th.desc .sort-icon::before {
    content: "↓";
    opacity: 1;
}

th.sortable .sort-icon::before {
    content: "↕";
    font-size: 10px;
}

th.asc .sort-icon::before,
th.desc .sort-icon::before {
    font-size: 14px;
}

th.asc,
th.desc {
    color: var(--accent-primary);
}

td {
    padding: 16px 12px;
    border-bottom: 1px solid var(--border-color);
    font-size: 14px;
}

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

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

/* Accessibility Highlights */
:focus-visible {
    outline: 3px solid var(--accent-primary);
    outline-offset: 2px;
}

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

.spinner {
    width: 40px;
    height: 40px;
    border: 4px solid var(--glass-border);
    border-top-color: var(--accent-primary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

.overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(15, 23, 42, 0.8);
    backdrop-filter: blur(4px);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 16px;
    z-index: 1000;
}

/* Toast Notifications */
#toast-container {
    position: fixed;
    bottom: 24px;
    right: 24px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    z-index: 2000;
}

.toast {
    padding: 12px 24px;
    background: var(--bg-sidebar);
    color: white;
    border-left: 4px solid var(--accent-primary);
    border-radius: var(--radius-sm);
    box-shadow: var(--shadow-xl);
    font-size: 14px;
    min-width: 250px;
    animation: slideIn 0.3s ease forwards;
    transition: opacity 0.5s ease;
}

@keyframes slideIn {
    from {
        transform: translateX(100%);
        opacity: 0;
    }

    to {
        transform: translateX(0);
        opacity: 1;
    }
}

.toast-success {
    border-left-color: var(--status-online);
}

.toast-error {
    border-left-color: var(--status-offline);
}

.toast-warning {
    border-left-color: var(--status-working);
}

/* Progress & Badges */
.badge {
    padding: 4px 10px;
    border-radius: 100px;
    font-size: 12px;
    font-weight: 600;
    background: rgba(255, 255, 255, 0.1);
}

.status-completed {
    color: var(--status-online);
    background: rgba(16, 185, 129, 0.1);
}

.status-processing {
    color: var(--status-working);
    background: rgba(245, 158, 11, 0.1);
}

.status-failed {
    color: var(--status-offline);
    background: rgba(239, 68, 68, 0.1);
}

progress {
    width: 100%;
    height: 8px;
    border-radius: 100px;
    overflow: hidden;
    appearance: none;
    -webkit-appearance: none;
}

::-webkit-progress-bar {
    background-color: rgba(255, 255, 255, 0.1);
}

::-webkit-progress-value {
    background: linear-gradient(90deg, var(--accent-primary), var(--accent-secondary));
}

.empty-state {
    text-align: center;
    padding: 40px;
    color: var(--text-muted);
}

/* Modal */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(8px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1500;
}

.modal-card {
    background: var(--bg-sidebar);
    width: 90%;
    max-width: 500px;
    border-radius: var(--radius-lg);
    border: 1px solid var(--glass-border);
    box-shadow: var(--shadow-xl);
    overflow: hidden;
    animation: modalSlide 0.3s ease-out;
}

@keyframes modalSlide {
    from {
        transform: translateY(20px);
        opacity: 0;
    }

    to {
        transform: translateY(0);
        opacity: 1;
    }
}

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

.btn-close {
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 24px;
    cursor: pointer;
}

.modal-body {
    padding: 24px;
}

.modal-footer {
    padding: 16px 24px;
    background: var(--glass-bg);
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    border-top: 1px solid var(--border-color);
}

/* Voice Grid */
.voice-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
    margin-top: 24px;
}

.voice-card {
    position: relative;
    padding: 24px;
}

.voice-card h3 {
    margin-bottom: 8px;
}

.voice-actions {
    display: flex;
    gap: 8px;
    margin-top: 16px;
}

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

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border-width: 0;
}

.btn-danger {
    color: #ff4d4d;
}

.btn-danger:hover {
    background: rgba(255, 77, 77, 0.1);
    border-color: #ff4d4d;
}

.default-voice {
    border-color: var(--accent-primary);
    box-shadow: 0 0 15px rgba(99, 102, 241, 0.2);
}

.default-voice::after {
    content: "STANDARD";
    position: absolute;
    top: 12px;
    right: 12px;
    background: var(--accent-primary);
    color: white;
    font-size: 10px;
    font-weight: 800;
    padding: 2px 6px;
    border-radius: 4px;
}

/* Filter Bar */
.filter-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    margin-top: 24px;
    flex-wrap: wrap;
}

.search-box {
    position: relative;
    flex: 1;
    min-width: 200px;
}

.search-box input {
    width: 100%;
    padding: 10px 14px 10px 40px;
}

.search-icon {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
}

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

/* Tabs */
.tabs-small {
    display: flex;
    gap: 4px;
    background: rgba(0, 0, 0, 0.2);
    padding: 4px;
    border-radius: var(--radius-md);
    margin-bottom: 24px;
}

.tab-btn {
    flex: 1;
    padding: 8px;
    border: none;
    background: none;
    color: var(--text-muted);
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    border-radius: var(--radius-sm);
    transition: all 0.2s;
}

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

/* Dropzone */
.dropzone {
    border: 2px dashed var(--border-color);
    border-radius: var(--radius-lg);
    padding: 40px 20px;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s;
    background: rgba(255, 255, 255, 0.02);
    margin-top: 20px;
}

.dropzone:hover,
.dropzone.dragover {
    border-color: var(--accent-primary);
    background: rgba(99, 102, 241, 0.05);
}

.dropzone-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
}

.drop-icon {
    color: var(--accent-primary);
    transform: scale(1.5);
}

.file-info {
    font-size: 12px;
    color: var(--accent-secondary);
    font-weight: 500;
}

/* Recording UI */
.recording-ui {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
    padding: 20px 0;
}

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

.recording-timer {
    font-size: 32px;
    font-family: monospace;
    font-weight: 700;
    color: var(--accent-primary);
}

.btn-record {
    background: #ef4444;
    color: white;
    width: 140px;
}

.btn-record:hover {
    background: #dc2626;
    transform: scale(1.05);
}

.btn-record.recording {
    animation: pulse 1.5s infinite;
}

@keyframes pulse {
    0% {
        box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.7);
    }

    70% {
        box-shadow: 0 0 0 15px rgba(239, 68, 68, 0);
    }

    100% {
        box-shadow: 0 0 0 0 rgba(239, 68, 68, 0);
    }
}

/* Voice Card Preview */
.btn-preview {
    padding: 8px;
    border-radius: 50%;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
}

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

.lang-badge {
    background: var(--glass-bg);
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 11px;
    color: var(--accent-secondary);
    text-transform: uppercase;
    font-weight: 700;
}

/* Recording Visualizer */
.recording-visualizer {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: rgba(239, 68, 68, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    margin: 20px 0;
}

.recording-visualizer::before,
.recording-visualizer::after {
    content: "";
    position: absolute;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    background: rgba(239, 68, 68, 0.4);
    animation: pulse-ring 2s infinite;
}

.recording-visualizer::after {
    animation-delay: 1s;
}

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

    100% {
        transform: scale(2.5);
        opacity: 0;
    }
}

.hidden {
    display: none !important;
}

/* List View for Voices */
.voice-grid {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: 20px;
}

.voice-card {
    display: grid;
    grid-template-columns: 60px 1fr auto;
    align-items: center;
    padding: 12px 16px;
    gap: 16px;
    background: var(--glass-bg);
}

.voice-card h3 {
    margin-bottom: 0;
    font-size: 16px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.voice-meta {
    margin-bottom: 0;
}

.voice-actions {
    margin-top: 0;
    display: flex;
    gap: 8px;
}

.voice-actions .btn-sm {
    padding: 6px 10px;
    font-size: 12px;
}

/* Compact specific styles */
@media (max-width: 768px) {
    .voice-card {
        grid-template-columns: 40px 1fr;
    }

    .voice-actions {
        grid-column: 1 / -1;
        justify-content: flex-end;
    }
}

/* Compact List Enhancements */
.voice-card h3 {
    font-weight: 600;
    color: var(--text-main);
}

.voice-actions {
    align-items: center;
}

.lang-badge {
    opacity: 0.8;
    border: 1px solid var(--glass-border);
}

/* Adjustments for fixed layout */
.voice-card .btn-preview {
    background: var(--accent-primary);
    color: white;
    border: none;
    transition: transform 0.2s;
}

.voice-card .btn-preview:hover {
    transform: scale(1.1);
}

.btn-sm {
    padding: 4px 12px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Parameter Hints */
.hint {
    font-size: 11px;
    color: var(--text-muted);
    margin-top: 4px;
    font-style: italic;
}

.advanced-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    background: rgba(0, 0, 0, 0.1);
    padding: 20px;
    border-radius: var(--radius-md);
    margin-top: 15px;
}

/* WaveSurfer UI */
#waveform {
    width: 100%;
    height: 120px;
    background: rgba(0, 0, 0, 0.2);
    border-radius: var(--radius-md);
    margin: 20px 0;
    border: 1px solid var(--border-color);
}

.trim-controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    margin-bottom: 20px;
    padding: 0 10px;
}

#trim-info {
    font-size: 13px;
    color: var(--accent-primary);
    font-weight: 700;
}

/* Modal sizing for waveform */
.modal-card {
    max-width: 650px;
    /* Slightly wider for the waveform */
}

/* Global Scroll Strategy */
html,
body {
    height: 100%;
    overflow: hidden;
}

body {
    display: flex;
    flex-direction: column;
}

.app-container {
    height: 100vh;
    overflow: hidden;
    display: flex;
}

main {
    flex: 1;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    padding: 24px;
}

/* Modal Scroll Fix */
.modal-overlay {
    padding: 20px;
}

.modal-card {
    max-height: 90vh;
    display: flex;
    flex-direction: column;
}

.modal-body {
    overflow-y: auto;
    flex: 1;
    -webkit-overflow-scrolling: touch;
}

/* Responsive sidebar */
@media (max-width: 1024px) {
    .app-container {
        flex-direction: column;
    }

    aside {
        width: 100%;
        height: auto;
        flex-direction: row;
        padding: 10px;
        order: 2;
        /* Move sidebar to bottom on mobile maybe? Or keep top */
    }

    .sidebar-nav {
        flex-direction: row;
        justify-content: space-around;
        width: 100%;
    }

    .nav-item {
        flex-direction: column;
        font-size: 10px;
        gap: 4px;
        padding: 8px;
    }

    .logo,
    .api-status {
        display: none;
    }
}

/* Region selection styling */
.wavesurfer-region {
    border: 2px solid var(--accent-primary) !important;
}

/* Character Counter Styles */
.char-dot {
    background: var(--accent-primary);
    box-shadow: 0 0 8px var(--accent-primary);
}

#char-counter {
    margin-left: 15px;
    background: rgba(255, 255, 255, 0.05);
    padding: 4px 12px;
    border-radius: 20px;
    transition: opacity 0.3s;
}

/* Mobile Nav to Top */
@media (max-width: 1024px) {
    .app-container {
        flex-direction: column !important;
    }

    .sidebar {
        width: 100% !important;
        height: auto !important;
        flex-direction: row !important;
        padding: 5px 15px !important;
        border-right: none !important;
        border-bottom: 1px solid var(--glass-border) !important;
        order: -1 !important;
        /* Force to top */
        justify-content: space-between !important;
    }

    .nav-links {
        flex-direction: row !important;
        gap: 5px !important;
        margin: 0 !important;
    }

    .nav-item {
        padding: 8px 12px !important;
        justify-content: center !important;
    }

    .nav-item .label,
    .nav-item .shortcut {
        display: none !important;
        /* Hide labels on mobile to save space */
    }

    .logo {
        margin-bottom: 0 !important;
    }
}

/* Delete Icon Color */
.btn-danger .icon svg {
    fill: #ef4444;
}

/* Navigation Header Refinement */
@media (max-width: 1024px) {
    .content-header {
        padding: 5px 20px !important;
        background: rgba(15, 23, 42, 0.8) !important;
        backdrop-filter: blur(10px) !important;
    }

    main {
        padding: 10px !important;
    }

    .sidebar {
        background: var(--sidebar-bg) !important;
        z-index: 100 !important;
    }

    .nav-item.active {
        background: var(--accent-primary) !important;
        color: white !important;
    }
}

/* Character counter hide/show animation */
.hidden {
    display: none !important;
}

#char-counter:not(.hidden) {
    display: flex !important;
    animation: fadeIn 0.3s ease-out;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(-5px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Sidebar Status Styling */
.sidebar {
    position: relative;
    padding-bottom: 20px !important;
}

.sidebar-status {
    position: absolute;
    bottom: 20px;
    left: 20px;
    background: rgba(255, 255, 255, 0.05);
    padding: 8px 12px;
    border-radius: var(--radius-md);
    white-space: nowrap;
    z-index: 10;
}

/* Mobile Status Placement (Right) */
@media (max-width: 1024px) {
    .sidebar-status {
        position: static;
        margin-left: auto;
        bottom: auto;
        left: auto;
        padding: 5px 10px;
        order: 10;
    }

    .logo {
        display: none !important;
    }
}

/* TTS Info Row */
.tts-info-row {
    display: flex;
    flex-direction: column;
    gap: 5px;
    margin-top: 8px;
}

.char-count-green {
    color: #10b981;
    /* Green like API status */
    font-size: 13px;
    font-weight: 600;
}

.char-count-accent {
    color: var(--accent-primary);
    font-size: 13px;
    font-weight: 600;
}

#tts-hint.hidden {
    display: none !important;
}

.small-header {
    height: 10px;
    padding: 0;
}

/* Removal of top spacing since headings are gone */
.main-content {
    padding-top: 20px !important;
}

.screen {
    padding-top: 0 !important;
}

.card {
    margin-top: 0 !important;
}

/* Character counter and hint side-by-side */
.tts-info-row {
    flex-direction: row !important;
    align-items: center !important;
    gap: 10px !important;
    margin-top: 5px !important;
}

#tts-hint {
    margin-top: 0 !important;
}

/* History action buttons group */
.history-actions {
    display: flex;
    gap: 5px;
    flex-wrap: wrap;
}

.btn-icon-only {
    padding: 6px !important;
    min-width: 32px;
}

/* Distinct Styles for Job Actions */
.action-pause {
    background: var(--secondary-color) !important;
}

.action-resume {
    background: var(--accent-color) !important;
    color: white !important;
}

.action-cancel {
    background: #dc3545 !important;
    /* Standard error/danger red */
    color: white !important;
}

.history-actions {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

.badge.status-paused {
    background: #ffc107;
    color: #212529;
}