/* Fonts */
@font-face {
    font-family: 'SpaceGrotesk';
    src: url('../fonts/SpaceGrotesk-Regular.ttf') format('truetype');
    font-weight: 400;
    font-style: normal;
}

@font-face {
    font-family: 'SpaceGrotesk';
    src: url('../fonts/SpaceGrotesk-Bold.ttf') format('truetype');
    font-weight: 700;
    font-style: normal;
}

/* Theme — mapped from Pull.Mobile/Theme/AppTheme.cs */
:root {
    --bg: #121214;
    --bg-light: #1C1C1E;
    --surface: #2C2C2E;
    --primary: #44CCFF;
    --success: #1EFC1E;
    --danger: #F24236;
    --muted: #D3C1D2;
    --text-primary: #F5F5F7;
    --text-secondary: #A1A1A6;
    --text-muted: #636366;
    --border: #3A3A3C;
    --border-light: #48484A;
    --overlay-dark: rgba(18, 18, 20, 0.9);
    --overlay-medium: rgba(18, 18, 20, 0.7);
}

/* Reset & Base */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html, body {
    height: 100%;
    font-family: 'SpaceGrotesk', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background-color: var(--bg);
    color: var(--text-primary);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

#app {
    height: 100%;
}

/* Loading screen */
.loading-screen {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100vh;
    gap: 1rem;
}

.loading-screen h1 {
    font-size: 2rem;
    font-weight: 700;
}

.loading-screen p {
    color: var(--text-secondary);
}

/* Layout */
.page-shell {
    display: flex;
    flex-direction: column;
    height: 100vh;
    max-width: 1200px;
    margin: 0 auto;
}

.page-content {
    flex: 1;
    overflow-y: auto;
    padding: 16px 24px;
    position: relative;
    z-index: 1;
}

/* Header */
.header {
    display: flex;
    justify-content: center;
    align-items: flex-start;
    padding: 12px 24px 16px;
    position: relative;
    z-index: 100;
}

.header-center {
    text-align: center;
}

.header-center h1 {
    font-size: 2rem;
    font-weight: 700;
    margin: 0;
}

.header-center p {
    font-size: 0.875rem;
    color: var(--text-secondary);
    margin: 4px 0 0;
}

.header-user {
    position: absolute;
    right: 16px;
    top: 8px;
    text-align: right;
}

.header-user .username {
    font-size: 0.75rem;
    font-weight: 700;
    padding: 8px 8px 2px;
}

.header-user .sign-out {
    font-size: 0.75rem;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 0 8px 8px;
}

.header-user .sign-out:hover {
    color: var(--danger);
}

.header-user .sign-in-link {
    font-size: 0.8125rem;
    font-weight: 700;
    color: var(--primary);
    cursor: pointer;
    padding: 8px;
    text-decoration: none;
}

.header-user .sign-in-link:hover {
    color: var(--text-primary);
}

/* Auth-disabled controls for guests */
.auth-disabled {
    opacity: 0.4 !important;
    cursor: not-allowed !important;
}

/* Nav Menu (hamburger) */
.nav-menu {
    position: absolute;
    left: 12px;
    top: 10px;
    z-index: 1000;
}

.nav-menu-btn {
    background: none;
    border: 2px solid var(--border);
    border-radius: 8px;
    padding: 6px 10px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

.nav-menu-btn:hover {
    background: var(--border-light);
}

.nav-menu-icon {
    font-size: 1.25rem;
    color: var(--text-primary);
}

.nav-menu-backdrop {
    position: fixed;
    inset: 0;
    z-index: 999;
}

.nav-menu-dropdown {
    position: absolute;
    top: calc(100% + 6px);
    left: 0;
    background: var(--surface);
    border: 2px solid var(--border);
    border-radius: 12px;
    padding: 6px 0;
    min-width: 220px;
    z-index: 1000;
    box-shadow: 0 8px 24px rgba(0,0,0,0.4);
}

.nav-menu-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 20px;
    color: var(--text-primary);
    text-decoration: none;
    font-size: 1.375rem;
    font-weight: 700;
    transition: background-color 0.15s;
}

.nav-menu-item:hover {
    background: var(--border-light);
}

.nav-menu-item.active {
    background: var(--border-light);
}

.nav-menu-item .icon {
    font-size: 1.375rem;
    color: var(--primary);
}

.nav-menu-item .heart-icon {
    font-size: 1.25rem;
    color: var(--primary);
}

/* Week Cards */
.week-cards {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.week-card {
    position: relative;
    border-radius: 16px;
    border: 2px solid var(--border);
    height: 220px;
    overflow: hidden;
    cursor: pointer;
    transition: transform 0.15s;
}

.week-card:hover {
    transform: scale(1.02);
}

.week-card-bg {
    position: absolute;
    inset: 0;
    object-fit: cover;
    width: 100%;
    height: 100%;
    opacity: 0.6;
}

.week-card-info {
    position: absolute;
    bottom: 0;
    left: 0;
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.week-card-info .week-title {
    font-size: 1.375rem;
    font-weight: 700;
    color: white;
    text-shadow: 0 1px 4px rgba(0,0,0,0.6);
}

.week-card-info .foc-date {
    font-size: 0.9375rem;
    color: var(--muted);
    text-shadow: 0 1px 4px rgba(0,0,0,0.6);
}

/* Progress Overlay */
.week-card-progress {
    position: absolute;
    inset: 0;
    background: var(--overlay-dark);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 12px;
}

.progress-text {
    font-size: 2.25rem;
    font-weight: 700;
    color: var(--success);
    text-shadow: 0 0 12px rgba(30, 252, 30, 0.7);
}

.slime-bar-outer {
    width: 220px;
    height: 28px;
    border-radius: 12px;
    border: 3px solid #0A3D0A;
    background: #111D13;
    overflow: hidden;
    box-shadow: 0 0 10px rgba(30, 252, 30, 0.5);
    position: relative;
}

.slime-bar-fill {
    height: 100%;
    background: var(--success);
    border-radius: 10px;
    transition: width 0.3s ease;
}

.slime-bar-shine {
    position: absolute;
    top: 3px;
    left: 4px;
    right: 4px;
    height: 10px;
    background: linear-gradient(to bottom, rgba(255,255,255,0.25), transparent);
    border-radius: 6px;
}

.progress-label {
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--success);
    opacity: 0.7;
}

/* Cover image fallback */
.cover-placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg);
    color: var(--text-muted);
    font-size: 0.875rem;
    font-weight: 600;
    letter-spacing: 0.05em;
    text-align: center;
    width: 100%;
    height: 100%;
    min-height: 300px;
    border: 1px solid var(--border-light);
    border-radius: 8px;
}

/* Small thumbnail placeholders — fully override base dimensions */
.cover-placeholder.book-card-cover,
.cover-placeholder.pull-item-cover,
.cover-placeholder.rank-item-cover {
    width: 64px;
    height: 96px;
    min-width: 64px;
    min-height: 96px;
    font-size: 0.55rem;
    padding: 4px;
    background: var(--bg-light);
    border: 2px solid var(--border-light);
    border-radius: 6px;
}

.cover-placeholder.book-card-cover {
    width: 64px;
    height: 96px;
}

.cover-placeholder.pull-item-cover,
.cover-placeholder.rank-item-cover {
    width: 48px;
    height: 72px;
    min-width: 48px;
    min-height: 72px;
}

.cover-placeholder.rank-hero-cover {
    width: 120px;
    height: 180px;
    min-width: 120px;
    min-height: 180px;
    font-size: 0.75rem;
    padding: 8px;
    background: var(--bg-light);
    border: 2px solid var(--border-light);
    border-radius: 8px;
}

.cover-placeholder.comic-grid-cover {
    min-height: unset;
    font-size: 0.7rem;
    padding: 8px;
}

/* Auth pages */
.auth-page {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    padding: 2rem;
    position: relative;
}

.version-tag {
    position: fixed;
    bottom: 8px;
    right: 12px;
    font-size: 0.625rem;
    color: var(--text-muted);
    opacity: 0.4;
}

.auth-card {
    width: 100%;
    max-width: 360px;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.auth-card h1 {
    font-size: 2rem;
    font-weight: 700;
    text-align: center;
}

.auth-card p {
    color: var(--text-secondary);
    text-align: center;
    font-size: 0.875rem;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.form-group label {
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.form-group input {
    padding: 12px 16px;
    border-radius: 8px;
    border: 2px solid var(--border);
    background: var(--surface);
    color: var(--text-primary);
    font-family: inherit;
    font-size: 1rem;
    outline: none;
    transition: border-color 0.15s;
}

.form-group input:focus {
    border-color: var(--primary);
}

.btn-primary {
    padding: 12px 24px;
    border-radius: 8px;
    border: none;
    background: var(--primary);
    color: var(--bg);
    font-family: inherit;
    font-size: 1rem;
    font-weight: 700;
    cursor: pointer;
    transition: opacity 0.15s;
}

.btn-primary:hover {
    opacity: 0.9;
}

.btn-primary:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.error-message {
    color: var(--danger);
    font-size: 0.875rem;
    text-align: center;
}

.auth-link {
    color: var(--primary);
    cursor: pointer;
    text-decoration: none;
}

.auth-link:hover {
    text-decoration: underline;
}

/* Busy spinner */
.spinner-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    padding: 4rem 0;
}

.spinner {
    width: 48px;
    height: 48px;
    border: 4px solid var(--border);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Utility */
.text-secondary {
    color: var(--text-secondary);
}

.text-muted {
    color: var(--text-muted);
}

.text-center {
    text-align: center;
}

/* Blazor error UI */
#blazor-error-ui {
    background: var(--danger);
    color: white;
    padding: 0.5rem;
    text-align: center;
    position: fixed;
    bottom: 0;
    width: 100%;
    z-index: 1000;
}

#blazor-error-ui .reload {
    color: white;
    font-weight: bold;
}

/* =============================================
   Phase 2 — Filter, Swipe, Grid Styles
   ============================================= */

/* Back button */
.header-back {
    position: absolute;
    left: 16px;
    top: 12px;
    font-size: 0.875rem;
    font-weight: 700;
    color: var(--primary);
    cursor: pointer;
    padding: 4px 8px;
}

.header-back:hover {
    opacity: 0.8;
}

.content-back {
    font-size: 0.875rem;
    font-weight: 700;
    color: var(--primary);
    cursor: pointer;
    padding: 0 0 12px;
}

.content-back:hover {
    opacity: 0.8;
}

/* Filter Search */
.filter-search {
    margin-bottom: 16px;
    position: relative;
}

.filter-search-input {
    width: 100%;
    padding: 12px 40px 12px 16px;
    border-radius: 8px;
    border: 2px solid var(--border);
    background: var(--surface);
    color: var(--text-primary);
    font-family: inherit;
    font-size: 1rem;
    outline: none;
    transition: border-color 0.15s;
}

.filter-search-input:focus {
    border-color: var(--primary);
}

.filter-search-clear {
    position: absolute;
    right: 8px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 0.9rem;
    cursor: pointer;
    padding: 4px 8px;
    line-height: 1;
}

.filter-search-clear:hover {
    color: var(--text-primary);
}

/* Filter Cards Grid */
.filter-cards-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

@media (min-width: 640px) {
    .filter-cards-grid {
        grid-template-columns: 1fr 1fr 1fr;
        gap: 16px;
    }
}

@media (min-width: 960px) {
    .filter-cards-grid {
        grid-template-columns: 1fr 1fr 1fr 1fr;
        gap: 16px;
    }
}

/* Filter Card */
.filter-card {
    position: relative;
    border-radius: 12px;
    border: 2px solid var(--border);
    height: 160px;
    overflow: hidden;
    cursor: pointer;
    transition: transform 0.15s;
}

.filter-card:hover {
    transform: scale(1.03);
}

.filter-card--done {
    opacity: 0.5;
}

.filter-card-bg {
    position: absolute;
    inset: 0;
    object-fit: cover;
    width: 100%;
    height: 100%;
    opacity: 0.4;
}

.filter-card-bg-placeholder {
    position: absolute;
    inset: 0;
    background: var(--surface);
}

.filter-card-overlay {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
    background: var(--overlay-medium);
}

.filter-card-name {
    font-size: 1.125rem;
    font-weight: 700;
    color: white;
    text-shadow: 0 1px 4px rgba(0,0,0,0.5);
    text-align: center;
    padding: 0 8px;
}

.filter-card-count {
    font-size: 0.8125rem;
    font-weight: 700;
    color: var(--success);
}

/* Book List */
.book-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.book-card {
    display: flex;
    gap: 12px;
    padding: 12px;
    border-radius: 12px;
    border: 2px solid var(--border);
    background: var(--surface);
    cursor: pointer;
    transition: background-color 0.15s;
    position: relative;
    overflow: hidden;
}

.book-card-bg {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    filter: blur(20px) brightness(0.25);
    transform: scale(1.3);
    z-index: 0;
}

.book-card-left {
    position: relative;
    z-index: 1;
}

.book-card:hover {
    border-color: var(--border-light);
}

.book-card-cover {
    width: 64px;
    height: 96px;
    border-radius: 6px;
    object-fit: cover;
    flex-shrink: 0;
}

.book-card-info {
    display: flex;
    flex-direction: column;
    gap: 4px;
    justify-content: center;
    min-width: 0;
    position: relative;
    z-index: 1;
}

.book-card-title {
    font-size: 0.9375rem;
    font-weight: 700;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.book-card-variants {
    font-size: 0.75rem;
    color: var(--text-secondary);
}

.book-card-stats {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.book-stat {
    font-size: 0.6875rem;
    font-weight: 700;
    padding: 2px 6px;
    border-radius: 4px;
}

.book-stat.unswiped {
    background: var(--border);
    color: var(--text-secondary);
}

.book-stat.pulled {
    background: rgba(30, 252, 30, 0.15);
    color: var(--success);
}

.book-stat.liked {
    background: rgba(242, 66, 54, 0.15);
    color: var(--danger);
}

/* Week Detail Header */
.week-detail-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 24px;
    position: relative;
    z-index: 10;
}

.week-detail-header-center {
    text-align: center;
    flex: 1;
}

.week-detail-counter {
    font-size: 0.875rem;
    font-weight: 700;
}

.week-detail-pulls {
    font-size: 0.75rem;
    color: var(--success);
    margin-left: 8px;
}

.view-toggle {
    font-size: 1.25rem;
    cursor: pointer;
    padding: 4px 8px;
    opacity: 0.7;
    transition: opacity 0.15s;
}

.view-toggle:hover {
    opacity: 1;
}

.header-right-actions {
    position: absolute;
    right: 24px;
    top: 12px;
    display: flex;
    align-items: center;
    gap: 4px;
}

.share-btn {
    font-size: 1rem;
    cursor: pointer;
    padding: 4px 8px;
    opacity: 0.7;
    transition: opacity 0.15s, color 0.15s;
    user-select: none;
}
.share-btn:hover { opacity: 1; }
.share-btn--copied {
    opacity: 1;
    color: #1EFC1E;
    font-size: 0.75rem;
    font-weight: 700;
}

/* Tooltip on hover for header action buttons */
.header-right-actions .view-toggle {
    position: relative;
}

.header-right-actions .view-toggle::after {
    content: attr(title);
    position: absolute;
    top: 100%;
    right: 0;
    margin-top: 4px;
    padding: 4px 8px;
    background: var(--surface);
    color: var(--text-secondary);
    font-size: 0.7rem;
    white-space: nowrap;
    border-radius: 4px;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.15s;
}

.header-right-actions .view-toggle:hover::after {
    opacity: 1;
}

/* Floating close button — top-right overlay */
.floating-close-btn {
    position: fixed;
    top: 16px;
    right: 16px;
    z-index: 100;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: none;
    background: rgba(0, 0, 0, 0.6);
    color: var(--text-primary);
    font-size: 1.125rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.15s;
    backdrop-filter: blur(8px);
}

.floating-close-btn:hover {
    background: rgba(0, 0, 0, 0.85);
}

/* Blurred Cover Background */
.card-view-bg {
    position: absolute;
    inset: 0;
    overflow: hidden;
    z-index: 0;
}

.card-view-bg-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    filter: blur(40px) brightness(0.3);
    transform: scale(1.2);
}

/* Shared hover-driven blurred page background */
.page-blur-bg {
    position: fixed;
    inset: 0;
    overflow: hidden;
    z-index: 0;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.3s;
}

.page-blur-bg--visible {
    opacity: 1;
}

.page-blur-bg img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    filter: blur(40px);
    transform: scale(1.2);
}

/* Card View Content — arrows + card + info */
.card-view-content {
    display: flex;
    align-items: stretch;
    flex: 1;
    position: relative;
    z-index: 1;
    overflow-y: auto;
    padding: 0 0 16px;
}

/* Nav arrows beside the cover */
.card-nav-arrow {
    width: 48px;
    flex-shrink: 0;
    border: none;
    background: transparent;
    color: var(--text-primary);
    font-size: 1.25rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0.6;
    transition: opacity 0.15s;
}

.card-nav-arrow:hover:not(:disabled) {
    opacity: 1;
}

.card-nav-arrow:disabled {
    opacity: 0.15;
    cursor: not-allowed;
}

/* Center row: card left + info right */
.card-view-center {
    flex: 1;
    display: flex;
    flex-direction: row;
    align-items: flex-start;
    min-width: 0;
    gap: 20px;
}

/* Swipe Card */
.swipe-area {
    flex-shrink: 0;
    width: 530px;
    display: flex;
    flex-direction: column;
    align-items: center;
    position: relative;
}

.pulled-badge {
    position: absolute;
    bottom: 10px;
    left: 10px;
    background: var(--success);
    color: #000;
    font-size: 0.625rem;
    font-weight: 800;
    letter-spacing: 0.06em;
    padding: 3px 8px;
    border-radius: 4px;
    z-index: 2;
    pointer-events: none;
}

.swipe-card-container {
    width: 100%;
    aspect-ratio: 2/3;
    position: relative;
}

.swipe-card {
    position: absolute;
    inset: 0;
    border-radius: 0;
    border: none;
    overflow: hidden;
    cursor: grab;
    user-select: none;
    touch-action: none;
    will-change: transform;
    background: transparent;
}

.swipe-card:active {
    cursor: grabbing;
}

.swipe-card--pull-glow {
    box-shadow: 0 0 24px rgba(30, 252, 30, 0.4);
    border-color: var(--success);
}

.swipe-card--fling-glow {
    box-shadow: 0 0 24px rgba(242, 66, 54, 0.4);
    border-color: var(--danger);
}

.swipe-card--pull-exit {
    opacity: 0;
}

.swipe-card--fling-exit {
    opacity: 0;
}

.swipe-card-cover {
    width: 100%;
    height: 100%;
    object-fit: contain;
    cursor: pointer;
}

.swipe-card-ratio {
    font-size: 0.6875rem;
    font-weight: 700;
    color: var(--bg);
    background: var(--danger);
    padding: 1px 6px;
    border-radius: 4px;
}

/* Card Info Panel (right of card) */
.card-info-panel {
    flex: 1;
    min-width: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 14px;
    overflow-y: auto;
}

.card-info-title-wrap {
    height: 3.6rem;
    overflow: hidden;
}

.card-info-title {
    font-size: 1.25rem;
    font-weight: 700;
    line-height: 1.4;
    color: var(--text-primary);
    background: transparent;
    padding: 2px 8px;
    border-radius: 4px;
    display: inline;
    box-decoration-break: clone;
    -webkit-box-decoration-break: clone;
}

.card-info-title--pulled {
    color: #000;
    background: var(--success);
}

.card-info-row {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.card-info-publisher {
    font-size: 0.9375rem;
    color: var(--text-secondary);
}

.card-info-price {
    font-size: 0.9375rem;
    font-weight: 700;
    color: var(--primary);
}

/* Creator Credits */
.card-info-credits {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.card-info-credit {
    font-size: 0.9375rem;
    color: var(--text-secondary);
    line-height: 1.5;
}

.credit-label {
    font-weight: 700;
    color: var(--text-muted);
    margin-right: 6px;
    text-transform: uppercase;
    font-size: 0.75rem;
}

/* Solicitation Text — always visible */
.solicit-text {
    width: 100%;
}

.solicit-text--visible {
    max-height: 200px;
    overflow-y: auto;
}

.solicit-text p {
    font-size: 0.9375rem;
    color: var(--text-secondary);
    line-height: 1.6;
    padding: 4px 0;
}

/* Action Bar — - | PULL/REMOVE | + */
.action-bar {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 4px 0;
}

.like-btn {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2.25rem;
    cursor: pointer;
    color: var(--text-muted);
    transition: color 0.15s;
}

.like-btn:hover {
    color: var(--danger);
}

.like-btn--active {
    color: var(--danger);
}

.btn-pull {
    padding: 12px 30px;
    border-radius: 8px;
    border: 2px solid var(--success);
    background: transparent;
    color: var(--success);
    font-family: inherit;
    font-size: 1.09rem;
    font-weight: 700;
    cursor: pointer;
    transition: background-color 0.15s, color 0.15s;
}

.btn-pull:hover {
    background: rgba(30, 252, 30, 0.15);
}

.btn-pull--active {
    background: var(--success);
    color: var(--bg);
}

.btn-pull--active:hover {
    background: rgba(30, 252, 30, 0.8);
}

.btn-pull--locked {
    cursor: default;
    pointer-events: none;
}

.action-remove {
    font-size: 0.75rem;
    color: var(--text-muted);
    cursor: pointer;
    text-align: center;
    margin-top: 6px;
    transition: color 0.15s;
}

.action-remove:hover {
    color: var(--danger);
}

/* Mobile card view */
@media (max-width: 640px) {
    .card-view-bg {
        position: fixed;
    }

    .card-view-center {
        flex-direction: column;
        align-items: center;
    }

    .swipe-area {
        width: 60%;
    }

    .card-nav-arrow {
        display: none;
    }

    .card-info-panel {
        padding: 0 12px;
    }

    .mobile-swipe-nav {
        cursor: grab;
        user-select: none;
        border-bottom: 2px solid var(--border-light);
        padding-bottom: 8px;
    }
}

.qty-btn {
    width: 36px;
    height: 36px;
    border-radius: 8px;
    border: 2px solid var(--border);
    background: var(--surface);
    color: var(--text-primary);
    font-size: 1.125rem;
    font-weight: 700;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.15s;
}

.qty-btn:hover:not(:disabled) {
    background: var(--border-light);
}

.qty-btn:disabled {
    opacity: 0.3;
    cursor: not-allowed;
}

/* Lightbox Overlay */
.lightbox-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.92);
    z-index: 999;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}

.lightbox-img {
    max-width: 95vw;
    height: 100vh;
    object-fit: contain;
}

/* Week Progress Bar */
.week-progress-bar {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: var(--border);
    z-index: 20;
}

.week-progress-fill {
    height: 100%;
    background: var(--success);
    transition: width 0.3s ease;
}

/* Comic Grid */
.comic-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
}

@media (min-width: 640px) {
    .comic-grid {
        grid-template-columns: repeat(4, 1fr);
        gap: 12px;
    }
}

@media (min-width: 960px) {
    .comic-grid {
        grid-template-columns: repeat(5, 1fr);
        gap: 12px;
    }
}

.comic-grid-item {
    position: relative;
    aspect-ratio: 2/3;
    border-radius: 8px;
    overflow: hidden;
    cursor: pointer;
    border: 2px solid var(--border);
    transition: transform 0.15s;
}

.comic-grid-item:hover {
    transform: scale(1.03);
}

.comic-grid-item--pulled {
    border-color: var(--success);
}

.comic-grid-cover {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.comic-grid-badge {
    position: absolute;
    bottom: 6px;
    right: 6px;
    background: var(--success);
    color: var(--bg);
    font-size: 0.75rem;
    font-weight: 700;
    padding: 3px 8px;
    border-radius: 4px;
}

.comic-grid-heart {
    position: absolute;
    bottom: 6px;
    left: 6px;
    color: var(--danger);
    font-size: 1.25rem;
    text-shadow: 0 1px 3px rgba(0,0,0,0.6);
}

.comic-grid-loadmore {
    text-align: center;
    padding: 16px 0;
}

.btn-secondary {
    padding: 10px 20px;
    border-radius: 8px;
    border: 2px solid var(--border);
    background: var(--surface);
    color: var(--text-primary);
    font-family: inherit;
    font-size: 0.875rem;
    font-weight: 700;
    cursor: pointer;
    transition: background-color 0.15s;
}

.btn-secondary:hover {
    background: var(--border-light);
}

/* =============================================
   Phase 3 — My Pulls, My Likes, Rankings
   ============================================= */

/* Week Selector (shared) */
.week-selector {
    margin-bottom: 16px;
}

.week-select {
    width: 100%;
    padding: 10px 16px;
    border-radius: 8px;
    border: 2px solid var(--border);
    background: var(--surface);
    color: var(--text-primary);
    font-family: inherit;
    font-size: 0.875rem;
    font-weight: 700;
    outline: none;
    cursor: pointer;
}

.week-select:focus {
    border-color: var(--primary);
}

/* ---- My Pulls ---- */
.pulls-stats {
    display: flex;
    gap: 24px;
    margin-bottom: 16px;
    padding: 12px 0;
    border-bottom: 1px solid var(--border);
}

.pulls-stat {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.pulls-stat-value {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary);
}

.pulls-stat-label {
    font-size: 0.75rem;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.pull-group-header {
    font-size: 0.6875rem;
    font-weight: 700;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    padding: 16px 0 8px;
    border-bottom: 1px solid var(--border);
    margin-bottom: 8px;
}

.pull-item {
    display: flex;
    gap: 12px;
    padding: 10px 0;
    border-bottom: 1px solid var(--border);
    align-items: center;
}

.pull-item-cover-wrap {
    flex-shrink: 0;
    cursor: pointer;
    border-radius: 4px;
    transition: transform 0.15s;
}

.pull-item-cover-wrap:hover {
    transform: scale(1.08);
}

.pull-item-cover {
    width: 48px;
    height: 72px;
    border-radius: 4px;
    object-fit: cover;
    flex-shrink: 0;
    display: block;
}

.pull-item-info {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.pull-item-title {
    font-size: 0.875rem;
    font-weight: 700;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.pull-item-meta {
    display: flex;
    gap: 8px;
    font-size: 0.75rem;
    color: var(--text-secondary);
}

.pull-item-code {
    font-family: monospace;
    color: var(--text-muted);
}

.pull-item-qty {
    display: flex;
    align-items: center;
    gap: 6px;
}

.pull-item-qty-value {
    font-size: 0.875rem;
    font-weight: 700;
    min-width: 28px;
    text-align: center;
}

.pull-item-remove {
    width: 28px;
    height: 28px;
    border-radius: 6px;
    border: 1px solid var(--border);
    background: transparent;
    color: var(--danger);
    font-size: 0.75rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-left: 8px;
    transition: background-color 0.15s;
}

.pull-item-remove:hover {
    background: rgba(242, 66, 54, 0.15);
}

/* ---- My Likes (extends .comic-grid) ---- */
.like-grid-title {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 4px 6px;
    font-size: 0.625rem;
    font-weight: 700;
    color: white;
    background: linear-gradient(transparent, rgba(0,0,0,0.8));
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* ---- Rankings ---- */
.rankings-controls {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 16px;
}

@media (min-width: 640px) {
    .rankings-controls {
        flex-direction: row;
        align-items: center;
        justify-content: space-between;
    }

    .rankings-controls .week-selector {
        margin-bottom: 0;
        width: 220px;
    }
}

.rankings-type-toggle {
    display: flex;
    gap: 4px;
    background: var(--surface);
    border-radius: 8px;
    padding: 4px;
    border: 2px solid var(--border);
}

.rankings-type-btn {
    padding: 8px 14px;
    border-radius: 6px;
    border: none;
    background: transparent;
    color: var(--text-secondary);
    font-family: inherit;
    font-size: 0.8125rem;
    font-weight: 700;
    cursor: pointer;
    transition: background-color 0.15s, color 0.15s;
}

.rankings-type-btn.active {
    background: var(--primary);
    color: var(--bg);
}

.rankings-type-btn:hover:not(.active) {
    color: var(--text-primary);
}

.rank-hero {
    display: flex;
    gap: 20px;
    padding: 20px;
    border-radius: 16px;
    border: 2px solid var(--primary);
    background: var(--surface);
    margin-bottom: 16px;
    align-items: center;
}

.rank-hero-cover {
    width: 120px;
    height: 180px;
    border-radius: 8px;
    object-fit: cover;
    flex-shrink: 0;
}

.rank-hero-info {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.rank-hero-title {
    font-size: 1.25rem;
    font-weight: 700;
}

.rank-hero-publisher {
    font-size: 0.875rem;
    color: var(--text-secondary);
}

.rank-hero-stats {
    display: flex;
    gap: 12px;
}

.rank-badge {
    font-size: 0.875rem;
    font-weight: 700;
    color: var(--text-secondary);
    min-width: 36px;
    text-align: center;
    flex-shrink: 0;
}

.rank-badge--gold {
    font-size: 1.5rem;
    color: var(--primary);
}

.rank-list {
    display: flex;
    flex-direction: column;
}

.rank-item {
    display: flex;
    gap: 12px;
    padding: 10px 0;
    border-bottom: 1px solid var(--border);
    align-items: center;
}

.rank-item-cover {
    width: 48px;
    height: 72px;
    border-radius: 4px;
    object-fit: cover;
    flex-shrink: 0;
}

.rank-item-info {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.rank-item-title {
    font-size: 0.875rem;
    font-weight: 700;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.rank-item-publisher {
    font-size: 0.75rem;
    color: var(--text-secondary);
}

.rank-item-counts {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 2px;
    flex-shrink: 0;
}

.rank-stat-pulls {
    font-size: 0.6875rem;
    font-weight: 700;
    color: var(--success);
}

.rank-stat-likes {
    font-size: 0.6875rem;
    font-weight: 700;
    color: var(--danger);
}

/* ---- Pull Grid (4-wide) ---- */
.pull-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 8px;
}

.pull-grid-item {
    position: relative;
    aspect-ratio: 2/3;
    border-radius: 8px;
    overflow: hidden;
    cursor: pointer;
    border: 2px solid var(--border);
    transition: transform 0.15s;
}

.pull-grid-item:hover {
    transform: scale(1.03);
}

.pull-grid-qty {
    position: absolute;
    bottom: 6px;
    right: 6px;
    background: var(--success);
    color: var(--bg);
    font-size: 0.8rem;
    font-weight: 700;
    padding: 3px 8px;
    border-radius: 4px;
}

/* Pull Lightbox */
.pull-lightbox {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
    max-width: 90vw;
}

.pull-lightbox-cover {
    max-width: 85vw;
    max-height: 75vh;
    object-fit: contain;
    border-radius: 8px;
}

.pull-lightbox-info {
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
}

.pull-lightbox-title {
    font-size: 1rem;
    font-weight: 700;
}

.pull-lightbox-meta {
    display: flex;
    gap: 10px;
    font-size: 0.875rem;
    color: var(--text-secondary);
}

/* ---- Like Remove Button (X overlay) ---- */
.like-remove-btn {
    position: absolute;
    top: 6px;
    right: 6px;
    z-index: 3;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    border: none;
    background: rgba(0, 0, 0, 0.7);
    color: var(--text-primary);
    font-size: 0.625rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.15s;
}

.pull-grid-item:hover .like-remove-btn {
    opacity: 1;
}

.like-remove-btn:hover {
    background: var(--danger);
}

.like-grid-clickable {
    width: 100%;
    height: 100%;
    cursor: pointer;
}

/* ---- Rank Blurred Backgrounds ---- */
.rank-hero {
    position: relative;
    overflow: hidden;
}

.rank-hero-bg {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    filter: blur(15px) brightness(0.25);
    transform: scale(1.3);
    z-index: 0;
}

.rank-hero-cover {
    position: relative;
    z-index: 1;
}

.rank-hero-info {
    position: relative;
    z-index: 1;
}

.rank-item {
    position: relative;
    overflow: hidden;
}

.rank-item-bg {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    filter: blur(15px) brightness(0.25);
    transform: scale(1.3);
    z-index: 0;
}

.rank-badge {
    position: relative;
    z-index: 1;
}

.rank-item-cover {
    position: relative;
    z-index: 1;
}

.rank-item-info {
    position: relative;
    z-index: 1;
}

.rank-item-counts {
    position: relative;
    z-index: 1;
}

/* ============================================
   PIPELINE STATUS PAGE
   ============================================ */

.pipeline-summary {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.pipeline-stat {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 1rem;
    text-align: center;
}

.pipeline-stat-label {
    font-size: 0.75rem;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 0.25rem;
}

.pipeline-stat-value {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text-primary);
}

.pipeline-badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 6px;
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.05em;
}

.pipeline-badge--ok {
    background: rgba(52, 199, 89, 0.2);
    color: #34c759;
}

.pipeline-badge--error {
    background: rgba(255, 69, 58, 0.2);
    color: #ff453a;
}

.pipeline-badge--unknown {
    background: rgba(142, 142, 147, 0.2);
    color: var(--text-secondary);
}

.pipeline-badge--warn {
    background: rgba(255, 204, 0, 0.2);
    color: #ffcc00;
}

.pipeline-error {
    background: rgba(255, 69, 58, 0.1);
    border: 1px solid rgba(255, 69, 58, 0.3);
    border-radius: 8px;
    padding: 0.75rem 1rem;
    color: #ff453a;
    font-size: 0.8125rem;
    margin-bottom: 1.5rem;
}

.pipeline-warning {
    background: rgba(255, 204, 0, 0.1);
    border: 1px solid rgba(255, 204, 0, 0.3);
    border-radius: 8px;
    padding: 0.75rem 1rem;
    color: #ffcc00;
    font-size: 0.8125rem;
    margin-bottom: 1.5rem;
}

.pipeline-upload {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 1.25rem;
    margin-bottom: 1.5rem;
}

.pipeline-upload h2 {
    font-size: 1rem;
    font-weight: 700;
    margin: 0 0 0.25rem;
}

.pipeline-upload p {
    margin: 0 0 0.75rem;
}

.pipeline-upload ::deep input[type="file"] {
    color: var(--text-primary);
    font-size: 0.875rem;
}

.pipeline-upload-success {
    margin-top: 0.5rem;
    padding: 0.5rem 0.75rem;
    background: rgba(52, 199, 89, 0.1);
    border-radius: 6px;
    color: #34c759;
    font-size: 0.8125rem;
}

.pipeline-upload-error {
    margin-top: 0.5rem;
    padding: 0.5rem 0.75rem;
    background: rgba(255, 69, 58, 0.1);
    border-radius: 6px;
    color: #ff453a;
    font-size: 0.8125rem;
}

.pipeline-logs {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.pipeline-log {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 0.75rem 1rem;
}

.pipeline-log--error {
    border-color: rgba(255, 69, 58, 0.3);
}

.pipeline-log--warning {
    border-color: rgba(255, 204, 0, 0.3);
}

.pipeline-log-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.pipeline-log-phase {
    font-weight: 700;
    font-size: 0.8125rem;
    color: var(--text-primary);
}

.pipeline-log-dist {
    font-size: 0.75rem;
    color: var(--primary);
    font-weight: 600;
}

.pipeline-log-time {
    font-size: 0.75rem;
    color: var(--text-secondary);
    margin-left: auto;
}

.pipeline-log-stats {
    font-size: 0.75rem;
    color: var(--text-secondary);
    margin-top: 0.25rem;
}

.pipeline-log-file {
    font-size: 0.6875rem;
    color: var(--text-secondary);
    font-family: monospace;
    margin-top: 0.25rem;
}

.pipeline-log-error {
    font-size: 0.75rem;
    color: #ff453a;
    margin-top: 0.25rem;
}

.pipeline-log-warn {
    font-size: 0.75rem;
    color: #ffcc00;
    margin-top: 0.25rem;
}

@media (max-width: 600px) {
    .pipeline-summary {
        grid-template-columns: repeat(2, 1fr);
    }
}
