/* ═══════════════════════════════════════════════════════════════════
   IMDb Intelligence — Cinematic Design System
   Aesthetic: Projectionist's Digital Command Console
   Palette: OLED Obsidian, Slate Glass, IMDb Luminous Amber, Emerald Telemetry
   ═══════════════════════════════════════════════════════════════════ */

:root {
    /* Safe Area Variables */
    --sat: env(safe-area-inset-top, 0px);
    --sab: env(safe-area-inset-bottom, 0px);
    --sal: env(safe-area-inset-left, 0px);
    --sar: env(safe-area-inset-right, 0px);

    /* Color Palette */
    --bg-deep: #07090E;
    --bg-base: #0B0E14;
    --bg-surface: #11151E;
    --bg-surface-elevated: #171C28;
    --bg-surface-glass: rgba(17, 21, 30, 0.75);
    
    /* Borders & Outlines */
    --border-subtle: rgba(255, 255, 255, 0.07);
    --border-medium: rgba(255, 255, 255, 0.14);
    --border-focus: rgba(245, 197, 24, 0.55);

    /* IMDb Gold & Ambers */
    --gold-primary: #F5C518;
    --gold-hover: #FFD034;
    --gold-active: #E0B000;
    --gold-glow: rgba(245, 197, 24, 0.22);
    --gold-glow-soft: rgba(245, 197, 24, 0.08);

    /* Telemetry Accents */
    --emerald: #10B981;
    --emerald-glow: rgba(16, 185, 129, 0.2);
    --cyan: #06B6D4;
    --ruby: #EF4444;

    /* Text & Legibility */
    --text-primary: #F3F4F6;
    --text-secondary: #9CA3AF;
    --text-muted: #6B7280;
    --text-inverse: #0B0E14;

    /* Typography */
    --font-sans: 'Outfit', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    --font-mono: 'JetBrains Mono', SFMono-Regular, Menlo, Monaco, Consolas, monospace;

    /* Depth & Elevation */
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.4);
    --shadow-md: 0 8px 24px rgba(0, 0, 0, 0.55);
    --shadow-lg: 0 16px 40px rgba(0, 0, 0, 0.7);
    --shadow-gold: 0 0 30px rgba(245, 197, 24, 0.18);

    /* Transitions */
    --transition-fast: 0.15s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-base: 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-smooth: 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

/* ── Global Resets & Browser Surfaces ────────────────────────────── */
*, *::before, *::after {
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

html, body {
    margin: 0;
    padding: 0;
    background-color: var(--bg-deep);
    color: var(--text-primary);
    font-family: var(--font-sans);
    font-size: 15px;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    -webkit-text-size-adjust: 100%;
    text-size-adjust: 100%;
    min-height: 100vh;
    min-height: 100dvh;
    overflow-x: hidden;
    width: 100%;
    position: relative;
    touch-action: manipulation;
}

code, kbd, samp, pre {
    font-family: var(--font-mono);
    word-break: break-word;
    overflow-wrap: anywhere;
}

::selection {
    background-color: var(--gold-primary);
    color: var(--text-inverse);
}

::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

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

::-webkit-scrollbar-thumb {
    background: var(--bg-surface-elevated);
    border: 2px solid var(--bg-deep);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--border-medium);
}

/* ── Ambient Background Glow ─────────────────────────────────────── */
.ambient-glow {
    position: fixed;
    top: -250px;
    left: 50%;
    transform: translateX(-50%);
    width: 1000px;
    height: 500px;
    background: radial-gradient(circle, rgba(245, 197, 24, 0.07) 0%, rgba(6, 182, 212, 0.03) 40%, rgba(7, 9, 14, 0) 70%);
    pointer-events: none;
    z-index: 0;
}

/* ── Typography Utilities ────────────────────────────────────────── */
.text-gold { color: var(--gold-primary) !important; }
.text-emerald { color: var(--emerald) !important; }
.text-cyan { color: var(--cyan) !important; }
.font-mono { font-family: var(--font-mono) !important; }

/* ── Navigation Header ───────────────────────────────────────────── */
.navbar-cinema {
    position: sticky;
    top: 0;
    z-index: 1000;
    background: rgba(11, 14, 20, 0.88);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-bottom: 1px solid var(--border-subtle);
    transition: var(--transition-base);
    padding-top: max(0px, env(safe-area-inset-top));
}

.brand-cinema {
    display: inline-flex;
    align-items: center;
    color: var(--text-primary);
}

.brand-icon-box {
    width: 36px;
    height: 36px;
    border-radius: 9px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: var(--transition-base);
}

.brand-icon-img {
    width: 34px;
    height: 34px;
    display: block;
    border-radius: 8px;
    filter: drop-shadow(0 2px 6px rgba(0, 0, 0, 0.4));
    transition: transform var(--transition-fast), filter var(--transition-fast);
}

.brand-cinema:hover .brand-icon-img {
    transform: scale(1.06);
    filter: drop-shadow(0 0 12px rgba(245, 197, 24, 0.5));
}

.brand-title {
    font-size: 1.2rem;
    font-weight: 800;
    letter-spacing: -0.02em;
    color: var(--gold-primary);
    line-height: 1.1;
}

.brand-subtitle {
    color: var(--text-primary);
    font-weight: 500;
    margin-left: 3px;
}

.brand-tagline {
    font-size: 0.68rem;
    color: var(--text-muted);
    font-weight: 500;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

/* Settings Button */
.btn-settings-cinema {
    background: var(--bg-surface);
    color: var(--text-primary);
    border: 1px solid var(--border-medium);
    border-radius: 10px;
    padding: 0.45rem 0.9rem;
    font-size: 0.85rem;
    font-weight: 600;
    transition: var(--transition-base);
}

.btn-settings-cinema:hover {
    background: var(--bg-surface-elevated);
    border-color: var(--gold-primary);
    color: var(--text-primary);
    box-shadow: 0 0 16px var(--gold-glow-soft);
}

.badge-api-status {
    background: rgba(245, 197, 24, 0.15);
    color: var(--gold-primary);
    border: 1px solid rgba(245, 197, 24, 0.3);
    font-size: 0.72rem;
    font-weight: 600;
    padding: 0.25em 0.6em;
    border-radius: 6px;
}

.badge-api-status.status-active {
    background: rgba(16, 185, 129, 0.15);
    color: #34D399;
    border-color: rgba(16, 185, 129, 0.35);
}

/* ── Hero Search Section ─────────────────────────────────────────── */
.hero-cinema {
    position: relative;
    padding: 3rem 1rem 1.25rem;
    z-index: 1;
}

.hero-collapsible {
    max-height: 400px;
    opacity: 1;
    overflow: hidden;
    transition: max-height 0.45s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.35s ease, margin 0.35s ease;
}

.hero-collapsible.collapsed {
    max-height: 0 !important;
    opacity: 0 !important;
    margin-bottom: 0 !important;
    pointer-events: none;
}

.hero-title {
    font-size: 2.75rem;
    font-weight: 800;
    letter-spacing: -0.03em;
    line-height: 1.15;
    margin-bottom: 0.75rem;
    color: #FFFFFF;
}

.highlight-gold {
    color: var(--gold-primary);
    position: relative;
    display: inline-block;
}

.hero-desc {
    font-size: 1.05rem;
    color: var(--text-secondary);
    max-width: 640px;
    margin: 0 auto 1.75rem;
    font-weight: 400;
}

/* ── Search Console ──────────────────────────────────────────────── */
.search-console-wrapper {
    position: relative;
    max-width: 860px;
    margin: 0 auto;
    width: 100%;
}

.search-input-shell {
    position: relative;
    display: flex;
    align-items: center;
    background: var(--bg-surface);
    border: 1.5px solid var(--border-medium);
    border-radius: 18px;
    padding: 0.45rem 0.55rem 0.45rem 1.35rem;
    min-height: 58px;
    box-shadow: var(--shadow-md), 0 0 0 1px rgba(255, 255, 255, 0.03);
    transition: var(--transition-base);
}

.search-input-shell:focus-within,
.search-input-shell:hover {
    border-color: var(--gold-primary);
    background: var(--bg-surface-elevated);
    box-shadow: var(--shadow-lg), var(--shadow-gold);
}

.search-leading-icon {
    color: var(--text-muted);
    font-size: 1.15rem;
    margin-right: 0.85rem;
    transition: var(--transition-fast);
    flex-shrink: 0;
}

.search-input-shell:focus-within .search-leading-icon {
    color: var(--gold-primary);
}

.search-input {
    flex-grow: 1;
    min-width: 0;
    background: transparent;
    border: none;
    outline: none;
    color: var(--text-primary);
    font-size: 1.05rem;
    font-weight: 500;
    font-family: var(--font-sans);
    padding: 0.6rem 0.5rem 0.6rem 0;
}

.search-input::placeholder {
    color: rgba(156, 163, 175, 0.75);
    font-weight: 400;
    transition: opacity var(--transition-fast), color var(--transition-fast);
}

.search-action-group {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-shrink: 0;
}

.btn-clear-query {
    background: transparent;
    border: none;
    color: var(--text-muted);
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: var(--transition-fast);
    flex-shrink: 0;
}

.btn-clear-query:hover {
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-primary);
}

.kbd-shortcut {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.2rem 0.55rem;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid var(--border-subtle);
    border-radius: 6px;
    color: var(--text-muted);
    font-family: var(--font-mono);
    font-size: 0.75rem;
    font-weight: 600;
    user-select: none;
}

.btn-search-cinema {
    background: var(--gold-primary);
    color: var(--text-inverse);
    border: none;
    border-radius: 14px;
    padding: 0.65rem 1.4rem;
    font-weight: 700;
    font-size: 0.95rem;
    letter-spacing: -0.01em;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.35rem;
    min-height: 44px;
    flex-shrink: 0;
    transition: var(--transition-fast);
    box-shadow: 0 4px 14px rgba(245, 197, 24, 0.3);
}

.btn-search-cinema:hover {
    background: var(--gold-hover);
    transform: translateY(-1px);
    box-shadow: 0 6px 20px rgba(245, 197, 24, 0.45);
}

.btn-search-cinema:active {
    transform: translateY(1px);
}

.btn-search-cinema:disabled {
    opacity: 0.65;
    cursor: not-allowed;
    transform: none;
}

/* ── Suggested Chips (Momentum Scroll Rail) ─────────────────────── */
.chips-scroll-rail-wrapper {
    position: relative;
    max-width: 860px;
    margin: 0.65rem auto 0;
    overflow: hidden;
}

.chips-scroll-rail {
    display: flex;
    align-items: center;
    gap: 0.45rem;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    padding: 0.25rem 0.5rem;
    justify-content: center;
}

.chips-scroll-rail::-webkit-scrollbar {
    display: none;
}

.chips-prompt-label {
    font-size: 0.74rem;
    font-weight: 700;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.06em;
    margin-right: 0.2rem;
    display: inline-flex;
    align-items: center;
    flex-shrink: 0;
}

.cinema-chip {
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--border-subtle);
    color: var(--text-secondary);
    font-size: 0.78rem;
    font-weight: 500;
    padding: 0.25rem 0.75rem;
    border-radius: 999px;
    cursor: pointer;
    transition: var(--transition-fast);
    white-space: nowrap;
    line-height: 1.35;
    flex-shrink: 0;
}

.cinema-chip:hover {
    background: var(--bg-surface-elevated);
    border-color: var(--border-medium);
    color: var(--gold-primary);
    transform: translateY(-1px);
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.3);
}

.cinema-chip:active {
    transform: scale(0.96);
}

/* ── Loading Animation & Stepper ─────────────────────────────────── */
.loading-state-cinema {
    animation: fadeIn 0.3s ease-out;
}

.projector-loader-sm .loader-ring-sm {
    width: 44px;
    height: 44px;
    margin: 0 auto;
    border-radius: 50%;
    border: 2.5px solid transparent;
    border-top-color: var(--gold-primary);
    border-right-color: var(--cyan);
    animation: spinRing 1s linear infinite;
}

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

/* ── Error State ─────────────────────────────────────────────────── */
.error-state-cinema {
    max-width: 820px;
    margin: 1.5rem auto;
    animation: fadeIn 0.3s ease-out;
}

.error-card {
    background: rgba(239, 68, 68, 0.08);
    border: 1px solid rgba(239, 68, 68, 0.25);
    border-radius: 14px;
    padding: 1.25rem 1.5rem;
}

.error-icon-box {
    width: 36px;
    height: 36px;
    border-radius: 8px;
    background: rgba(239, 68, 68, 0.15);
    color: var(--ruby);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    flex-shrink: 0;
}

.error-heading {
    color: #FCA5A5;
    font-weight: 700;
    font-size: 1rem;
}

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

.error-suggest-label {
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.btn-retry-cinema {
    background: rgba(239, 68, 68, 0.15);
    color: #FCA5A5;
    border: 1px solid rgba(239, 68, 68, 0.3);
    border-radius: 8px;
    padding: 0.35rem 0.85rem;
    font-size: 0.82rem;
    font-weight: 600;
    transition: var(--transition-fast);
}

.btn-retry-cinema:hover {
    background: rgba(239, 68, 68, 0.25);
    color: #FFFFFF;
}

.btn-close-cinema {
    background: transparent;
    border: none;
    color: var(--text-muted);
    font-size: 1rem;
    cursor: pointer;
    padding: 0.25rem;
    transition: var(--transition-fast);
}

.btn-close-cinema:hover {
    color: var(--text-primary);
}

/* ── Results Control & Telemetry Bar ─────────────────────────────── */
.results-meta-cinema {
    background: var(--bg-surface);
    border: 1px solid var(--border-subtle);
    border-radius: 14px;
    padding: 0.85rem 1.25rem;
    margin-bottom: 1.25rem;
    box-shadow: var(--shadow-sm);
}

.metric-badge {
    display: inline-flex;
    align-items: center;
    padding: 0.35rem 0.75rem;
    border-radius: 8px;
    background: var(--bg-surface-elevated);
    border: 1px solid var(--border-subtle);
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--text-primary);
}

.latency-badge {
    font-family: var(--font-mono);
    color: var(--gold-primary);
}

.btn-telemetry {
    background: var(--bg-surface-elevated);
    border: 1px solid var(--border-subtle);
    color: var(--text-secondary);
    border-radius: 8px;
    padding: 0.35rem 0.8rem;
    font-size: 0.82rem;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    transition: var(--transition-fast);
}

.btn-telemetry:hover,
.btn-telemetry[aria-expanded="true"] {
    border-color: var(--gold-primary);
    color: var(--gold-primary);
    background: rgba(245, 197, 24, 0.08);
}

.btn-telemetry .caret-icon {
    font-size: 0.7rem;
    transition: transform 0.2s ease;
}

.btn-telemetry[aria-expanded="true"] .caret-icon {
    transform: rotate(180deg);
}

.btn-filter-toggle {
    background: var(--bg-surface-elevated);
    border: 1px solid var(--border-subtle);
    color: var(--text-primary);
    border-radius: 8px;
    padding: 0.35rem 0.9rem;
    font-size: 0.82rem;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    transition: var(--transition-fast);
}

.btn-filter-toggle:hover {
    border-color: var(--cyan);
    color: var(--cyan);
}

.filter-count-badge {
    background: var(--cyan);
    color: var(--text-inverse);
    font-size: 0.7rem;
    font-weight: 700;
    padding: 0.15em 0.55em;
    border-radius: 999px;
    margin-left: 0.4rem;
}

/* ── SQL Terminal Drawer ─────────────────────────────────────────── */
.sql-terminal-box {
    background: #080A0F;
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 12px;
    overflow: hidden;
    box-shadow: inset 0 2px 8px rgba(0, 0, 0, 0.6);
}

.sql-terminal-header {
    background: #10141D;
    padding: 0.5rem 1rem;
    border-bottom: 1px solid var(--border-subtle);
}

.terminal-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    display: inline-block;
}
.terminal-dot.red { background: #FF5F56; }
.terminal-dot.yellow { background: #FFBD2E; }
.terminal-dot.green { background: #27C93F; }

.terminal-title {
    font-family: var(--font-mono);
    font-size: 0.75rem;
    color: var(--text-muted);
    font-weight: 500;
}

.btn-copy-sql {
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid var(--border-subtle);
    color: var(--text-secondary);
    font-size: 0.75rem;
    border-radius: 6px;
    padding: 0.2rem 0.6rem;
    transition: var(--transition-fast);
}

.btn-copy-sql:hover {
    background: var(--gold-primary);
    color: var(--text-inverse);
    border-color: var(--gold-primary);
}

.sql-code-block {
    padding: 1rem 1.25rem;
    font-family: var(--font-mono);
    font-size: 0.85rem;
    color: #A7F3D0;
    line-height: 1.5;
    background: transparent;
    overflow-x: auto;
}

/* ── Filter Console Panel ────────────────────────────────────────── */
.filter-card {
    background: var(--bg-surface-elevated);
    border: 1px solid var(--border-medium);
    border-radius: 12px;
    padding: 1.25rem;
}

.filter-section-title {
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-secondary);
    margin-bottom: 0.35rem;
    display: block;
}

.filter-input-group {
    background: var(--bg-surface);
    border: 1px solid var(--border-subtle);
    border-radius: 8px;
    overflow: hidden;
}

.filter-input {
    background: transparent !important;
    border: none !important;
    color: var(--text-primary) !important;
    font-size: 0.85rem;
    padding: 0.45rem 0.65rem;
    font-family: var(--font-mono);
}

.filter-input:focus {
    box-shadow: none;
}

.filter-divider {
    background: var(--bg-surface-elevated) !important;
    border: none !important;
    color: var(--text-muted);
    font-size: 0.75rem;
    font-weight: 600;
}

.chip-filter {
    background: var(--bg-surface);
    border: 1px solid var(--border-subtle);
    color: var(--text-secondary);
    font-size: 0.78rem;
    font-weight: 600;
    padding: 0.28rem 0.7rem;
    border-radius: 8px;
    cursor: pointer;
    transition: var(--transition-fast);
}

.chip-filter:hover {
    background: rgba(255, 255, 255, 0.08);
    color: var(--text-primary);
}

.chip-filter.active {
    background: var(--gold-primary);
    color: var(--text-inverse);
    border-color: var(--gold-primary);
    box-shadow: 0 0 12px var(--gold-glow);
}

.btn-filter-clear {
    background: transparent;
    border: 1px solid var(--border-medium);
    color: var(--text-secondary);
    border-radius: 8px;
    padding: 0.45rem 0.85rem;
    font-size: 0.82rem;
    font-weight: 600;
    transition: var(--transition-fast);
}

.btn-filter-clear:hover {
    background: rgba(255, 255, 255, 0.06);
    color: var(--text-primary);
}

.btn-filter-apply {
    background: var(--gold-primary);
    color: var(--text-inverse);
    border: none;
    border-radius: 8px;
    padding: 0.45rem 0.85rem;
    font-size: 0.82rem;
    font-weight: 700;
    transition: var(--transition-fast);
}

.btn-filter-apply:hover {
    background: var(--gold-hover);
    box-shadow: 0 4px 12px var(--gold-glow);
}

/* ── Results Data Table ──────────────────────────────────────────── */
.cinema-table-card {
    background: var(--bg-surface);
    border: 1px solid var(--border-subtle);
    border-radius: 16px;
    overflow: hidden;
    box-shadow: var(--shadow-md);
}

.table-responsive {
    overflow-x: auto !important;
    -webkit-overflow-scrolling: touch;
    width: 100%;
}

.table-cinema {
    --bs-table-bg: transparent;
    --bs-table-color: var(--text-primary);
    --bs-table-hover-bg: rgba(245, 197, 24, 0.04);
    --bs-table-hover-color: #FFFFFF;
    margin-bottom: 0;
    min-width: 660px;
    width: 100% !important;
}

.table-cinema thead th {
    background: #0E121A;
    color: var(--text-secondary);
    font-size: 0.76rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    border-bottom: 1px solid var(--border-medium);
    padding: 0.9rem 0.85rem;
    white-space: nowrap;
}

.table-cinema tbody td {
    padding: 0.85rem 0.85rem;
    border-bottom: 1px solid var(--border-subtle);
    font-size: 0.88rem;
    vertical-align: middle;
}

/* Dedicated Column Styling */
.table-cinema thead th.col-title-header,
.table-cinema tbody td.col-title-cell {
    min-width: 180px;
    max-width: 340px;
}

.title-text-cell {
    font-weight: 600;
    color: #FFFFFF;
    word-break: normal;
    overflow-wrap: break-word;
    white-space: normal;
    line-height: 1.4;
    display: inline-block;
}

.table-cinema thead th.col-id-header,
.table-cinema tbody td.col-id-cell {
    min-width: 105px;
    width: 110px;
    white-space: nowrap;
}

.table-cinema thead th.col-year-header,
.table-cinema tbody td.col-year-cell {
    min-width: 70px;
    width: 75px;
    white-space: nowrap;
}

.table-cinema thead th.col-rating-header,
.table-cinema tbody td.col-rating-cell {
    min-width: 85px;
    width: 90px;
    white-space: nowrap;
}

.table-cinema thead th.col-votes-header,
.table-cinema tbody td.col-votes-cell {
    min-width: 85px;
    width: 95px;
    white-space: nowrap;
}

.table-cinema thead th.col-genres-header,
.table-cinema tbody td.col-genres-cell {
    min-width: 135px;
    white-space: normal;
}

.table-cinema tbody tr {
    transition: background-color var(--transition-fast);
}

.table-cinema tbody tr:hover td {
    background-color: rgba(255, 255, 255, 0.02);
}

/* Rating Star Badge */
.badge-rating {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    background: rgba(245, 197, 24, 0.12);
    border: 1px solid rgba(245, 197, 24, 0.3);
    color: var(--gold-primary);
    padding: 0.25rem 0.6rem;
    border-radius: 6px;
    font-size: 0.82rem;
    font-weight: 700;
    font-family: var(--font-mono);
}

.badge-year {
    display: inline-block;
    background: rgba(255, 255, 255, 0.06);
    color: var(--text-secondary);
    border: 1px solid var(--border-subtle);
    padding: 0.2rem 0.55rem;
    border-radius: 6px;
    font-size: 0.8rem;
    font-weight: 600;
    font-family: var(--font-mono);
}

.votes-count-cell {
    color: var(--text-muted);
    font-size: 0.8rem;
    font-family: var(--font-mono);
}

.genre-chip-inline {
    display: inline-block;
    padding: 0.15rem 0.5rem;
    border-radius: 999px;
    background: rgba(6, 182, 212, 0.1);
    color: #67E8F9;
    border: 1px solid rgba(6, 182, 212, 0.22);
    font-size: 0.72rem;
    font-weight: 600;
    margin: 0.1rem;
    letter-spacing: 0.02em;
}

.imdb-link-badge {
    color: var(--gold-primary);
    text-decoration: none;
    font-family: var(--font-mono);
    font-size: 0.8rem;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.2rem 0.5rem;
    border-radius: 6px;
    background: rgba(245, 197, 24, 0.08);
    border: 1px solid rgba(245, 197, 24, 0.2);
    transition: var(--transition-fast);
}

.imdb-link-badge:hover {
    background: var(--gold-primary);
    color: var(--text-inverse);
    border-color: var(--gold-primary);
}

.badge-country-lang {
    display: inline-block;
    background: rgba(168, 85, 247, 0.12);
    color: #C084FC;
    border: 1px solid rgba(168, 85, 247, 0.25);
    padding: 0.15rem 0.45rem;
    border-radius: 4px;
    font-size: 0.72rem;
    font-weight: 700;
    font-family: var(--font-mono);
    letter-spacing: 0.05em;
}

.movie-poster-thumb {
    width: 38px;
    height: 56px;
    object-fit: cover;
    border-radius: 6px;
    border: 1px solid rgba(255, 255, 255, 0.15);
    box-shadow: 0 3px 8px rgba(0, 0, 0, 0.45);
    flex-shrink: 0;
    background: var(--bg-surface-elevated);
}

.movie-poster-placeholder {
    width: 38px;
    height: 56px;
    border-radius: 6px;
    background: var(--bg-surface-elevated);
    border: 1px solid rgba(255, 255, 255, 0.08);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
    font-size: 0.95rem;
    flex-shrink: 0;
}

/* AI Summary Trigger Button */
.btn-ai-synopsis {
    background: rgba(245, 197, 24, 0.1);
    border: 1px solid rgba(245, 197, 24, 0.25);
    color: var(--gold-primary);
    width: 28px;
    height: 28px;
    border-radius: 7px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    cursor: pointer;
    transition: var(--transition-fast);
    flex-shrink: 0;
}

.btn-ai-synopsis:hover {
    background: var(--gold-primary);
    color: var(--text-inverse);
    box-shadow: 0 0 12px var(--gold-glow);
    transform: scale(1.08);
}

/* ── DataTables Overrides ────────────────────────────────────────── */
.dataTables_wrapper {
    padding: 0;
    width: 100%;
}

.table-controls-header {
    background: #0B0E14;
    border-bottom: 1px solid var(--border-subtle);
    padding: 0.85rem 1.25rem;
}

.table-controls-footer {
    background: #0B0E14;
    border-top: 1px solid var(--border-subtle);
    padding: 0.75rem 1.25rem;
}

.dataTables_wrapper .dataTables_length,
.dataTables_wrapper .dataTables_filter {
    margin-bottom: 0;
}

.dataTables_wrapper .dataTables_length label,
.dataTables_wrapper .dataTables_filter label {
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--text-secondary);
    display: inline-flex;
    align-items: center;
    margin-bottom: 0;
}

.dataTables_wrapper .dataTables_length select {
    background-color: var(--bg-surface-elevated);
    border: 1px solid var(--border-subtle);
    color: var(--text-primary);
    border-radius: 8px;
    padding: 0.35rem 1.8rem 0.35rem 0.75rem;
    margin: 0 0.5rem;
    font-size: 0.82rem;
    outline: none;
}

.dataTables_wrapper .dataTables_filter input {
    background-color: var(--bg-surface-elevated);
    border: 1px solid var(--border-subtle);
    color: var(--text-primary);
    border-radius: 8px;
    padding: 0.35rem 0.75rem;
    margin-left: 0.5rem;
    font-size: 0.82rem;
    outline: none;
    transition: var(--transition-fast);
}

.dataTables_wrapper .dataTables_filter input:focus {
    border-color: var(--gold-primary);
    box-shadow: 0 0 0 2px var(--gold-glow-soft);
}

.dataTables_wrapper .dataTables_info {
    font-size: 0.8rem;
    color: var(--text-muted);
    padding: 0;
    font-family: var(--font-mono);
}

.dataTables_wrapper .dataTables_paginate {
    padding: 0;
}

.dataTables_wrapper .pagination {
    gap: 0.25rem;
}

.dataTables_wrapper .page-link {
    background-color: var(--bg-surface-elevated);
    border: 1px solid var(--border-subtle);
    color: var(--text-secondary);
    border-radius: 8px !important;
    font-size: 0.8rem;
    font-weight: 600;
    padding: 0.35rem 0.75rem;
    transition: var(--transition-fast);
}

.dataTables_wrapper .page-link:hover {
    background-color: rgba(255, 255, 255, 0.08);
    border-color: var(--border-medium);
    color: var(--text-primary);
}

.dataTables_wrapper .page-item.active .page-link {
    background-color: var(--gold-primary);
    border-color: var(--gold-primary);
    color: var(--text-inverse);
    box-shadow: 0 0 12px var(--gold-glow);
}

/* ── No Results State ────────────────────────────────────────────── */
.no-results-cinema {
    animation: fadeIn 0.4s ease-out;
}

.no-results-icon-box {
    width: 64px;
    height: 64px;
    border-radius: 16px;
    background: var(--bg-surface);
    border: 1px solid var(--border-subtle);
    color: var(--text-muted);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.75rem;
    margin: 0 auto;
}

.no-results-title {
    font-size: 1.25rem;
    font-weight: 700;
    color: #FFFFFF;
    margin-bottom: 0.4rem;
}

.no-results-subtitle {
    font-size: 0.9rem;
    color: var(--text-muted);
    max-width: 480px;
    margin: 0 auto;
}

/* ── Modals & Glass Dialogs ──────────────────────────────────────── */
.modal-cinema {
    padding-left: 0 !important;
    padding-right: 0 !important;
}

.modal-cinema .modal-dialog {
    margin: 1.75rem auto;
    max-width: 720px;
}

.modal-cinema .modal-content-cinema {
    background: var(--bg-surface);
    border: 1px solid var(--border-medium);
    border-radius: 18px;
    box-shadow: var(--shadow-lg), 0 0 40px rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    overflow: hidden;
    max-height: calc(100dvh - 3.5rem);
    display: flex;
    flex-direction: column;
}

.modal-header-cinema {
    background: #0E121A;
    border-bottom: 1px solid var(--border-subtle);
    padding: 1.25rem 1.5rem;
    flex-shrink: 0;
}

.modal-icon-sparkle,
.modal-icon-key {
    width: 38px;
    height: 38px;
    border-radius: 10px;
    background: rgba(245, 197, 24, 0.1);
    border: 1px solid rgba(245, 197, 24, 0.25);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    flex-shrink: 0;
}

.modal-title {
    font-size: 1.15rem;
    font-weight: 700;
    color: #FFFFFF;
    line-height: 1.25;
    word-break: break-word;
    overflow-wrap: break-word;
}

.modal-subtitle-text {
    font-size: 0.75rem;
    color: var(--text-muted);
    display: block;
    line-height: 1.3;
    word-break: break-word;
    overflow-wrap: break-word;
}

.modal-body-cinema {
    padding: 1.5rem;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    flex: 1 1 auto;
    word-break: break-word;
    overflow-wrap: break-word;
}

.modal-footer-cinema {
    background: #0E121A;
    border-top: 1px solid var(--border-subtle);
    padding: 1rem 1.5rem;
    flex-shrink: 0;
}

/* Forms in Modals */
.cinema-form-label {
    font-size: 0.78rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--text-secondary);
    margin-bottom: 0.35rem;
    display: block;
}

.cinema-input {
    background: var(--bg-surface-elevated) !important;
    border: 1px solid var(--border-medium) !important;
    color: var(--text-primary) !important;
    border-radius: 10px !important;
    font-size: 0.9rem;
    padding: 0.6rem 0.85rem;
    transition: var(--transition-fast);
    width: 100%;
}

.cinema-input:focus {
    border-color: var(--gold-primary) !important;
    box-shadow: 0 0 0 2px var(--gold-glow) !important;
}

.cinema-input::placeholder {
    color: var(--text-muted) !important;
    opacity: 0.5 !important;
    font-weight: 400;
    font-size: 0.85rem;
    text-overflow: ellipsis;
    overflow: hidden;
    white-space: nowrap;
}

.btn-cinema-addon {
    background: var(--bg-surface-elevated);
    border: 1px solid var(--border-medium);
    border-left: none;
    color: var(--text-muted);
    border-radius: 0 10px 10px 0;
    padding: 0.6rem 0.85rem;
}

.btn-cinema-addon:hover {
    color: var(--text-primary);
}

.settings-security-note {
    background: rgba(16, 185, 129, 0.08);
    border: 1px solid rgba(16, 185, 129, 0.2);
    border-radius: 10px;
    padding: 0.75rem 1rem;
    font-size: 0.8rem;
    color: #A7F3D0;
    line-height: 1.45;
    word-break: break-word;
    overflow-wrap: break-word;
}

.settings-guide-box {
    background: rgba(245, 197, 24, 0.06);
    border: 1px solid rgba(245, 197, 24, 0.2);
    word-break: break-word;
    overflow-wrap: break-word;
}

.settings-guide-list {
    margin-bottom: 0;
}

.settings-guide-list li {
    word-break: break-word;
    overflow-wrap: break-word;
    margin-bottom: 0.4rem;
    font-size: 0.82rem;
    line-height: 1.45;
}

.settings-guide-list code,
.form-text code {
    word-break: break-all;
    overflow-wrap: anywhere;
    white-space: normal;
    color: #FDE68A;
    background: rgba(255, 255, 255, 0.07);
    padding: 0.1em 0.35em;
    border-radius: 4px;
    font-size: 0.85em;
}

/* Modal Buttons */
.btn-cinema-gold {
    background: var(--gold-primary);
    color: var(--text-inverse);
    border: none;
    border-radius: 10px;
    padding: 0.5rem 1.1rem;
    font-weight: 700;
    font-size: 0.85rem;
    transition: var(--transition-fast);
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.btn-cinema-gold:hover {
    background: var(--gold-hover);
    box-shadow: 0 0 15px var(--gold-glow);
}

.btn-cinema-secondary {
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid var(--border-medium);
    color: var(--text-secondary);
    border-radius: 10px;
    padding: 0.5rem 1.1rem;
    font-weight: 600;
    font-size: 0.85rem;
    transition: var(--transition-fast);
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.btn-cinema-secondary:hover {
    background: rgba(255, 255, 255, 0.12);
    color: var(--text-primary);
}

.btn-cinema-danger {
    background: rgba(239, 68, 68, 0.12);
    border: 1px solid rgba(239, 68, 68, 0.25);
    color: #FCA5A5;
    border-radius: 10px;
    padding: 0.5rem 0.9rem;
    font-weight: 600;
    font-size: 0.85rem;
    transition: var(--transition-fast);
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.btn-cinema-danger:hover {
    background: rgba(239, 68, 68, 0.22);
    color: #FFFFFF;
}

/* AI Synopsis Body */
.synopsis-title {
    font-size: 1.35rem;
    font-weight: 800;
    color: var(--gold-primary);
    letter-spacing: -0.02em;
    word-break: break-word;
    overflow-wrap: break-word;
    line-height: 1.25;
}

.synopsis-body {
    font-size: 0.95rem;
    line-height: 1.7;
    color: var(--text-primary);
    word-break: break-word;
    overflow-wrap: break-word;
}

.synopsis-body p {
    margin-bottom: 1rem;
    word-break: break-word;
    overflow-wrap: break-word;
}

.synopsis-body strong {
    color: #FFFFFF;
    font-weight: 700;
}

.projector-loader-sm .loader-ring-sm {
    width: 44px;
    height: 44px;
    margin: 0 auto;
    border-radius: 50%;
    border: 2.5px solid transparent;
    border-top-color: var(--gold-primary);
    border-right-color: var(--cyan);
    animation: spinRing 1s linear infinite;
}

/* ── Toast Notifications ─────────────────────────────────────────── */
.toast-cinema {
    background: var(--bg-surface-elevated);
    border: 1px solid var(--border-medium);
    border-radius: 12px;
    color: var(--text-primary);
    box-shadow: var(--shadow-lg);
}

/* ── Animations ──────────────────────────────────────────────────── */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.fade-in {
    animation: fadeIn 0.35s ease-out;
}

/* ── Live Agent Telemetry & Unified Stepper Rail ─────────────────── */
.agent-stepper-card {
    position: relative;
    background: var(--bg-surface);
    border: 1px solid var(--border-medium);
    border-radius: 18px;
    padding: 1.25rem 1.4rem 1.15rem;
    box-shadow: var(--shadow-lg), 0 0 35px rgba(0, 0, 0, 0.6);
    max-width: 600px;
    overflow: hidden;
    text-align: left;
    word-break: break-word;
    overflow-wrap: break-word;
}

.stepper-progress-track {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3.5px;
    background: rgba(255, 255, 255, 0.06);
    overflow: hidden;
}

.stepper-progress-bar {
    height: 100%;
    width: 45%;
    background: linear-gradient(90deg, var(--gold-primary), var(--cyan), var(--gold-primary));
    border-radius: 999px;
    animation: progressIndeterminate 1.5s cubic-bezier(0.65, 0, 0.35, 1) infinite;
}

@keyframes progressIndeterminate {
    0% { transform: translateX(-100%) scaleX(0.2); }
    50% { transform: translateX(50%) scaleX(0.8); }
    100% { transform: translateX(250%) scaleX(0.2); }
}

.agent-pulse-dot {
    width: 9px;
    height: 9px;
    border-radius: 50%;
    background: var(--gold-primary);
    box-shadow: 0 0 10px var(--gold-primary);
    animation: pulseDot 1.4s ease-in-out infinite;
    display: inline-block;
}

@keyframes pulseDot {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.4; transform: scale(1.25); }
}

.agent-live-title {
    font-size: 0.82rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--gold-primary);
}

.agent-current-step {
    font-size: 1rem;
    color: var(--text-primary);
    min-height: 1.5rem;
    word-break: break-word;
    overflow-wrap: break-word;
    line-height: 1.4;
}

/* Continuous Vertical Timeline Rail */
.agent-activity-timeline {
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 0;
    padding-left: 0.25rem;
    max-height: 200px;
    overflow-y: auto;
    overflow-x: hidden;
}

.agent-step-item {
    position: relative;
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 0.65rem;
    padding: 0.35rem 0.35rem 0.35rem 1.65rem;
    font-size: 0.84rem;
    color: var(--text-muted);
    border-left: 2px solid rgba(255, 255, 255, 0.08);
    transition: var(--transition-fast);
}

.agent-step-item:last-child {
    border-left-color: transparent;
}

.agent-step-node {
    position: absolute;
    left: -7px;
    top: 7px;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: var(--bg-surface-elevated);
    border: 2px solid var(--border-medium);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition-base);
}

.agent-step-item.active .agent-step-node {
    background: var(--gold-primary);
    border-color: var(--gold-primary);
    box-shadow: 0 0 10px var(--gold-primary);
}

.agent-step-item.completed .agent-step-node {
    background: var(--emerald);
    border-color: var(--emerald);
    box-shadow: 0 0 8px var(--emerald);
}

.agent-step-item.active {
    color: #FFFFFF;
    font-weight: 600;
}

.agent-step-item.completed {
    color: var(--text-secondary);
}

.timeline-time-pill {
    font-family: var(--font-mono);
    font-size: 0.72rem;
    color: var(--text-muted);
    white-space: nowrap;
    font-variant-numeric: tabular-nums;
    flex-shrink: 0;
}

.btn-agent-abort {
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.3);
    color: #FCA5A5;
    border-radius: 10px;
    padding: 0.45rem 1.1rem;
    font-size: 0.82rem;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    cursor: pointer;
    transition: var(--transition-fast);
}

.btn-agent-abort:hover, .btn-agent-abort:active {
    background: rgba(239, 68, 68, 0.22);
    color: #FFFFFF;
    border-color: rgba(239, 68, 68, 0.5);
}

/* ── Entity Disambiguation Ribbon ──────────────────────────────── */
.disambiguation-banner-cinema {
    background: linear-gradient(135deg, rgba(245, 197, 24, 0.08) 0%, rgba(13, 202, 240, 0.04) 100%);
    border: 1px solid rgba(245, 197, 24, 0.35);
    border-radius: 14px;
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.25);
    word-break: break-word;
    overflow-wrap: break-word;
}

.disambig-icon-box {
    width: 34px;
    height: 34px;
    border-radius: 9px;
    background: rgba(245, 197, 24, 0.15);
    border: 1px solid rgba(245, 197, 24, 0.3);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    flex-shrink: 0;
}

.badge-disambig {
    background: rgba(13, 202, 240, 0.15);
    border: 1px solid rgba(13, 202, 240, 0.35);
    color: #6edff6;
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    padding: 0.25rem 0.55rem;
    border-radius: 6px;
    display: inline-block;
}

.disambig-headline {
    font-size: 0.92rem;
}

.disambig-headline strong {
    color: var(--gold-primary);
}

.disambig-chip {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.14);
    border-radius: 50px;
    color: var(--text-primary);
    padding: 0.38rem 0.85rem;
    font-size: 0.84rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    text-decoration: none;
}

.disambig-chip:hover {
    background: rgba(245, 197, 24, 0.14);
    border-color: rgba(245, 197, 24, 0.45);
    color: #ffffff;
    transform: translateY(-1px);
    box-shadow: 0 4px 14px rgba(245, 197, 24, 0.18);
}

.disambig-chip:active {
    transform: translateY(0);
}

.disambig-meta-badge {
    background: rgba(255, 255, 255, 0.08);
    color: var(--text-secondary);
    font-size: 0.72rem;
    padding: 0.15rem 0.48rem;
    border-radius: 10px;
    font-family: var(--font-mono, monospace);
}

.disambig-chip:hover .disambig-meta-badge {
    background: rgba(245, 197, 24, 0.22);
    color: var(--gold-primary);
}

/* ── Auto-Correction Notice Banner ──────────────────────────────── */
.correction-banner-cinema {
    background: rgba(245, 197, 24, 0.07);
    border: 1px solid rgba(245, 197, 24, 0.3);
    border-radius: 14px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
    word-break: break-word;
    overflow-wrap: break-word;
}

.correction-icon-box {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    background: rgba(245, 197, 24, 0.15);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.95rem;
    flex-shrink: 0;
}

.badge-intent {
    background: rgba(245, 197, 24, 0.2);
    border: 1px solid rgba(245, 197, 24, 0.4);
    color: var(--gold-primary);
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    padding: 0.25rem 0.5rem;
    border-radius: 6px;
    display: inline-block;
}

.correction-text {
    font-size: 0.92rem;
    color: var(--text-primary);
    word-break: break-word;
    overflow-wrap: break-word;
}

.correction-text strong {
    color: var(--gold-primary);
}

/* ── Grounding Diagnosis Card ───────────────────────────────────── */
.diagnosis-card {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border-medium);
    border-radius: 12px;
    text-align: left;
    word-break: break-word;
    overflow-wrap: break-word;
}

/* ── Mobile Cinema Cards Feed ────────────────────────────────────── */
.mobile-results-feed {
    display: flex;
    flex-direction: column;
    gap: 0.85rem;
}

.movie-card-mobile {
    background: var(--bg-surface);
    border: 1px solid var(--border-subtle);
    border-radius: 16px;
    padding: 0.85rem;
    display: flex;
    gap: 0.85rem;
    align-items: stretch;
    box-shadow: var(--shadow-sm);
    transition: transform var(--transition-fast), border-color var(--transition-fast);
    position: relative;
}

.movie-card-mobile:active {
    transform: scale(0.985);
    border-color: var(--border-medium);
}

.movie-card-poster-box {
    width: 70px;
    min-height: 105px;
    border-radius: 8px;
    overflow: hidden;
    background: var(--bg-surface-elevated);
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.5);
    flex-shrink: 0;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
}

.movie-card-poster {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.poster-placeholder-icon {
    color: var(--text-muted);
    font-size: 1.5rem;
    opacity: 0.4;
}

.movie-card-content {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    gap: 0.35rem;
}

.movie-card-header-row {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 0.5rem;
}

.movie-card-title {
    font-size: 1rem;
    font-weight: 700;
    color: #FFFFFF;
    line-height: 1.3;
    word-break: break-word;
    overflow-wrap: break-word;
}

.movie-card-meta-row {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.4rem;
    font-size: 0.78rem;
}

.movie-card-genres {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.25rem;
}

.movie-card-actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    margin-top: 0.25rem;
    padding-top: 0.35rem;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
}

.btn-card-synopsis {
    background: rgba(245, 197, 24, 0.12);
    border: 1px solid rgba(245, 197, 24, 0.3);
    color: var(--gold-primary);
    border-radius: 8px;
    padding: 0.28rem 0.65rem;
    font-size: 0.76rem;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    cursor: pointer;
    transition: var(--transition-fast);
}

.btn-card-synopsis:active {
    background: var(--gold-primary);
    color: var(--text-inverse);
}

.btn-card-imdb {
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 0.75rem;
    font-family: var(--font-mono);
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.25rem 0.5rem;
    border-radius: 6px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--border-subtle);
    transition: var(--transition-fast);
}

.btn-card-imdb:active {
    background: var(--gold-primary);
    color: var(--text-inverse);
    border-color: var(--gold-primary);
}

/* ═══════════════════════════════════════════════════════════════════
   RESPONSIVE ADAPTATIONS & NATIVE MOBILE APP SHELL
   ═══════════════════════════════════════════════════════════════════ */

/* Dual View Layout Rules: Desktop Table vs Mobile Cards */
@media (max-width: 768px) {
    #resultsContainer,
    .results-table-container {
        display: none !important;
    }

    #mobileResultsFeed:not(.d-none) {
        display: flex !important;
    }

    .hero-title {
        font-size: clamp(1.75rem, 5.5vw, 2.2rem);
        text-wrap: balance;
    }

    .hero-desc {
        text-wrap: pretty;
    }

    .hero-cinema {
        padding: 2rem 0.75rem 0.85rem;
    }

    .chips-scroll-rail-wrapper {
        overflow: visible;
        margin: 0.75rem auto 0;
    }

    .chips-scroll-rail-wrapper::after,
    .chips-scroll-rail-wrapper::before {
        display: none !important;
    }

    .chips-scroll-rail {
        display: flex;
        flex-wrap: wrap;
        justify-content: center;
        align-items: center;
        gap: 0.45rem 0.4rem;
        padding: 0.2rem 0.5rem;
        overflow-x: visible;
    }

    .chips-prompt-label {
        font-size: 0.74rem;
        font-weight: 700;
        color: var(--text-muted);
        letter-spacing: 0.05em;
        display: inline-flex;
        align-items: center;
        margin-right: 0.2rem;
    }

    .cinema-chip {
        font-size: 0.78rem;
        padding: 0.32rem 0.75rem;
        border-radius: 999px;
        white-space: normal;
        text-align: center;
        line-height: 1.25;
        min-height: 32px;
        display: inline-flex;
        align-items: center;
    }

    .search-input-shell {
        min-height: 54px;
        padding: 0.35rem 0.5rem 0.35rem 1rem;
        border-radius: 16px;
        gap: 0.4rem;
    }

    .search-leading-icon {
        color: var(--gold-primary);
        opacity: 0.9;
    }

    .search-input {
        font-size: 16px;
        padding: 0.5rem 0.25rem 0.5rem 0;
        min-width: 0;
    }

    .btn-search-cinema {
        padding: 0.55rem 1.15rem;
        font-size: 0.9rem;
        min-height: 44px;
        border-radius: 12px;
    }

    .results-meta-cinema {
        padding: 0.75rem;
    }

    /* Bottom Sheet Dialogs on Mobile */
    .modal-bottom-sheet .modal-dialog {
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        margin: 0 !important;
        max-width: 100% !important;
        width: 100% !important;
        transform: translateY(100%);
        transition: transform 0.35s cubic-bezier(0.16, 1, 0.3, 1) !important;
    }

    .modal-bottom-sheet.show .modal-dialog {
        transform: translateY(0) !important;
    }

    .modal-bottom-sheet .modal-content-cinema {
        border-radius: 22px 22px 0 0 !important;
        max-height: 88dvh !important;
        border-bottom: none !important;
        padding-bottom: max(16px, env(safe-area-inset-bottom));
        box-shadow: 0 -10px 40px rgba(0, 0, 0, 0.8);
    }

    .sheet-grabber-bar {
        width: 100%;
        padding: 0.75rem 0 0.25rem;
        display: flex;
        justify-content: center;
        cursor: grab;
        background: #0E121A;
    }

    .sheet-grabber {
        width: 38px;
        height: 4.5px;
        border-radius: 999px;
        background: rgba(255, 255, 255, 0.25);
    }

    .modal-header-cinema {
        padding: 0.85rem 1.25rem;
    }

    .modal-body-cinema {
        padding: 1.15rem 1.15rem;
    }

    .modal-footer-cinema {
        padding: 0.85rem 1.15rem;
    }
}

@media (min-width: 769px) {
    #mobileResultsFeed {
        display: none !important;
    }

    #resultsContainer:not(.d-none) {
        display: block !important;
    }
}

@media (max-width: 576px) {
    /* Navbar */
    .brand-title {
        font-size: 1.05rem;
    }

    .brand-tagline {
        display: none;
    }

    .brand-icon-box {
        width: 30px;
        height: 30px;
    }

    .brand-icon-img {
        width: 28px;
        height: 28px;
        border-radius: 7px;
    }

    .btn-settings-cinema {
        padding: 0.35rem 0.6rem;
        font-size: 0.78rem;
        border-radius: 8px;
    }

    .badge-api-status {
        font-size: 0.68rem;
        padding: 0.2em 0.5em;
    }

    /* Hero */
    .hero-cinema {
        padding: 1.5rem 0.35rem 0.65rem;
    }

    .hero-title {
        font-size: clamp(1.4rem, 6.5vw, 1.8rem);
        margin-bottom: 0.45rem;
    }

    .hero-desc {
        font-size: 0.86rem;
        margin-bottom: 1rem;
        padding: 0 0.25rem;
        line-height: 1.45;
    }

    /* Search Console (Roomy and Spacious on Small Screens) */
    .search-console-wrapper {
        width: 100%;
        padding: 0 0.15rem;
    }

    .search-input-shell {
        min-height: 52px;
        padding: 0.35rem 0.45rem 0.35rem 0.85rem;
        border-radius: 16px;
        gap: 0.35rem;
    }

    .search-leading-icon {
        font-size: 1rem;
        margin-right: 0.25rem;
        flex-shrink: 0;
    }

    .search-input {
        font-size: 16px !important;
        padding: 0.45rem 0.25rem 0.45rem 0;
        min-width: 0;
        flex: 1;
    }

    .search-action-group {
        display: flex;
        align-items: center;
        gap: 0.35rem;
        flex-shrink: 0;
    }

    .btn-search-cinema {
        padding: 0.55rem 0.85rem;
        font-size: 0.88rem;
        border-radius: 12px;
        min-height: 42px;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        gap: 0.3rem;
        flex-shrink: 0;
    }

    .btn-clear-query {
        width: 28px;
        height: 28px;
        font-size: 0.85rem;
        flex-shrink: 0;
    }

    .chips-prompt-label {
        font-size: 0.72rem;
    }

    .cinema-chip {
        font-size: 0.74rem;
        padding: 0.28rem 0.65rem;
        min-height: 30px;
    }

    /* Stepper Card on Mobile */
    .agent-stepper-card {
        padding: 1rem 0.9rem;
        border-radius: 14px;
    }

    .agent-current-step {
        font-size: 0.92rem;
    }

    .agent-step-item {
        padding: 0.3rem 0.3rem 0.3rem 1.4rem;
        font-size: 0.78rem;
        gap: 0.45rem;
    }

    .timeline-time-pill {
        font-size: 0.68rem;
    }

    /* Results Meta & Telemetry */
    .results-meta-cinema {
        padding: 0.65rem 0.75rem;
        border-radius: 12px;
        margin-bottom: 0.85rem;
    }

    .meta-bar-inner {
        flex-direction: column;
        align-items: stretch;
        gap: 0.55rem;
    }

    .meta-bar-inner > div:first-child {
        display: flex;
        flex-wrap: wrap;
        gap: 0.35rem;
        width: 100%;
    }

    .meta-bar-inner > div:last-child {
        width: 100%;
    }

    .btn-filter-toggle {
        width: 100%;
        justify-content: center;
        font-size: 0.8rem;
        padding: 0.45rem;
        border-radius: 8px;
    }

    .metric-badge {
        font-size: 0.75rem;
        padding: 0.3rem 0.55rem;
        border-radius: 6px;
    }

    .btn-telemetry {
        font-size: 0.75rem;
        padding: 0.3rem 0.55rem;
        border-radius: 6px;
    }

    /* Filter Panel */
    .filter-card {
        padding: 0.85rem;
        border-radius: 10px;
    }

    .genre-filter-chips {
        max-height: 130px;
        overflow-y: auto;
        gap: 0.3rem !important;
    }

    .chip-filter {
        font-size: 0.72rem;
        padding: 0.2rem 0.5rem;
    }

    .filter-input {
        font-size: 16px !important;
        padding: 0.4rem 0.5rem;
    }

    /* Settings Modal Footer (Stacked layout on mobile) */
    .settings-modal-footer {
        flex-direction: column-reverse !important;
        align-items: stretch !important;
        gap: 0.5rem !important;
        padding: 0.75rem 0.85rem;
    }

    .settings-modal-footer #resetSettingsBtn {
        width: 100%;
        text-align: center;
        justify-content: center;
        padding: 0.55rem;
        font-size: 0.82rem;
        min-height: 40px;
    }

    .settings-modal-actions {
        width: 100%;
        display: flex;
        gap: 0.5rem;
    }

    .settings-modal-actions .btn {
        flex: 1 1 50%;
        text-align: center;
        justify-content: center;
        padding: 0.55rem 0.5rem;
        font-size: 0.82rem;
        min-height: 40px;
    }

    /* Synopsis Modal */
    .synopsis-title {
        font-size: 1.15rem;
        margin-bottom: 0.5rem;
    }

    .synopsis-body {
        font-size: 0.88rem;
        line-height: 1.55;
    }

    .summary-modal-footer {
        display: flex;
        gap: 0.5rem;
        padding: 0.75rem 0.85rem;
    }

    .summary-modal-footer .btn {
        flex: 1 1 auto;
        text-align: center;
        justify-content: center;
        min-height: 40px;
    }

    /* Toast Notification on Mobile */
    .toast-container {
        left: 50% !important;
        transform: translateX(-50%);
        right: auto !important;
        width: calc(100vw - 1.5rem);
        max-width: calc(100vw - 1.5rem);
        padding: 0 !important;
        bottom: max(1rem, env(safe-area-inset-bottom)) !important;
    }

    .toast-cinema {
        width: 100%;
    }
}

/* ═══════════════════════════════════════════════════════════════════
   Cinema Analytics & Trend Visualization Dashboard
   ═══════════════════════════════════════════════════════════════════ */

.view-mode-tabs-container {
    margin-top: 0.5rem;
    margin-bottom: 1.25rem;
}

.view-switcher-group {
    background: var(--bg-surface-elevated);
    padding: 3px;
    border-radius: 10px;
    border: 1px solid var(--border-subtle);
    display: inline-flex;
}

.btn-view-tab {
    background: transparent;
    border: none;
    color: var(--text-secondary);
    font-size: 0.85rem;
    font-weight: 600;
    padding: 0.45rem 0.95rem;
    border-radius: 8px;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
}

.btn-view-tab:hover {
    color: var(--text-primary);
    background: rgba(255, 255, 255, 0.05);
}

.btn-view-tab.active {
    background: rgba(245, 197, 24, 0.15);
    color: var(--gold-primary);
    border: 1px solid rgba(245, 197, 24, 0.35);
    box-shadow: 0 0 12px rgba(245, 197, 24, 0.12);
}

.badge-tab-count {
    background: rgba(245, 197, 24, 0.2);
    color: var(--gold-primary);
    font-family: var(--font-mono);
    font-size: 0.72rem;
    padding: 0.15rem 0.45rem;
    border-radius: 6px;
    font-weight: 600;
}

/* KPI Ribbon Cards */
.kpi-ribbon-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 0.85rem;
    margin-bottom: 1.25rem;
}

.kpi-stat-card {
    background: var(--bg-surface-elevated);
    border: 1px solid var(--border-subtle);
    border-radius: 12px;
    padding: 1rem 1.15rem;
    position: relative;
    overflow: hidden;
    transition: transform 0.2s ease, border-color 0.2s ease;
}

.kpi-stat-card:hover {
    border-color: rgba(245, 197, 24, 0.4);
    transform: translateY(-2px);
}

.kpi-stat-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 3px;
    height: 100%;
    background: var(--gold-primary);
}

.kpi-stat-label {
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-secondary);
    margin-bottom: 0.35rem;
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.kpi-stat-val {
    font-family: var(--font-mono);
    font-size: 1.75rem;
    font-weight: 800;
    color: #FFFFFF;
    line-height: 1.1;
    margin-bottom: 0.25rem;
}

.kpi-stat-sub {
    font-size: 0.75rem;
    color: var(--text-muted);
}

/* Analytics Chart Card */
.analytics-chart-card {
    background: var(--bg-surface-elevated);
    border: 1px solid var(--border-subtle);
    border-radius: 14px;
    overflow: hidden;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.35);
}

.chart-header {
    background: rgba(0, 0, 0, 0.2);
}

.btn-clear-drill-tag {
    background: transparent;
    border: none;
    color: inherit;
    font-size: 1.1rem;
    line-height: 1;
    padding: 0 0.2rem;
    cursor: pointer;
}

.btn-clear-drill-tag:hover {
    color: #FFFFFF;
}

.btn-agg-action {
    background: rgba(245, 197, 24, 0.1);
    color: var(--gold-primary);
    border: 1px solid rgba(245, 197, 24, 0.25);
    font-size: 0.75rem;
    padding: 0.25rem 0.6rem;
    border-radius: 6px;
    font-weight: 600;
    transition: all 0.15s ease;
}

.btn-agg-action:hover {
    background: var(--gold-primary);
    color: var(--text-inverse);
    border-color: var(--gold-primary);
}