/* ============================================================
   GALACTIC RADIO DJs - Space Theme CSS
   Professional SPA with Glass Morphism Design
   Matches galactic-radio-weather and galactic-radio-ads
   ============================================================ */

/* ============================================================
   CSS VARIABLES
   ============================================================ */
:root {
    --bg-deep: #050a15;
    --bg-surface: #0a1628;
    --bg-tertiary: #0d1b30;
    --glass-bg: rgba(255, 255, 255, 0.04);
    --glass-border: rgba(255, 255, 255, 0.08);
    --glass-hover: rgba(255, 255, 255, 0.07);
    --cyan: #00d4ff;
    --cyan-dim: rgba(0, 212, 255, 0.15);
    --cyan-glow: rgba(0, 212, 255, 0.3);
    --purple: #7c3aed;
    --purple-dim: rgba(124, 58, 237, 0.15);
    --text-bright: #f0f4ff;
    --text-primary: #c8d6e5;
    --text-muted: #8a9dbf;
    --text-tertiary: #6b7f99;
    --green: #10b981;
    --green-dim: rgba(16, 185, 129, 0.15);
    --amber: #f59e0b;
    --amber-dim: rgba(245, 158, 11, 0.15);
    --red: #ef4444;
    --red-dim: rgba(239, 68, 68, 0.15);
    --border-light: rgba(255, 255, 255, 0.05);
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.3);
    --shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
    --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.4);
    --shadow-lg: 0 10px 30px rgba(0, 0, 0, 0.5);
    --radius: 12px;
    --radius-sm: 8px;
    --radius-full: 9999px;
    --app-width: 1220px;
    --max-width: 640px;
}

/* ============================================================
   STAR FIELD BACKGROUND
   ============================================================ */
.stars-bg {
    position: fixed;
    inset: 0;
    z-index: 0;
    pointer-events: none;
    background: linear-gradient(180deg, #050a15 0%, #0a1628 40%, #0d1b30 100%);
}
.stars { position: absolute; inset: 0; background-repeat: repeat; }
.stars-sm {
    background-image:
        radial-gradient(1px 1px at 50px 80px, rgba(255,255,255,0.6), transparent),
        radial-gradient(1px 1px at 180px 150px, rgba(255,255,255,0.5), transparent),
        radial-gradient(1px 1px at 320px 40px, rgba(255,255,255,0.4), transparent),
        radial-gradient(1px 1px at 450px 200px, rgba(255,255,255,0.5), transparent),
        radial-gradient(1px 1px at 90px 270px, rgba(255,255,255,0.3), transparent),
        radial-gradient(1px 1px at 600px 100px, rgba(255,255,255,0.5), transparent),
        radial-gradient(1px 1px at 250px 320px, rgba(255,255,255,0.4), transparent),
        radial-gradient(1px 1px at 700px 260px, rgba(255,255,255,0.5), transparent),
        radial-gradient(1px 1px at 400px 350px, rgba(255,255,255,0.3), transparent),
        radial-gradient(1px 1px at 550px 50px, rgba(255,255,255,0.6), transparent);
    background-size: 800px 400px;
    animation: drift 120s linear infinite;
}
.stars-md {
    background-image:
        radial-gradient(1.5px 1.5px at 100px 200px, rgba(255,255,255,0.7), transparent),
        radial-gradient(1.5px 1.5px at 350px 100px, rgba(255,255,255,0.5), transparent),
        radial-gradient(1.5px 1.5px at 520px 300px, rgba(255,255,255,0.6), transparent),
        radial-gradient(1.5px 1.5px at 200px 50px, rgba(255,255,255,0.4), transparent),
        radial-gradient(1.5px 1.5px at 680px 180px, rgba(255,255,255,0.5), transparent);
    background-size: 900px 400px;
    animation: drift 180s linear infinite;
}
.stars-lg {
    background-image:
        radial-gradient(2px 2px at 150px 130px, rgba(0, 212, 255, 0.5), transparent),
        radial-gradient(2px 2px at 500px 250px, rgba(124, 58, 237, 0.4), transparent),
        radial-gradient(2px 2px at 300px 350px, rgba(255, 255, 255, 0.8), transparent);
    background-size: 700px 500px;
    animation: drift 240s linear infinite reverse;
}
@keyframes drift {
    from { transform: translateY(0); }
    to { transform: translateY(-400px); }
}

/* ============================================================
   RESET & BASE
   ============================================================ */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html, body {
    height: 100%;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Inter, Roboto, sans-serif;
    background: var(--bg-deep);
    color: var(--text-primary);
    line-height: 1.6;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
}

:focus-visible {
    outline: 2px solid var(--cyan);
    outline-offset: 2px;
}

@media (prefers-reduced-motion: reduce) {
    .stars { animation: none !important; }
}

#app {
    position: relative;
    z-index: 1;
    min-height: 100vh;
}

.hidden {
    display: none !important;
}

/* ============================================================
   TOP NAV
   ============================================================ */
.top-nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.75rem 1.5rem;
    background: rgba(5, 10, 21, 0.85);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-bottom: 1px solid var(--glass-border);
    position: sticky;
    top: 0;
    z-index: 100;
}
.nav-left {
    display: flex;
    align-items: center;
    gap: 0.6rem;
}
.nav-logo {
    width: 28px;
    height: 28px;
    color: var(--cyan);
}
.nav-title {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text-bright);
}
.nav-right {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}
.user-chip {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.3rem 0.75rem 0.3rem 0.3rem;
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: 50px;
}
.user-avatar {
    width: 26px;
    height: 26px;
    border-radius: 50%;
    object-fit: cover;
}
.user-email {
    font-size: 0.8rem;
    color: var(--text-primary);
    max-width: 160px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.admin-nav-link {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: 1px solid rgba(124, 58, 237, 0.25);
    color: var(--purple);
    text-decoration: none;
    transition: color 0.2s, border-color 0.2s, background 0.2s;
}
.admin-nav-link:hover {
    color: var(--text-bright);
    border-color: var(--purple);
    background: var(--purple-dim);
}
.nav-btn-logout {
    background: none;
    border: 1px solid var(--glass-border);
    color: var(--text-muted);
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: color 0.2s, border-color 0.2s;
}
.nav-btn-logout:hover {
    color: var(--red);
    border-color: rgba(239, 68, 68, 0.3);
}

/* ============================================================
   TAB BAR (WEATHER PATTERN)
   ============================================================ */
.tab-bar {
    max-width: var(--app-width);
    margin: 0 auto;
    padding: 0.9rem 1.5rem 0;
    display: flex;
    gap: 0.25rem;
}
.tab-btn {
    padding: 0.6rem 1.5rem;
    background: none;
    border: 1px solid transparent;
    border-bottom: none;
    border-radius: var(--radius-sm) var(--radius-sm) 0 0;
    color: var(--text-muted);
    font-size: 0.85rem;
    font-weight: 500;
    cursor: pointer;
    transition: color 0.2s, background 0.2s;
}
.tab-btn:hover {
    color: var(--text-primary);
}
.tab-btn.active {
    color: var(--cyan);
    background: var(--glass-bg);
    border-color: var(--glass-border);
}

/* ---- Tab Content ---- */
.tab-content {
    display: none;
    animation: fadeIn 0.3s ease;
}
.tab-content.active {
    display: block;
}

/* ============================================================
   SIDEBAR LAYOUT
   ============================================================ */
.app-layout {
    display: flex;
    min-height: calc(100vh - 56px);
    position: relative;
    z-index: 1;
}
.app-sidebar {
    width: 220px;
    min-width: 220px;
    background: rgba(5, 10, 21, 0.85);
    backdrop-filter: blur(16px);
    border-right: 1px solid var(--glass-border);
    padding: 1rem 0;
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    position: sticky;
    top: 56px;
    height: calc(100vh - 56px);
}
.app-main {
    flex: 1;
    min-width: 0;
    overflow-x: hidden;
}

/* ---- Sidebar Groups ---- */
.sidebar-group {
    padding: 0.25rem 0.75rem;
    margin-bottom: 0.25rem;
}
.sidebar-group-label {
    font-size: 0.65rem;
    font-weight: 700;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.12em;
    padding: 0.5rem 0.75rem 0.35rem;
}

/* ---- Sidebar Buttons ---- */
.sidebar-btn {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    width: 100%;
    padding: 0.5rem 0.75rem;
    background: none;
    border: none;
    border-radius: var(--radius-sm);
    color: var(--text-muted);
    font-size: 0.82rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.15s ease;
    text-align: left;
}
.sidebar-btn:hover {
    background: var(--glass-hover);
    color: var(--text-bright);
}
.sidebar-btn.active {
    background: rgba(0, 212, 255, 0.1);
    color: var(--cyan);
}
.sidebar-btn svg {
    flex-shrink: 0;
    opacity: 0.7;
}
.sidebar-btn.active svg {
    opacity: 1;
}

/* ---- Sidebar Links (external) ---- */
.sidebar-link {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.5rem 0.75rem;
    color: var(--text-muted);
    text-decoration: none;
    font-size: 0.82rem;
    font-weight: 500;
    border-radius: var(--radius-sm);
    transition: all 0.15s ease;
}
.sidebar-link:hover {
    background: var(--glass-hover);
    color: var(--text-bright);
}
.sidebar-link svg {
    flex-shrink: 0;
    opacity: 0.7;
}

/* ---- Sidebar Footer ---- */
.sidebar-footer {
    margin-top: auto;
    padding: 1rem 1.5rem 0.5rem;
    border-top: 1px solid var(--glass-border);
}
.sidebar-footer .footer-copy {
    font-size: 0.65rem;
    color: var(--text-muted);
    opacity: 0.5;
}

/* ---- Sidebar Toggle (hamburger, mobile only) ---- */
.sidebar-toggle {
    display: none;
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 0.4rem;
    border-radius: var(--radius-sm);
    transition: color 0.2s;
}
.sidebar-toggle:hover {
    color: var(--text-bright);
}

/* ---- Mobile sidebar ---- */
@media (max-width: 768px) {
    .sidebar-toggle {
        display: flex;
    }
    .app-sidebar {
        position: fixed;
        top: 56px;
        left: 0;
        bottom: 0;
        z-index: 100;
        transform: translateX(-100%);
        transition: transform 0.25s ease;
        background: rgba(5, 10, 21, 0.96);
    }
    .app-sidebar.open {
        transform: translateX(0);
        box-shadow: 4px 0 20px rgba(0, 0, 0, 0.5);
    }
    .app-main {
        width: 100%;
    }
}

/* ============================================================
   TTS MANAGEMENT STYLES (shared between index and tts-management)
   ============================================================ */

/* ---- TTS Navigation Tabs (standalone page) ---- */
.nav-tabs {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
    padding-bottom: 0;
    border-bottom: none;
}
.nav-tab {
    padding: 0.5rem 1.25rem;
    background: transparent;
    border: 1px solid transparent;
    border-radius: var(--radius-sm) var(--radius-sm) 0 0;
    cursor: pointer;
    color: var(--text-muted);
    font-size: 0.85rem;
    font-weight: 500;
    transition: color 0.2s, background 0.2s;
}
.nav-tab.active {
    color: var(--cyan);
    background: var(--glass-bg);
    border-color: var(--glass-border);
    border-bottom-color: transparent;
}
.nav-tab:hover:not(.active) {
    color: var(--text-bright);
}

/* ---- TTS Management Sections ---- */
.management-section {
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius);
    padding: 0 1.5rem 1.5rem 1.5rem;
    margin-bottom: 1.5rem;
    backdrop-filter: blur(12px);
}

/* ---- TTS Button Variants ---- */
.btn-primary {
    background: var(--cyan);
    color: var(--bg-deep);
}
.btn-primary:hover {
    filter: brightness(1.15);
}
.btn-secondary {
    background: var(--glass-bg);
    color: var(--text-bright);
    border: 1px solid var(--glass-border);
}
.btn-secondary:hover {
    background: var(--glass-hover);
}
.btn-danger {
    background: #ff4757;
    color: white;
}
.btn-danger:hover {
    background: #ff3742;
}

/* ---- Data Grid (TTS models/hierarchy) ---- */
.data-grid {
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-sm);
    overflow: hidden;
    background: var(--glass-bg);
}
.data-grid-header {
    background: rgba(0, 224, 255, 0.05);
    padding: 1rem;
    font-weight: 600;
    color: var(--text-bright);
    border-bottom: 1px solid var(--glass-border);
    text-align: left;
}
.data-grid-row {
    display: flex;
    align-items: center;
    padding: 1rem;
    border-bottom: 1px solid var(--glass-border);
    transition: background 0.2s ease;
    width: 100%;
}
.data-grid-row:hover {
    background: var(--glass-hover);
}
.data-grid-row:last-child {
    border-bottom: none;
}
.data-grid-cell {
    flex: 1;
    padding-right: 1rem;
    color: var(--text-primary);
    text-align: left;
    vertical-align: top;
}
.data-grid-cell.actions {
    flex: 0 0 auto;
    display: flex;
    gap: 0.5rem;
}
.data-grid-cell .btn {
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
}

/* ---- Voices Table ---- */
.voices-table {
    width: 100%;
    border-collapse: collapse;
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-sm);
    overflow: hidden;
}
.voices-table th {
    background: rgba(0, 224, 255, 0.05);
    padding: 1rem;
    font-weight: 600;
    color: var(--text-bright);
    border-bottom: 1px solid var(--glass-border);
    text-align: left;
    white-space: nowrap;
}
.voices-table td {
    padding: 0.75rem 1rem;
    border-bottom: 1px solid var(--glass-border);
    color: var(--text-primary);
    vertical-align: middle;
}
.voices-table tr:hover {
    background: var(--glass-hover);
}
.voices-table tr:last-child td {
    border-bottom: none;
}
.voice-name-cell { min-width: 200px; max-width: 300px; }
.factory-cell { min-width: 120px; max-width: 150px; }
.voice-id-cell {
    min-width: 150px; max-width: 200px;
    font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
    font-size: 0.85rem;
}
.gender-cell { min-width: 80px; max-width: 100px; text-transform: capitalize; }
.demo-cell { min-width: 50px; max-width: 70px; text-align: center; }
.actions-cell { min-width: 115px; width: 115px; white-space: nowrap; }
.voice-title { font-weight: 600; color: var(--text-bright); margin-bottom: 0.25rem; }
.voice-subtitle { font-size: 0.875rem; color: var(--text-muted); margin-bottom: 0.25rem; }
.voice-tags { font-size: 0.75rem; color: var(--cyan); }

/* ---- Demo Controls ---- */
.demo-controls {
    display: flex;
    align-items: center;
    justify-content: center;
}
.demo-play-btn {
    width: 32px; height: 32px;
    border-radius: 50%;
    border: 1px solid var(--glass-border);
    background: var(--glass-bg);
    color: var(--text-muted);
    cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    font-size: 14px;
    transition: all 0.2s ease;
    margin-right: 0.5rem;
}
.demo-play-btn:hover {
    background: var(--cyan);
    color: var(--bg-deep);
    border-color: var(--cyan);
}
.demo-play-btn.playing {
    background: var(--cyan);
    color: var(--bg-deep);
    border-color: var(--cyan);
}

/* ---- Factories Grid ---- */
.factories-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
    width: 100%;
}
.factory-card {
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius);
    padding: 1rem;
    backdrop-filter: blur(12px);
    width: 100%;
    box-sizing: border-box;
}
.factory-title { color: var(--text-bright); margin: 0 0 0.5rem 0; font-size: 1rem; font-weight: 600; }
.factory-description { color: var(--text-muted); margin: 0 0 1rem 0; font-size: 0.85rem; }
.factory-actions { display: flex; gap: 0.5rem; margin-bottom: 1rem; }
.factory-stats { display: flex; flex-direction: column; gap: 0.5rem; }
.factory-stat { display: flex; justify-content: space-between; font-size: 0.8rem; }
.factory-stat-label { color: var(--text-primary); }
.factory-stat-value { color: var(--text-muted); }
.factory-stat-value.yes { color: var(--green); }
.factory-stat-value.no { color: #ff4757; }

/* ---- Hierarchy Grid ---- */
.hierarchy-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
    gap: 2rem;
    margin-bottom: 2rem;
    width: 100%;
}
.hierarchy-card {
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius);
    padding: 1.5rem;
    backdrop-filter: blur(12px);
    width: 100%;
    box-sizing: border-box;
    transition: all 0.3s ease;
    box-shadow: var(--shadow-sm);
}
.hierarchy-card:hover {
    box-shadow: var(--shadow-md);
    border-color: var(--cyan);
}
.hierarchy-stats {
    display: flex;
    gap: 1.5rem;
    margin: 1rem 0;
    padding: 1rem;
    background: rgba(0, 0, 0, 0.2);
    border-radius: var(--radius-sm);
    border: 1px solid var(--glass-border);
}
.hierarchy-stat { text-align: center; flex: 1; }
.hierarchy-stat-number { font-size: 1.5rem; font-weight: 600; color: var(--cyan); display: block; }
.hierarchy-stat-label { font-size: 0.875rem; color: var(--text-muted); margin-top: 0.25rem; }

/* ---- TTS Action Buttons ---- */
.action-buttons {
    display: flex;
    align-items: center;
    gap: 0.25rem;
}
.icon-btn {
    width: 32px; height: 32px;
    display: flex; align-items: center; justify-content: center;
    background: none;
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-sm);
    color: var(--text-muted);
    cursor: pointer;
    transition: all 0.2s;
}
.icon-btn:hover {
    background: var(--glass-hover);
    color: var(--text-bright);
    border-color: var(--cyan);
}
.icon-btn svg { width: 15px; height: 15px; }
.icon-btn.danger:hover,
.icon-btn-delete:hover {
    color: #ff4757;
    background: rgba(255, 71, 87, 0.1);
    border-color: rgba(255, 71, 87, 0.3);
}
.icon-btn-edit:hover {
    color: var(--cyan);
    background: rgba(0, 212, 255, 0.1);
    border-color: var(--cyan);
}

/* ---- TTS Badges ---- */
.premium-badge {
    background: #ffd700;
    color: #000;
    padding: 0.25rem 0.5rem;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 600;
}
.version-tag {
    padding: 0.15rem 0.4rem;
    border-radius: 8px;
    font-size: 0.65rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    display: inline-block;
}
.version-tag.v3 {
    background: #9c27b0;
    color: white;
}

/* ---- TTS Form Controls ---- */
.form-group { margin-bottom: 1.5rem; }
.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    color: var(--text-primary);
    font-weight: 500;
}
.form-control {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-sm);
    background: rgba(0, 0, 0, 0.2);
    color: var(--text-primary);
    font-size: 1rem;
    box-sizing: border-box;
}
.form-control:focus {
    outline: none;
    border-color: var(--cyan);
    box-shadow: 0 0 0 2px rgba(0, 212, 255, 0.15);
}
textarea.form-control { resize: vertical; min-height: 100px; }
.checkbox-group { display: flex; align-items: center; gap: 0.5rem; }

/* ---- TTS Loading Spinner ---- */
.loading-spinner {
    display: inline-block;
    width: 12px; height: 12px;
    border: 2px solid var(--glass-border);
    border-radius: 50%;
    border-top-color: var(--cyan);
    animation: spin 1s ease-in-out infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ---- TTS Status Messages ---- */
.tts-error-msg, .tts-success-msg {
    padding: 1rem;
    border-radius: var(--radius-sm);
    margin-bottom: 1rem;
}

/* ---- TTS Responsive ---- */
@media (max-width: 768px) {
    .factories-grid, .hierarchy-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    .data-grid-row {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }
    .voices-table { font-size: 0.85rem; }
    .voices-table th,
    .voices-table td { padding: 0.75rem 0.5rem; }
    .voice-name-cell { min-width: 150px; max-width: 200px; }
    .factory-cell { min-width: 90px; max-width: 120px; }
    .voice-id-cell { min-width: 120px; max-width: 150px; font-size: 0.75rem; }
}

/* ============================================================
   TAB HERO SECTIONS
   ============================================================ */
.tab-hero {
    padding: 1.25rem 1.5rem 2rem;
    max-width: var(--app-width);
    margin: 0 auto;
}
.tab-eyebrow {
    font-size: 0.72rem;
    font-weight: 700;
    color: var(--cyan);
    text-transform: uppercase;
    letter-spacing: 0.16em;
}
.tab-heading {
    font-size: clamp(1.65rem, 2.2vw, 2.35rem);
    color: var(--text-bright);
    margin-top: 0.4rem;
    letter-spacing: -0.03em;
}
.tab-subcopy {
    font-size: 0.98rem;
    color: var(--text-muted);
    line-height: 1.7;
    max-width: 56ch;
    margin-top: 0.35rem;
}

/* ============================================================
   GLASS CARDS
   ============================================================ */
.glass-card {
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius);
    padding: 1.2rem;
    backdrop-filter: blur(12px);
}

/* ============================================================
   FORM LABELS (WEATHER PATTERN)
   ============================================================ */
.form-label {
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--text-muted);
    margin-bottom: 0.35rem;
    display: block;
}

/* ============================================================
   SEARCH BOX
   ============================================================ */
.search-box {
    position: relative;
    width: 100%;
}
.search-icon {
    position: absolute;
    left: 0.75rem;
    top: 50%;
    transform: translateY(-50%);
    width: 18px;
    height: 18px;
    color: var(--text-tertiary);
}
.search-input {
    width: 100%;
    padding: 0.5rem 0.75rem 0.5rem 2.5rem;
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-full);
    font-size: 0.875rem;
    color: var(--text-primary);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}
.search-input:focus {
    outline: none;
    border-color: var(--cyan);
    background: rgba(0, 0, 0, 0.3);
    box-shadow: 0 0 0 3px rgba(0, 212, 255, 0.1),
                0 2px 8px rgba(0, 212, 255, 0.2);
    transform: translateY(-1px);
}

/* ============================================================
   MAIN CONTENT
   ============================================================ */
.main-content {
    flex: 1;
    padding: 1.5rem;
    overflow-y: auto;
    background: transparent;
    position: relative;
    z-index: 1;
    max-width: var(--app-width);
    margin: 0 auto;
    width: 100%;
}

/* ---- Standard Page Content Wrapper ---- */
.page-content {
    flex: 1;
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem;
    padding-top: 1rem;
    width: 100%;
    box-sizing: border-box;
}

/* ============================================================
   DJ CONTAINER
   ============================================================ */
.dj-container {
    display: grid;
    gap: 1rem;
    animation: fadeIn 0.3s ease;
}
.dj-container.grid-view {
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
}
.dj-container.list-view {
    grid-template-columns: 1fr;
}

/* ============================================================
   DJ CARDS (GLASS EFFECT)
   ============================================================ */
.dj-card {
    position: relative;
    display: flex;
    flex-direction: column;
    background: var(--glass-bg);
    border-radius: var(--radius);
    padding: 1rem;
    border: 1px solid var(--glass-border);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    cursor: pointer;
    animation: slideUp 0.3s ease;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}
.dj-card:hover {
    transform: translateY(-4px) scale(1.02);
    box-shadow: 0 20px 40px -15px rgba(0, 212, 255, 0.2),
                0 10px 20px -10px rgba(0, 0, 0, 0.3);
    border-color: var(--cyan);
    background: var(--glass-hover);
}

/* ---- Playing State ---- */
.dj-card.playing {
    border-color: var(--cyan);
    background: linear-gradient(135deg, var(--glass-bg), rgba(0, 212, 255, 0.08));
    animation: pulseGlow 2s ease-in-out infinite;
    transform: translateY(-2px);
    overflow: hidden;
    position: relative;
}
.dj-card.playing::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg,
        transparent 0%,
        rgba(0, 212, 255, 0.1) 20%,
        rgba(0, 212, 255, 0.3) 50%,
        rgba(0, 212, 255, 0.1) 80%,
        transparent 100%);
    animation: radioWave 2s ease-in-out infinite;
    pointer-events: none;
    z-index: 1;
}
.dj-card.playing::after {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg,
        transparent 0%,
        rgba(124, 58, 237, 0.05) 20%,
        rgba(124, 58, 237, 0.15) 50%,
        rgba(124, 58, 237, 0.05) 80%,
        transparent 100%);
    animation: radioWave 2s ease-in-out infinite 0.3s;
    pointer-events: none;
    z-index: 1;
}

.dj-card-header {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 0.75rem;
    position: relative;
    z-index: 2;
}

/* ---- DJ Avatar ---- */
.dj-avatar {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    object-fit: cover;
    background: linear-gradient(135deg, var(--cyan), var(--purple));
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 600;
    font-size: 1.25rem;
    flex-shrink: 0;
    position: relative;
    transition: transform 0.3s ease;
    overflow: visible;
}
.dj-card:hover .dj-avatar {
    transform: rotate(-5deg) scale(1.1);
}
.dj-card.playing .dj-avatar {
    animation: avatarPulse 2s ease-in-out infinite;
}
.dj-avatar img {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    object-fit: cover;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

/* ---- Play Button Overlay on Avatar ---- */
.dj-play-overlay {
    position: absolute;
    bottom: -6px;
    right: -6px;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--cyan), var(--purple));
    color: white;
    border: 2px solid var(--bg-surface);
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    box-shadow: 0 2px 10px rgba(0, 212, 255, 0.4);
    z-index: 5;
    opacity: 0;
    transform: scale(0.8);
}
.dj-card:hover .dj-play-overlay {
    opacity: 1;
    transform: scale(1);
}
.dj-play-overlay[data-playing="true"] {
    opacity: 1;
    transform: scale(1);
    background: var(--green);
    animation: playPulse 1.5s ease-in-out infinite;
}
.dj-play-overlay:hover {
    transform: scale(1.15);
    box-shadow: 0 3px 12px rgba(0, 212, 255, 0.4);
}
.dj-play-overlay svg {
    width: 14px;
    height: 14px;
    stroke-width: 2.5;
}

/* ---- DJ Info ---- */
.dj-info {
    flex: 1;
    min-width: 0;
}
.dj-name {
    font-weight: 600;
    font-size: 1rem;
    color: var(--text-bright);
    margin-bottom: 0.125rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.dj-meta {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.75rem;
    color: var(--text-tertiary);
}
/* ---- Card Wallet Footer ---- */
.dj-card-wallet {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-top: auto;
    padding: 0.35rem 1rem 0;
    margin-left: -1rem;
    margin-right: -1rem;
    margin-bottom: -1rem;
    padding-bottom: 0.4rem;
    border-top: 1px solid rgba(255, 255, 255, 0.06);
    font-size: 0.75rem;
    color: #f0b90b;
    position: relative;
    z-index: 2;
}
.card-botfi-balance {
    opacity: 0.7;
    font-variant-numeric: tabular-nums;
}
.dj-summary {
    font-size: 0.875rem;
    color: var(--text-muted);
    line-height: 1.4;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    margin-bottom: 0.75rem;
    position: relative;
    z-index: 2;
}

/* ---- Tags ---- */
.dj-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.375rem;
    margin-top: 0.625rem;
    margin-bottom: 0.75rem;
    position: relative;
    z-index: 2;
}
.tag-chip {
    display: inline-block;
    padding: 0.25rem 0.625rem;
    background: var(--cyan-dim);
    border: 1px solid rgba(0, 212, 255, 0.2);
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 500;
    color: var(--cyan);
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    cursor: default;
}
.tag-chip:hover {
    background: rgba(0, 212, 255, 0.25);
    border-color: var(--cyan);
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(0, 212, 255, 0.2);
}

/* ---- DJ Actions ---- */
.dj-actions {
    display: flex;
    gap: 0.5rem;
}
.dj-title-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
}

/* ---- Round Action Buttons ---- */
.dj-action-btn {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    color: var(--text-muted);
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    backdrop-filter: blur(5px);
}
.dj-action-btn:hover {
    background: var(--cyan);
    color: var(--bg-deep);
    border-color: var(--cyan);
    transform: translateY(-2px) rotate(5deg);
    box-shadow: 0 4px 12px rgba(0, 212, 255, 0.3);
}
.dj-action-btn:active {
    transform: translateY(0) rotate(0deg);
}
.dj-action-btn.delete-btn:hover {
    background: var(--red);
    color: white;
    border-color: var(--red);
}
.dj-action-btn svg {
    width: 16px;
    height: 16px;
}

/* ---- DJ Button (inline) ---- */
.dj-btn {
    flex: 1;
    padding: 0.5rem;
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-sm);
    color: var(--text-muted);
    font-size: 0.75rem;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.375rem;
    min-width: 36px;
}
.dj-btn:hover {
    background: var(--glass-hover);
    color: var(--text-bright);
    border-color: var(--cyan);
}
.dj-btn svg {
    width: 16px;
    height: 16px;
}
.dj-btn.play-btn {
    background: var(--cyan);
    color: var(--bg-deep);
    border-color: var(--cyan);
    flex: 0 0 auto;
    min-width: auto;
    padding: 0.375rem 0.625rem;
}
.dj-btn.play-btn:hover {
    background: #00b8db;
    border-color: #00b8db;
    transform: scale(1.05);
}
.dj-btn.play-btn[data-playing="true"] {
    background: var(--green);
    border-color: var(--green);
}
.dj-btn.play-btn svg {
    width: 16px;
    height: 16px;
}

/* ---- List View ---- */
.list-view .dj-card {
    display: flex;
    align-items: center;
    padding: 0.75rem 1rem;
}
.list-view .dj-card-header {
    flex: 1;
    margin-bottom: 0;
}
.list-view .dj-avatar {
    width: 40px;
    height: 40px;
}
.list-view .dj-summary,
.list-view .dj-card-wallet {
    display: none;
}
.list-view .dj-actions {
    margin-left: auto;
}

/* ============================================================
   EMPTY STATE
   ============================================================ */
.empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 4rem 2rem;
    text-align: center;
    color: var(--text-tertiary);
}
.empty-state svg {
    width: 64px;
    height: 64px;
    margin-bottom: 1rem;
    opacity: 0.5;
}
.empty-state h3 {
    font-size: 1.25rem;
    color: var(--text-muted);
    margin-bottom: 0.5rem;
}

/* ============================================================
   STATUS BAR
   ============================================================ */
.status-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.5rem 1.5rem;
    background: var(--glass-bg);
    border-top: 1px solid var(--glass-border);
    font-size: 0.75rem;
    color: var(--text-tertiary);
    position: relative;
    z-index: 1;
}
.status-left,
.status-center,
.status-right {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}
.status-center {
    flex: 1;
    justify-content: center;
}
.status-indicator {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--green);
    animation: pulse 2s infinite;
    box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.4);
}
.status-indicator.active {
    animation: statusPulse 1.5s ease-in-out infinite;
}
.status-indicator.error {
    background: var(--red);
}
.separator {
    opacity: 0.3;
}

/* ============================================================
   MODALS
   ============================================================ */
.modal {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.75);
    backdrop-filter: blur(12px);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}
.modal.show {
    display: flex;
    animation: fadeIn 0.3s ease;
}
/* Backward compat with edit.html which uses .hidden */
.modal.hidden {
    display: none;
}

.modal-content {
    background: #0d1b30;
    border-radius: 16px;
    width: 90%;
    max-width: 500px;
    max-height: 90vh;
    overflow: hidden;
    box-shadow: 0 30px 60px -20px rgba(0, 0, 0, 0.7),
                0 0 80px -20px rgba(0, 212, 255, 0.15),
                inset 0 0 0 1px rgba(255, 255, 255, 0.03);
    animation: modalSlideIn 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
    border: 1px solid rgba(255, 255, 255, 0.08);
}
.modal-content.compact {
    max-width: 320px;
    padding: 2rem;
    text-align: center;
}
.modal-content.large {
    max-width: 800px;
}
.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1.5rem 1.75rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    background: linear-gradient(180deg, rgba(0, 212, 255, 0.08) 0%, transparent 100%);
}
.modal-header h2 {
    font-size: 1.375rem;
    font-weight: 600;
    background: linear-gradient(135deg, var(--cyan), var(--purple));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}
.close-btn {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 50%;
    color: rgba(255, 255, 255, 0.5);
    font-size: 1.25rem;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}
.close-btn:hover {
    background: var(--red-dim);
    border-color: rgba(239, 68, 68, 0.3);
    color: var(--red);
    transform: rotate(90deg) scale(1.1);
}
.modal-body {
    padding: 1.75rem;
    overflow-y: auto;
    max-height: calc(90vh - 100px);
    background: transparent;
}

/* ---- DJ Detail Modal ---- */
.dj-detail-wrapper {
    background: #131b28;
    border-radius: 12px;
    margin: -1rem;
    padding: 0;
    overflow: hidden;
}
.dj-detail-header {
    display: flex;
    gap: 1.25rem;
    padding: 1.5rem;
    background: linear-gradient(180deg, rgba(0, 212, 255, 0.06) 0%, transparent 100%);
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}
.dj-detail-avatar {
    width: 100px;
    height: 100px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--cyan), var(--purple));
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    overflow: hidden;
    border: 2px solid rgba(255, 255, 255, 0.1);
}
.dj-detail-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.dj-detail-initials {
    color: white;
    font-size: 2.25rem;
    font-weight: 600;
}
.dj-detail-info {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    justify-content: center;
}
.dj-detail-name {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-bright);
    margin-bottom: 0.25rem;
}
.dj-detail-meta {
    display: flex;
    gap: 0.625rem;
    font-size: 0.85rem;
    color: rgba(255, 255, 255, 0.5);
}
.dj-detail-meta span:not(:last-child)::after {
    content: "\00b7";
    margin-left: 0.625rem;
    color: rgba(255, 255, 255, 0.25);
}
.dj-detail-section {
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}
.dj-detail-section:last-of-type {
    border-bottom: none;
}
.dj-detail-section-title {
    color: rgba(var(--primary-rgb), 0.85);
    margin-bottom: 0.75rem;
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}
.dj-detail-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 0.75rem;
}
.dj-detail-field {
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
}
.dj-detail-label {
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.4);
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}
.dj-detail-value {
    color: rgba(255, 255, 255, 0.9);
    font-size: 0.9rem;
}
.dj-detail-mono {
    font-family: monospace;
    font-size: 0.8rem;
    color: rgba(255, 255, 255, 0.65);
    word-break: break-all;
}
.dj-detail-id-row {
    display: flex;
    flex-direction: column;
    gap: 0.625rem;
}
.dj-detail-id-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 0.75rem;
    background: rgba(0, 0, 0, 0.25);
    border-radius: 8px;
    flex-wrap: wrap;
}
.dj-detail-id-item .dj-detail-label {
    text-transform: uppercase;
    flex-shrink: 0;
    min-width: 70px;
}
.dj-detail-id-item .dj-detail-mono {
    flex: 1;
    min-width: 0;
}
.dj-detail-copy-btn {
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 0.25rem;
    color: rgba(255, 255, 255, 0.35);
    transition: color 0.2s;
    flex-shrink: 0;
}
.dj-detail-copy-btn:hover {
    color: var(--cyan);
}
.dj-detail-actions {
    display: flex;
    gap: 0.75rem;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 1.5rem;
    border-top: 1px solid rgba(255, 255, 255, 0.06);
    background: rgba(0, 0, 0, 0.15);
}

/* ============================================================
   FORMS
   ============================================================ */
.pin-input {
    width: 100%;
    padding: 0.75rem;
    margin: 1rem 0;
    background: rgba(0, 0, 0, 0.3);
    border: 2px solid var(--glass-border);
    border-radius: var(--radius-sm);
    font-size: 1.5rem;
    text-align: center;
    letter-spacing: 0.5em;
    color: var(--text-primary);
}
.pin-input:focus {
    outline: none;
    border-color: var(--cyan);
}

/* ---- Buttons ---- */
.btn {
    padding: 0.625rem 1.25rem;
    background: var(--bg-tertiary);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}
.btn:hover {
    background: var(--glass-hover);
}
.btn.primary {
    background: linear-gradient(135deg, var(--cyan), var(--purple));
    border: none;
    color: white;
    position: relative;
    overflow: hidden;
    padding: 0.75rem 1.5rem;
    font-weight: 500;
    letter-spacing: 0.025em;
    box-shadow: 0 4px 12px rgba(0, 212, 255, 0.2);
}
.btn.primary::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.3);
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
}
.btn.primary:hover::before {
    width: 300px;
    height: 300px;
}
.btn.primary:hover {
    background: linear-gradient(135deg, #00b8db, #6d28d9);
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(0, 212, 255, 0.35);
}
#submitDjBtn {
    width: 100%;
    margin-top: 1.5rem;
}

/* ---- Error Message ---- */
.error-msg {
    color: var(--red);
    font-size: 0.8125rem;
    margin-top: 0.75rem;
    padding: 0.5rem 0.75rem;
    background: var(--red-dim);
    border: 1px solid rgba(239, 68, 68, 0.2);
    border-radius: 8px;
    display: none;
}
.error-msg:not(:empty) {
    display: block;
    animation: slideUp 0.3s ease;
}

/* ---- Tabs (inside modals) ---- */
.tabs {
    display: flex;
    gap: 0.25rem;
    margin-bottom: 1.75rem;
    padding: 0.25rem;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 10px;
    border: 1px solid rgba(255, 255, 255, 0.05);
}
.tab {
    flex: 1;
    padding: 0.625rem 1rem;
    background: transparent;
    border: none;
    border-radius: 8px;
    color: rgba(255, 255, 255, 0.6);
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}
.tab:hover:not(.active) {
    background: rgba(255, 255, 255, 0.05);
    color: rgba(255, 255, 255, 0.8);
}
.tab.active {
    background: linear-gradient(135deg, var(--cyan), var(--purple));
    color: white;
    box-shadow: 0 2px 8px rgba(0, 212, 255, 0.3);
    transform: translateY(-1px);
}

/* ---- Modal Tab Specific ---- */
#jsonTab {
    width: 100%;
}
#jsonTab .input-group {
    width: 100%;
}
#urlTab {
    min-height: 80px;
    width: 100%;
}

/* ---- DJ Modal Specific ---- */
#djModal .input-group {
    margin-bottom: 1.25rem;
}
#djModal .input-group:first-child {
    margin-bottom: 1rem;
}
#djModal #hostUrl {
    background: rgba(0, 0, 0, 0.4);
    border: 1px solid rgba(255, 255, 255, 0.08);
    color: rgba(255, 255, 255, 0.9);
}
#djModal #hostUrl::placeholder {
    color: rgba(255, 255, 255, 0.3);
}
#djModal #hostUrl:focus {
    background: rgba(0, 0, 0, 0.5);
    border-color: rgba(0, 212, 255, 0.5);
}
#urlInput {
    width: 100%;
    padding: 1rem;
    background: rgba(0, 0, 0, 0.4);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 10px;
    color: rgba(255, 255, 255, 0.9);
    font-size: 0.875rem;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}
#urlInput::placeholder {
    color: rgba(255, 255, 255, 0.3);
}
#urlInput:focus {
    outline: none;
    border-color: var(--cyan);
    background: rgba(0, 0, 0, 0.5);
    box-shadow: 0 0 0 3px rgba(0, 212, 255, 0.1),
                inset 0 0 0 1px rgba(0, 212, 255, 0.2);
}

/* ============================================================
   INPUT GROUPS
   ============================================================ */
.input-group {
    margin-bottom: 0.75rem;
    display: flex;
    flex-direction: column;
}
.input-group.half {
    display: inline-block;
    width: calc(50% - 0.5rem);
}
.input-group.half:nth-child(odd) {
    margin-right: 1rem;
}
.input-group label {
    display: block;
    font-size: 0.8125rem;
    font-weight: 500;
    color: rgba(255, 255, 255, 0.7);
    margin-bottom: 0.375rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}
.input-group input,
.input-group textarea {
    width: 100%;
    padding: 0.75rem 1rem;
    background: rgba(0, 0, 0, 0.4);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    color: rgba(255, 255, 255, 0.9);
    font-size: 0.875rem;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}
.input-group input::placeholder,
.input-group textarea::placeholder {
    color: rgba(255, 255, 255, 0.3);
}
.input-group input:focus,
.input-group textarea:focus {
    outline: none;
    border-color: var(--cyan);
    background: rgba(0, 0, 0, 0.5);
    box-shadow: 0 0 0 3px rgba(0, 212, 255, 0.1),
                inset 0 0 0 1px rgba(0, 212, 255, 0.2);
}

textarea {
    resize: vertical;
    min-height: 120px;
    font-family: inherit;
    line-height: 1.5;
}
textarea#jsonInput {
    width: 100% !important;
    min-height: 350px;
    font-family: 'Courier New', monospace;
    font-size: 0.9rem;
    background: rgba(0, 0, 0, 0.4);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 10px;
    color: rgba(255, 255, 255, 0.9);
    padding: 1rem;
    margin-top: 0.75rem;
    resize: vertical;
    display: block;
    box-sizing: border-box;
}
textarea#jsonInput:focus {
    background: rgba(0, 0, 0, 0.5);
    border-color: rgba(0, 212, 255, 0.5);
    box-shadow: 0 0 0 3px rgba(0, 212, 255, 0.1),
                inset 0 0 0 1px rgba(0, 212, 255, 0.2);
}
textarea#jsonInput::placeholder {
    color: rgba(255, 255, 255, 0.3);
}

.required {
    color: var(--red);
    font-weight: 600;
}

/* ---- Sections ---- */
.section {
    margin-bottom: 1.5rem;
}
.section h3 {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-bright);
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid var(--glass-border);
}
.form-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
}
.form-grid > * {
    flex: 1;
    min-width: 200px;
}

/* ---- Form Actions ---- */
.form-actions {
    display: flex;
    gap: 1rem;
    justify-content: flex-end;
    margin-top: 1.5rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--glass-border);
}

/* ============================================================
   MEDIA UPLOAD
   ============================================================ */
.media-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    margin-bottom: 1rem;
}
.upload-box {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 2rem 1rem;
    background: var(--glass-bg);
    border: 2px dashed var(--glass-border);
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all 0.2s;
}
.upload-box:hover {
    border-color: var(--cyan);
    background: var(--glass-hover);
}
.upload-box svg {
    width: 32px;
    height: 32px;
    color: var(--text-tertiary);
    margin-bottom: 0.5rem;
}
.upload-box span {
    font-size: 0.875rem;
    color: var(--text-muted);
}
.media-preview {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}
.media-preview img,
.media-preview audio {
    max-width: 100%;
    border-radius: var(--radius-sm);
}

/* ============================================================
   COLLAPSIBLE
   ============================================================ */
.collapsible {
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-sm);
    margin-bottom: 1rem;
}
.collapsible summary {
    padding: 0.75rem 1rem;
    background: var(--glass-bg);
    cursor: pointer;
    font-weight: 500;
    color: var(--text-primary);
    user-select: none;
}
.collapsible summary:hover {
    background: var(--glass-hover);
}
.collapsible[open] summary {
    border-bottom: 1px solid var(--glass-border);
}
.collapsible > *:not(summary) {
    padding: 1rem;
}

/* ============================================================
   SPINNER / LOADING
   ============================================================ */
.loading {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
}
.spinner {
    width: 32px;
    height: 32px;
    position: relative;
    animation: spinnerRotate 1s linear infinite;
}
.spinner::before,
.spinner::after {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: 50%;
    border: 3px solid transparent;
}
.spinner::before {
    border-top-color: var(--cyan);
    animation: spin 1.5s linear infinite;
}
.spinner::after {
    border-bottom-color: var(--purple);
    animation: spin 1.5s linear infinite reverse;
}
.spinner.small {
    width: 20px;
    height: 20px;
    border-width: 2px;
}

/* ---- Progress Box ---- */
.progress-box {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem;
    background: var(--cyan-dim);
    border: 1px solid rgba(0, 212, 255, 0.2);
    border-radius: 10px;
    margin-bottom: 1rem;
}
.progress-box span {
    color: var(--cyan);
    font-size: 0.875rem;
    font-weight: 500;
}

/* ============================================================
   ICON BUTTONS
   ============================================================ */
.icon-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    padding: 0;
    background: transparent;
    border: 1px solid transparent;
    border-radius: var(--radius-sm);
    color: var(--text-muted);
    cursor: pointer;
    transition: all 0.2s ease;
    position: relative;
    overflow: hidden;
}
.icon-btn::before {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(circle, var(--cyan), transparent);
    opacity: 0;
    transition: opacity 0.3s ease;
}
.icon-btn:hover::before {
    opacity: 0.1;
}
.icon-btn:hover {
    background: var(--glass-bg);
    color: var(--text-bright);
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
}
.icon-btn.primary {
    background: var(--cyan);
    color: var(--bg-deep);
}
.icon-btn.primary:hover {
    background: #00b8db;
}
.icon-btn svg {
    width: 20px;
    height: 20px;
}
.icon-btn:not(.primary) {
    color: var(--text-muted);
}
.icon-btn:not(.primary):hover {
    color: var(--cyan);
    background: var(--cyan-dim);
}
.icon-btn.active {
    color: var(--cyan);
    background: var(--cyan-dim);
}

/* ============================================================
   API DOCUMENTATION STYLES
   ============================================================ */
.docs-content {
    font-size: 0.875rem;
    line-height: 1.6;
}
.docs-content h3 {
    color: var(--cyan);
    margin: 1.5rem 0 0.75rem;
    font-size: 1.125rem;
}
.docs-content h4 {
    color: var(--text-bright);
    margin: 1rem 0 0.5rem;
    font-size: 1rem;
}
.docs-content code {
    background: rgba(0, 0, 0, 0.3);
    padding: 0.125rem 0.375rem;
    border-radius: 0.25rem;
    font-family: 'Courier New', monospace;
    font-size: 0.875rem;
}
.docs-content pre {
    background: rgba(0, 0, 0, 0.3);
    padding: 1rem;
    border-radius: var(--radius-sm);
    overflow-x: auto;
    margin: 1rem 0;
}
.docs-content pre code {
    background: none;
    padding: 0;
}

/* ---- API Docs Sections ---- */
.docs-section {
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius);
    padding: 1.5rem;
    margin-bottom: 1.25rem;
    backdrop-filter: blur(12px);
}
.docs-section h3 {
    color: var(--cyan);
    font-size: 1.1rem;
    margin-top: 0;
    margin-bottom: 1rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid var(--glass-border);
}

/* ---- Endpoint Cards ---- */
.endpoint-card {
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-sm);
    padding: 1rem 1.25rem;
    margin-bottom: 0.75rem;
    transition: border-color 0.2s;
}
.endpoint-card:hover {
    border-color: var(--glass-border);
}
.endpoint-card:last-child {
    margin-bottom: 0;
}

/* ---- Method Badges ---- */
.method-badge {
    display: inline-block;
    padding: 0.2rem 0.6rem;
    border-radius: var(--radius-full);
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-right: 0.5rem;
    vertical-align: middle;
}
.method-badge.get {
    background: var(--green-dim);
    color: var(--green);
    border: 1px solid rgba(16, 185, 129, 0.25);
}
.method-badge.post {
    background: var(--cyan-dim);
    color: var(--cyan);
    border: 1px solid rgba(0, 212, 255, 0.25);
}
.method-badge.put {
    background: var(--amber-dim);
    color: var(--amber);
    border: 1px solid rgba(245, 158, 11, 0.25);
}
.method-badge.delete {
    background: var(--red-dim);
    color: var(--red);
    border: 1px solid rgba(239, 68, 68, 0.25);
}

/* ---- Endpoint Path ---- */
.endpoint-path {
    font-family: 'Courier New', monospace;
    font-size: 0.85rem;
    color: var(--text-bright);
    vertical-align: middle;
}

/* ---- Params Table ---- */
.params-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 0.75rem;
    font-size: 0.8rem;
}
.params-table th {
    text-align: left;
    padding: 0.5rem 0.75rem;
    color: var(--text-muted);
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    border-bottom: 1px solid var(--glass-border);
}
.params-table td {
    padding: 0.5rem 0.75rem;
    color: var(--text-primary);
    border-bottom: 1px solid var(--border-light);
}
.params-table td code {
    background: rgba(0, 0, 0, 0.25);
    padding: 0.1rem 0.35rem;
    border-radius: 4px;
    font-size: 0.78rem;
    color: var(--cyan);
}

/* ---- Code Block ---- */
.code-block {
    background: rgba(0, 0, 0, 0.35);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-sm);
    padding: 1rem;
    overflow-x: auto;
    font-family: 'Courier New', monospace;
    font-size: 0.8rem;
    color: var(--text-primary);
    line-height: 1.5;
    margin-top: 0.75rem;
}

/* ---- Auth Badge ---- */
.auth-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    padding: 0.2rem 0.55rem;
    background: var(--purple-dim);
    border: 1px solid rgba(124, 58, 237, 0.25);
    border-radius: var(--radius-full);
    font-size: 0.68rem;
    font-weight: 600;
    color: var(--purple);
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

/* ============================================================
   API KEYS TABLE
   ============================================================ */
.keys-table {
    width: 100%;
    border-collapse: collapse;
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius);
    overflow: hidden;
}
.keys-table th {
    text-align: left;
    padding: 0.75rem 1rem;
    color: var(--cyan);
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    background: rgba(0, 0, 0, 0.2);
    border-bottom: 1px solid var(--glass-border);
}
.keys-table td {
    padding: 0.75rem 1rem;
    color: var(--text-primary);
    font-size: 0.85rem;
    border-bottom: 1px solid var(--glass-border);
}
.keys-table tr:last-child td {
    border-bottom: none;
}
.keys-table tr:hover td {
    background: var(--glass-hover);
}

/* ---- Status Badge ---- */
.status-badge {
    display: inline-block;
    padding: 0.2rem 0.6rem;
    border-radius: var(--radius-full);
    font-size: 0.72rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}
.status-badge.active {
    background: var(--green-dim);
    color: var(--green);
    border: 1px solid rgba(16, 185, 129, 0.25);
}
.status-badge.revoked {
    background: var(--red-dim);
    color: var(--red);
    border: 1px solid rgba(239, 68, 68, 0.25);
}

/* ---- Key Prefix ---- */
.key-prefix {
    font-family: 'Courier New', monospace;
    font-size: 0.82rem;
    color: var(--text-muted);
    background: rgba(0, 0, 0, 0.2);
    padding: 0.15rem 0.4rem;
    border-radius: 4px;
}

/* ============================================================
   MODIFIER CARDS
   ============================================================ */
.modifier-card {
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius);
    padding: 1.2rem;
    margin-bottom: 0.75rem;
    backdrop-filter: blur(12px);
    transition: border-color 0.2s, box-shadow 0.2s;
}
.modifier-card:hover {
    border-color: rgba(255, 255, 255, 0.12);
    box-shadow: var(--shadow-md);
}
.modifier-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
    margin-top: 0.5rem;
}
.modifier-tags .tag-chip {
    font-size: 0.7rem;
    padding: 0.2rem 0.5rem;
}
.modifier-actions {
    display: flex;
    gap: 0.5rem;
    margin-top: 0.75rem;
}
.modifier-actions button {
    padding: 0.35rem 0.75rem;
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-sm);
    color: var(--text-muted);
    font-size: 0.78rem;
    cursor: pointer;
    transition: all 0.2s;
}
.modifier-actions button:hover {
    background: var(--glass-hover);
    color: var(--text-bright);
    border-color: var(--cyan);
}
.modifier-actions .delete-btn:hover {
    background: var(--red-dim);
    color: var(--red);
    border-color: rgba(239, 68, 68, 0.3);
}

/* ---- Sub-Tab Bar (inner tabs for accents/modifiers) ---- */
.sub-tab-bar {
    display: flex;
    gap: 0.25rem;
    margin-bottom: 1.25rem;
    padding: 0.25rem;
    background: rgba(0, 0, 0, 0.15);
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-light);
}
.sub-tab-btn {
    flex: 1;
    padding: 0.5rem 1rem;
    background: transparent;
    border: none;
    border-radius: 6px;
    color: var(--text-muted);
    font-size: 0.82rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    text-align: center;
}
.sub-tab-btn:hover:not(.active) {
    background: rgba(255, 255, 255, 0.04);
    color: var(--text-primary);
}
.sub-tab-btn.active {
    background: var(--glass-bg);
    color: var(--cyan);
    border: 1px solid var(--glass-border);
}

/* ---- Generate Form ---- */
.generate-form {
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius);
    padding: 1.5rem;
    backdrop-filter: blur(12px);
}
.generate-form .form-label {
    margin-bottom: 0.35rem;
}
.generate-form input,
.generate-form textarea,
.generate-form select {
    width: 100%;
    padding: 0.65rem 0.85rem;
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-size: 0.85rem;
    transition: border-color 0.2s;
}
.generate-form input:focus,
.generate-form textarea:focus,
.generate-form select:focus {
    outline: none;
    border-color: var(--cyan);
    box-shadow: 0 0 0 3px rgba(0, 212, 255, 0.1);
}

/* ============================================================
   LANDING PAGE
   ============================================================ */
.landing {
    position: relative;
    z-index: 1;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 3rem 1.5rem 2rem;
}
.landing-content {
    max-width: var(--max-width);
    width: 100%;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1.5rem;
    padding: 2rem;
}
.hero-title {
    font-size: 3rem;
    font-weight: 800;
    color: var(--text-bright);
    letter-spacing: -0.02em;
    line-height: 1.1;
}
.title-accent {
    background: linear-gradient(135deg, var(--cyan), var(--purple));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}
.landing-subtitle {
    font-size: 1.1rem;
    color: var(--text-muted);
    max-width: 400px;
}
.google-signin-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1.5rem;
    background: white;
    color: #3c4043;
    border: none;
    border-radius: var(--radius-full);
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}
.google-signin-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.4);
}
.google-signin-btn:active {
    transform: translateY(0);
}

/* ============================================================
   FOOTER
   ============================================================ */
.landing-footer,
.app-footer {
    padding: 1.5rem;
    text-align: center;
    border-top: 1px solid var(--glass-border);
}
.landing-footer {
    margin-top: auto;
    padding-top: 2rem;
}
.app-footer {
    max-width: var(--app-width);
    margin: 2rem auto 0;
}
.footer-links {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    flex-wrap: wrap;
    margin-bottom: 0.5rem;
}
.footer-links a {
    font-size: 0.78rem;
    color: var(--text-muted);
    text-decoration: none;
    transition: color 0.2s;
}
.footer-links a:hover {
    color: var(--cyan);
}
.footer-copy {
    font-size: 0.7rem;
    color: var(--text-muted);
    opacity: 0.6;
}

/* ============================================================
   VOICE / AUDIO / EDIT-SPECIFIC STYLES
   (Used by edit.html)
   ============================================================ */

/* ---- Enhanced Voice Settings UI ---- */
.voice-section {
    background: var(--glass-bg);
    border-radius: var(--radius);
    padding: 1.5rem;
    margin-bottom: 2rem;
    border: 1px solid var(--glass-border);
}
.section-header {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    margin-bottom: 1.5rem;
}
.section-header h3 {
    margin: 0 0 0.75rem 0;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}
.section-subtitle {
    color: var(--text-tertiary);
    font-size: 0.875rem;
}
.voice-actions {
    display: flex;
    gap: 0.5rem;
}
.btn-small {
    padding: 0.375rem 0.75rem;
    font-size: 0.875rem;
    display: flex;
    align-items: center;
    gap: 0.375rem;
}
.voice-factory-select {
    width: 100%;
    padding: 0.625rem;
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-sm);
    background: var(--bg-deep);
    color: var(--text-primary);
    font-size: 0.9375rem;
    transition: all 0.2s;
}
.voice-factory-select:focus {
    outline: none;
    border-color: var(--cyan);
    box-shadow: 0 0 0 3px rgba(0, 212, 255, 0.1);
}
.factory-settings {
    margin-top: 1rem;
    padding: 1rem;
    background: var(--bg-deep);
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-light);
}

/* ---- Emotional Tags Selector ---- */
.tag-selector {
    position: relative;
}
.tag-selector input {
    width: 100%;
    padding: 0.625rem;
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-sm);
    background: var(--bg-deep);
}
.tag-suggestions {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--bg-surface);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-sm);
    margin-top: 0.25rem;
    max-height: 200px;
    overflow-y: auto;
    z-index: 10;
    box-shadow: var(--shadow-md);
}
.tag-suggestion-item {
    padding: 0.5rem 0.75rem;
    cursor: pointer;
    transition: background 0.2s;
}
.tag-suggestion-item:hover {
    background: var(--glass-hover);
}
.selected-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: 0.75rem;
}
.emotional-tag {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.25rem 0.75rem;
    background: var(--cyan-dim);
    color: var(--cyan);
    border-radius: var(--radius-full);
    font-size: 0.875rem;
}
.emotional-tag .remove {
    cursor: pointer;
    opacity: 0.7;
    transition: opacity 0.2s;
}
.emotional-tag .remove:hover {
    opacity: 1;
}

/* ---- Style Prompt Presets ---- */
.style-prompt-presets {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: 0.75rem;
}
.preset-chip {
    padding: 0.375rem 0.875rem;
    background: var(--bg-tertiary);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-full);
    font-size: 0.875rem;
    cursor: pointer;
    transition: all 0.2s;
    color: var(--text-primary);
}
.preset-chip:hover {
    background: var(--cyan-dim);
    border-color: var(--cyan);
    color: var(--cyan);
}

/* ---- Voice Test Controls ---- */
.voice-test-controls {
    display: flex;
    gap: 0.75rem;
    margin-top: 1rem;
}
.btn-test {
    background: var(--bg-tertiary);
    color: var(--text-primary);
}
.btn-test:hover {
    background: var(--glass-hover);
}
.btn-generate {
    flex: 1;
}
.voice-test-player {
    margin-top: 1rem;
    padding: 1rem;
    background: var(--bg-deep);
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    gap: 1rem;
}
.voice-test-player audio {
    flex: 1;
}
.test-status {
    color: var(--text-muted);
    font-size: 0.875rem;
}

/* ---- Audio Files List ---- */
.audio-files-list {
    margin-bottom: 1rem;
}
.audio-file-item {
    display: flex;
    flex-direction: column;
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-sm);
    margin-bottom: 0.75rem;
    transition: all 0.2s ease;
    position: relative;
    box-shadow: var(--shadow-sm);
    overflow: visible;
}
.audio-file-item:hover {
    border-color: var(--cyan);
    box-shadow: var(--shadow-md);
    transform: translateY(-1px);
}
.audio-file-item.is-default {
    border-color: var(--green);
    background: linear-gradient(135deg, var(--glass-bg) 0%, rgba(16, 185, 129, 0.05) 100%);
}
.audio-card-header {
    width: 100%;
    padding: 0.75rem 1rem 0.5rem 1rem;
    border-bottom: 1px solid var(--border-light);
    background-color: rgba(0, 0, 0, 0.15);
}
.audio-card-body {
    padding: 0.875rem;
    display: grid;
    grid-template-columns: 1fr auto;
    grid-template-rows: auto auto auto;
    gap: 0.875rem;
    width: 100%;
    overflow: visible;
    position: relative;
}
.audio-file-title {
    font-weight: 600;
    font-size: 0.9rem;
    color: var(--text-bright);
    line-height: 1.3;
}
.audio-file-meta {
    display: flex;
    font-size: 0.75rem;
    color: var(--text-muted);
    line-height: 1.3;
    grid-column: 1 / -1;
    grid-row: 3 / 4;
    padding-top: 0.5rem;
    margin-top: 0.25rem;
    border-top: 1px solid var(--border-light);
    position: relative;
}
.meta-row {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    width: 100%;
    position: relative;
}
.audio-file-meta .meta-item {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    background: var(--bg-tertiary);
    border-radius: 4px;
    padding: 0.25rem 0.5rem;
    white-space: nowrap;
    position: relative;
    margin-right: 0.5rem;
    margin-bottom: 0.5rem;
}
.audio-file-meta .meta-label {
    font-weight: 600;
    color: var(--text-bright);
    min-width: fit-content;
}
.audio-file-meta .meta-value {
    color: var(--text-muted);
    max-width: 100px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.info-btn {
    font-size: 0.75rem;
    color: var(--cyan);
    cursor: pointer;
    margin-left: 0.25rem;
    background: var(--cyan-dim);
    padding: 0.1rem 0.25rem;
    border-radius: 50%;
    width: 1.25rem;
    height: 1.25rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: none;
    font-style: italic;
    font-weight: bold;
}
.info-btn:hover {
    background: rgba(0, 212, 255, 0.25);
}
.meta-details-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 9999;
    align-items: center;
    justify-content: center;
}
.meta-details-modal.visible {
    display: flex;
}
.meta-details-content {
    background: var(--bg-deep);
    border-radius: var(--radius-sm);
    width: 90%;
    max-width: 500px;
    max-height: 80vh;
    overflow-y: auto;
    box-shadow: var(--shadow-lg);
    display: flex;
    flex-direction: column;
    border: 1px solid var(--glass-border);
}
.meta-details-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem;
    border-bottom: 1px solid var(--glass-border);
}
.meta-details-header h3 {
    margin: 0;
    font-size: 1.25rem;
}
.meta-details-header .close-btn {
    background: transparent;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--text-muted);
}
.meta-details-body {
    padding: 1.5rem;
    overflow-y: auto;
    max-height: 60vh;
}
.meta-details-text {
    white-space: pre-wrap;
    word-break: break-word;
    line-height: 1.5;
    overflow-wrap: break-word;
    max-width: 100%;
}
.default-badge {
    position: absolute;
    top: -5px;
    right: 0;
    background: var(--green);
    color: white;
    padding: 0.125rem 0.5rem;
    border-radius: var(--radius-full);
    font-size: 0.65rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    box-shadow: var(--shadow);
    z-index: 5;
}
.audio-file-controls {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    margin-left: auto;
}
.audio-file-actions {
    display: flex;
    flex-direction: column;
    gap: 0.375rem;
    grid-column: 2 / 3;
    grid-row: 1 / 2;
    justify-content: center;
    min-width: 120px;
    align-items: stretch;
}
.audio-file-actions button {
    padding: 0.375rem 0.5rem;
    border-radius: var(--radius-sm);
    font-size: 0.75rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    border: 1px solid transparent;
    white-space: nowrap;
    width: 100%;
    text-align: center;
}
.audio-file-actions .default-btn {
    background: var(--cyan);
    color: var(--bg-deep);
    border-color: var(--cyan);
}
.audio-file-actions .default-btn:hover {
    background: #00b8db;
    transform: translateY(-1px);
    box-shadow: var(--shadow);
}
.audio-file-actions .delete-btn {
    background: transparent;
    color: var(--red);
    border-color: var(--red);
}
.audio-file-actions .delete-btn:hover {
    background: var(--red);
    color: white;
    transform: translateY(-1px);
    box-shadow: var(--shadow);
}

/* ---- Audio Player ---- */
.audio-player-container {
    grid-column: 1 / 2;
    grid-row: 1 / 2;
    width: 100%;
}
.audio-file-item audio {
    width: 100%;
    height: 36px;
    border-radius: var(--radius-sm);
    background: rgba(0, 0, 0, 0.2);
}

/* ---- Factory Settings Labels ---- */
.factory-label {
    font-weight: 600;
    color: var(--cyan);
    font-size: 0.875rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid var(--glass-border);
}

/* ---- Audio Actions ---- */
.audio-actions {
    display: flex;
    gap: 0.75rem;
}

/* ---- Saved Configurations ---- */
.saved-configs {
    margin-top: 1.5rem;
    padding: 1rem;
    background: var(--bg-deep);
    border-radius: var(--radius-sm);
    border: 1px solid var(--glass-border);
}
.saved-configs h4 {
    margin-bottom: 1rem;
    color: var(--text-muted);
    font-size: 0.875rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}
.saved-config-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem;
    background: var(--glass-bg);
    border-radius: var(--radius-sm);
    margin-bottom: 0.5rem;
    cursor: pointer;
    transition: all 0.2s;
}
.saved-config-item:hover {
    background: var(--glass-hover);
    transform: translateX(4px);
}
.saved-config-name {
    font-weight: 500;
}
.saved-config-details {
    font-size: 0.875rem;
    color: var(--text-muted);
}

/* ---- Pro Voice Indicator ---- */
.pro-badge {
    display: inline-block;
    margin-left: 0.5rem;
    padding: 0.125rem 0.375rem;
    background: linear-gradient(135deg, var(--cyan) 0%, var(--purple) 100%);
    color: white;
    border-radius: var(--radius-sm);
    font-size: 0.75rem;
    font-weight: 600;
}

/* ---- Voice Loading States ---- */
.voice-loading {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 1rem;
    background: var(--glass-bg);
    border-radius: var(--radius-sm);
}
.voice-loading .spinner {
    width: 20px;
    height: 20px;
    border: 2px solid var(--glass-border);
    border-top-color: var(--cyan);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

/* ---- Character Voice Settings ---- */
.character-voice-section {
    background: var(--glass-bg);
    border: 1px solid var(--cyan);
    border-radius: var(--radius);
    margin-bottom: 2rem;
}
.character-voice-section .section-header {
    background: linear-gradient(135deg, var(--cyan), var(--purple));
    color: white;
    padding: 1.5rem 1.5rem;
    border-radius: var(--radius) var(--radius) 0 0;
    margin: 0;
}
.character-voice-section .section-header h3 {
    margin: 0 0 0.75rem 0;
    font-size: 1.1rem;
    color: white;
    border-bottom: none;
}
.character-voice-section .section-description {
    margin: 0;
    font-size: 0.9rem;
    opacity: 0.9;
    color: rgba(255, 255, 255, 0.8);
    line-height: 1.4;
}
.character-voice-content {
    padding: 2rem;
}
.character-voice-content .voice-basics-row,
.character-voice-content .voice-personality-row {
    display: grid !important;
    grid-template-columns: 1fr 1fr !important;
    gap: 1.5rem !important;
    margin-bottom: 1.5rem !important;
}
.voice-basics-row .input-group,
.voice-personality-row .input-group,
.voice-selection-row .input-group,
.voice-modifiers-grid .input-group,
.gemini-modifiers-grid .input-group {
    margin: 0 !important;
    margin-bottom: 0 !important;
}
.field-hint {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-top: 0.25rem;
    display: block;
    font-style: italic;
}

/* ---- Inheritance Indicators ---- */
.inheritance-note {
    font-size: 0.9rem;
    color: var(--text-muted);
    font-style: italic;
    font-weight: normal;
}
.inherited-indicator {
    font-size: 0.8rem;
    color: var(--cyan);
    font-weight: normal;
    background: var(--cyan-dim);
    padding: 2px 6px;
    border-radius: var(--radius-sm);
    margin-left: 0.5rem;
}
.inherited-field {
    border-left: 3px solid var(--cyan);
    background: rgba(0, 212, 255, 0.05);
}
.inherited-field:focus {
    border-left: 3px solid var(--purple);
    background: rgba(0, 212, 255, 0.1);
}
.inherited-field::placeholder {
    color: rgba(0, 212, 255, 0.4);
}

/* ---- Voice Override Toggle ---- */
.voice-override-toggle {
    background: linear-gradient(135deg, var(--glass-bg), var(--bg-deep));
    border: 2px solid var(--border-light);
    border-radius: var(--radius);
    padding: 2rem;
    margin-bottom: 2rem;
    text-align: center;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}
.toggle-container {
    display: flex;
    justify-content: center;
    margin-bottom: 1rem;
}
.toggle-label {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    cursor: pointer;
    font-weight: 600;
    font-size: 1.05rem;
    color: var(--text-bright);
}
.toggle-slider {
    position: relative;
    width: 60px;
    height: 30px;
    background: var(--cyan);
    border-radius: 15px;
    transition: all 0.3s ease;
}
.toggle-slider::before {
    content: '';
    position: absolute;
    top: 3px;
    left: 3px;
    width: 24px;
    height: 24px;
    background: white;
    border-radius: 50%;
    transition: transform 0.3s ease;
}
#voiceOverrideToggle {
    display: none;
}
#voiceOverrideToggle:checked + .toggle-slider {
    background: var(--purple);
}
#voiceOverrideToggle:checked + .toggle-slider::before {
    transform: translateX(30px);
}
.toggle-text .inherit-text {
    color: var(--cyan);
}
.toggle-text .override-text {
    color: var(--purple);
    display: none;
}
#voiceOverrideToggle:checked ~ .toggle-text .inherit-text {
    display: none;
}
#voiceOverrideToggle:checked ~ .toggle-text .override-text {
    display: inline;
}
.toggle-description {
    font-size: 0.9rem;
    color: var(--text-muted);
}
.toggle-description .inherit-desc {
    color: var(--cyan);
}
.toggle-description .override-desc {
    color: var(--purple);
}

/* ---- Override Mode ---- */
.voice-section.override-mode .inherited-indicator {
    display: none;
}
.voice-section.override-mode .inherit-mode-title {
    display: none;
}
.voice-section.override-mode .override-mode-title {
    display: inline !important;
}
.voice-section.override-mode .inherited-field {
    border-left: 3px solid var(--purple);
    background: rgba(124, 58, 237, 0.05);
}
.voice-section.override-mode .inherited-field:focus {
    border-left: 3px solid var(--purple);
    background: rgba(124, 58, 237, 0.1);
}
.voice-section.override-mode .voice-step {
    border: 2px solid var(--purple);
}
.voice-section.override-mode .step-number {
    background: var(--purple);
}
.voice-section.override-mode .override-mode-title .inheritance-note {
    color: var(--purple);
}

/* ---- Voice Generation Step ---- */
.voice-step {
    background: var(--bg-deep);
    border-radius: var(--radius);
    border: 1px solid var(--border-light);
    margin-bottom: 2rem;
    overflow: hidden;
}
.step-header {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    padding: 1.5rem;
    background: linear-gradient(135deg, var(--glass-bg), var(--bg-deep));
    border-bottom: 1px solid var(--border-light);
}
.step-header h4 {
    margin: 0;
    font-size: 1.1rem;
    color: var(--text-bright);
    padding-top: 0.25rem;
}
.step-content {
    padding: 2rem;
    flex: 1;
}
.step-content .voice-selection-row {
    display: grid !important;
    grid-template-columns: 1fr 1fr 1fr !important;
    gap: 1.5rem !important;
    align-items: end !important;
}
.step-number {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--cyan);
    color: var(--bg-deep);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    flex-shrink: 0;
}
.step-content h4 {
    margin: 0 0 1rem 0;
    color: var(--text-bright);
    font-size: 1rem;
}

/* ---- Factory Settings (voice context) ---- */
.factory-settings {
    background: var(--bg-deep);
    padding: 1.5rem;
    margin: 0;
    border-radius: var(--radius-sm);
    border: 1px solid var(--glass-border);
    box-shadow: var(--shadow-sm);
}
.factory-header {
    margin-bottom: 1.5rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid var(--border-light);
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}
.factory-header h5 {
    margin: 0;
    color: var(--text-bright);
    font-size: 1rem;
    font-weight: 600;
}
.factory-desc {
    margin: 0;
    color: var(--text-muted);
    font-size: 0.85rem;
    line-height: 1.4;
}

/* ---- Emotion and Style Sections ---- */
.emotion-section,
.style-section {
    margin-bottom: 2rem;
    background: var(--glass-bg);
    padding: 1.25rem;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-light);
}
.section-label {
    display: block;
    margin-bottom: 0.75rem;
    font-weight: 600;
    color: var(--text-bright);
    font-size: 0.95rem;
}
.emotion-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
}
.emotion-btn {
    padding: 0.5rem 1rem;
    border: 2px solid var(--border-light);
    background: var(--bg-deep);
    color: var(--text-primary);
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 0.85rem;
    font-weight: 500;
    white-space: nowrap;
}
.emotion-btn:hover {
    border-color: var(--cyan);
    background: var(--cyan);
    color: var(--bg-deep);
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(0, 212, 255, 0.2);
}
.emotion-btn.active {
    background: var(--cyan);
    border-color: var(--cyan);
    color: var(--bg-deep);
    box-shadow: 0 2px 8px rgba(0, 212, 255, 0.3);
}

/* ---- Voice Modifier Grids ---- */
.voice-modifiers-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
    align-items: start;
}
.gemini-modifiers-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1.5rem;
}

/* ---- Form Elements ---- */
.full-width {
    grid-column: 1 / -1;
}
.styled-select,
.styled-input {
    width: 100% !important;
    min-height: 44px;
    padding: 0.75rem 1rem !important;
    border: 2px solid var(--border-light) !important;
    border-radius: var(--radius-sm) !important;
    background: var(--bg-deep) !important;
    color: var(--text-primary) !important;
    font-size: 0.95rem !important;
    transition: all 0.2s ease;
    box-sizing: border-box;
}
.styled-select:focus,
.styled-input:focus {
    outline: none;
    border-color: var(--cyan) !important;
    box-shadow: 0 0 0 3px rgba(0, 212, 255, 0.1);
}
.styled-select:hover,
.styled-input:hover {
    border-color: var(--cyan) !important;
}
.simple-settings {
    display: flex;
    align-items: center;
    gap: 1rem;
}
.simple-settings label {
    color: var(--text-muted);
    font-size: 0.875rem;
}
.emotion-quick-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}
.voice-generate-buttons {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-top: 1rem;
}
.btn-primary-action {
    padding: 0.75rem 1.5rem;
    background: var(--cyan);
    color: var(--bg-deep);
    border: none;
    border-radius: var(--radius-sm);
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    transition: all 0.2s;
}
.btn-primary-action:hover {
    background: #00b8db;
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}
.help-text {
    color: var(--text-tertiary);
    font-size: 0.875rem;
}

/* ---- Audio File Info (additional) ---- */
.audio-file-info {
    flex: 1;
}
.audio-file-controls button {
    padding: 0.5rem 0.75rem;
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-size: 0.875rem;
    cursor: pointer;
    transition: all 0.2s;
}
.audio-file-controls button:hover {
    background: var(--glass-hover);
    border-color: var(--cyan);
}
.audio-file-controls .delete-btn:hover {
    background: var(--red);
    color: white;
}
.empty-audio-state {
    text-align: center;
    padding: 2rem;
    color: var(--text-tertiary);
    background: var(--glass-bg);
    border-radius: var(--radius-sm);
    border: 2px dashed var(--glass-border);
}
.audio-section .section-subtitle {
    display: block;
    margin-top: 0.25rem;
    color: var(--text-tertiary);
    font-size: 0.875rem;
    font-weight: normal;
}

/* ---- Emotional Tags Helper ---- */
.emotional-tags-helper {
    margin-top: 0.75rem;
    padding: 1rem;
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-sm);
}
.tags-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.75rem;
    font-weight: 500;
    color: var(--text-bright);
}
.close-tags-btn {
    background: none;
    border: none;
    font-size: 18px;
    color: var(--text-tertiary);
    cursor: pointer;
    padding: 0;
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
}
.close-tags-btn:hover {
    color: var(--text-bright);
}
.tags-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 0.5rem;
    margin-bottom: 0.75rem;
}
.emotion-tag {
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: 4px;
    padding: 0.375rem 0.75rem;
    font-size: 0.875rem;
    color: var(--text-muted);
    cursor: pointer;
    transition: all 0.2s ease;
    text-align: center;
    user-select: none;
}
.emotion-tag:hover {
    background: var(--cyan);
    color: var(--bg-deep);
    border-color: var(--cyan);
    transform: translateY(-1px);
}
.tags-note {
    color: var(--text-tertiary);
    font-size: 0.8rem;
    line-height: 1.4;
}
.script-controls {
    margin-top: 0.5rem;
    margin-bottom: 0.75rem;
}
.btn-link {
    background: none;
    border: none;
    color: var(--cyan);
    font-size: 0.875rem;
    cursor: pointer;
    text-decoration: underline;
    padding: 0;
}
.btn-link:hover {
    color: #00b8db;
}

/* ---- Voice ID Click-to-Copy ---- */
.voice-id-copy:hover {
    background: var(--glass-hover) !important;
    color: var(--cyan) !important;
}
.voice-id-copy:active {
    background: var(--cyan) !important;
    color: var(--bg-deep) !important;
}

/* ---- Factory Pills ---- */
.factory-pill {
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

/* ---- Radio Wave Animation for Audio Playback ---- */
.audio-playing-indicator {
    position: relative;
    display: inline-block;
    width: 24px;
    height: 24px;
}
.audio-playing-indicator::before,
.audio-playing-indicator::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 100%;
    height: 100%;
    border: 2px solid var(--cyan);
    border-radius: 50%;
    transform: translate(-50%, -50%);
    animation: radio-wave 1.5s ease-out infinite;
}
.audio-playing-indicator::after {
    animation-delay: 0.5s;
}

/* ============================================================
   ANIMATIONS
   ============================================================ */
@keyframes fadeIn {
    from {
        opacity: 0;
        backdrop-filter: blur(0);
    }
    to {
        opacity: 1;
        backdrop-filter: blur(8px);
    }
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(20px) scale(0.98);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

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

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

@keyframes fadeOut {
    from {
        opacity: 1;
    }
    to {
        opacity: 0;
    }
}

@keyframes radioWave {
    0% {
        left: -100%;
        opacity: 0;
    }
    10% {
        opacity: 1;
    }
    90% {
        opacity: 1;
    }
    100% {
        left: 100%;
        opacity: 0;
    }
}

@keyframes pulseGlow {
    0%, 100% {
        box-shadow: 0 0 20px rgba(0, 212, 255, 0.3),
                    0 0 40px rgba(0, 212, 255, 0.15),
                    inset 0 0 20px rgba(0, 212, 255, 0.05);
    }
    50% {
        box-shadow: 0 0 30px rgba(0, 212, 255, 0.5),
                    0 0 60px rgba(0, 212, 255, 0.25),
                    inset 0 0 30px rgba(0, 212, 255, 0.1);
    }
}

@keyframes avatarPulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.05); }
}

@keyframes playPulse {
    0%, 100% {
        box-shadow: 0 2px 8px rgba(0, 212, 255, 0.3);
    }
    50% {
        box-shadow: 0 2px 12px rgba(0, 212, 255, 0.5),
                    0 0 0 4px rgba(0, 212, 255, 0.1);
    }
}

@keyframes statusPulse {
    0% {
        box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.4);
    }
    70% {
        box-shadow: 0 0 0 10px rgba(16, 185, 129, 0);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(16, 185, 129, 0);
    }
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: translateY(30px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

@keyframes spinnerRotate {
    100% { transform: rotate(360deg); }
}

@keyframes radio-wave {
    0% {
        transform: scale(1);
        opacity: 1;
    }
    50% {
        transform: scale(1.5);
        opacity: 0.5;
    }
    100% {
        transform: scale(2);
        opacity: 0;
    }
}

@keyframes fadeInOut {
    0% { opacity: 0; transform: translate(-50%, -50%) scale(0.8); }
    20% { opacity: 1; transform: translate(-50%, -50%) scale(1); }
    80% { opacity: 1; transform: translate(-50%, -50%) scale(1); }
    100% { opacity: 0; transform: translate(-50%, -50%) scale(0.8); }
}

/* ============================================================
   RESPONSIVE BREAKPOINTS
   ============================================================ */

@media (max-width: 1024px) {
    .step-content .voice-selection-row {
        grid-template-columns: 1fr 1fr !important;
    }
}

@media (max-width: 768px) {
    .top-nav { padding: 0.5rem 1rem; }
    .user-email { max-width: 100px; }

    /* Tab bar horizontal scroll for mobile */
    .tab-bar {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
    .tab-btn {
        white-space: nowrap;
        padding: 0.5rem 1rem;
        font-size: 0.8rem;
    }

    .dj-container.grid-view {
        grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    }

    .modal-content {
        width: 95%;
        margin: 1rem;
    }

    .media-grid {
        grid-template-columns: 1fr;
    }

    .form-grid > * {
        min-width: 100%;
    }

    .audio-card-body {
        grid-template-columns: 1fr;
        grid-template-rows: auto auto auto;
    }

    .audio-player-container,
    .audio-file-meta,
    .audio-file-actions {
        grid-column: 1 / -1;
    }

    .audio-file-actions {
        flex-direction: row;
        justify-content: center;
        gap: 0.5rem;
        margin-top: 0.5rem;
    }

    .audio-file-actions button {
        flex: 1;
        min-width: unset;
    }

    .audio-file-meta {
        grid-template-columns: 1fr;
        gap: 0.5rem;
    }

    .voice-section {
        padding: 1rem;
    }

    .voice-actions {
        flex-direction: column;
        width: 100%;
    }

    .voice-actions button {
        width: 100%;
    }

    .voice-test-controls {
        flex-direction: column;
    }

    .voice-test-controls button {
        width: 100%;
    }

    .character-voice-content .voice-basics-row,
    .character-voice-content .voice-personality-row {
        grid-template-columns: 1fr !important;
        gap: 1rem !important;
    }

    .voice-modifiers-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 640px) {
    .step-content .voice-selection-row {
        grid-template-columns: 1fr !important;
    }
}

@media (max-width: 480px) {
    .main-content {
        padding: 1rem;
    }

    .dj-container.grid-view {
        grid-template-columns: 1fr;
    }
}
