/* ==========================================================================
   Veda AI - Minimalist Black & White Theme (Inspired by MetaCleaner & Portfolio)
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&family=JetBrains+Mono:wght@400;500;600&family=Outfit:wght@400;500;600;700;800&display=swap');

:root {
    --bg-primary: #000000;
    --bg-surface: rgba(14, 14, 18, 0.85);
    --bg-card: rgba(18, 18, 22, 0.7);
    --bg-input: rgba(255, 255, 255, 0.03);
    
    --border-color: rgba(255, 255, 255, 0.12);
    --border-subtle: rgba(255, 255, 255, 0.08);
    --border-hover: rgba(255, 255, 255, 0.35);
    --border-focus: rgba(255, 255, 255, 0.65);

    --text-primary: #ffffff;
    --text-secondary: #a1a1aa;
    --text-muted: #71717a;
    
    --radius-sm: 8px;
    --radius-md: 14px;
    --radius-lg: 18px;
    --radius-pill: 9999px;

    --transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
    --transition-smooth: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    -webkit-tap-highlight-color: transparent;
}

html, body {
    width: 100%;
    height: 100vh;
    max-height: 100vh;
    background-color: var(--bg-primary);
    color: var(--text-primary);
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    overflow: hidden;
}

/* Background Grid & Ambient Glow (from MetaCleaner) */
.bg-grid {
    position: fixed;
    inset: 0;
    z-index: 0;
    pointer-events: none;
    background-image:
        linear-gradient(rgba(255, 255, 255, 0.025) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, 0.025) 1px, transparent 1px);
    background-size: 48px 48px;
    mask-image: radial-gradient(circle at 50% 50%, #000 30%, transparent 85%);
    -webkit-mask-image: radial-gradient(circle at 50% 50%, #000 30%, transparent 85%);
}

.bg-ambient-glow {
    position: fixed;
    top: -20%;
    left: 50%;
    transform: translateX(-50%);
    width: 900px;
    height: 450px;
    background: radial-gradient(ellipse, rgba(255, 255, 255, 0.04) 0%, transparent 70%);
    pointer-events: none;
    z-index: 0;
}

/* Custom Scrollbars */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}
::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.02);
}
::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.15);
    border-radius: var(--radius-pill);
}
::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.35);
}

/* ==========================================================================
   Header Navbar (Consistent with MetaCleaner)
   ========================================================================== */

.navbar-header {
    position: sticky;
    top: 0;
    z-index: 100;
    height: 56px;
    min-height: 56px;
    border-bottom: 1px solid var(--border-subtle);
    background: rgba(0, 0, 0, 0.88);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    display: flex;
    align-items: center;
    padding: 0 24px;
}

.navbar-container {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}

.navbar-left {
    display: flex;
    align-items: center;
    gap: 12px;
}

.brand-logo {
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
    color: var(--text-primary);
    font-size: 1.05rem;
    font-weight: 600;
    letter-spacing: -0.3px;
    transition: var(--transition);
}
.brand-logo i {
    width: 20px;
    height: 20px;
    stroke: #ffffff;
}
.project-logo {
    height: 24px;
    width: 24px;
    object-fit: contain;
    border-radius: 4px;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.4));
}
.brand-logo:hover {
    opacity: 0.85;
}

.nav-brand-divider {
    height: 16px;
    width: 1px;
    background: rgba(255, 255, 255, 0.15);
    margin: 0 4px;
}

.nav-brand-emblem-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    transition: var(--transition);
}
.nav-brand-emblem-link:hover {
    transform: scale(1.08);
    filter: brightness(1.15);
}

.nav-brand-emblem {
    height: 24px;
    width: auto;
    max-height: 26px;
    object-fit: contain;
    display: block;
    filter: drop-shadow(0 2px 6px rgba(0, 0, 0, 0.4));
}

.nav-route-badge {
    font-size: 0.75rem;
    font-weight: 500;
    color: var(--text-secondary);
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-subtle);
    padding: 3px 10px;
    border-radius: var(--radius-pill);
}

/* Navbar Search (Middle) */
.navbar-search {
    flex: 1;
    max-width: 460px;
    margin: 0 16px;
}
.navbar-search-form .input-group {
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-pill);
    padding: 4px 6px 4px 14px;
    display: flex;
    align-items: center;
    gap: 10px;
    transition: var(--transition);
}
.navbar-search-form .input-group:focus-within {
    border-color: var(--border-focus);
    background: rgba(255, 255, 255, 0.07);
    box-shadow: 0 0 16px rgba(255, 255, 255, 0.1);
}
.navbar-search-form .search-input {
    background: transparent;
    border: none;
    outline: none;
    color: var(--text-primary);
    font-size: 0.82rem;
    font-family: inherit;
    flex: 1;
}
.navbar-search-form .search-input::placeholder {
    color: var(--text-muted);
}

.navbar-right {
    display: flex;
    align-items: center;
    gap: 16px;
}

.nav-links {
    display: flex;
    align-items: center;
    gap: 6px;
}

.nav-link {
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 0.85rem;
    font-weight: 500;
    padding: 6px 14px;
    border-radius: var(--radius-pill);
    transition: var(--transition);
}
.nav-link:hover {
    color: var(--text-primary);
    background: rgba(255, 255, 255, 0.06);
}
.nav-link.active {
    color: var(--text-primary);
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.14);
}

.nav-actions {
    display: flex;
    align-items: center;
    gap: 10px;
}

.github-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    color: var(--text-secondary);
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-color);
    text-decoration: none;
    transition: var(--transition);
}
.github-btn i {
    width: 16px;
    height: 16px;
}
.github-btn:hover {
    color: var(--text-primary);
    background: rgba(255, 255, 255, 0.15);
    border-color: rgba(255, 255, 255, 0.3);
}

.dlm-badge {
    text-decoration: none;
    display: flex;
    align-items: center;
}
.dlm-pill {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.72rem;
    font-weight: 600;
    letter-spacing: 0.5px;
    color: #ffffff;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.2);
    padding: 3px 8px;
    border-radius: var(--radius-pill);
    transition: var(--transition);
}
.dlm-badge:hover .dlm-pill {
    background: #ffffff;
    color: #000000;
    box-shadow: 0 0 10px rgba(255, 255, 255, 0.3);
}

.icon-btn {
    background: transparent;
    border: 1px solid var(--border-subtle);
    color: var(--text-secondary);
    cursor: pointer;
    padding: 7px;
    border-radius: var(--radius-sm);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
}
.icon-btn:hover {
    color: var(--text-primary);
    background: rgba(255, 255, 255, 0.1);
    border-color: var(--border-hover);
}
.icon-btn i {
    width: 16px;
    height: 16px;
}

/* ==========================================================================
   Main App Layout (Sidebar + Workspace)
   ========================================================================== */

.app-container {
    display: grid;
    grid-template-columns: 280px 1fr;
    height: calc(100vh - 56px - 36px);
    max-height: calc(100vh - 56px - 36px);
    position: relative;
    z-index: 2;
    overflow: hidden;
    transition: grid-template-columns 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.app-container.collapsed-sidebar {
    grid-template-columns: 0px 1fr;
}

/* Sidebar: History Drawer */
aside {
    background: rgba(6, 6, 8, 0.95);
    border-right: 1px solid var(--border-subtle);
    backdrop-filter: blur(14px);
    padding: 16px 14px;
    display: flex;
    flex-direction: column;
    gap: 14px;
    height: 100%;
    max-height: 100%;
    overflow: hidden;
    transition: opacity 0.25s ease, padding 0.3s ease, border-color 0.25s ease;
}

.app-container.collapsed-sidebar aside {
    opacity: 0;
    pointer-events: none;
    padding-left: 0;
    padding-right: 0;
    border-right-color: transparent;
}

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

.sidebar-title {
    font-size: 0.72rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    gap: 6px;
}
.sidebar-title i {
    width: 13px;
    height: 13px;
}
.sidebar-close-btn {
    display: none;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid var(--border-color);
    color: #ffffff;
    border-radius: 50%;
    width: 28px;
    height: 28px;
    min-width: 28px;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    padding: 0;
    margin-right: 4px;
    transition: var(--transition);
}
.sidebar-close-btn:hover,
.sidebar-close-btn:active {
    background: rgba(255, 255, 255, 0.2);
    color: #ffffff;
}
.sidebar-close-btn i,
.sidebar-close-btn svg {
    width: 15px;
    height: 15px;
    stroke-width: 2.5;
    display: block;
    margin: 0;
}

.history-list {
    flex: 1;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding-right: 4px;
}

.history-item {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-sm);
    padding: 10px 12px;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    flex-direction: column;
    gap: 6px;
    position: relative;
    flex-shrink: 0;
}

.history-item:hover {
    border-color: var(--border-hover);
    background: rgba(255, 255, 255, 0.05);
    transform: translateY(-1px);
}

.history-item.active {
    border-color: rgba(255, 255, 255, 0.5);
    background: rgba(255, 255, 255, 0.08);
}

.history-item .title {
    font-weight: 500;
    font-size: 0.8rem;
    color: var(--text-primary);
    line-height: 1.35;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.history-item .meta {
    font-size: 0.7rem;
    color: var(--text-muted);
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-family: 'JetBrains Mono', monospace;
}

.history-item .delete-btn {
    position: absolute;
    top: 8px;
    right: 8px;
    background: rgba(0, 0, 0, 0.6);
    border: 1px solid var(--border-subtle);
    color: var(--text-muted);
    border-radius: 4px;
    padding: 3px;
    cursor: pointer;
    opacity: 0;
    transition: var(--transition);
}
.history-item:hover .delete-btn {
    opacity: 1;
}
.history-item .delete-btn:hover {
    background: rgba(239, 68, 68, 0.2);
    border-color: #ef4444;
    color: #ffffff;
}

.empty-history {
    text-align: center;
    padding: 24px 12px;
    color: var(--text-muted);
    font-size: 0.78rem;
    border: 1px dashed var(--border-subtle);
    border-radius: var(--radius-sm);
}

/* ==========================================================================
   Main Content Workspace
   ========================================================================== */

main {
    padding: 20px 32px;
    display: flex;
    flex-direction: column;
    gap: 16px;
    max-width: 1400px;
    width: 100%;
    height: 100%;
    max-height: 100%;
    margin: 0 auto;
    overflow: hidden;
}

/* Buttons - B&W Minimalist */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 8px 18px;
    font-size: 0.82rem;
    font-weight: 600;
    border-radius: var(--radius-pill);
    cursor: pointer;
    text-decoration: none;
    transition: var(--transition);
    border: none;
    outline: none;
    font-family: inherit;
    white-space: nowrap;
}

.btn-primary {
    background: #ffffff;
    color: #000000;
    box-shadow: 0 2px 10px rgba(255, 255, 255, 0.12);
}
.btn-primary:hover {
    background: #f4f4f5;
    transform: translateY(-1px);
    box-shadow: 0 4px 16px rgba(255, 255, 255, 0.25);
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.06);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
}
.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.12);
    border-color: var(--border-hover);
    transform: translateY(-1px);
}

.btn-sm {
    padding: 6px 14px;
    font-size: 0.75rem;
}

/* ==========================================================================
   Expandable Arrow Button (Desktop: Arrow Icon -> Expands on Hover; Mobile: Arrow Icon Only)
   ========================================================================== */

.btn-icon-expand {
    width: 38px;
    height: 38px;
    min-width: 38px;
    max-width: 38px;
    padding: 0 !important;
    gap: 0 !important;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
    overflow: hidden;
    flex-shrink: 0;
    transition: all 0.28s cubic-bezier(0.16, 1, 0.3, 1);
    box-shadow: 0 2px 10px rgba(255, 255, 255, 0.12);
}

.btn-icon-expand i,
.btn-icon-expand svg {
    width: 18px;
    height: 18px;
    display: block;
    margin: 0;
    stroke-width: 2.5;
    flex-shrink: 0;
    transition: transform 0.22s ease;
}

.btn-icon-expand .btn-expand-text {
    display: none !important;
    max-width: 0;
    opacity: 0;
    white-space: nowrap;
    overflow: hidden;
    font-size: 0.82rem;
    font-weight: 600;
    margin: 0;
    transition: max-width 0.28s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.2s ease;
}

/* Desktop Hover: reveals text smoothly */
@media (min-width: 961px) {
    .btn-icon-expand:hover {
        width: auto;
        max-width: 180px;
        padding: 0 16px 0 14px !important;
        gap: 8px !important;
        border-radius: var(--radius-pill);
        box-shadow: 0 4px 16px rgba(255, 255, 255, 0.25);
    }
    .btn-icon-expand:hover .btn-expand-text {
        display: inline-block !important;
        max-width: 130px;
        opacity: 1;
    }
}

/* Navbar Search Button Variant */
.navbar-search-form .btn-icon-expand {
    width: 32px;
    height: 32px;
    min-width: 32px;
    max-width: 32px;
    padding: 0 !important;
    gap: 0 !important;
}
.navbar-search-form .btn-icon-expand i,
.navbar-search-form .btn-icon-expand svg {
    width: 16px;
    height: 16px;
    display: block;
    margin: 0;
}
@media (min-width: 961px) {
    .navbar-search-form .btn-icon-expand:hover {
        width: auto;
        max-width: 120px;
        padding: 0 12px 0 10px !important;
        gap: 6px !important;
    }
    .navbar-search-form .btn-icon-expand:hover .btn-expand-text {
        display: inline-block !important;
        max-width: 80px;
        opacity: 1;
    }
}

/* ==========================================================================
   Hero Search (Empty State - MetaCleaner Style)
   ========================================================================== */

.workspace-hero {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 20px;
    height: 100%;
    max-height: 100%;
    animation: fadeIn 0.3s ease-out;
}

.workspace-header {
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
}

.status-meta-pill {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 0.74rem;
    font-weight: 500;
    color: var(--text-secondary);
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--border-subtle);
    padding: 4px 12px;
    border-radius: var(--radius-pill);
    margin-bottom: 4px;
}

.status-indicator-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: #71717a;
    transition: var(--transition);
}
.status-indicator-dot.active {
    background: #ffffff;
    box-shadow: 0 0 8px #ffffff;
}

.workspace-header h1 {
    font-family: 'Outfit', sans-serif;
    font-size: 2.25rem;
    font-weight: 700;
    letter-spacing: -0.6px;
    color: var(--text-primary);
}

.workspace-header p {
    font-size: 0.92rem;
    color: var(--text-secondary);
    max-width: 580px;
    line-height: 1.6;
}

.search-box-card {
    width: 100%;
    max-width: 680px;
}

.search-box-card .input-group {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-pill);
    padding: 6px 8px 6px 20px;
    display: flex;
    align-items: center;
    gap: 12px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.5);
    transition: var(--transition);
}
.search-box-card .input-group:focus-within {
    border-color: var(--border-focus);
    background: rgba(255, 255, 255, 0.06);
    box-shadow: 0 0 25px rgba(255, 255, 255, 0.12);
}

.search-box-card .input-group i {
    width: 20px;
    height: 20px;
    stroke: var(--text-muted);
    flex-shrink: 0;
}
.search-box-card .input-group:focus-within i {
    stroke: #ffffff;
}

.search-box-card .search-input {
    background: transparent;
    border: none;
    outline: none;
    color: var(--text-primary);
    font-size: 0.92rem;
    font-family: inherit;
    flex: 1;
    min-width: 0;
    padding: 8px 0;
}
.search-box-card .search-input::placeholder {
    color: var(--text-muted);
}

.format-pills {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 8px;
    margin-top: 4px;
}

.format-pill {
    font-size: 0.7rem;
    font-weight: 500;
    font-family: 'JetBrains Mono', monospace;
    color: var(--text-secondary);
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--border-subtle);
    padding: 3px 10px;
    border-radius: var(--radius-pill);
    transition: var(--transition);
}
.format-pill:hover {
    border-color: var(--border-hover);
    color: var(--text-primary);
}

/* ==========================================================================
   Loading Progress Stepper
   ========================================================================== */

.loader-container {
    display: none;
    flex-direction: column;
    align-items: center;
    gap: 20px;
    padding: 40px 20px;
    max-width: 650px;
    width: 100%;
    margin: 40px auto;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    background: var(--bg-card);
    backdrop-filter: blur(14px);
    animation: fadeIn 0.3s ease;
}

.stepper {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    position: relative;
    padding: 0 10px;
}
.stepper::before {
    content: '';
    position: absolute;
    top: 16px;
    left: 20px;
    right: 20px;
    height: 1px;
    background: rgba(255, 255, 255, 0.1);
    z-index: 1;
}

.step {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    position: relative;
    z-index: 2;
}

.step-circle {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: #0d0f14;
    border: 1.5px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8rem;
    font-weight: 600;
    font-family: 'JetBrains Mono', monospace;
    color: var(--text-muted);
    transition: var(--transition);
}

.step.active .step-circle {
    background: #ffffff;
    border-color: #ffffff;
    color: #000000;
    box-shadow: 0 0 16px rgba(255, 255, 255, 0.5);
}

.step.completed .step-circle {
    background: rgba(255, 255, 255, 0.2);
    border-color: #ffffff;
    color: #ffffff;
}

.step-label {
    font-size: 0.72rem;
    font-weight: 500;
    color: var(--text-muted);
}
.step.active .step-label {
    color: #ffffff;
    font-weight: 600;
}

.loading-sub {
    font-size: 0.82rem;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    gap: 8px;
}
.loading-sub i {
    width: 15px;
    height: 15px;
}

.spin {
    animation: spin 1s linear infinite;
}
@keyframes spin {
    to { transform: rotate(360deg); }
}

/* ==========================================================================
   Results Dashboard (2-Column Grid)
   ========================================================================== */

.results-container {
    display: none;
    grid-template-columns: 290px 1fr;
    gap: 16px;
    height: 100%;
    max-height: 100%;
    overflow: hidden;
    animation: fadeIn 0.3s ease-out;
}

.video-column {
    display: flex;
    flex-direction: column;
    gap: 12px;
    height: 100%;
    max-height: 100%;
    overflow: hidden;
}

.video-card, .transcript-card, .notes-card {
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    backdrop-filter: blur(14px);
    border-radius: var(--radius-md);
    overflow: hidden;
    transition: var(--transition);
}

/* Compact Video Card */
.video-card {
    flex-shrink: 0;
}

.thumbnail-container {
    position: relative;
    width: 100%;
    height: 135px;
    background-color: #050505;
    overflow: hidden;
}

.thumbnail-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.duration-badge {
    position: absolute;
    bottom: 6px;
    right: 6px;
    background: rgba(0, 0, 0, 0.88);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: #ffffff;
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 0.68rem;
    font-family: 'JetBrains Mono', monospace;
    font-weight: 500;
}

.video-details {
    padding: 10px 12px;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.video-title {
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--text-primary);
    line-height: 1.35;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.video-author {
    font-size: 0.72rem;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    gap: 6px;
}
.video-author i {
    width: 12px;
    height: 12px;
}

/* Transcript Viewer Card - Expanded for More View Area */
.transcript-card {
    padding: 12px 14px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    flex: 1;
    min-height: 0;
    overflow: hidden;
}

.transcript-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.transcript-header h3 {
    font-size: 0.76rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    color: var(--text-muted);
}

.transcript-search-wrapper {
    position: relative;
}
.transcript-search-wrapper i {
    position: absolute;
    left: 9px;
    top: 50%;
    transform: translateY(-50%);
    width: 12px;
    height: 12px;
    stroke: var(--text-muted);
}
.transcript-search {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-sm);
    padding: 5px 8px 5px 28px;
    color: var(--text-primary);
    font-family: inherit;
    font-size: 0.74rem;
    width: 100%;
    outline: none;
    transition: var(--transition);
}
.transcript-search:focus {
    border-color: var(--border-focus);
}

.transcript-scroller {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 5px;
    padding-right: 4px;
}

.transcript-segment {
    font-size: 0.76rem;
    line-height: 1.4;
    color: var(--text-secondary);
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    gap: 8px;
    align-items: flex-start;
    padding: 5px 6px;
    border-radius: var(--radius-sm);
    border: 1px solid transparent;
}
.transcript-segment:hover {
    color: #ffffff;
    background: rgba(255, 255, 255, 0.05);
    border-color: var(--border-subtle);
}

.timestamp {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.66rem;
    font-weight: 500;
    color: #ffffff;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid var(--border-subtle);
    padding: 1px 5px;
    border-radius: 4px;
    white-space: nowrap;
    flex-shrink: 0;
}

.transcript-segment.match {
    background: rgba(255, 255, 255, 0.12);
    color: #ffffff;
    border-left: 2px solid #ffffff;
}

/* AI Notes Card - Full Height Scrollable Panel with Tight Typography */
.notes-card {
    padding: 12px 18px 14px 18px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    height: 100%;
    max-height: 100%;
    min-height: 0;
    overflow: hidden;
}

.notes-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--border-subtle);
    padding-bottom: 6px;
    flex-wrap: nowrap;
    gap: 8px;
    flex-shrink: 0;
}

.notes-engine-tag {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.62rem;
    font-weight: 600;
    letter-spacing: 0.3px;
    color: #ffffff;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-color);
    padding: 2px 7px;
    border-radius: var(--radius-pill);
    display: inline-flex;
    align-items: center;
    gap: 4px;
    line-height: 1.3;
}
.notes-engine-tag i {
    width: 11px;
    height: 11px;
}

.notes-actions {
    display: flex;
    align-items: center;
    gap: 6px;
}

.notes-actions .btn-sm {
    padding: 3px 10px;
    font-size: 0.70rem;
    height: auto;
    gap: 5px;
    border-radius: var(--radius-pill);
    line-height: 1.3;
}
.notes-actions .btn-sm i {
    width: 12px;
    height: 12px;
}

/* Tab Switcher (Notes vs Chat) - Compact Pill */
.view-tabs {
    display: flex;
    align-items: center;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--border-color);
    padding: 2px;
    border-radius: var(--radius-pill);
    gap: 2px;
}

.view-tab {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 3px 9px;
    font-size: 0.70rem;
    font-weight: 600;
    color: var(--text-secondary);
    background: transparent;
    border: none;
    border-radius: var(--radius-pill);
    cursor: pointer;
    transition: var(--transition);
    white-space: nowrap;
    line-height: 1.2;
}

.view-tab i {
    width: 12px;
    height: 12px;
}

.view-tab:hover {
    color: #ffffff;
    background: rgba(255, 255, 255, 0.06);
}

.view-tab.active {
    color: #000000;
    background: #ffffff;
    box-shadow: 0 1px 6px rgba(255, 255, 255, 0.18);
}

.tab-badge {
    font-size: 0.55rem;
    font-weight: 700;
    padding: 0 4px;
    line-height: 1.3;
    border-radius: 3px;
    background: #2563eb;
    color: #ffffff;
    letter-spacing: 0.3px;
}
.view-tab.active .tab-badge {
    background: #000000;
    color: #ffffff;
}

/* Content Views Toggling - Strict Isolation */
.tab-content-view {
    display: none !important;
}
.tab-content-view.active {
    display: flex !important;
    flex-direction: column;
}
#notesMarkdown.tab-content-view.active {
    display: block !important;
}
#chatContainer.tab-content-view.active {
    display: flex !important;
    flex-direction: column;
}

/* ==========================================================================
   Interactive Chat Interface (100% Unscrollable Container, Internal Scrolling)
   ========================================================================== */
.chat-body {
    flex: 1;
    min-height: 0;
    gap: 8px;
    padding-top: 4px;
}

.chat-empty-state {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 180px;
    color: var(--text-muted);
    font-size: 0.84rem;
    font-weight: 500;
    letter-spacing: 0.4px;
    user-select: none;
    text-align: center;
}

.chat-messages {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding-right: 6px;
}

.chat-message {
    display: flex;
    gap: 10px;
    animation: fadeIn 0.2s ease-out;
}

.chat-message.user {
    flex-direction: row-reverse;
}

.msg-avatar {
    width: 26px;
    height: 26px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}
.chat-message.assistant .msg-avatar {
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid var(--border-color);
    color: #ffffff;
}
.chat-message.user .msg-avatar {
    background: #ffffff;
    color: #000000;
}
.msg-avatar i {
    width: 14px;
    height: 14px;
}

.msg-bubble {
    max-width: 82%;
    padding: 8px 12px;
    border-radius: 12px;
    font-size: 0.83rem;
    line-height: 1.5;
}

.chat-message.assistant .msg-bubble {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border-color);
    color: #e4e4e7;
    border-top-left-radius: 2px;
}

.chat-message.user .msg-bubble {
    background: rgba(255, 255, 255, 0.12);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: #ffffff;
    border-top-right-radius: 2px;
}

.msg-bubble p {
    margin: 0 0 6px 0;
}
.msg-bubble p:last-child {
    margin-bottom: 0;
}
.msg-bubble ul, .msg-bubble ol {
    margin: 4px 0 6px 0;
    padding-left: 16px;
}
.msg-bubble li {
    margin-bottom: 3px;
}
.msg-bubble code {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.76rem;
    background: rgba(255, 255, 255, 0.08);
    padding: 1px 4px;
    border-radius: 3px;
}

.typing-indicator .dots span {
    animation: blink 1.4s infinite both;
    font-size: 1.4rem;
    line-height: 0.5;
}
.typing-indicator .dots span:nth-child(2) { animation-delay: .2s; }
.typing-indicator .dots span:nth-child(3) { animation-delay: .4s; }

@keyframes blink {
    0% { opacity: .2; }
    20% { opacity: 1; }
    100% { opacity: .2; }
}

/* Chat Input Bar */
.chat-input-wrapper {
    flex-shrink: 0;
    padding-top: 6px;
}

.chat-input-form {
    display: flex;
    align-items: center;
    gap: 8px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-pill);
    padding: 4px 6px 4px 14px;
    transition: var(--transition);
}
.chat-input-form:focus-within {
    border-color: #ffffff;
    box-shadow: 0 0 12px rgba(255, 255, 255, 0.15);
}

.chat-input-form input {
    flex: 1;
    background: transparent;
    border: none;
    outline: none;
    color: #ffffff;
    font-size: 0.82rem;
    font-family: inherit;
}
.chat-input-form input::placeholder {
    color: var(--text-muted);
}

.chat-send-btn {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: #ffffff;
    color: #000000;
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: var(--transition);
    flex-shrink: 0;
}
.chat-send-btn:hover {
    background: #e4e4e7;
    transform: scale(1.05);
}
.chat-send-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
    transform: none;
}
.chat-send-btn i {
    width: 14px;
    height: 14px;
}

/* Rendered Markdown Notes - Tight High-Density Typography */
.markdown-body {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    padding-right: 6px;
    font-size: 0.86rem;
    line-height: 1.55;
    color: #d4d4d8;
}

.markdown-body h1, .markdown-body h2, .markdown-body h3, .markdown-body h4 {
    color: #ffffff;
    font-weight: 700;
    margin-top: 0.9em;
    margin-bottom: 0.35em;
    letter-spacing: -0.2px;
}
.markdown-body h1 {
    font-size: 1.35rem;
    border-bottom: 1px solid var(--border-subtle);
    padding-bottom: 6px;
}
.markdown-body h2 {
    font-size: 1.1rem;
}
.markdown-body h3 {
    font-size: 0.96rem;
}
.markdown-body p {
    margin-bottom: 0.55em;
}
.markdown-body ul, .markdown-body ol {
    margin-bottom: 0.55em;
    padding-left: 1.25em;
}
.markdown-body li {
    margin-bottom: 0.25em;
}
.markdown-body strong {
    color: #ffffff;
    font-weight: 600;
}
.markdown-body blockquote {
    border-left: 2px solid #ffffff;
    padding-left: 10px;
    margin: 0.7em 0;
    color: var(--text-secondary);
    font-style: italic;
    background: rgba(255, 255, 255, 0.02);
    padding: 5px 10px;
    border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
}
.markdown-body code {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.8rem;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid var(--border-subtle);
    padding: 2px 6px;
    border-radius: 4px;
    color: #ffffff;
}
.markdown-body pre {
    background: #08080a;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    padding: 14px;
    overflow-x: auto;
    margin: 1.2em 0;
}
.markdown-body pre code {
    background: transparent;
    border: none;
    padding: 0;
}
.markdown-body hr {
    border: none;
    border-top: 1px solid var(--border-subtle);
    margin: 2em 0;
}

/* KaTeX / LaTeX Formulas - Clean B&W Styling */
.markdown-body .katex-display {
    overflow-x: auto;
    overflow-y: hidden;
    padding: 12px 16px;
    margin: 1.2em 0;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    text-align: center;
}
.markdown-body .katex {
    font-size: 1.05em;
    color: #ffffff;
}
.markdown-body .katex .mord, 
.markdown-body .katex .mbin, 
.markdown-body .katex .mrel {
    color: inherit;
}

/* ==========================================================================
   Toast Notifications
   ========================================================================== */

.toast-container {
    position: fixed;
    bottom: 24px;
    right: 24px;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.toast {
    position: fixed;
    bottom: 24px;
    right: 24px;
    z-index: 9999;
    background: #000000;
    border: 1px solid var(--border-color);
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.85);
    color: #ffffff;
    padding: 10px 16px;
    border-radius: var(--radius-sm);
    font-size: 0.82rem;
    display: none;
    align-items: center;
    gap: 10px;
    animation: toastIn 0.25s ease-out;
}
.toast.show {
    display: flex;
}
.toast.toast-error {
    border-color: rgba(239, 68, 68, 0.6);
}
.toast.toast-success {
    border-color: rgba(255, 255, 255, 0.5);
}

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

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

/* ==========================================================================
   Footer Bar (from MetaCleaner)
   ========================================================================== */

.footer-bar {
    position: relative;
    z-index: 10;
    height: 36px;
    min-height: 36px;
    border-top: 1px solid var(--border-subtle);
    background: rgba(0, 0, 0, 0.9);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 20px;
}
.footer-bar p {
    font-size: 0.72rem;
    color: var(--text-muted);
}
.footer-bar a {
    color: #ffffff;
    text-decoration: underline;
    font-weight: 500;
}

/* ==========================================================================
   Responsive Adaptations & Mobile UI Optimization
   ========================================================================== */

/* Tablet & Mobile Screens (<= 960px) */
@media (max-width: 960px) {
    html, body {
        height: auto;
        min-height: 100%;
        max-height: none;
        overflow-x: hidden;
        overflow-y: auto;
    }

    /* Navbar */
    .navbar-header {
        padding: 0 12px;
        height: 52px;
        min-height: 52px;
    }
    .navbar-container {
        gap: 8px;
    }
    .navbar-left {
        gap: 8px;
    }
    .brand-logo {
        font-size: 0.95rem;
        gap: 7px;
    }
    .brand-logo .project-logo {
        height: 22px;
        width: 22px;
    }
    .nav-brand-divider {
        display: none !important;
    }
    .nav-brand-emblem-link {
        display: none !important;
    }
    .navbar-search {
        display: none !important;
    }
    .navbar-right {
        display: none !important;
    }
    .nav-links {
        display: none !important;
    }
    .nav-actions {
        display: none !important;
    }

    /* Fix stacking context so backdrop blurs the page and receives clicks, NOT trapped behind app-container */
    .app-container {
        display: flex !important;
        flex-direction: column !important;
        height: calc(100dvh - 52px - 36px) !important;
        max-height: calc(100dvh - 52px - 36px) !important;
        grid-template-columns: none !important;
        overflow: hidden !important;
        width: 100% !important;
        position: static !important;
        z-index: auto !important;
    }

    /* Sidebar Drawer Backdrop (In front of page, behind aside, handles touch-to-close) */
    .sidebar-backdrop {
        position: fixed;
        inset: 0;
        background: rgba(0, 0, 0, 0.75);
        backdrop-filter: blur(5px);
        -webkit-backdrop-filter: blur(5px);
        z-index: 1050 !important;
        opacity: 0;
        pointer-events: none;
        cursor: pointer;
        -webkit-tap-highlight-color: transparent;
        touch-action: manipulation;
        transition: opacity 0.25s ease;
    }
    .sidebar-backdrop.active {
        opacity: 1;
        pointer-events: auto;
    }

    /* Off-Canvas Sidebar Drawer (100% Sharp text, solid background, in front of backdrop) */
    aside {
        position: fixed !important;
        left: 0 !important;
        top: 0 !important;
        bottom: 0 !important;
        width: min(85vw, 300px) !important;
        height: 100% !important;
        max-height: 100% !important;
        z-index: 1060 !important;
        transform: translateX(-100%) !important;
        transition: transform 0.28s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.28s ease !important;
        background: #090a0f !important;
        border-right: 1px solid var(--border-color) !important;
        box-shadow: none;
        padding: 16px 14px !important;
        pointer-events: none !important;
        opacity: 0 !important;
        backdrop-filter: none !important;
        -webkit-backdrop-filter: none !important;
    }
    .app-container.mobile-sidebar-open aside {
        transform: translateX(0) !important;
        opacity: 1 !important;
        pointer-events: auto !important;
        box-shadow: 10px 0 40px rgba(0, 0, 0, 0.95) !important;
    }

    /* Mobile Sidebar Header: Replace clock icon with tap-friendly Cross (X) close button */
    .sidebar-clock-icon {
        display: none !important;
    }
    .sidebar-close-btn {
        display: inline-flex !important;
    }

    /* Main Workspace (Unscrollable Frame) */
    main {
        padding: 8px 10px 6px 10px !important;
        height: 100% !important;
        max-height: 100% !important;
        overflow: hidden !important;
        width: 100%;
        max-width: 100%;
        display: flex;
        flex-direction: column;
        gap: 6px;
    }

    /* Workspace Hero (Centered, Non-scrollable Empty State) */
    .workspace-hero {
        flex: 1;
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        padding: 16px 4px;
        gap: 16px;
        height: 100%;
        max-height: 100%;
        width: 100%;
        text-align: center;
        overflow: hidden;
    }
    .workspace-header h1 {
        font-size: 1.85rem;
        line-height: 1.22;
        letter-spacing: -0.4px;
    }
    .workspace-header p {
        font-size: 0.84rem;
        line-height: 1.5;
        max-width: 100%;
        padding: 0 4px;
    }
    .search-box-card {
        width: 100%;
        max-width: 100%;
    }
    .search-box-card .input-group {
        padding: 5px 6px 5px 14px;
        gap: 8px;
    }
    .search-box-card .search-input {
        min-width: 0;
        font-size: 0.84rem;
        padding: 7px 0;
    }
    .btn-icon-expand,
    .search-box-card .btn-icon-expand,
    .search-box-card .btn-primary {
        width: 36px !important;
        height: 36px !important;
        min-width: 36px !important;
        max-width: 36px !important;
        padding: 0 !important;
        gap: 0 !important;
        border-radius: 50% !important;
        display: inline-flex !important;
        align-items: center !important;
        justify-content: center !important;
        line-height: 1 !important;
        flex-shrink: 0 !important;
    }
    .btn-icon-expand .btn-expand-text,
    .search-box-card .btn-primary span {
        display: none !important;
    }
    .btn-icon-expand i,
    .btn-icon-expand svg,
    .search-box-card .btn-primary i,
    .search-box-card .btn-primary svg {
        width: 18px !important;
        height: 18px !important;
        margin: 0 !important;
        display: block !important;
        flex-shrink: 0 !important;
    }
    .format-pills {
        gap: 6px;
        max-width: 100%;
    }
    .format-pill {
        font-size: 0.65rem;
        padding: 3px 8px;
    }

    /* Loader / Stepper */
    .loader-container {
        padding: 24px 12px;
        margin: 20px auto;
        width: 100%;
    }
    .stepper {
        padding: 0 4px;
    }
    .stepper::before {
        left: 14px;
        right: 14px;
    }
    .step-circle {
        width: 28px;
        height: 28px;
        font-size: 0.72rem;
    }
    .step-label {
        font-size: 0.62rem;
        max-width: 65px;
        text-align: center;
        line-height: 1.2;
    }

    /* Results Workspace (Unscrollable Parent, Internal Scroll) */
    .results-container {
        grid-template-columns: 1fr !important;
        gap: 8px !important;
        height: 100% !important;
        max-height: 100% !important;
        overflow: hidden !important;
        width: 100%;
        flex: 1;
        min-height: 0;
    }
    .results-container[style*="display: none"] {
        display: none !important;
    }
    .results-container[style*="display: grid"],
    .results-container.active {
        display: flex !important;
        flex-direction: column !important;
    }
    #heroSearch[style*="display: none"] {
        display: none !important;
    }
    #loaderContainer[style*="display: none"] {
        display: none !important;
    }

    /* Video Column: Compact Horizontal Video Card Only */
    .video-column {
        display: flex !important;
        flex-direction: column !important;
        gap: 0 !important;
        height: auto !important;
        max-height: none !important;
        overflow: visible !important;
        width: 100% !important;
        flex-shrink: 0 !important;
    }

    /* Compact Horizontal Video Card for Mobile */
    .video-card {
        display: flex !important;
        flex-direction: row !important;
        align-items: center !important;
        gap: 12px !important;
        padding: 7px 10px !important;
        border-radius: var(--radius-sm) !important;
        background: var(--bg-surface) !important;
        border: 1px solid var(--border-color) !important;
        flex-shrink: 0 !important;
        width: 100% !important;
    }
    .thumbnail-container {
        width: 105px !important;
        height: 60px !important;
        min-width: 105px !important;
        max-width: 105px !important;
        border-radius: 6px !important;
        overflow: hidden !important;
        flex-shrink: 0 !important;
        position: relative !important;
    }
    .thumbnail-img {
        width: 100% !important;
        height: 100% !important;
        object-fit: cover !important;
    }
    .duration-badge {
        bottom: 3px !important;
        right: 3px !important;
        font-size: 0.6rem !important;
        padding: 1px 4px !important;
    }
    .video-details {
        padding: 0 !important;
        display: flex !important;
        flex-direction: column !important;
        gap: 4px !important;
        flex: 1 !important;
        min-width: 0 !important;
    }
    .video-title {
        font-size: 0.78rem !important;
        font-weight: 600 !important;
        line-height: 1.3 !important;
        color: #ffffff !important;
        display: -webkit-box !important;
        -webkit-line-clamp: 2 !important;
        -webkit-box-orient: vertical !important;
        overflow: hidden !important;
    }
    .video-author {
        font-size: 0.68rem !important;
        color: var(--text-secondary) !important;
        display: flex !important;
        align-items: center !important;
        gap: 4px !important;
    }
    .video-author i {
        width: 11px !important;
        height: 11px !important;
    }

    /* HIDE Transcript Completely on Mobile */
    .transcript-card {
        display: none !important;
    }

    /* Notes & Chat Card - Fills remaining height, internal scroll */
    .notes-card {
        flex: 1 !important;
        min-height: 0 !important;
        height: 100% !important;
        max-height: 100% !important;
        display: flex !important;
        flex-direction: column !important;
        overflow: hidden !important;
        width: 100% !important;
        padding: 8px 10px !important;
        gap: 6px !important;
    }
    .notes-header {
        display: flex !important;
        flex-wrap: nowrap !important;
        justify-content: space-between !important;
        align-items: center !important;
        gap: 8px !important;
        padding-bottom: 6px !important;
        flex-shrink: 0 !important;
    }
    .view-tabs {
        display: flex !important;
        flex: 1 !important;
        max-width: none !important;
        justify-content: flex-start !important;
    }
    .view-tab {
        flex: 1 !important;
        justify-content: center !important;
        padding: 5px 8px !important;
        font-size: 0.72rem !important;
    }
    .notes-actions {
        display: flex !important;
        align-items: center !important;
        gap: 6px !important;
        flex-shrink: 0 !important;
    }
    .notes-engine-tag {
        display: none !important;
    }
    /* Mobile PDF Button: Icon only, no text */
    #downloadPdfBtn {
        width: 32px !important;
        height: 32px !important;
        min-width: 32px !important;
        padding: 0 !important;
        border-radius: 50% !important;
        display: inline-flex !important;
        align-items: center !important;
        justify-content: center !important;
        flex-shrink: 0 !important;
    }
    #downloadPdfBtn span {
        display: none !important;
    }
    #downloadPdfBtn i {
        width: 15px !important;
        height: 15px !important;
        margin: 0 !important;
    }

    /* Strict Tab Isolation on Mobile - NEVER display both views together */
    .tab-content-view {
        display: none !important;
    }
    .tab-content-view:not(.active) {
        display: none !important;
    }

    /* Active Notes View */
    #notesMarkdown.tab-content-view.active {
        display: block !important;
        flex: 1 !important;
        min-height: 0 !important;
        height: 100% !important;
        max-height: 100% !important;
        overflow-y: auto !important;
        -webkit-overflow-scrolling: touch !important;
        padding-right: 4px !important;
        font-size: 0.82rem !important;
        line-height: 1.5 !important;
    }
    #notesMarkdown.tab-content-view:not(.active) {
        display: none !important;
    }
    .markdown-body h1 {
        font-size: 1.15rem !important;
        margin-top: 0.7em !important;
        margin-bottom: 0.3em !important;
    }
    .markdown-body h2 {
        font-size: 1.0rem !important;
        margin-top: 0.6em !important;
    }
    .markdown-body h3 {
        font-size: 0.9rem !important;
    }

    /* Active Chat View */
    #chatContainer.tab-content-view.active {
        display: flex !important;
        flex-direction: column !important;
        flex: 1 !important;
        min-height: 0 !important;
        height: 100% !important;
        max-height: 100% !important;
        overflow: hidden !important;
        gap: 6px !important;
    }
    #chatContainer.tab-content-view:not(.active) {
        display: none !important;
    }
    .chat-messages {
        flex: 1 !important;
        min-height: 0 !important;
        overflow-y: auto !important;
        -webkit-overflow-scrolling: touch !important;
        padding-right: 4px !important;
        gap: 8px !important;
    }
    .chat-input-wrapper {
        flex-shrink: 0 !important;
        padding-top: 4px !important;
    }
    .chat-input-form input {
        min-width: 0 !important;
        font-size: 16px !important; /* Prevents auto-zoom on iOS */
    }
    .search-box-card .search-input {
        min-width: 0 !important;
        font-size: 16px !important; /* Prevents auto-zoom on iOS */
    }

    /* Toast Notification */
    .toast {
        left: 14px;
        right: 14px;
        bottom: 14px;
        width: auto;
        box-sizing: border-box;
    }

    /* Footer */
    .footer-bar {
        height: 36px;
        padding: 0 14px;
    }
    .footer-bar p {
        font-size: 0.68rem;
    }
}

/* Small Smartphone Screens (<= 480px) */
@media (max-width: 480px) {
    .workspace-header h1 {
        font-size: 1.55rem;
    }
    .workspace-header p {
        font-size: 0.8rem;
        padding: 0;
    }
    .search-box-card .input-group {
        padding: 4px 5px 4px 12px;
        gap: 6px;
    }
}