:root {
    --bg-primary: #121212;
    --bg-secondary: #1e1e1e;
    --bg-card: #252525;
    --text-main: #f0f0f0;
    --text-muted: #a0a0a0;
    --border-radius: 12px;
    --border-subtle: rgba(255, 255, 255, 0.1);
    --border-active: rgba(255, 255, 255, 0.25);
    --accent-color: #3b82f6;
    --accent-hover: #2563eb;
    --success-color: #10b981;
    --danger-color: #ef4444;
    --surface-light: #2a2a2a;
    --surface-dark: #1e1e1e;
    --bg-dark: #121212;
    --shadow-main: 0 4px 20px rgba(0, 0, 0, 0.5);
    --transition-fast: 0.2s ease;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

html {
    width: 100%;
    max-width: 100%;
    overscroll-behavior-x: none;
    touch-action: pan-y;
    -webkit-text-size-adjust: 100%;
}

body {
    background-color: var(--bg-primary);
    color: var(--text-main);
    line-height: 1.6;
    margin: 0;
    padding: 0;
    width: 100%;
    max-width: 100%;
    position: relative;
    overflow-x: hidden;
    overscroll-behavior-x: none;
    touch-action: pan-y;
    -webkit-touch-callout: none;
}

/* Form inputs explicitly support user selection and touch callouts */
input,
textarea,
select,
[contenteditable="true"] {
    -webkit-touch-callout: default;
    -webkit-user-select: text;
    user-select: text;
    touch-action: auto;
}

/* Fast tap response on interactive controls */
button,
.btn,
.nav-tab,
.pill-btn,
.roku-btn,
.roku-channel-pill {
    touch-action: manipulation;
}

/* Inner scrollable horizontal containers support horizontal swipe without page swirling */
.horizontal-scroll-grid,
.filter-bar,
.overflow-x-auto,
[style*="overflow-x: auto"] {
    touch-action: pan-x pan-y;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior-x: contain;
}

/* --- Typography --- */
h1, h2, h3 { margin-bottom: 0.5rem; }
a { color: var(--accent-color); text-decoration: none; }

/* --- Header --- */
.site-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 2rem;
    background-color: var(--bg-secondary);
    border-bottom: 1px solid var(--border-subtle);
    position: sticky;
    top: 0;
    z-index: 100;
}

.logo h1 {
    font-size: 1.5rem;
    margin: 0;
}

.logo-subline {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    margin-top: 3px;
}

.logo .domain {
    font-size: 0.8rem;
    color: var(--text-muted);
    font-family: inherit;
    line-height: 1;
}

.logo .logo-divider {
    font-size: 0.75rem;
    color: var(--text-muted);
    opacity: 0.5;
    line-height: 1;
    user-select: none;
}

.version-badge-btn {
    background: rgba(0, 195, 255, 0.08);
    border: 1px solid rgba(0, 195, 255, 0.28);
    color: var(--accent-color);
    font-family: inherit;
    font-size: 0.76rem;
    font-weight: 600;
    letter-spacing: 0.02em;
    padding: 1px 7px;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    line-height: 1.2;
}

.version-badge-btn:hover {
    background: rgba(0, 195, 255, 0.2);
    border-color: var(--accent-color);
    box-shadow: 0 0 10px rgba(0, 195, 255, 0.35);
    transform: translateY(-1px);
}

.auth-section {
    display: flex;
    align-items: center;
    gap: 1rem;
}

/* --- Ecosystem Home Button (seelye.info) --- */
.btn-home-seelye {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid var(--border-subtle);
    color: var(--text-main);
    text-decoration: none;
    cursor: pointer;
    transition: all var(--transition-fast);
    flex-shrink: 0;
    line-height: 1;
}

.btn-home-seelye:hover {
    background: rgba(0, 195, 255, 0.15);
    border-color: var(--accent-color);
    box-shadow: 0 0 10px rgba(0, 195, 255, 0.35);
    transform: translateY(-1px);
}

.btn-home-seelye:active {
    transform: translateY(0);
}

.btn-home-seelye .home-icon {
    font-size: 1.05rem;
    line-height: 1;
    display: inline-block;
    transition: transform var(--transition-fast);
    user-select: none;
}

.btn-home-seelye:hover .home-icon {
    transform: scale(1.12);
}

.badge, .auth-badge {
    padding: 0.3rem 0.75rem;
    border-radius: 20px;
    font-size: 0.85rem;
    background-color: var(--bg-card);
    border: 1px solid var(--border-subtle);
    color: var(--text-muted);
    max-width: 220px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    display: inline-block;
    vertical-align: middle;
}

.badge.logged-in, .auth-badge.logged-in {
    background-color: rgba(16, 185, 129, 0.12);
    color: var(--success-color);
    border-color: rgba(16, 185, 129, 0.35);
}

/* --- Buttons --- */
.btn {
    padding: 0.5rem 1rem;
    border-radius: 6px;
    border: none;
    cursor: pointer;
    font-weight: 600;
    transition: background-color var(--transition-fast);
}

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

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

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

.secondary-btn:hover {
    background-color: var(--bg-secondary);
    border-color: var(--border-active);
}

/* --- Main Layout --- */
.dashboard {
    padding: 2rem;
    width: 100%;
    max-width: 1400px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    gap: 2rem;
    box-sizing: border-box;
    overflow-x: hidden;
    overscroll-behavior-x: none;
    touch-action: pan-y;
}

/* --- Horizontal Scroll Carousels --- */
.horizontal-scroll-section h2 {
    font-size: 1.5rem;
}

.horizontal-scroll-grid {
    scrollbar-width: thin;
    scrollbar-color: var(--border-active) var(--bg-primary);
}

.horizontal-scroll-grid::-webkit-scrollbar {
    height: 8px;
}

.horizontal-scroll-grid::-webkit-scrollbar-track {
    background: var(--bg-primary); 
}

.horizontal-scroll-grid::-webkit-scrollbar-thumb {
    background: var(--border-active); 
    border-radius: 4px;
}

.horizontal-scroll-grid .content-card {
    min-width: 220px;
    max-width: 220px;
    flex-shrink: 0;
}

.horizontal-scroll-grid .card-poster {
    height: 330px;
}

/* --- Filters --- */
.filters-section {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
}

.filter-bar {
    display: flex;
    gap: 0.5rem;
    overflow-x: auto;
    padding-bottom: 0.5rem;
}

.mobile-filter-bar {
    display: none;
}

.pill-btn {
    background-color: var(--bg-card);
    color: var(--text-main);
    border: 1px solid var(--border-subtle);
    padding: 0.5rem 1rem;
    border-radius: 20px;
    cursor: pointer;
    transition: all var(--transition-fast);
    white-space: nowrap;
}

.pill-btn:hover {
    border-color: var(--border-active);
}

.pill-btn.active {
    background-color: var(--accent-color);
    border-color: var(--accent-color);
}

.search-bar input {
    background-color: var(--bg-card);
    border: 1px solid var(--border-subtle);
    color: var(--text-main);
    padding: 0.5rem 1rem;
    border-radius: 20px;
    width: 250px;
}

.search-bar input:focus {
    outline: none;
    border-color: var(--accent-color);
}

/* --- Catalog Grid --- */
.catalog-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 1.5rem;
}

.content-card {
    background-color: var(--bg-card);
    border-radius: var(--border-radius);
    overflow: hidden;
    border: 1px solid var(--border-subtle);
    transition: transform var(--transition-fast), box-shadow var(--transition-fast);
    display: flex;
    flex-direction: column;
}

.content-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-main);
    border-color: var(--border-active);
}

.card-poster {
    width: 100%;
    height: 330px;
    background-color: #1a1a1a;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    position: relative;
    border-radius: 8px;
    transition: transform 0.3s ease;
}

.card-service-badge {
    position: absolute;
    top: 10px;
    right: 10px;
    background-color: rgba(0,0,0,0.7);
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: bold;
}

.card-info {
    padding: 1rem;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.card-title {
    font-size: 1.1rem;
    font-weight: 600;
}

.card-meta {
    font-size: 0.85rem;
    color: var(--text-muted);
}

.card-actions {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-top: auto;
    padding-top: 1rem;
    border-top: 1px solid var(--border-subtle);
}

.status-dropdown {
    width: 100%;
    padding: 0.5rem;
    background-color: var(--bg-primary);
    color: var(--text-main);
    border: 1px solid var(--border-subtle);
    border-radius: 4px;
    margin-bottom: 0.5rem;
}

.status-dropdown:focus {
    outline: none;
    border-color: var(--accent-color);
}

.rating-bar {
    display: flex;
    justify-content: space-between;
    gap: 0.5rem;
}

.rating-btn {
    flex: 1;
    padding: 0.25rem;
    background-color: var(--bg-primary);
    border: 1px solid var(--border-subtle);
    border-radius: 4px;
    color: var(--text-muted);
    cursor: pointer;
    font-size: 1.2rem;
    transition: all var(--transition-fast);
}

.rating-btn:hover {
    background-color: var(--bg-secondary);
}

.rating-btn.active.up {
    color: var(--success-color);
    border-color: var(--success-color);
    background-color: rgba(16, 185, 129, 0.1);
}

.rating-btn.active.down {
    color: #ef4444;
    border-color: #ef4444;
    background-color: rgba(239, 68, 68, 0.1);
}

/* Completed State styling */
.content-card.completed {
    opacity: 0.7;
}

.content-card.dropped {
    opacity: 0.5;
    filter: grayscale(0.8);
}

/* --- Modals --- */
.modal {
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    background-color: rgba(0,0,0,0.8);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.modal.hidden {
    display: none;
}

.modal-content {
    background-color: var(--bg-secondary);
    padding: 2rem;
    border-radius: var(--border-radius);
    border: 1px solid var(--border-subtle);
    width: 100%;
    max-width: 400px;
}

.modal-content h2 { margin-bottom: 1.5rem; }

.input-group {
    margin-bottom: 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.input-group label {
    font-size: 0.9rem;
    color: var(--text-muted);
}

.input-group input {
    padding: 0.75rem;
    border-radius: 6px;
    border: 1px solid var(--border-subtle);
    background-color: var(--bg-primary);
    color: var(--text-main);
}

.input-group input:focus {
    outline: none;
    border-color: var(--accent-color);
}

.modal-actions {
    display: flex;
    justify-content: flex-end;
    gap: 1rem;
    margin-top: 1.5rem;
}

.error-msg {
    color: #ef4444;
    margin-top: 1rem;
    font-size: 0.9rem;
}

/* Utilities */
.skeleton-loader {
    color: var(--text-muted);
    font-style: italic;
}

/* --- Footer & Changelog --- */
.site-footer {
    padding: 2rem;
    max-width: 1400px;
    margin: 2rem auto 0;
    border-top: 1px solid var(--border-subtle);
    color: var(--text-muted);
}

.version-info {
    margin-bottom: 1rem;
    color: var(--text-main);
}

.changelog h3 {
    font-size: 1.1rem;
    color: var(--text-main);
    margin-bottom: 0.5rem;
}

.changelog ul {
    list-style-type: none;
    padding-left: 0;
}

.changelog li {
    margin-bottom: 0.5rem;
    font-size: 0.9rem;
}

.changelog li strong {
    color: var(--accent-color);
}

/* --- Admin Panel --- */
.admin-section {
    padding: 2rem 5%;
    max-width: 1400px;
    margin: 0 auto;
}

.admin-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
}

.admin-settings-card, .admin-search-card {
    background: var(--surface-light);
    border: 1px solid var(--border-subtle);
    border-radius: 8px;
    padding: 2rem;
    margin-bottom: 2rem;
}

.admin-settings-card h3, .admin-search-card h3 {
    margin-bottom: 1rem;
    color: var(--text-main);
}

.admin-settings-card p, .admin-search-card p {
    color: var(--text-muted);
    margin-bottom: 1rem;
    font-size: 0.9rem;
}

.tmdb-result-card {
    background: var(--surface-dark);
    border-radius: 10px;
    overflow: hidden;
    transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
    border: 1px solid var(--border-subtle);
    display: flex;
    flex-direction: column;
    cursor: pointer;
    position: relative;
    user-select: none;
}

.tmdb-result-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 10px 24px rgba(0, 195, 255, 0.2);
    border-color: var(--accent-color);
}

.tmdb-result-card.already-in-library {
    border-color: rgba(16, 185, 129, 0.4);
    background: rgba(16, 185, 129, 0.05);
}

.tmdb-result-card.adding {
    opacity: 0.7;
    pointer-events: none;
}

.tmdb-poster-container {
    position: relative;
    width: 100%;
    aspect-ratio: 2/3;
    background-color: #1a1a1a;
    overflow: hidden;
    cursor: pointer;
}

.tmdb-poster {
    width: 100%;
    height: 100%;
    aspect-ratio: 2/3;
    object-fit: cover;
    display: block;
    transition: transform 0.3s ease;
}

.tmdb-poster-container:hover .tmdb-poster {
    transform: scale(1.04);
}

.tmdb-badge-imdb-hint {
    position: absolute;
    top: 8px;
    left: 8px;
    background: rgba(0, 0, 0, 0.8);
    border: 1px solid rgba(245, 197, 24, 0.6);
    color: #f5c518;
    padding: 3px 7px;
    border-radius: 4px;
    font-size: 0.72rem;
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    backdrop-filter: blur(4px);
    transition: all 0.2s ease;
    z-index: 2;
    pointer-events: none;
}

.tmdb-poster-container:hover .tmdb-badge-imdb-hint {
    background: #f5c518;
    color: #000;
    border-color: #f5c518;
    transform: scale(1.05);
}

.tmdb-badge-in-lib {
    position: absolute;
    bottom: 8px;
    right: 8px;
    background: rgba(16, 185, 129, 0.9);
    color: white;
    padding: 3px 7px;
    border-radius: 4px;
    font-size: 0.72rem;
    font-weight: 600;
}

.tmdb-info {
    padding: 0.9rem;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}

.tmdb-title {
    font-size: 0.95rem;
    font-weight: 600;
    line-height: 1.3;
    margin-bottom: 2px;
    color: var(--text-main);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.tmdb-year {
    font-size: 0.8rem;
    color: var(--text-muted);
}

.tmdb-overview {
    font-size: 0.75rem;
    color: var(--text-muted);
    line-height: 1.3;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    margin-bottom: 4px;
}

.tmdb-service-row {
    margin-top: 4px;
}

.admin-select-dropdown {
    width: 100%;
    padding: 0.5rem;
    background: var(--bg-dark);
    border: 1px solid var(--border-subtle);
    color: var(--text-main);
    border-radius: 4px;
    margin-bottom: 0.5rem;
    font-family: inherit;
}

/* --- Admin / Add Shows Modal Content --- */
.modal-content.admin-content {
    max-width: 960px;
    width: 95%;
    max-height: 88vh;
    overflow-y: auto;
    position: relative;
    padding: 2rem;
    -webkit-overflow-scrolling: touch;
}

.close-btn {
    position: absolute;
    top: 1rem;
    right: 1.25rem;
    font-size: 1.75rem;
    color: var(--text-muted);
    cursor: pointer;
    line-height: 1;
    transition: color var(--transition-fast);
    user-select: none;
}

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

.admin-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 1.5rem;
    margin-top: 1rem;
}

#admin-search-card {
    grid-column: 1 / -1;
}

.admin-card {
    background: var(--surface-dark);
    border: 1px solid var(--border-subtle);
    border-radius: 8px;
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.admin-card h3 {
    font-size: 1.15rem;
    color: var(--text-main);
    margin-bottom: 0.5rem;
}

.tmdb-results {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(185px, 1fr));
    gap: 1.25rem;
    margin-top: 1.25rem;
    padding-right: 4px;
}

/* --- Service Discovery Section --- */
.service-discovery-section {
    margin-top: 2rem;
    padding-top: 2rem;
    border-top: 1px solid var(--border-subtle);
}

.service-discovery-header {
    margin-bottom: 1.25rem;
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.service-discovery-header h2 {
    font-size: 1.45rem;
    color: var(--text-main);
    margin-bottom: 0.25rem;
}

.service-discovery-header p {
    color: var(--text-muted);
    font-size: 0.95rem;
}

/* --- Card Removal Action --- */
.remove-btn {
    background: transparent;
    border: 1px solid rgba(239, 68, 68, 0.35);
    color: var(--danger-color);
    border-radius: 4px;
    padding: 4px 8px;
    font-size: 0.75rem;
    cursor: pointer;
    transition: all var(--transition-fast);
    width: 100%;
    margin-top: 0.25rem;
}

.remove-btn:hover {
    background: rgba(239, 68, 68, 0.15);
    border-color: var(--danger-color);
}

/* --- Toast Notifications --- */
.toast-container {
    position: fixed;
    bottom: 24px;
    right: 24px;
    z-index: 10000;
    display: flex;
    flex-direction: column;
    gap: 10px;
    max-width: 380px;
    width: 90%;
    pointer-events: none;
}

.toast {
    pointer-events: auto;
    padding: 12px 16px;
    border-radius: 8px;
    background: var(--bg-card);
    color: var(--text-main);
    border: 1px solid var(--border-subtle);
    box-shadow: var(--shadow-main);
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    animation: toastSlideIn 0.25s ease;
}

.toast.success {
    border-left: 4px solid var(--success-color);
}

.toast.error {
    border-left: 4px solid var(--danger-color);
}

.toast.info {
    border-left: 4px solid var(--accent-color);
}

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

/* --- Primary Inline Navigation Bar (100% Inline Architecture) --- */
.dashboard-nav {
    display: flex;
    gap: 0.75rem;
    align-items: center;
    margin-bottom: 2rem;
    padding: 0.4rem;
    background: rgba(18, 24, 36, 0.75);
    border: 1px solid var(--border-subtle);
    border-radius: 12px;
    backdrop-filter: blur(12px);
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.nav-tab {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.65rem 1.15rem;
    background: transparent;
    border: 1px solid transparent;
    border-radius: 8px;
    color: var(--text-muted);
    font-size: 0.95rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
    user-select: none;
}

.label-short {
    display: none;
}

.label-full {
    display: inline;
}

.nav-tab:hover {
    color: var(--text-main);
    background: rgba(255, 255, 255, 0.05);
}

.nav-tab.active {
    color: #fff;
    background: var(--accent-color);
    box-shadow: 0 4px 14px rgba(0, 195, 255, 0.35);
    font-weight: 600;
}

.nav-tab-icon {
    font-size: 1.1rem;
}

.nav-tab-badge {
    background: rgba(255, 255, 255, 0.2);
    color: inherit;
    font-size: 0.75rem;
    padding: 2px 7px;
    border-radius: 999px;
    font-weight: 600;
}

.nav-tab.active .nav-tab-badge {
    background: rgba(0, 0, 0, 0.25);
    color: #fff;
}

.pulse-badge {
    background: rgba(0, 195, 255, 0.2);
    color: var(--accent-color);
    border: 1px solid rgba(0, 195, 255, 0.4);
}

/* --- View Panels (100% Inline) --- */
.view-panel {
    display: none;
    animation: fadeInView 0.25s ease;
}

.view-panel.active {
    display: block;
}

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

/* --- Filter Bar Counter Badges --- */
.status-count, .svc-count {
    display: inline-block;
    font-size: 0.72rem;
    padding: 1px 5px;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.12);
    color: inherit;
    margin-left: 4px;
}

.pill-btn.active .status-count,
.pill-btn.active .svc-count {
    background: rgba(0, 0, 0, 0.3);
    color: #fff;
}

/* --- Taste Profile Summary Banner --- */
.taste-profile-banner {
    background: linear-gradient(135deg, rgba(18, 24, 38, 0.9), rgba(12, 16, 26, 0.95));
    border: 1px solid var(--border-subtle);
    border-radius: 14px;
    padding: 1.5rem;
    margin-bottom: 2rem;
    box-shadow: var(--shadow-main);
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.taste-profile-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.75rem;
}

.taste-profile-title {
    font-size: 1.15rem;
    font-weight: 600;
    color: var(--text-main);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.taste-metrics-row {
    display: flex;
    flex-wrap: wrap;
    gap: 1.5rem;
    padding-top: 0.5rem;
    border-top: 1px solid rgba(255, 255, 255, 0.06);
}

.taste-metric {
    display: flex;
    flex-direction: column;
}

.taste-metric-val {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--accent-color);
}

.taste-metric-label {
    font-size: 0.75rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.genre-tag-list {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.genre-chip {
    padding: 3px 10px;
    border-radius: 20px;
    font-size: 0.8rem;
    background: rgba(0, 195, 255, 0.1);
    color: var(--accent-color);
    border: 1px solid rgba(0, 195, 255, 0.25);
    font-weight: 500;
}

/* --- Contextual Reason Badge on Recommendation Cards --- */
.rec-reason-badge {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--accent-color);
    background: rgba(0, 195, 255, 0.12);
    border: 1px solid rgba(0, 195, 255, 0.28);
    padding: 3px 8px;
    border-radius: 6px;
    margin-bottom: 0.4rem;
    display: inline-block;
    line-height: 1.3;
}

/* --- Empty State Helper Card (e.g. 0 shows for a filtered provider) --- */
.library-empty-provider-card {
    grid-column: 1 / -1;
    text-align: center;
    padding: 2.5rem 1.5rem;
    background: rgba(18, 24, 38, 0.45);
    border-radius: 12px;
    border: 1px dashed var(--border-subtle);
}

.library-empty-provider-card h3 {
    font-size: 1.25rem;
    margin-bottom: 0.5rem;
    color: var(--text-main);
}

.library-empty-provider-card p {
    color: var(--text-muted);
    margin-bottom: 1.25rem;
    font-size: 0.95rem;
}

/* --- IMDb Pop-up Modal (Pop-up Over Content) --- */
.imdb-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.88);
    backdrop-filter: blur(8px);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 2100;
}

.imdb-modal.hidden {
    display: none;
}

.imdb-modal-content {
    max-width: 860px;
    width: 94%;
    max-height: 88vh;
    overflow-y: auto;
    position: relative;
    padding: 0;
    border-radius: 16px;
    border: 1px solid rgba(245, 197, 24, 0.35);
    background: #131313;
    box-shadow: 0 25px 65px rgba(0, 0, 0, 0.92);
    color: var(--text-main);
    -webkit-overflow-scrolling: touch;
}

.close-imdb-btn,
#close-imdb-modal-btn {
    position: absolute;
    top: 1rem;
    right: 1.2rem;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.65);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: #fff;
    font-size: 1.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 10;
    line-height: 1;
    transition: all 0.2s ease;
}

.close-imdb-btn:hover,
#close-imdb-modal-btn:hover {
    background: #f5c518;
    color: #000;
    border-color: #f5c518;
    transform: scale(1.08);
}

.imdb-hero {
    position: relative;
    min-height: 230px;
    background-size: cover;
    background-position: center top;
    background-repeat: no-repeat;
    display: flex;
    align-items: flex-end;
    padding: 2.5rem 2rem 1.5rem 2rem;
    border-radius: 16px 16px 0 0;
}

.imdb-hero-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(to top, #131313 12%, rgba(19, 19, 19, 0.78) 60%, rgba(19, 19, 19, 0.35) 100%);
    pointer-events: none;
}

.imdb-hero-content {
    position: relative;
    z-index: 2;
    display: flex;
    gap: 1.5rem;
    align-items: flex-end;
    width: 100%;
}

.imdb-poster-thumb {
    width: 115px;
    min-width: 115px;
    aspect-ratio: 2/3;
    border-radius: 8px;
    object-fit: cover;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.85);
    border: 2px solid rgba(255, 255, 255, 0.15);
}

.imdb-meta-summary {
    display: flex;
    flex-direction: column;
    gap: 7px;
    flex-grow: 1;
}

.imdb-rating-badge {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    background: rgba(245, 197, 24, 0.12);
    border: 1px solid rgba(245, 197, 24, 0.45);
    padding: 4px 9px;
    border-radius: 6px;
    width: fit-content;
}

.imdb-gold-pill {
    background: #f5c518;
    color: #000;
    font-weight: 900;
    font-size: 0.78rem;
    padding: 2px 6px;
    border-radius: 3px;
    letter-spacing: 0.5px;
    line-height: 1.2;
}

.imdb-rating-val {
    color: #f5c518;
    font-weight: 700;
    font-size: 0.95rem;
}

.imdb-rating-votes {
    color: var(--text-muted);
    font-size: 0.8rem;
}

.imdb-show-title {
    font-size: 1.85rem;
    font-weight: 700;
    line-height: 1.2;
    margin: 0;
    color: #ffffff;
}

.imdb-show-submeta {
    color: var(--text-muted);
    font-size: 0.9rem;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
}

.imdb-submeta-dot {
    opacity: 0.5;
}

.imdb-action-row {
    margin-top: 10px;
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    align-items: center;
}

.imdb-visit-btn {
    background: #f5c518;
    color: #000 !important;
    font-weight: 700;
    font-size: 0.9rem;
    padding: 8px 16px;
    border-radius: 8px;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    transition: background 0.2s, transform 0.15s;
    border: none;
    cursor: pointer;
}

.imdb-visit-btn:hover {
    background: #e2b616;
    transform: translateY(-1px);
}

.imdb-body-content {
    padding: 1.5rem 2rem 2rem 2rem;
}

.imdb-tabs {
    display: flex;
    gap: 8px;
    border-bottom: 1px solid var(--border-subtle);
    margin-bottom: 1.35rem;
}

.imdb-tab-btn {
    background: none;
    border: none;
    border-bottom: 2px solid transparent;
    color: var(--text-muted);
    font-size: 0.95rem;
    font-weight: 600;
    padding: 8px 14px;
    cursor: pointer;
    transition: color 0.2s, border-color 0.2s;
}

.imdb-tab-btn.active {
    color: #f5c518;
    border-bottom-color: #f5c518;
}

.imdb-info-grid {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 1.75rem;
}

@media (max-width: 680px) {
    .imdb-info-grid {
        grid-template-columns: 1fr;
    }
    .imdb-hero-content {
        flex-direction: column;
        align-items: flex-start;
    }
    .imdb-poster-thumb {
        width: 90px;
        min-width: 90px;
    }
    .imdb-show-title {
        font-size: 1.45rem;
    }
}

.imdb-section-title {
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    color: var(--text-muted);
    margin-bottom: 6px;
    font-weight: 600;
}

.imdb-tagline {
    font-size: 1.05rem;
    font-style: italic;
    color: rgba(255, 255, 255, 0.85);
    margin-bottom: 12px;
}

.imdb-synopsis {
    font-size: 0.96rem;
    line-height: 1.65;
    color: rgba(255, 255, 255, 0.88);
    margin-bottom: 1.35rem;
}

.imdb-cast-list {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 1.25rem;
}

.imdb-cast-chip {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-subtle);
    padding: 5px 11px;
    border-radius: 14px;
    font-size: 0.82rem;
    color: var(--text-main);
}

.imdb-cast-character {
    color: var(--text-muted);
    font-size: 0.78rem;
}

.imdb-side-fact {
    margin-bottom: 14px;
}

.imdb-side-fact-label {
    font-size: 0.76rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 2px;
}

.imdb-side-fact-val {
    font-size: 0.92rem;
    color: var(--text-main);
    font-weight: 500;
}

.imdb-iframe-container {
    position: relative;
    width: 100%;
    height: 520px;
    background: #000;
    border-radius: 8px;
    overflow: hidden;
    border: 1px solid var(--border-subtle);
}

.imdb-iframe {
    width: 100%;
    height: 100%;
    border: none;
}

/* --- 30-Second Taste Quiz (100% Inline Architecture) --- */
.taste-quiz-container {
    width: 100%;
    margin-bottom: 24px;
}

.taste-quiz-prompt-card {
    background: linear-gradient(135deg, rgba(0, 195, 255, 0.1) 0%, rgba(20, 27, 45, 0.95) 100%);
    border: 1px solid rgba(0, 195, 255, 0.35);
    border-radius: 14px;
    padding: 18px 22px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    flex-wrap: wrap;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.35);
    transition: all 0.25s ease;
}

.taste-quiz-prompt-card:hover {
    border-color: rgba(0, 195, 255, 0.55);
    box-shadow: 0 6px 26px rgba(0, 195, 255, 0.15);
}

.taste-quiz-prompt-info {
    flex: 1;
    min-width: 250px;
}

.taste-quiz-prompt-title {
    font-size: 1.15rem;
    font-weight: 700;
    color: #fff;
    margin-bottom: 4px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.taste-quiz-prompt-desc {
    font-size: 0.9rem;
    color: var(--text-muted);
    margin: 0;
    line-height: 1.4;
}

.taste-quiz-prompt-actions {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.taste-quiz-active-card {
    background: #141c2e;
    border: 1px solid rgba(0, 195, 255, 0.4);
    border-radius: 16px;
    padding: 24px;
    box-shadow: 0 10px 36px rgba(0, 0, 0, 0.5);
    position: relative;
    animation: fadeIn 0.3s ease;
}

.quiz-progress-track {
    height: 6px;
    width: 100%;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 18px;
}

.quiz-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #007bff, #00c3ff);
    transition: width 0.3s ease;
    border-radius: 4px;
}

.quiz-step-indicator {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
    font-size: 0.82rem;
    color: var(--accent-color);
    font-weight: 600;
    letter-spacing: 0.5px;
    text-transform: uppercase;
}

.quiz-step-timer-badge {
    background: rgba(255, 255, 255, 0.08);
    color: var(--text-muted);
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 0.76rem;
    font-weight: 500;
}

.quiz-question-heading {
    font-size: 1.35rem;
    font-weight: 700;
    color: #fff;
    margin-bottom: 6px;
    line-height: 1.3;
}

.quiz-question-subtext {
    font-size: 0.92rem;
    color: var(--text-muted);
    margin-bottom: 20px;
}

.quiz-options-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 12px;
    margin-bottom: 22px;
}

.quiz-option-btn {
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 12px;
    padding: 14px 16px;
    text-align: left;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: flex-start;
    gap: 12px;
    color: var(--text-main);
    font-family: inherit;
    width: 100%;
}

.quiz-option-btn:hover {
    border-color: rgba(0, 195, 255, 0.6);
    background: rgba(0, 195, 255, 0.08);
    transform: translateY(-2px);
}

.quiz-option-btn.selected {
    border-color: var(--accent-color);
    background: rgba(0, 195, 255, 0.18);
    box-shadow: 0 0 16px rgba(0, 195, 255, 0.35);
}

.quiz-option-icon {
    font-size: 1.6rem;
    line-height: 1;
    flex-shrink: 0;
    margin-top: 2px;
}

.quiz-option-label {
    font-weight: 600;
    font-size: 1rem;
    color: #fff;
    margin-bottom: 4px;
    display: block;
}

.quiz-option-desc {
    font-size: 0.82rem;
    color: var(--text-muted);
    line-height: 1.35;
    display: block;
}

.quiz-action-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    padding-top: 16px;
}

.quiz-pill-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 3px 10px;
    border-radius: 16px;
    font-size: 0.78rem;
    font-weight: 600;
    background: rgba(0, 195, 255, 0.15);
    color: #00c3ff;
    border: 1px solid rgba(0, 195, 255, 0.35);
}

@media (max-width: 600px) {
    .taste-quiz-prompt-card {
        padding: 14px 16px;
    }
    .taste-quiz-active-card {
        padding: 16px;
    }
    .quiz-options-grid {
        grid-template-columns: 100%;
    }
}

/* --- Inline Changelog View Panel --- */
.changelog-view-section {
    padding: 1rem 0 3rem;
    max-width: 960px;
    margin: 0 auto;
}

.changelog-header-row {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 1.25rem;
    margin-bottom: 2.2rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid var(--border-subtle);
    flex-wrap: wrap;
}

.changelog-title-group {
    display: flex;
    align-items: center;
    gap: 0.85rem;
    flex-wrap: wrap;
}

.changelog-title-group h2 {
    margin: 0;
    font-size: 1.65rem;
}

.changelog-current-badge {
    background: rgba(0, 195, 255, 0.15);
    color: var(--accent-color);
    border: 1px solid rgba(0, 195, 255, 0.35);
    padding: 2px 10px;
    border-radius: 12px;
    font-size: 0.8rem;
    font-weight: 600;
}

.changelog-subtitle {
    color: var(--text-muted);
    font-size: 0.94rem;
    margin: 6px 0 0 0;
}

.changelog-timeline-wrap {
    margin-top: 1rem;
}

.changelog-timeline-list {
    list-style: none;
    padding: 0;
    margin: 0;
    position: relative;
}

.changelog-timeline-list::before {
    content: '';
    position: absolute;
    top: 8px;
    bottom: 24px;
    left: 14px;
    width: 2px;
    background: linear-gradient(to bottom, var(--accent-color), rgba(0, 195, 255, 0.2), rgba(255, 255, 255, 0.05));
}

.changelog-entry {
    position: relative;
    padding-left: 42px;
    margin-bottom: 2rem;
}

.changelog-entry::before {
    content: '';
    position: absolute;
    left: 8px;
    top: 5px;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: var(--bg-primary);
    border: 2px solid var(--accent-color);
    box-shadow: 0 0 10px rgba(0, 195, 255, 0.5);
}

.changelog-entry-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 6px;
    flex-wrap: wrap;
}

.changelog-version-tag {
    font-weight: 700;
    font-size: 1.08rem;
    color: var(--text-main);
}

.changelog-tag-pill {
    font-size: 0.72rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    background: rgba(16, 185, 129, 0.15);
    color: var(--success-color);
    border: 1px solid rgba(16, 185, 129, 0.3);
    border-radius: 10px;
    padding: 1px 8px;
}

.changelog-desc {
    color: #cbd5e1;
    font-size: 0.94rem;
    line-height: 1.65;
    margin: 0;
}

.changelog-desc code {
    background: rgba(0, 0, 0, 0.45);
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 0.86em;
    color: #67e8f9;
    border: 1px solid rgba(255, 255, 255, 0.08);
}

/* --- Phone Orientation Notice Banner --- */
.phone-orientation-banner {
    display: none;
    background: linear-gradient(135deg, rgba(15, 23, 42, 0.96), rgba(30, 41, 59, 0.96));
    border-bottom: 1px solid rgba(0, 195, 255, 0.35);
    color: #e2e8f0;
    padding: 8px 14px;
    font-size: 0.84rem;
    position: sticky;
    top: 0;
    z-index: 999;
    backdrop-filter: blur(12px);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.4);
    width: 100%;
    box-sizing: border-box;
}

.phone-orientation-banner.visible {
    display: block;
}

.orientation-banner-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    max-width: 600px;
    margin: 0 auto;
}

.orientation-banner-icon {
    font-size: 1.2rem;
    flex-shrink: 0;
}

.orientation-dismiss-btn {
    background: transparent;
    border: none;
    color: #94a3b8;
    font-size: 0.95rem;
    cursor: pointer;
    padding: 3px 6px;
    border-radius: 4px;
    flex-shrink: 0;
}

.orientation-dismiss-btn:hover {
    color: #fff;
    background: rgba(255, 255, 255, 0.1);
}

/* ==========================================================================
   MOBILE & IPHONE RESPONSIVE OPTIMIZATION (<= 640px)
   Strictly adheres to iOS Safari Web App Development Best Practices:
   - Zero horizontal elasticity (flush 100% width, no vw units)
   - Contained strictly within phone viewport bounds
   - 2-column mobile streaming catalog grid
   ========================================================================== */
@media (max-width: 640px), (max-device-width: 640px) {
    /* Header contained flush within phone bounds */
    .site-header {
        padding: 0.65rem 0.85rem;
        flex-wrap: wrap;
        gap: 0.5rem;
        width: 100%;
        max-width: 100%;
        box-sizing: border-box;
    }

    .logo {
        flex-shrink: 1;
        min-width: 0;
    }

    .logo h1 {
        font-size: 1.25rem;
        line-height: 1.2;
    }

    .logo-subline {
        font-size: 0.72rem;
        gap: 5px;
        flex-wrap: nowrap;
    }

    .version-badge-btn {
        font-size: 0.7rem;
        padding: 1px 5px;
    }

    .auth-section {
        gap: 0.45rem;
        flex-shrink: 0;
    }

    .btn-home-seelye {
        width: 30px;
        height: 30px;
    }

    .btn-home-seelye .home-icon {
        font-size: 0.95rem;
    }

    .auth-section .btn {
        padding: 0.38rem 0.65rem;
        font-size: 0.8rem;
    }

    .auth-badge {
        max-width: 105px;
        font-size: 0.74rem;
        padding: 0.25rem 0.55rem;
    }

    /* Dashboard Layout on Phone */
    .dashboard {
        padding: 0.85rem 0.75rem calc(85px + env(safe-area-inset-bottom, 0px));
        width: 100%;
        max-width: 100%;
        gap: 1.25rem;
        box-sizing: border-box;
        overflow-x: hidden;
        overscroll-behavior-x: none;
        touch-action: pan-y;
    }

    .toast-container {
        right: 12px;
        left: 12px;
        bottom: calc(75px + env(safe-area-inset-bottom, 0px));
        width: auto;
        max-width: calc(100% - 24px);
        box-sizing: border-box;
    }

    .label-short {
        display: inline;
    }

    .label-full {
        display: none;
    }

    /* Primary Navigation Bar docked to bottom on Phone (Native iOS Tab Bar) */
    .dashboard-nav {
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        width: 100%;
        z-index: 850;
        margin: 0;
        padding: 6px 12px calc(6px + env(safe-area-inset-bottom, 0px));
        gap: 6px;
        background: rgba(10, 14, 26, 0.94);
        backdrop-filter: blur(20px);
        -webkit-backdrop-filter: blur(20px);
        border-top: 1px solid rgba(255, 255, 255, 0.12);
        border-bottom: none;
        border-left: none;
        border-right: none;
        border-radius: 0;
        box-shadow: 0 -4px 24px rgba(0, 0, 0, 0.55);
        display: grid;
        grid-template-columns: repeat(4, 1fr);
        box-sizing: border-box;
        overflow-x: visible;
    }

    .nav-tab {
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        padding: 6px 4px;
        font-size: 0.75rem;
        gap: 2px;
        text-align: center;
        white-space: nowrap;
        min-width: 0;
        width: 100%;
        box-sizing: border-box;
        border-radius: 8px;
    }

    .nav-tab-icon {
        font-size: 1.25rem;
        line-height: 1;
    }

    .nav-tab-label {
        font-size: 0.72rem;
        font-weight: 600;
        line-height: 1.1;
    }

    .nav-tab-badge {
        font-size: 0.65rem;
        padding: 1px 4px;
        margin-top: 1px;
    }

    /* Personal Library & Catalog Grids on Phone (Clean 2-Column Mobile Streaming) */
    .catalog-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 0.75rem;
    }

    .card-poster {
        height: 220px;
    }

    .content-card .card-info {
        padding: 0.65rem;
    }

    .content-card .card-info h3 {
        font-size: 0.92rem;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    .content-card .card-meta {
        font-size: 0.76rem;
    }

    /* Horizontal Carousels on Phone */
    .horizontal-scroll-grid .content-card {
        min-width: 155px;
        max-width: 155px;
    }

    .horizontal-scroll-grid .card-poster {
        height: 230px;
    }

    /* Filters Section on Phone (Dropdown architecture replaces cluttered pill clump) */
    .filters-section {
        flex-direction: column;
        align-items: stretch;
        gap: 0.65rem;
    }

    #library-status-filters,
    #library-service-filters,
    #explore-service-filters {
        display: none !important;
    }

    .mobile-filter-bar {
        display: flex !important;
        align-items: center;
        gap: 8px;
        width: 100%;
        box-sizing: border-box;
    }

    .mobile-explore-filter-bar {
        margin-bottom: 1rem;
    }

    .mobile-select-group {
        position: relative;
        flex: 1;
        min-width: 0;
        display: flex;
        align-items: center;
    }

    .mobile-select-icon {
        position: absolute;
        left: 10px;
        pointer-events: none;
        font-size: 0.95rem;
        z-index: 1;
    }

    .mobile-filter-select {
        width: 100%;
        appearance: none;
        -webkit-appearance: none;
        background: rgba(255, 255, 255, 0.07);
        border: 1px solid var(--border-color, rgba(255, 255, 255, 0.15));
        border-radius: 10px;
        color: var(--text-main);
        font-size: 0.84rem;
        font-weight: 500;
        padding: 9px 28px 9px 32px;
        outline: none;
        cursor: pointer;
        background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' fill='%2394a3b8' viewBox='0 0 16 16'%3E%3Cpath d='M8 11.5l-5-5h10l-5 5z'/%3E%3C/svg%3E");
        background-repeat: no-repeat;
        background-position: right 10px center;
        background-size: 10px;
        box-sizing: border-box;
        transition: border-color 0.2s, background-color 0.2s;
    }

    .mobile-filter-select:focus {
        border-color: var(--accent-blue, #007bff);
        background-color: rgba(255, 255, 255, 0.1);
    }

    .mobile-filter-select option {
        background-color: #131b2e;
        color: #e2e8f0;
    }

    .search-bar {
        width: 100%;
    }

    .search-bar input {
        width: 100%;
        box-sizing: border-box;
    }

    /* Modals & Dialogs on Phone */
    .modal-content {
        padding: 1.25rem 1rem;
        width: 95%;
        max-width: 95%;
        margin: 1.5rem auto;
    }

    /* Taste Quiz Card on Phone */
    .taste-quiz-prompt-card {
        padding: 14px 16px;
    }

    .taste-quiz-active-card {
        padding: 14px 16px;
    }

    .quiz-options-grid {
        grid-template-columns: 1fr;
        gap: 8px;
    }

    .quiz-option-btn {
        padding: 12px 14px;
        font-size: 0.9rem;
    }
}

/* ==========================================================================
   IPAD & TABLET RESPONSIVE OPTIMIZATION (641px - 1024px)
   Optimized for both Portrait and Landscape Orientations
   ========================================================================== */
@media (min-width: 641px) and (max-width: 1024px) {
    .site-header {
        padding: 0.85rem 1.5rem;
        width: 100%;
        box-sizing: border-box;
    }

    .dashboard {
        padding: 1.25rem 1.5rem 3rem;
        width: 100%;
        box-sizing: border-box;
    }

    .auth-badge {
        max-width: 160px;
    }

    .nav-tab {
        padding: 0.6rem 1rem;
        font-size: 0.92rem;
        min-height: 44px; /* iOS touch target standard */
    }
}

/* iPad Portrait Mode (768px - 834px approx) */
@media (min-width: 641px) and (max-width: 1024px) and (orientation: portrait) {
    .catalog-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
        gap: 1.1rem;
    }

    .card-poster {
        height: 260px;
    }

    .horizontal-scroll-grid .content-card {
        min-width: 185px;
        max-width: 185px;
    }

    .horizontal-scroll-grid .card-poster {
        height: 275px;
    }
}

/* iPad Landscape Mode (1024px approx) */
@media (min-width: 641px) and (max-width: 1024px) and (orientation: landscape) {
    .catalog-grid {
        grid-template-columns: repeat(4, minmax(0, 1fr));
        gap: 1.25rem;
    }

    .card-poster {
        height: 280px;
    }

    .horizontal-scroll-grid .content-card {
        min-width: 200px;
        max-width: 200px;
    }

    .horizontal-scroll-grid .card-poster {
        height: 295px;
    }
}

/* ==========================================================================
   Show Tracker & Episode Checklist View (100% Inline Architecture)
   ========================================================================== */

.show-tracker-section {
    width: 100%;
    margin-bottom: 3rem;
}

/* Tracker Navigation & Breadcrumb */
.tracker-nav-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 1.5rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid var(--border-subtle);
}

.tracker-breadcrumb {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.95rem;
    color: var(--text-muted);
}

.crumb-link {
    color: var(--accent-color);
    text-decoration: none;
    transition: color var(--transition-fast);
}

.crumb-link:hover {
    color: var(--accent-hover);
    text-decoration: underline;
}

.crumb-separator {
    color: var(--text-muted);
    font-weight: 300;
}

.crumb-active {
    color: var(--text-main);
    font-weight: 600;
}

/* Show Tracker Hero */
.tracker-hero {
    position: relative;
    border-radius: var(--border-radius);
    overflow: hidden;
    background-size: cover;
    background-position: center top;
    margin-bottom: 1.5rem;
    border: 1px solid var(--border-subtle);
    box-shadow: var(--shadow-main);
}

.tracker-hero-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, rgba(10, 14, 26, 0.78) 0%, rgba(10, 14, 26, 0.96) 100%);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}

.tracker-hero-content {
    position: relative;
    z-index: 2;
    display: flex;
    gap: 1.5rem;
    padding: 1.75rem;
    align-items: flex-start;
}

.tracker-poster-thumb {
    width: 130px;
    min-width: 130px;
    height: 195px;
    border-radius: 8px;
    object-fit: cover;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.6);
    border: 1px solid rgba(255, 255, 255, 0.15);
}

.tracker-hero-meta {
    flex: 1;
    min-width: 0;
}

.tracker-title-row {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 8px;
}

.tracker-show-title {
    font-size: 1.85rem;
    font-weight: 700;
    color: var(--text-main);
    margin: 0;
    line-height: 1.2;
}

.badge-archived {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    background: rgba(16, 185, 129, 0.16);
    color: var(--success-color);
    border: 1px solid rgba(16, 185, 129, 0.35);
    font-size: 0.78rem;
    font-weight: 600;
    padding: 3px 10px;
    border-radius: 999px;
}

.badge-watching {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    background: rgba(59, 130, 246, 0.16);
    color: var(--accent-color);
    border: 1px solid rgba(59, 130, 246, 0.35);
    font-size: 0.78rem;
    font-weight: 600;
    padding: 3px 10px;
    border-radius: 999px;
}

.tracker-meta-tags {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 12px;
}

.tracker-service-pill {
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
    font-size: 0.78rem;
    font-weight: 600;
    padding: 2px 8px;
    border-radius: 4px;
    text-transform: capitalize;
}

.tracker-meta-pill {
    font-size: 0.84rem;
    color: var(--text-muted);
}

.tracker-meta-pill.rating-gold {
    color: #fbbf24;
    font-weight: 600;
}

.tracker-overview {
    font-size: 0.92rem;
    color: rgba(255, 255, 255, 0.78);
    line-height: 1.5;
    margin: 0;
    max-width: 780px;
}

/* Overall Series Progress Card */
.tracker-progress-card {
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    border-radius: var(--border-radius);
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    box-shadow: var(--shadow-main);
}

.tracker-progress-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    flex-wrap: wrap;
    gap: 16px;
    margin-bottom: 14px;
}

.tracker-progress-title {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 4px;
}

.tracker-progress-title h3 {
    margin: 0;
    font-size: 1.25rem;
    color: var(--text-main);
}

.tracker-progress-badge {
    background: rgba(59, 130, 246, 0.15);
    color: var(--accent-color);
    border: 1px solid rgba(59, 130, 246, 0.3);
    font-size: 0.8rem;
    font-weight: 600;
    padding: 2px 10px;
    border-radius: 999px;
}

.tracker-progress-sub {
    font-size: 0.88rem;
    color: var(--text-muted);
    margin: 0;
    max-width: 620px;
    line-height: 1.4;
}

.tracker-series-actions {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
}

.tracker-rating-bar {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: rgba(255, 255, 255, 0.05);
    padding: 4px 10px;
    border-radius: 8px;
    border: 1px solid var(--border-subtle);
}

.tracker-bar-container {
    width: 100%;
    height: 10px;
    background: rgba(255, 255, 255, 0.08);
    border-radius: 999px;
    overflow: hidden;
    position: relative;
    border: 1px solid rgba(255, 255, 255, 0.06);
}

.tracker-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, #00c3ff 0%, #3b82f6 50%, #10b981 100%);
    border-radius: 999px;
    transition: width 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 0 12px rgba(0, 195, 255, 0.5);
}

/* Season Tabs Bar */
.tracker-seasons-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 1.5rem;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--border-subtle);
    border-radius: var(--border-radius);
    padding: 10px 14px;
}

.tracker-season-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
}

.season-tab-btn {
    background: rgba(255, 255, 255, 0.06);
    color: var(--text-muted);
    border: 1px solid transparent;
    padding: 8px 16px;
    border-radius: 8px;
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    transition: all var(--transition-fast);
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.season-tab-btn:hover {
    background: rgba(255, 255, 255, 0.12);
    color: var(--text-main);
}

.season-tab-btn.active {
    background: var(--accent-color);
    color: #fff;
    font-weight: 600;
    box-shadow: 0 0 14px rgba(59, 130, 246, 0.4);
}

.season-tab-btn.season-done .season-check-icon {
    color: var(--success-color);
    font-weight: 700;
}

.season-tab-btn.active.season-done .season-check-icon {
    color: #fff;
}

.season-tab-count {
    font-size: 0.8rem;
    opacity: 0.8;
}

/* Episodes Checklist Header & List */
.tracker-episodes-header {
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid var(--border-subtle);
}

.tracker-episodes-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

/* Episode Card */
.episode-card {
    display: flex;
    flex-direction: column;
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    border-radius: var(--border-radius);
    overflow: hidden;
    transition: border-color var(--transition-fast), background var(--transition-fast), box-shadow var(--transition-fast);
    padding: 12px;
    gap: 12px;
}

.episode-card:hover {
    border-color: var(--border-active);
    background: rgba(255, 255, 255, 0.05);
}

.episode-card.is-watched {
    border-color: rgba(16, 185, 129, 0.35);
    background: rgba(16, 185, 129, 0.04);
}

.episode-card.is-playing {
    border-color: rgba(0, 195, 255, 0.55);
    background: rgba(0, 195, 255, 0.04);
    box-shadow: 0 4px 24px rgba(0, 195, 255, 0.15);
}

.episode-card-main {
    display: flex;
    align-items: center;
    gap: 16px;
    width: 100%;
}

.episode-still-col {
    flex-shrink: 0;
}

.episode-still-img {
    width: 140px;
    height: 85px;
    border-radius: 8px;
    background-size: cover;
    background-position: center;
    position: relative;
    overflow: hidden;
    background-color: #1a1a1a;
    border: 1px solid rgba(255, 255, 255, 0.08);
}

.episode-runtime-pill {
    position: absolute;
    bottom: 4px;
    right: 4px;
    background: rgba(0, 0, 0, 0.75);
    color: #fff;
    font-size: 0.72rem;
    padding: 2px 6px;
    border-radius: 4px;
    backdrop-filter: blur(4px);
}

.episode-watched-badge {
    position: absolute;
    top: 4px;
    left: 4px;
    background: rgba(16, 185, 129, 0.9);
    color: #fff;
    font-size: 0.72rem;
    font-weight: 600;
    padding: 2px 6px;
    border-radius: 4px;
}

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

.episode-header-line {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    margin-bottom: 4px;
}

.episode-title {
    font-size: 1.05rem;
    font-weight: 600;
    color: var(--text-main);
    margin: 0;
    display: flex;
    align-items: center;
    gap: 8px;
    line-height: 1.3;
}

.ep-num-pill {
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-muted);
    font-size: 0.75rem;
    font-weight: 700;
    padding: 2px 6px;
    border-radius: 4px;
}

.episode-card.is-watched .ep-num-pill {
    background: rgba(16, 185, 129, 0.2);
    color: var(--success-color);
}

.ep-rating-pill {
    font-size: 0.8rem;
    color: #fbbf24;
    font-weight: 600;
    white-space: nowrap;
}

.episode-sub-meta {
    font-size: 0.82rem;
    color: var(--text-muted);
    margin-bottom: 6px;
}

.episode-overview {
    font-size: 0.86rem;
    color: rgba(255, 255, 255, 0.7);
    line-height: 1.4;
    margin: 0;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.episode-action-col {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    gap: 8px;
    padding-left: 8px;
    flex-wrap: wrap;
}

.btn-watch-episode {
    background: rgba(0, 195, 255, 0.12);
    color: var(--accent-color);
    border: 1px solid rgba(0, 195, 255, 0.35);
    padding: 8px 14px;
    border-radius: 8px;
    font-size: 0.86rem;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition-fast);
    display: inline-flex;
    align-items: center;
    gap: 6px;
    min-height: 40px;
    white-space: nowrap;
}

.btn-watch-episode:hover {
    background: rgba(0, 195, 255, 0.22);
    border-color: var(--accent-color);
    color: #fff;
    box-shadow: 0 0 12px rgba(0, 195, 255, 0.3);
}

.btn-watch-episode.is-playing {
    background: rgba(239, 68, 68, 0.16);
    color: #f87171;
    border-color: rgba(239, 68, 68, 0.4);
}

.btn-watch-episode.is-playing:hover {
    background: rgba(239, 68, 68, 0.28);
    color: #fff;
}

.btn-episode-toggle {
    background: rgba(255, 255, 255, 0.08);
    color: var(--text-muted);
    border: 1px solid var(--border-subtle);
    padding: 8px 16px;
    border-radius: 8px;
    font-size: 0.88rem;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition-fast);
    display: inline-flex;
    align-items: center;
    gap: 6px;
    min-height: 40px;
    white-space: nowrap;
}

.btn-episode-toggle:hover {
    background: rgba(255, 255, 255, 0.15);
    color: var(--text-main);
    border-color: var(--border-active);
}

.btn-episode-toggle.is-watched {
    background: rgba(16, 185, 129, 0.18);
    color: var(--success-color);
    border-color: rgba(16, 185, 129, 0.45);
    box-shadow: 0 0 10px rgba(16, 185, 129, 0.2);
}

.btn-episode-toggle.is-watched:hover {
    background: rgba(16, 185, 129, 0.28);
}

/* Inline Video Theater (100% Inline Architecture patterned after games.seelye.info) */
.episode-inline-theater {
    width: 100%;
    padding: 12px 14px;
    background: rgba(10, 14, 26, 0.96);
    border: 1px solid rgba(0, 195, 255, 0.45);
    border-radius: 10px;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.7), 0 0 20px rgba(0, 195, 255, 0.15);
    display: flex;
    flex-direction: column;
    gap: 10px;
    box-sizing: border-box;
    animation: fadeIn 0.25s ease-out;
}

.theater-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    flex-wrap: wrap;
}

.theater-status {
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
    flex: 1;
}

.theater-beacon {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #00c3ff;
    box-shadow: 0 0 8px #00c3ff;
    flex-shrink: 0;
    animation: pulseDot 1.8s infinite ease-in-out;
}

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

.theater-badge {
    font-size: 0.72rem;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: 4px;
    background: rgba(0, 195, 255, 0.15);
    color: #00c3ff;
    border: 1px solid rgba(0, 195, 255, 0.35);
    text-transform: capitalize;
    white-space: nowrap;
}

.theater-title {
    font-size: 0.88rem;
    font-weight: 600;
    color: #e2e8f0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 320px;
}

.theater-type-pill {
    font-size: 0.72rem;
    padding: 1px 6px;
    border-radius: 4px;
    background: rgba(255, 255, 255, 0.08);
    color: var(--text-muted);
    white-space: nowrap;
}

.theater-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}

.theater-ext-btn {
    font-size: 0.78rem;
    font-weight: 600;
    padding: 4px 10px;
    border-radius: 6px;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    transition: all var(--transition-fast);
    white-space: nowrap;
}

.theater-ext-btn.provider-btn {
    background: rgba(0, 195, 255, 0.18);
    color: #00c3ff;
    border: 1px solid rgba(0, 195, 255, 0.4);
}

.theater-ext-btn.provider-btn:hover {
    background: #00c3ff;
    color: #000;
    border-color: #00c3ff;
}

.theater-ext-btn.youtube-btn {
    background: rgba(255, 0, 0, 0.14);
    color: #ff6b6b;
    border: 1px solid rgba(255, 0, 0, 0.3);
}

.theater-ext-btn.youtube-btn:hover {
    background: #ff4444;
    color: #fff;
}

.theater-close-btn {
    background: rgba(255, 255, 255, 0.08);
    color: var(--text-muted);
    border: 1px solid var(--border-subtle);
    width: 28px;
    height: 28px;
    border-radius: 6px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 0.85rem;
    transition: all var(--transition-fast);
}

.theater-close-btn:hover {
    background: rgba(239, 68, 68, 0.25);
    color: #fff;
    border-color: rgba(239, 68, 68, 0.5);
}

.theater-iframe-container {
    position: relative;
    width: 100%;
    aspect-ratio: 16 / 9;
    border-radius: 8px;
    overflow: hidden;
    background: #000;
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: inset 0 0 10px rgba(0, 0, 0, 0.8);
}

.theater-iframe {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    border: none;
}

.theater-fallback-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    font-size: 0.78rem;
    color: var(--text-muted);
    padding-top: 4px;
    flex-wrap: wrap;
}

.theater-fallback-info {
    display: flex;
    align-items: center;
    gap: 6px;
}

.theater-fallback-icon {
    font-size: 0.9rem;
}

.theater-fallback-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

.theater-fallback-link {
    color: var(--accent-color);
    text-decoration: none;
    font-weight: 500;
    transition: color var(--transition-fast);
}

.theater-fallback-link:hover {
    color: var(--accent-hover);
    text-decoration: underline;
}

.theater-fallback-divider {
    color: rgba(255, 255, 255, 0.2);
}

/* ==========================================================================
   Library Card Progress & Archive Badge Enhancements
   ========================================================================== */

.card-archive-badge {
    position: absolute;
    top: 8px;
    left: 8px;
    background: rgba(16, 185, 129, 0.9);
    color: #fff;
    font-size: 0.72rem;
    font-weight: 700;
    padding: 3px 8px;
    border-radius: 4px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.6);
    letter-spacing: 0.02em;
    backdrop-filter: blur(4px);
    z-index: 2;
}

.content-card.is-archived {
    opacity: 0.9;
    border-color: rgba(16, 185, 129, 0.3);
}

.content-card .card-poster {
    cursor: pointer;
}

.content-card .card-title {
    cursor: pointer;
    transition: color var(--transition-fast);
}

.content-card .card-title:hover {
    color: var(--accent-color);
}

/* Mini Progress Bar on Library Card */
.card-progress-bar-wrap {
    margin-bottom: 0.5rem;
    width: 100%;
}

.card-progress-label {
    display: flex;
    justify-content: space-between;
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-bottom: 3px;
    font-weight: 500;
}

.card-progress-track {
    width: 100%;
    height: 5px;
    background: rgba(255, 255, 255, 0.08);
    border-radius: 999px;
    overflow: hidden;
}

.card-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #00c3ff 0%, #3b82f6 100%);
    border-radius: 999px;
    transition: width 0.3s ease;
}

.content-card.is-archived .card-progress-fill {
    background: linear-gradient(90deg, #10b981 0%, #059669 100%);
}

.btn-track-card {
    background: rgba(59, 130, 246, 0.12);
    color: var(--accent-color);
    border: 1px solid rgba(59, 130, 246, 0.3);
    font-weight: 600;
    transition: all var(--transition-fast);
}

.btn-track-card:hover {
    background: rgba(59, 130, 246, 0.22);
    border-color: var(--accent-color);
    color: #fff;
}

/* ==========================================================================
   Responsive Adaptations for Show Tracker (iPhone & iPad)
   ========================================================================== */

@media (max-width: 640px) {
    .tracker-hero-content {
        flex-direction: column;
        align-items: center;
        text-align: center;
        padding: 1.25rem 1rem;
        gap: 1rem;
    }

    .tracker-poster-thumb {
        width: 110px;
        min-width: 110px;
        height: 165px;
    }

    .tracker-title-row {
        justify-content: center;
    }

    .tracker-meta-tags {
        justify-content: center;
    }

    .tracker-progress-header {
        flex-direction: column;
        align-items: stretch;
    }

    .tracker-series-actions {
        flex-direction: column;
        align-items: stretch;
        width: 100%;
    }

    .tracker-series-actions .btn {
        width: 100%;
        justify-content: center;
    }

    .tracker-rating-bar {
        justify-content: center;
        width: 100%;
    }

    .tracker-seasons-bar {
        flex-direction: column;
        align-items: stretch;
        gap: 10px;
    }

    .tracker-season-tabs {
        width: 100%;
        overflow-x: auto;
        flex-wrap: nowrap;
        padding-bottom: 4px;
        -webkit-overflow-scrolling: touch;
    }

    .season-tab-btn {
        flex-shrink: 0;
    }

    .tracker-season-action-btn-wrap {
        width: 100%;
    }

    .tracker-season-action-btn-wrap .btn {
        width: 100%;
        justify-content: center;
    }

    /* Episode Card on Mobile */
    .episode-card {
        padding: 10px;
        gap: 10px;
    }

    .episode-card-main {
        flex-direction: column;
        align-items: stretch;
        gap: 10px;
    }

    .episode-still-img {
        width: 100%;
        height: 150px;
    }

    .episode-action-col {
        padding-left: 0;
        width: 100%;
        flex-direction: column;
        align-items: stretch;
        gap: 8px;
    }

    .btn-watch-episode,
    .btn-episode-toggle {
        width: 100%;
        justify-content: center;
        min-height: 44px; /* iOS standard touch target */
    }

    .theater-header {
        flex-direction: column;
        align-items: stretch;
        gap: 8px;
    }

    .theater-title {
        max-width: 190px;
    }

    .theater-actions {
        width: 100%;
        justify-content: space-between;
    }

    .theater-ext-btn {
        flex: 1;
        justify-content: center;
        min-height: 38px;
    }

    .theater-close-btn {
        width: 38px;
        height: 38px;
    }

    .theater-fallback-bar {
        flex-direction: column;
        align-items: flex-start;
        gap: 6px;
    }

    .theater-fallback-actions {
        width: 100%;
        justify-content: space-between;
    }

    /* Roku Remote on Mobile */
    .roku-remote-section {
        padding: 0;
        width: 100%;
    }

    .remote-controller-shell {
        padding: 18px 14px;
        border-radius: 20px;
    }

    .roku-dpad-container {
        padding: 15px 0;
    }

    .roku-dpad {
        width: 180px;
        height: 180px;
    }

    .roku-dpad-center {
        width: 58px;
        height: 58px;
        font-size: 0.95rem;
    }

    .remote-channels-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 8px;
    }

    .remote-channels-title {
        font-size: 0.82rem;
    }
}

/* ==========================================================================
   ROKU REMOTE CONTROL & ECP SUBSYSTEM (Beta 2.0.0)
   100% Inline Architecture - Zero Modals
   ========================================================================== */

.remote-header-btn {
    font-size: 0.85rem;
    padding: 0.45rem 0.85rem;
    border-color: rgba(0, 195, 255, 0.35);
    background: rgba(0, 195, 255, 0.08);
    color: #00c3ff;
    transition: all var(--transition-fast);
}

.remote-header-btn:hover {
    background: rgba(0, 195, 255, 0.2);
    border-color: var(--accent-color);
    box-shadow: 0 0 12px rgba(0, 195, 255, 0.35);
    color: #fff;
}

.roku-remote-section {
    max-width: 480px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    gap: 16px;
    animation: fadeIn 0.25s ease;
}

/* Device Status Card */
.remote-header-card {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 14px 18px;
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    border-radius: 14px;
    box-shadow: var(--shadow-main);
}

.remote-device-info {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.remote-device-badge {
    display: flex;
    align-items: center;
    gap: 8px;
}

.remote-status-dot {
    width: 9px;
    height: 9px;
    border-radius: 50%;
    background: #10b981;
    box-shadow: 0 0 8px #10b981;
    flex-shrink: 0;
}

.remote-status-dot.unconfigured {
    background: #f59e0b;
    box-shadow: 0 0 8px #f59e0b;
}

.remote-device-name {
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--text-main);
}

.remote-ip-label {
    font-size: 0.78rem;
    color: var(--text-muted);
    font-family: monospace;
}

/* Search Bar */
.remote-search-card {
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    border-radius: 14px;
    padding: 12px;
}

.remote-search-form {
    display: flex;
    gap: 8px;
    width: 100%;
}

.remote-search-form input {
    flex: 1;
    background: rgba(0, 0, 0, 0.35);
    border: 1px solid var(--border-subtle);
    border-radius: 8px;
    padding: 10px 14px;
    color: var(--text-main);
    font-size: 0.9rem;
    outline: none;
    transition: border-color 0.2s ease;
}

.remote-search-form input:focus {
    border-color: var(--accent-color);
}

.remote-search-form button {
    white-space: nowrap;
    font-size: 0.88rem;
    padding: 10px 16px;
}

/* Remote Controller Shell */
.remote-controller-shell {
    background: linear-gradient(180deg, #181c28 0%, #111420 100%);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 28px;
    padding: 24px 22px;
    box-shadow: 0 16px 48px rgba(0, 0, 0, 0.65), inset 0 1px 0 rgba(255, 255, 255, 0.08);
    display: flex;
    flex-direction: column;
    gap: 18px;
}

/* Button Rows */
.remote-btn-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
}

.remote-top-row {
    padding: 0 4px;
}

/* Base Remote Button */
.roku-btn {
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 12px;
    color: var(--text-main);
    cursor: pointer;
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 10px 12px;
    transition: all 0.15s ease;
    user-select: none;
    -webkit-tap-highlight-color: transparent;
}

.roku-btn:hover {
    background: rgba(255, 255, 255, 0.12);
    border-color: var(--accent-color);
    box-shadow: 0 0 10px rgba(0, 195, 255, 0.3);
    transform: translateY(-1px);
}

.roku-btn:active {
    transform: scale(0.94);
    background: rgba(0, 195, 255, 0.2);
}

.roku-btn-util {
    flex: 1;
    min-height: 48px;
}

.roku-btn-home {
    flex: 1.2;
    min-height: 48px;
    background: rgba(0, 195, 255, 0.1);
    border-color: rgba(0, 195, 255, 0.3);
}

.roku-btn-home:hover {
    background: rgba(0, 195, 255, 0.25);
}

.roku-btn-power {
    flex: 1;
    min-height: 48px;
    color: #ef4444;
}

.roku-btn-power:hover {
    border-color: #ef4444;
    box-shadow: 0 0 10px rgba(239, 68, 68, 0.35);
    color: #ff6b6b;
}

.roku-btn-sub {
    flex: 1;
    min-height: 44px;
}

.roku-icon {
    font-size: 1.15rem;
    line-height: 1;
    margin-bottom: 2px;
}

.roku-btn-tag {
    font-size: 0.68rem;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

/* Directional D-Pad */
.roku-dpad-container {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 10px 0;
}

.roku-dpad {
    position: relative;
    width: 210px;
    height: 210px;
    border-radius: 50%;
    background: #141724;
    border: 2px solid rgba(255, 255, 255, 0.12);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5), inset 0 2px 6px rgba(255, 255, 255, 0.05);
    display: flex;
    align-items: center;
    justify-content: center;
}

.roku-dpad-btn {
    position: absolute;
    background: transparent;
    border: none;
    color: #cbd5e1;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    transition: all 0.15s ease;
    user-select: none;
    -webkit-tap-highlight-color: transparent;
}

.roku-dpad-btn:hover {
    color: #00c3ff;
    text-shadow: 0 0 8px rgba(0, 195, 255, 0.7);
}

.roku-dpad-btn:active {
    transform: scale(0.9);
}

.roku-dpad-up {
    top: 10px;
    left: 50%;
    transform: translateX(-50%);
    width: 70px;
    height: 48px;
}

.roku-dpad-down {
    bottom: 10px;
    left: 50%;
    transform: translateX(-50%);
    width: 70px;
    height: 48px;
}

.roku-dpad-left {
    left: 10px;
    top: 50%;
    transform: translateY(-50%);
    width: 48px;
    height: 70px;
}

.roku-dpad-right {
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    width: 48px;
    height: 70px;
}

.roku-dpad-center {
    position: relative;
    width: 68px;
    height: 68px;
    border-radius: 50%;
    background: linear-gradient(135deg, #252b3e 0%, #171b28 100%);
    border: 2px solid rgba(0, 195, 255, 0.4);
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.4), 0 0 10px rgba(0, 195, 255, 0.25);
    color: #fff;
    font-weight: 700;
    font-size: 1.05rem;
    letter-spacing: 0.02em;
    z-index: 2;
}

.roku-dpad-center:hover {
    border-color: #00c3ff;
    box-shadow: 0 0 16px rgba(0, 195, 255, 0.55);
    transform: scale(1.04);
}

.roku-dpad-center:active {
    transform: scale(0.95);
}

/* Media & Volume Bars */
.remote-transport-row, .remote-volume-row {
    padding: 0 6px;
}

.roku-btn-media, .roku-btn-vol {
    flex: 1;
    min-height: 44px;
    font-size: 1.05rem;
    flex-direction: row;
    gap: 4px;
    font-weight: 600;
}

.roku-btn-play {
    background: rgba(0, 195, 255, 0.15);
    border-color: rgba(0, 195, 255, 0.4);
    color: #00c3ff;
}

.roku-btn-play:hover {
    background: #00c3ff;
    color: #000;
    border-color: #00c3ff;
}

.roku-btn-mute {
    color: #f59e0b;
}

/* Channel Dock */
.remote-channels-card {
    background: rgba(0, 0, 0, 0.35);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 16px;
    padding: 14px;
}

.remote-channels-title {
    font-size: 0.88rem;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 10px;
    text-align: center;
}

.remote-channels-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 8px;
}

.roku-channel-pill {
    background: #181c28;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    padding: 10px 8px;
    cursor: pointer;
    color: #e2e8f0;
    font-size: 0.8rem;
    font-weight: 700;
    text-align: center;
    transition: all 0.18s ease;
    user-select: none;
    -webkit-tap-highlight-color: transparent;
}

.roku-channel-pill:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.4);
}

.roku-channel-pill:active {
    transform: scale(0.96);
}

.roku-channel-pill.ch-netflix:hover {
    border-color: #e50914;
    color: #ff4d4d;
    box-shadow: 0 0 12px rgba(229, 9, 20, 0.4);
}

.roku-channel-pill.ch-disney:hover {
    border-color: #0063e5;
    color: #3b82f6;
    box-shadow: 0 0 12px rgba(0, 99, 229, 0.4);
}

.roku-channel-pill.ch-hulu:hover {
    border-color: #1ce783;
    color: #1ce783;
    box-shadow: 0 0 12px rgba(28, 231, 131, 0.4);
}

.roku-channel-pill.ch-peacock:hover {
    border-color: #00c3ff;
    color: #00c3ff;
    box-shadow: 0 0 12px rgba(0, 195, 255, 0.4);
}

.roku-channel-pill.ch-prime:hover {
    border-color: #00a8e1;
    color: #00a8e1;
    box-shadow: 0 0 12px rgba(0, 168, 225, 0.4);
}

.roku-channel-pill.ch-appletv:hover {
    border-color: #cbd5e1;
    color: #ffffff;
    box-shadow: 0 0 12px rgba(255, 255, 255, 0.3);
}

.roku-channel-pill.ch-youtube:hover {
    border-color: #ff0000;
    color: #ff4d4d;
    box-shadow: 0 0 12px rgba(255, 0, 0, 0.4);
}

.roku-channel-pill.ch-max:hover {
    border-color: #002be7;
    color: #60a5fa;
    box-shadow: 0 0 12px rgba(0, 43, 231, 0.4);
}

/* Play on Roku Episode Action Button */
.btn-play-on-roku {
    background: rgba(0, 195, 255, 0.12);
    border: 1px solid rgba(0, 195, 255, 0.35);
    color: #00c3ff;
    font-weight: 600;
    font-size: 0.8rem;
    padding: 6px 12px;
    border-radius: 6px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    transition: all var(--transition-fast);
}

.btn-play-on-roku:hover {
    background: #00c3ff;
    color: #000;
    border-color: #00c3ff;
    box-shadow: 0 0 10px rgba(0, 195, 255, 0.4);
}

.btn-play-on-roku:active {
    transform: scale(0.96);
}




