/* ===================================
   Shared Portal/App Styles
   Used by portal.html, library.html, settings.html
   =================================== */

:root {
    --bg-dark-start: #0a0a14;
    --bg-dark-end: #14141f;
    --bg-card: rgba(26, 20, 36, 0.8);
    --bg-card-glass: rgba(26, 20, 36, 0.6);
    --primary: #8b5cf6;
    --primary-hover: #7c3aed;
    --text-main: #ffffff;
    --text-secondary: rgba(255, 255, 255, 0.6);
    --text-muted: rgba(255, 255, 255, 0.4);
    --divider: rgba(255, 255, 255, 0.1);
    --success: #10b981;
    --warning: #f59e0b;
    --danger: #ef4444;
    --border-glass: rgba(255, 255, 255, 0.1);
    --shell-max: 1440px;
    --shadow-elevated: 0 24px 60px rgba(0, 0, 0, 0.3);
}

.admin-main {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.admin-guard-card {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.admin-summary-grid {
    display: grid;
    grid-template-columns: repeat(6, minmax(0, 1fr));
    gap: 1rem;
}

.admin-summary-card {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}

.admin-summary-label {
    color: var(--text-muted);
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.admin-summary-card strong {
    font-size: 2rem;
    line-height: 1;
}

.admin-tabs-card {
    padding: 0.75rem;
}

.admin-tab-bar {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.admin-tab-button {
    border: 1px solid rgba(255, 255, 255, 0.1);
    background: rgba(255, 255, 255, 0.04);
    color: var(--text-secondary);
    border-radius: 999px;
    padding: 0.75rem 1rem;
    font: inherit;
    font-weight: 700;
    cursor: pointer;
}

.admin-tab-button.active {
    background: linear-gradient(135deg, var(--accent-primary), #9b6bff);
    color: white;
    border-color: transparent;
}

.admin-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.45fr) minmax(320px, 0.85fr);
    gap: 1rem;
}

.admin-sidebar-stack {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.admin-form-card,
.admin-sidebar-stack .glass-card,
.admin-panel .glass-card {
    padding: 1.25rem;
}

.admin-toggle {
    margin-bottom: 1.25rem;
}

.admin-form-actions {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.admin-code-block,
.admin-inline-code {
    white-space: pre-wrap;
    word-break: break-word;
    font-size: 0.85rem;
    margin: 0;
    color: var(--text-secondary);
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 18px;
    padding: 1rem;
}

.admin-inline-code {
    margin-top: 1rem;
}

.admin-toolbar {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    align-items: flex-start;
    margin-bottom: 1rem;
}

.admin-toolbar-controls {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
    align-items: center;
}

.admin-toolbar-controls .form-input,
.admin-toolbar-controls .form-select {
    min-width: 180px;
}

.admin-section-copy {
    margin: 0.35rem 0 0;
    color: var(--text-muted);
}

.admin-list {
    display: flex;
    flex-direction: column;
    gap: 0.85rem;
}

.admin-list-item {
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 20px;
    background: rgba(255, 255, 255, 0.03);
    padding: 1rem;
}

.admin-list-item.compact {
    padding: 0.85rem 1rem;
}

.admin-list-row {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    align-items: flex-start;
}

.admin-list-meta {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
    color: var(--text-muted);
    font-size: 0.85rem;
    margin-top: 0.35rem;
}

.admin-report-grid,
.admin-review-meta {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.75rem;
    margin-top: 0.9rem;
    color: var(--text-secondary);
    font-size: 0.92rem;
}

.admin-report-grid > div,
.admin-review-meta > span {
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
}

.admin-field-label {
    color: var(--text-muted);
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.admin-list-actions {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
    margin-top: 1rem;
}

.admin-review-copy {
    margin-top: 0.9rem;
    color: var(--text-primary);
    line-height: 1.6;
}

.admin-rating-pill {
    display: inline-flex;
    align-items: center;
    border-radius: 999px;
    padding: 0.45rem 0.8rem;
    background: rgba(124, 92, 255, 0.18);
    color: white;
    font-weight: 700;
}

.admin-empty {
    color: var(--text-muted);
    padding: 1rem 0;
}

@media (max-width: 1200px) {
    .admin-summary-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

@media (max-width: 900px) {
    .admin-grid {
        grid-template-columns: 1fr;
    }

    .admin-toolbar {
        flex-direction: column;
    }
}

@media (max-width: 700px) {
    .admin-summary-grid,
    .admin-report-grid,
    .admin-review-meta {
        grid-template-columns: 1fr;
    }

    .admin-list-row {
        flex-direction: column;
    }

    .admin-toolbar-controls {
        width: 100%;
    }

    .admin-toolbar-controls .form-input,
    .admin-toolbar-controls .form-select,
    .admin-toolbar-controls .btn {
        width: 100%;
    }
}

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

html, body {
    height: 100%;
    overflow-x: hidden;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background:
        radial-gradient(circle at top center, rgba(139, 92, 246, 0.14), transparent 34%),
        radial-gradient(circle at 15% 20%, rgba(59, 130, 246, 0.14), transparent 26%),
        linear-gradient(to bottom, var(--bg-dark-start), var(--bg-dark-end));
    color: var(--text-main);
    min-height: 100vh;
}

.about-credits {
    margin-top: 1rem;
    font-size: 0.8rem;
    color: var(--text-muted);
}

.about-credits summary {
    color: var(--text-secondary);
    cursor: pointer;
    list-style: none;
    font-weight: 600;
}

.about-credits summary::-webkit-details-marker {
    display: none;
}

.about-credits a {
    color: var(--primary);
    text-decoration: none;
}

/* ===================================
   Navigation Bar
   =================================== */

.app-nav {
    position: sticky;
    top: 0;
    z-index: 100;
    background: rgba(10, 10, 20, 0.78);
    backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--divider);
    padding: 0.9rem 1.5rem;
}

.app-nav-container {
    max-width: var(--shell-max);
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 2rem;
}

.app-nav-left {
    display: flex;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
}

.app-logo {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    text-decoration: none;
    color: var(--text-main);
    font-weight: 800;
    font-size: 1.25rem;
}

.app-logo img {
    width: 32px;
    height: 32px;
    border-radius: 8px;
}

.app-nav-tabs {
    display: flex;
    gap: 0.4rem;
    flex-wrap: wrap;
}

.app-nav-tab {
    padding: 0.65rem 1rem;
    text-decoration: none;
    color: var(--text-secondary);
    font-weight: 600;
    font-size: 0.9rem;
    border-radius: 999px;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    border: 1px solid transparent;
}

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

.app-nav-tab.active {
    color: var(--text-main);
    background: var(--primary);
}

.app-nav-tab.locked {
    opacity: 0.72;
}

.app-nav-tab.locked::after {
    content: "\f023";
    font-family: "Font Awesome 6 Free";
    font-weight: 900;
    font-size: 0.72rem;
}

.app-nav-right {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.app-user-info {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.app-user-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--primary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 0.85rem;
}

.app-user-email {
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.app-signout-btn {
    padding: 0.5rem 1rem;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid var(--divider);
    border-radius: 8px;
    color: var(--text-main);
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.app-signout-btn:hover {
    background: rgba(255, 255, 255, 0.15);
    border-color: var(--danger);
    color: var(--danger);
}

/* ===================================
   Main Content Container
   =================================== */

.app-main {
    max-width: var(--shell-max);
    margin: 0 auto;
    padding: 2.5rem 2rem 4rem;
    min-height: calc(100vh - 80px);
}

/* ===================================
   Glass Cards
   =================================== */

.glass-card {
    background: var(--bg-card-glass);
    backdrop-filter: blur(20px);
    border: 1px solid var(--border-glass);
    border-radius: 24px;
    padding: 1.6rem;
    margin-bottom: 1.5rem;
    box-shadow: var(--shadow-elevated);
}

.glass-card-section {
    margin-bottom: 2rem;
}

.glass-card-section:last-child {
    margin-bottom: 0;
}

.section-title {
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted);
    margin-bottom: 1rem;
}

/* ===================================
   Search Bar
   =================================== */

.search-header {
    margin-bottom: 2rem;
    padding: 1.25rem;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border-glass);
    border-radius: 22px;
    backdrop-filter: blur(20px);
}

.search-input-wrapper {
    position: relative;
    margin-bottom: 1rem;
}

.search-input-wrapper i {
    position: absolute;
    left: 1rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    pointer-events: none;
}

.search-input {
    width: 100%;
    padding: 1rem 3rem;
    background: var(--bg-card);
    border: 1px solid var(--border-glass);
    border-radius: 12px;
    color: var(--text-main);
    font-size: 1rem;
    font-family: inherit;
    transition: all 0.3s ease;
}

.search-input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.1);
}

.search-input::placeholder {
    color: var(--text-muted);
}

.search-clear-btn {
    position: absolute;
    right: 1rem;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    font-size: 1.25rem;
    padding: 0.25rem;
    display: none;
}

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

.search-filters {
    display: flex;
    gap: 0.75rem;
}

.filter-chip {
    padding: 0.5rem 1rem;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-glass);
    border-radius: 24px;
    color: var(--text-secondary);
    font-size: 0.875rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

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

.filter-chip.active {
    background: var(--primary);
    color: var(--text-main);
    border-color: var(--primary);
}

/* ===================================
   Content Sections
   =================================== */

.content-section {
    margin-bottom: 3.5rem;
}

.content-section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    margin-bottom: 1rem;
}

.content-section-icon {
    font-size: 1.5rem;
}

.content-section-title {
    font-size: 1.5rem;
    font-weight: 700;
}

.content-section-subtitle {
    font-size: 0.875rem;
    color: var(--text-secondary);
    margin-top: 0.25rem;
}

.section-link {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 700;
    white-space: nowrap;
}

.section-link:hover {
    color: var(--text-main);
}

.home-metrics {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 1rem;
    margin-bottom: 2rem;
}

.insight-card {
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.06), rgba(255, 255, 255, 0.03));
    border: 1px solid var(--border-glass);
    border-radius: 18px;
    padding: 1.25rem;
    backdrop-filter: blur(20px);
}

.insight-label {
    font-size: 0.75rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--text-muted);
    margin-bottom: 0.65rem;
}

.insight-value {
    font-size: 2rem;
    font-weight: 800;
    margin-bottom: 0.4rem;
}

.insight-footnote {
    font-size: 0.875rem;
    color: var(--text-secondary);
    line-height: 1.4;
}

/* ===================================
   Horizontal Scroll Container
   =================================== */

.horizontal-scroll {
    display: flex;
    gap: 1.25rem;
    overflow-x: auto;
    overflow-y: hidden;
    padding-bottom: 1rem;
    scroll-behavior: smooth;
    -webkit-overflow-scrolling: touch;
}

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

.horizontal-scroll::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 4px;
}

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

.horizontal-scroll::-webkit-scrollbar-thumb:hover {
    background: var(--primary-hover);
}

/* ===================================
   Show Cards
   =================================== */

.show-card {
    position: relative;
    flex: 0 0 156px;
    cursor: pointer;
    transition: transform 0.3s ease;
}

.show-card:hover {
    transform: translateY(-6px);
}

.show-card-poster {
    width: 156px;
    height: 234px;
    border-radius: 12px;
    overflow: hidden;
    background: var(--bg-card);
    position: relative;
}

.show-card-poster img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.show-card-badge {
    position: absolute;
    top: 8px;
    right: 8px;
    width: 24px;
    height: 24px;
    background: var(--success);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    color: white;
}

.show-card-info {
    margin-top: 0.5rem;
}

.show-card-title {
    font-size: 0.875rem;
    font-weight: 600;
    line-height: 1.3;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    margin-bottom: 0.25rem;
}

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

.release-show-card {
    flex: 0 0 208px;
}

.release-show-card .show-card-poster {
    width: 208px;
    height: 312px;
}

.release-card-type {
    position: absolute;
    left: 10px;
    bottom: 10px;
    padding: 0.25rem 0.55rem;
    border-radius: 999px;
    background: rgba(10, 10, 20, 0.8);
    color: #fff;
    font-size: 0.7rem;
    font-weight: 700;
    border: 1px solid rgba(255, 255, 255, 0.12);
    backdrop-filter: blur(10px);
}

.release-card-primary {
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--text-secondary);
    line-height: 1.35;
    margin-bottom: 0.2rem;
}

.release-card-secondary {
    font-size: 0.76rem;
    color: var(--text-muted);
    line-height: 1.45;
}

/* ===================================
   Grid Layout (for Library)
   =================================== */

.grid-layout {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 1.5rem;
}

.grid-card {
    position: relative;
    cursor: pointer;
    transition: transform 0.3s ease;
    padding: 0.9rem;
    border-radius: 22px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.06);
}

.grid-card:hover {
    transform: translateY(-6px);
    border-color: rgba(139, 92, 246, 0.3);
}

.grid-card-poster {
    width: 100%;
    aspect-ratio: 2/3;
    border-radius: 12px;
    overflow: hidden;
    background: var(--bg-card);
    position: relative;
}

.grid-card-poster img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.grid-card-badge {
    position: absolute;
    top: 8px;
    right: 8px;
    padding: 0.25rem 0.5rem;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(10px);
    border-radius: 6px;
    font-size: 0.75rem;
    font-weight: 600;
}

.grid-card-info {
    margin-top: 0.9rem;
}

.grid-card-title {
    font-size: 1rem;
    font-weight: 600;
    line-height: 1.3;
    margin-bottom: 0.25rem;
}

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

/* ===================================
   Empty States
   =================================== */

.empty-state {
    text-align: center;
    padding: 4rem 2rem;
}

.empty-state-icon {
    font-size: 4rem;
    color: var(--text-muted);
    margin-bottom: 1rem;
}

.empty-state-title {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
}

.empty-state-message {
    font-size: 1rem;
    color: var(--text-secondary);
    margin-bottom: 2rem;
}

.empty-state-btn {
    padding: 0.75rem 1.5rem;
    background: var(--primary);
    border: none;
    border-radius: 12px;
    color: var(--text-main);
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.empty-state-btn:hover {
    background: var(--primary-hover);
    transform: translateY(-2px);
}

/* ===================================
   Loading State
   =================================== */

.loading-state {
    text-align: center;
    padding: 4rem 2rem;
}

.loading-spinner {
    width: 48px;
    height: 48px;
    border: 4px solid rgba(139, 92, 246, 0.2);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 1rem;
}

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

.loading-text {
    font-size: 1rem;
    color: var(--text-secondary);
}

.calendar-preview-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 1rem;
    margin-bottom: 1rem;
}

.calendar-preview-title {
    font-size: 1.35rem;
    font-weight: 700;
    margin-top: 0.2rem;
}

.calendar-preview-list {
    display: grid;
    gap: 0.75rem;
}

.calendar-preview-item {
    display: grid;
    grid-template-columns: 180px minmax(0, 1fr) auto;
    gap: 1rem;
    align-items: center;
    text-decoration: none;
    color: inherit;
    padding: 0.9rem 1rem;
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.calendar-preview-item:hover {
    border-color: rgba(139, 92, 246, 0.4);
    background: rgba(139, 92, 246, 0.08);
}

.calendar-preview-time {
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
    font-size: 0.85rem;
}

.calendar-preview-time span,
.calendar-preview-copy span {
    color: var(--text-muted);
    font-size: 0.78rem;
}

.calendar-preview-copy {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    min-width: 0;
}

.calendar-preview-copy strong {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* ===================================
   Buttons
   =================================== */

.btn {
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 12px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    font-family: inherit;
}

.btn-primary {
    background: var(--primary);
    color: var(--text-main);
}

.btn-primary:hover {
    background: var(--primary-hover);
    transform: translateY(-2px);
}

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

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.15);
}

.btn-danger {
    background: var(--danger);
    color: var(--text-main);
}

.btn-danger:hover {
    background: #dc2626;
}

.btn-warning {
    background: var(--warning);
    color: var(--text-main);
}

.btn-warning:hover {
    background: #d97706;
}

/* ===================================
   Forms
   =================================== */

.form-group {
    margin-bottom: 1.5rem;
}

.form-label {
    display: block;
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 0.5rem;
}

.form-input,
.form-select {
    width: 100%;
    padding: 0.75rem 1rem;
    background: var(--bg-card);
    border: 1px solid var(--border-glass);
    border-radius: 12px;
    color: var(--text-main);
    font-size: 1rem;
    font-family: inherit;
    transition: all 0.3s ease;
}

.form-input:focus,
.form-select:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.1);
}

.form-select {
    cursor: pointer;
}

/* Toggle Switch */
.toggle-switch {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 0;
    border-bottom: 1px solid var(--divider);
}

.toggle-switch:last-child {
    border-bottom: none;
}

.toggle-switch-label {
    font-size: 1rem;
    color: var(--text-main);
}

.toggle-switch-input {
    position: relative;
    width: 48px;
    height: 28px;
}

.toggle-switch-input input {
    opacity: 0;
    width: 0;
    height: 0;
}

.toggle-switch-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.2);
    transition: 0.3s;
    border-radius: 28px;
}

.toggle-switch-slider:before {
    position: absolute;
    content: "";
    height: 20px;
    width: 20px;
    left: 4px;
    bottom: 4px;
    background: white;
    transition: 0.3s;
    border-radius: 50%;
}

.toggle-switch-input input:checked + .toggle-switch-slider {
    background: var(--primary);
}

.toggle-switch-input input:checked + .toggle-switch-slider:before {
    transform: translateX(20px);
}

.settings-layout {
    display: grid;
    grid-template-columns: minmax(0, 1.2fr) 380px;
    gap: 1.5rem;
    align-items: start;
}

.settings-primary,
.settings-sidebar {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

/* Status Badge */
.status-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.25rem 0.75rem;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 600;
}

.status-badge.success {
    background: rgba(16, 185, 129, 0.2);
    color: var(--success);
}

.status-badge.warning {
    background: rgba(245, 158, 11, 0.2);
    color: var(--warning);
}

/* ===================================
   Responsive Design
   =================================== */

@media (max-width: 768px) {
    .app-nav {
        padding: 1rem;
    }

    .app-nav-container {
        flex-direction: column;
        gap: 1rem;
    }

    .app-nav-left {
        width: 100%;
        flex-direction: column;
        gap: 1rem;
    }

    .app-nav-tabs {
        width: 100%;
        justify-content: flex-start;
        overflow-x: auto;
        padding-bottom: 0.25rem;
        gap: 0.5rem;
        scrollbar-width: none;
    }

    .app-nav-tab {
        flex: 0 0 auto;
        justify-content: center;
    }

    .app-nav-right {
        width: 100%;
        justify-content: space-between;
    }

    .app-user-email {
        display: none;
    }

    .app-main {
        padding: 1rem;
    }

    .search-header {
        padding: 1rem;
    }

    .grid-layout {
        grid-template-columns: repeat(2, 1fr);
        gap: 1rem;
    }

    .show-card {
        flex: 0 0 120px;
    }

    .show-card-poster {
        width: 120px;
        height: 180px;
    }

    .settings-layout {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 480px) {
    .search-filters {
        flex-wrap: wrap;
    }

    .filter-chip {
        flex: 1;
        text-align: center;
        min-width: calc(33.33% - 0.5rem);
    }
}

/* ===================================
   Detail Page Styles
   =================================== */

.detail-page {
    min-height: 100vh;
    padding-bottom: 4rem;
}

.back-button {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.08);
    color: var(--text-main);
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    padding: 0.65rem 1rem;
    border-radius: 999px;
    transition: all 0.3s ease;
}

.back-button:hover {
    background: rgba(255, 255, 255, 0.1);
}

.detail-hero {
    position: relative;
    width: 100%;
    min-height: 560px;
    overflow: hidden;
}

.detail-hero-backdrop {
    position: absolute;
    inset: 0;
    z-index: 0;
}

.detail-hero-backdrop img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.detail-hero-gradient {
    position: absolute;
    inset: 0;
    background:
        linear-gradient(90deg, rgba(10, 10, 20, 0.92) 0%, rgba(10, 10, 20, 0.45) 50%, rgba(10, 10, 20, 0.82) 100%),
        linear-gradient(to top, var(--bg-dark-start) 8%, rgba(10, 10, 20, 0.12) 45%);
}

.detail-hero-content {
    position: relative;
    z-index: 1;
    max-width: var(--shell-max);
    margin: 0 auto;
    padding: 7rem 2rem 3rem;
    min-height: 560px;
    display: grid;
    grid-template-columns: 280px minmax(0, 1fr);
    align-items: end;
    gap: 2.5rem;
}

.detail-hero-poster {
    width: 280px;
    border-radius: 24px;
    overflow: hidden;
    box-shadow: 0 30px 80px rgba(0, 0, 0, 0.5);
}

.detail-hero-poster img {
    width: 100%;
    aspect-ratio: 2 / 3;
    object-fit: cover;
    display: block;
}

.detail-hero-info {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    padding-bottom: 0.5rem;
}

.detail-hero-kicker-row {
    display: flex;
    align-items: center;
    gap: 0.9rem;
    flex-wrap: wrap;
}

.detail-hero-kicker {
    display: inline-flex;
    align-items: center;
    padding: 0.4rem 0.75rem;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.08);
    color: rgba(255, 255, 255, 0.92);
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

#status-badge-container {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.detail-title {
    font-size: clamp(2.75rem, 5vw, 4.75rem);
    font-weight: 800;
    text-shadow: 0 2px 20px rgba(0, 0, 0, 0.8);
    line-height: 0.95;
}

.detail-meta {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.75rem;
    font-size: 1rem;
    color: var(--text-secondary);
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.8);
}

.detail-meta-dot {
    color: var(--text-muted);
}

.detail-hero-summary {
    max-width: 760px;
    font-size: 1rem;
    line-height: 1.7;
    color: rgba(255, 255, 255, 0.78);
}

.detail-facts-strip {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.detail-fact-pill,
.detail-inline-pill {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    min-height: 40px;
    padding: 0.55rem 0.9rem;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.08);
    color: rgba(255, 255, 255, 0.92);
    font-size: 0.85rem;
    font-weight: 600;
}

.detail-inline-pill.success {
    background: rgba(16, 185, 129, 0.16);
    color: #7ee7bf;
}

.detail-inline-pill.danger {
    background: rgba(239, 68, 68, 0.16);
    color: #fca5a5;
}

.detail-actions {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
    margin-top: 0.5rem;
}

.detail-app-handoff {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin: 0 auto 1.25rem;
    max-width: var(--shell-max);
}

.detail-app-handoff h3 {
    margin: 0 0 0.35rem;
    font-size: 1.05rem;
}

.detail-app-handoff p {
    margin: 0;
    color: var(--text-muted);
}

.detail-app-handoff-actions {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
    justify-content: flex-end;
}

.detail-content-container {
    max-width: var(--shell-max);
    margin: 0 auto;
    padding: 2rem;
}

.detail-layout {
    display: grid;
    grid-template-columns: minmax(0, 1.7fr) 360px;
    gap: 1.5rem;
    align-items: start;
}

.detail-main-column,
.detail-sidebar {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.detail-section-card {
    margin-bottom: 0;
}

.detail-upcoming-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 1rem;
    align-items: center;
}

.detail-upcoming-copy {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}

.detail-upcoming-copy h4 {
    font-size: 1.4rem;
    font-weight: 700;
}

.detail-upcoming-timing {
    min-width: 240px;
    display: flex;
    flex-direction: column;
    gap: 0.45rem;
    align-items: flex-end;
    text-align: right;
}

.upcoming-badge {
    display: inline-flex;
    width: fit-content;
    padding: 0.4rem 0.7rem;
    border-radius: 999px;
    background: rgba(16, 185, 129, 0.16);
    color: #86efac;
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.upcoming-meta {
    color: var(--text-secondary);
    line-height: 1.5;
}

.upcoming-date {
    font-size: 1.05rem;
    font-weight: 700;
}

.upcoming-support {
    color: var(--text-muted);
    line-height: 1.45;
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    gap: 1rem;
}

.card-header-left {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.card-header-left i {
    font-size: 1.25rem;
}

.card-header-left h3 {
    font-size: 1.25rem;
    font-weight: 700;
    margin: 0;
}

.cache-badge {
    font-size: 0.75rem;
    color: var(--text-muted);
    font-weight: 600;
}

.card-title {
    font-size: 1.25rem;
    font-weight: 700;
    margin-bottom: 1rem;
}

.overview-container {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.overview-text {
    color: var(--text-secondary);
    line-height: 1.6;
}

.overview-text.truncated {
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.provider-group {
    margin-bottom: 1.5rem;
}

.provider-group:last-child {
    margin-bottom: 0;
}

.provider-group-title {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text-muted);
    margin-bottom: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.provider-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(96px, 1fr));
    gap: 0.85rem;
}

.provider-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    min-width: 0;
    padding: 0.9rem 0.65rem;
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.06);
}

.provider-item img {
    width: 64px;
    height: 64px;
    border-radius: 18px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.provider-item span {
    font-size: 0.75rem;
    color: var(--text-secondary);
    text-align: center;
}

.progress-label {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.5rem;
    font-size: 0.875rem;
    color: var(--text-secondary);
}

.progress-bar {
    width: 100%;
    height: 8px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 4px;
    overflow: hidden;
}

.progress-bar-fill {
    height: 100%;
    background: var(--primary);
    border-radius: 4px;
    transition: width 0.3s ease;
}

.seasons-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
    gap: 1.1rem;
}

.season-card {
    cursor: pointer;
    border-radius: 20px;
    overflow: hidden;
    transition: transform 0.3s ease, border-color 0.3s ease;
    text-align: left;
    padding: 0;
    border: 1px solid rgba(255, 255, 255, 0.08);
    background: rgba(255, 255, 255, 0.03);
    color: inherit;
}

.season-card:hover {
    transform: translateY(-4px);
    border-color: rgba(139, 92, 246, 0.35);
}

.season-card img {
    width: 100%;
    aspect-ratio: 2 / 3;
    object-fit: cover;
    display: block;
}

.season-card-info {
    padding: 0.95rem;
}

.season-card-title {
    font-weight: 600;
    margin-bottom: 0.25rem;
}

.season-card-meta {
    font-size: 0.875rem;
    color: var(--text-muted);
    margin-bottom: 0.2rem;
}

.season-card-submeta {
    font-size: 0.78rem;
    color: var(--text-secondary);
    margin-bottom: 0.7rem;
}

.season-progress-bar {
    width: 100%;
    height: 4px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 2px;
    overflow: hidden;
}

.season-progress-fill {
    height: 100%;
    background: var(--primary);
    border-radius: 2px;
}

.detail-cast-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 1rem;
}

.cast-card {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    padding: 0.8rem;
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.06);
}

.cast-card img {
    width: 100%;
    aspect-ratio: 2 / 3;
    border-radius: 14px;
    object-fit: cover;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.cast-card-name {
    font-weight: 600;
    font-size: 0.875rem;
}

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

.details-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 0.85rem;
}

.detail-item {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    padding: 0.9rem 1rem;
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.06);
}

.detail-label {
    font-size: 0.75rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-weight: 600;
}

.detail-value {
    font-size: 0.95rem;
    color: var(--text-secondary);
    line-height: 1.5;
}

.review-card {
    padding: 1rem;
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.06);
}

.review-card + .review-card {
    margin-top: 0.9rem;
}

.review-card-header {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 0.65rem;
    color: var(--text-secondary);
    font-size: 0.85rem;
}

.review-card p {
    color: var(--text-secondary);
    line-height: 1.65;
}

.ai-status-copy {
    display: flex;
    flex-direction: column;
    gap: 0.65rem;
}

.ai-status-copy p {
    color: var(--text-secondary);
    line-height: 1.6;
}

.ai-status-sources {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
    margin-top: 1rem;
}

.ai-status-sources a {
    color: var(--primary);
    text-decoration: none;
    font-size: 0.85rem;
}

.modal {
    position: fixed;
    inset: 0;
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
}

.modal-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(10px);
}

.modal-content {
    position: relative;
    z-index: 1;
    background: var(--bg-card);
    border: 1px solid var(--border-glass);
    border-radius: 24px;
    max-width: 760px;
    width: 100%;
    max-height: 80vh;
    display: flex;
    flex-direction: column;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem;
    border-bottom: 1px solid var(--divider);
}

.modal-header h2 {
    font-size: 1.5rem;
    font-weight: 700;
    margin: 0;
}

.modal-body {
    flex: 1;
    overflow-y: auto;
    padding: 1.5rem;
}

.episodes-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.episode-item {
    display: flex;
    gap: 1rem;
    padding: 1rem;
    background: rgba(255, 255, 255, 0.04);
    border-radius: 18px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    transition: all 0.3s ease;
}

.episode-item.watched {
    background: rgba(139, 92, 246, 0.1);
    border-color: rgba(139, 92, 246, 0.3);
}

.episode-item img {
    width: 120px;
    height: 68px;
    border-radius: 8px;
    object-fit: cover;
}

.episode-item-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.episode-item-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 0.5rem;
}

.episode-item-number {
    font-weight: 600;
    font-size: 0.95rem;
}

.episode-watch-btn {
    background: transparent;
    border: none;
    color: var(--primary);
    cursor: pointer;
    padding: 0.25rem;
    font-size: 1.25rem;
    transition: color 0.3s ease;
}

.episode-watch-btn:hover {
    color: var(--primary-hover);
}

.episode-item-meta {
    font-size: 0.75rem;
    color: var(--text-muted);
}

.episode-item-overview {
    font-size: 0.875rem;
    color: var(--text-secondary);
    line-height: 1.4;
}

@media (max-width: 1180px) {
    .detail-layout {
        grid-template-columns: 1fr;
    }

    .detail-sidebar {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 1.5rem;
    }
}

@media (max-width: 768px) {
    .detail-hero {
        min-height: 0;
    }

    .detail-hero-content {
        grid-template-columns: 1fr;
        justify-items: center;
        text-align: center;
        padding: 5.5rem 1rem 2rem;
        min-height: 0;
    }

    .detail-hero-poster {
        width: 180px;
    }

    .detail-hero-kicker-row,
    .detail-facts-strip,
    #status-badge-container,
    .detail-actions,
    .detail-app-handoff,
    .detail-app-handoff-actions {
        justify-content: center;
    }

    .detail-title {
        font-size: 2.25rem;
    }

    .detail-content-container {
        padding: 1.25rem 1rem 2rem;
    }

    .detail-app-handoff {
        flex-direction: column;
        align-items: stretch;
        text-align: center;
    }

    .detail-upcoming-grid,
    .detail-upcoming-timing {
        grid-template-columns: 1fr;
        align-items: flex-start;
        text-align: left;
    }

    .detail-upcoming-timing {
        min-width: 0;
    }

    .detail-sidebar {
        grid-template-columns: 1fr;
    }

    .seasons-grid {
        grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    }

    .episode-item {
        flex-direction: column;
    }

    .episode-item img {
        width: 100%;
        height: auto;
    }
}

/* ===================================
   Toast Animations
   =================================== */

@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateX(100%);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes slideOutRight {
    from {
        opacity: 1;
        transform: translateX(0);
    }
    to {
        opacity: 0;
        transform: translateX(100%);
    }
}

/* ===================================
   Home Page Styles (My Shows)
   =================================== */

.home-greeting {
    padding: 2rem 0 1rem;
}

#greeting-text {
    font-size: 2rem;
    font-weight: 800;
    margin-bottom: 0.25rem;
    background: linear-gradient(135deg, #fff, #9ca3af);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

#current-date {
    font-size: 1rem;
    color: var(--text-muted);
}

.home-hero-container {
    margin-bottom: 3rem;
    padding: 0;
}

.home-hero-carousel {
    position: relative;
    overflow: hidden;
    border-radius: 24px;
}

.home-hero-track {
    display: flex;
    transition: transform 0.45s ease;
    will-change: transform;
}

.home-hero-slide {
    flex: 0 0 100%;
    text-decoration: none;
    color: inherit;
}

.home-hero {
    position: relative;
    width: 100%;
    height: 420px;
    border-radius: 24px;
    overflow: hidden;
    cursor: pointer;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.home-hero:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.6);
}

.home-hero-backdrop {
    position: absolute;
    inset: 0;
    z-index: 0;
}

.home-hero-backdrop img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.home-hero-gradient {
    position: absolute;
    inset: 0;
    background: linear-gradient(to top, rgba(10, 10, 20, 0.9) 0%, rgba(10, 10, 20, 0.4) 50%, rgba(10, 10, 20, 0.1) 100%);
}

.home-hero-content {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    padding: 2.5rem;
    z-index: 1;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
}

.home-hero-title {
    font-size: clamp(2.1rem, 5vw, 3.4rem);
    font-weight: 800;
    margin-bottom: 0.5rem;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.8);
    max-width: 720px;
}

.home-hero-subtitle {
    font-size: 1.05rem;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 1.5rem;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.8);
    max-width: 720px;
}

.home-hero-kicker {
    display: inline-flex;
    align-items: center;
    width: fit-content;
    margin-bottom: 0.9rem;
    padding: 0.35rem 0.7rem;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.12);
    border: 1px solid rgba(255, 255, 255, 0.14);
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.home-hero-action {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 600;
    font-size: 1rem;
    padding: 0.75rem 1.5rem;
    background: var(--primary);
    color: white;
    border-radius: 12px;
    width: fit-content;
    box-shadow: 0 4px 15px rgba(139, 92, 246, 0.4);
    transition: background 0.2s ease;
}

.home-hero-action:hover {
    background: var(--primary-hover);
}

.home-hero-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 48px;
    height: 48px;
    border-radius: 999px;
    border: 1px solid rgba(255, 255, 255, 0.14);
    background: rgba(10, 10, 20, 0.58);
    color: #fff;
    cursor: pointer;
    z-index: 3;
    backdrop-filter: blur(18px);
}

.home-hero-nav.prev {
    left: 1.25rem;
}

.home-hero-nav.next {
    right: 1.25rem;
}

.home-hero-dots {
    position: absolute;
    left: 50%;
    bottom: 1.25rem;
    transform: translateX(-50%);
    display: flex;
    gap: 0.55rem;
    z-index: 3;
}

.home-hero-dot {
    width: 10px;
    height: 10px;
    border-radius: 999px;
    border: none;
    background: rgba(255, 255, 255, 0.35);
    cursor: pointer;
}

.home-hero-dot.active {
    background: #fff;
}

.discover-preview-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 1rem;
}

.discover-preview-card {
    cursor: pointer;
    transition: transform 0.25s ease;
}

.discover-preview-card:hover {
    transform: translateY(-4px);
}

.discover-preview-poster {
    position: relative;
    width: 100%;
    aspect-ratio: 2 / 3;
    overflow: hidden;
    border-radius: 18px;
    background: var(--bg-card);
}

.discover-preview-poster img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.discover-card-badge-slot {
    position: absolute;
    top: 8px;
    right: 8px;
    z-index: 2;
}

.discover-preview-info {
    margin-top: 0.75rem;
}

.discover-preview-title {
    font-size: 0.95rem;
    font-weight: 700;
    line-height: 1.35;
    margin-bottom: 0.25rem;
}

.discover-preview-meta {
    font-size: 0.78rem;
    color: var(--text-muted);
}

.category-rail-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1.25rem;
}

.category-rail-card {
    position: relative;
    min-height: 220px;
    border-radius: 24px;
    overflow: hidden;
    text-decoration: none;
    color: inherit;
    box-shadow: var(--shadow-elevated);
    transition: transform 0.25s ease;
}

.category-rail-card:hover {
    transform: translateY(-4px);
}

.category-rail-art {
    position: absolute;
    inset: 0;
}

.category-rail-art img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.category-rail-gradient {
    position: absolute;
    inset: 0;
    background: linear-gradient(to top, rgba(10, 10, 20, 0.92) 10%, rgba(10, 10, 20, 0.22) 55%);
}

.category-rail-copy {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    padding: 1.35rem;
    z-index: 1;
}

.category-rail-copy h3 {
    font-size: 1.4rem;
    font-weight: 800;
    margin: 0.2rem 0 0.45rem;
}

.category-rail-meta,
.category-rail-link {
    color: rgba(255, 255, 255, 0.78);
}

.category-rail-link {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    font-weight: 700;
}

.calendar-shell {
    display: grid;
    grid-template-columns: minmax(0, 1.55fr) minmax(320px, 0.95fr);
    gap: 1.5rem;
}

.calendar-main,
.calendar-sidebar {
    min-width: 0;
}

.calendar-sidebar {
    display: grid;
    gap: 1.5rem;
    align-content: start;
}

.calendar-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1rem;
}

.calendar-toolbar-title h3 {
    font-size: 1.4rem;
    font-weight: 800;
}

.calendar-weekdays,
.calendar-month-grid {
    display: grid;
    grid-template-columns: repeat(7, minmax(0, 1fr));
}

.calendar-weekdays {
    margin-bottom: 0.65rem;
    gap: 0.5rem;
}

.calendar-weekdays span {
    text-align: center;
    font-size: 0.78rem;
    font-weight: 700;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

.calendar-month-grid {
    gap: 0.5rem;
}

.calendar-day {
    min-height: 128px;
    padding: 0.75rem;
    border-radius: 16px;
    border: 1px solid rgba(255, 255, 255, 0.06);
    background: rgba(255, 255, 255, 0.03);
    color: inherit;
    cursor: pointer;
    text-align: left;
    transition: transform 0.2s ease, border-color 0.2s ease, background 0.2s ease;
}

.calendar-day:hover {
    transform: translateY(-2px);
    border-color: rgba(139, 92, 246, 0.32);
}

.calendar-day.outside {
    opacity: 0.45;
}

.calendar-day.selected {
    border-color: rgba(139, 92, 246, 0.7);
    background: rgba(139, 92, 246, 0.12);
}

.calendar-day.today .calendar-day-number {
    color: #fff;
}

.calendar-day-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 0.65rem;
}

.calendar-day-number {
    font-size: 1rem;
    font-weight: 700;
}

.calendar-day-count {
    min-width: 24px;
    height: 24px;
    border-radius: 999px;
    background: rgba(16, 185, 129, 0.18);
    color: var(--success);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.72rem;
    font-weight: 700;
}

.calendar-day-events {
    display: grid;
    gap: 0.35rem;
}

.calendar-day-pill {
    display: block;
    width: 100%;
    padding: 0.32rem 0.45rem;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-secondary);
    font-size: 0.72rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.calendar-agenda-list,
.calendar-upcoming-list {
    display: grid;
    gap: 0.8rem;
}

.calendar-agenda-item,
.calendar-upcoming-item {
    text-decoration: none;
    color: inherit;
    border: 1px solid rgba(255, 255, 255, 0.06);
    background: rgba(255, 255, 255, 0.03);
    border-radius: 14px;
    padding: 0.8rem;
}

.calendar-agenda-item {
    display: grid;
    grid-template-columns: 56px minmax(0, 1fr);
    gap: 0.75rem;
    align-items: center;
}

.calendar-agenda-item img {
    width: 56px;
    height: 84px;
    object-fit: cover;
    border-radius: 10px;
}

.calendar-agenda-copy,
.calendar-upcoming-item {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.calendar-agenda-copy span,
.calendar-upcoming-item span,
.calendar-agenda-copy small,
.calendar-upcoming-item small {
    color: var(--text-muted);
}

.calendar-feed-status {
    margin: 0.9rem 0 1rem;
    padding: 0.85rem 1rem;
    border-radius: 12px;
    background: rgba(139, 92, 246, 0.08);
    border: 1px solid rgba(139, 92, 246, 0.15);
    color: var(--text-secondary);
    line-height: 1.5;
}

.calendar-feed-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.75rem;
    margin-bottom: 0.75rem;
}

.calendar-empty-copy {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.95rem 0;
    color: var(--text-muted);
}

@media (max-width: 768px) {
    .section-link {
        width: 100%;
        justify-content: flex-start;
    }

    .home-hero {
        height: 300px;
    }

    .home-hero-content {
        padding: 1.5rem;
    }

    .home-hero-title {
        font-size: 1.75rem;
    }

    .home-hero-subtitle {
        font-size: 1rem;
        margin-bottom: 1rem;
    }

    .home-hero-nav {
        width: 40px;
        height: 40px;
    }

    .home-hero-nav.prev {
        left: 0.75rem;
    }

    .home-hero-nav.next {
        right: 0.75rem;
    }

    .home-metrics,
    .calendar-shell {
        grid-template-columns: 1fr;
    }

    .calendar-preview-header {
        flex-direction: column;
    }

    .calendar-preview-item {
        grid-template-columns: 1fr;
    }

    .discover-preview-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .category-rail-grid {
        grid-template-columns: 1fr;
    }

    .calendar-day {
        min-height: 112px;
    }

    .calendar-feed-actions {
        grid-template-columns: 1fr;
    }
}
