:root {
    --bg: #f7f4ee;
    --bg-accent: #efe6d8;
    --bg-accent-2: #e8eef8;
    --surface: #fffdfa;
    --surface-soft: #f6f1e8;
    --surface-strong: #fffdfa;
    --text: #171e28;
    --muted: #636d7a;
    --accent: #1f3558;
    --accent-strong: #162a46;
    --premium: #9d7b49;
    --premium-soft: #c8ab7a;
    --border: #e1d9cc;
    --border-strong: #c8b797;
    --shadow: 0 18px 38px rgba(14, 24, 39, 0.09);
    --shadow-soft: 0 10px 22px rgba(14, 24, 39, 0.06);
    --shine: rgba(255, 255, 255, 0.52);
}

* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    min-height: 100vh;
    font-family: "Manrope", "Nunito Sans", "Trebuchet MS", sans-serif;
    color: var(--text);
    background:
        radial-gradient(1120px 450px at -6% -15%, var(--bg-accent) 0%, transparent 62%),
        radial-gradient(920px 360px at 100% -15%, var(--bg-accent-2) 0%, transparent 58%),
        var(--bg);
}

.page-wrap {
    width: min(1240px, 94vw);
    margin: 1rem auto 2.75rem;
    position: relative;
    animation: none;
}

.topbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1.25rem;
    margin-bottom: 0.95rem;
}

.topbar > div:first-child {
    flex: 1 1 360px;
    min-width: 0;
}

.logo {
    text-decoration: none;
    color: var(--text);
    font-family: "Fraunces", "Georgia", serif;
    font-size: clamp(1.4rem, 2vw, 1.95rem);
    font-weight: 700;
    letter-spacing: 0;
}

.subtitle {
    margin: 0.34rem 0 0;
    color: var(--muted);
    font-size: 0.94rem;
}

.topbar-side {
    display: flex;
    flex: 0 0 auto;
    flex-wrap: nowrap;
    align-items: center;
    justify-content: flex-end;
    gap: 0.55rem;
    white-space: nowrap;
}

.top-pill {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--border);
    background: linear-gradient(180deg, #fffefc 0%, #fbf7f0 100%);
    border-radius: 999px;
    padding: 0.34rem 0.78rem;
    min-height: 42px;
    font-size: 0.8rem;
    font-weight: 600;
    line-height: 1.1;
    text-align: center;
    box-shadow: var(--shadow-soft);
}

.top-pill-muted {
    color: var(--muted);
    background: var(--surface-soft);
}

.panel {
    background: rgba(255, 253, 250, 0.94);
    border: 1px solid var(--border);
    border-radius: 16px;
    box-shadow: var(--shadow);
}

.catalog-hero {
    margin-bottom: 0.85rem;
    padding: 1.05rem 1.25rem;
    border-top: 0;
    border-left: 3px solid var(--premium);
    display: grid;
    grid-template-columns: minmax(17rem, 0.58fr) minmax(30rem, 1.42fr);
    gap: 1.35rem;
    align-items: center;
}

.catalog-hero h1 {
    margin: 0;
    font-family: "Fraunces", "Georgia", serif;
    font-size: clamp(1.45rem, 1.7vw, 2.1rem);
    line-height: 1.08;
    letter-spacing: -0.025em;
    color: var(--accent-strong);
}

.catalog-hero p {
    margin: 0;
    max-width: 74ch;
    color: var(--muted);
    font-size: 0.88rem;
    line-height: 1.48;
}

.search-panel {
    position: static;
    top: auto;
    z-index: 20;
    padding: 0.85rem;
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    border-top: 2px solid #d8c8ad;
}

.search-form {
    display: flex;
    flex-direction: column;
    gap: 0.58rem;
}

.search-main-row {
    display: grid;
    grid-template-columns: minmax(240px, 1fr) minmax(160px, 220px) auto;
    gap: 0.58rem;
}

.search-input-wrap {
    position: relative;
}

.sort-option-row {
    width: min(520px, 100%);
}

.list-toolbar {
    margin-top: 0.7rem;
    display: flex;
    justify-content: flex-end;
}

.sort-inline-form {
    display: flex;
    align-items: center;
    gap: 0.44rem;
}

.sort-inline-form select {
    width: 220px;
    min-height: 38px;
    padding: 0.4rem 0.62rem;
    padding-right: 2rem;
    font-size: 0.84rem;
    font-weight: 600;
    letter-spacing: 0;
    border-radius: 10px;
    border: 1px solid var(--border);
    color: var(--text) !important;
    -webkit-appearance: none;
    appearance: none;
    background-image:
        linear-gradient(45deg, transparent 50%, #6e7786 50%),
        linear-gradient(135deg, #6e7786 50%, transparent 50%),
        linear-gradient(180deg, var(--surface) 0%, var(--surface) 100%) !important;
    background-position:
        calc(100% - 15px) calc(50% - 2px),
        calc(100% - 10px) calc(50% - 2px),
        0 0;
    background-size: 5px 5px, 5px 5px, 100% 100%;
    background-repeat: no-repeat;
    background-color: var(--surface) !important;
    box-shadow: var(--shadow-soft);
}

.sort-submit {
    width: auto;
    min-height: 38px;
    padding: 0.4rem 0.62rem;
}

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    border: 0;
}

.admin-only {
    display: none !important;
}

input[type="search"],
select,
button,
.ghost-button {
    width: 100%;
    font: inherit;
    border-radius: 12px;
    border: 1px solid var(--border);
    background: var(--surface);
    color: var(--text);
    min-height: 46px;
    padding: 0.68rem 0.76rem;
}

input[type="search"] {
    padding-right: 2.35rem;
}

.key-hint {
    position: absolute;
    top: 50%;
    right: 0.55rem;
    transform: translateY(-50%);
    border: 1px solid var(--border);
    border-radius: 7px;
    background: var(--surface-soft);
    color: var(--muted);
    min-width: 1.5rem;
    text-align: center;
    font-size: 0.76rem;
    line-height: 1.45;
    padding: 0.05rem 0.25rem;
}

input[type="search"]:focus,
select:focus,
button:focus,
.ghost-button:focus {
    outline: none;
    border-color: #415c85;
    box-shadow: 0 0 0 3px rgba(31, 53, 88, 0.22);
}

button {
    border-color: transparent;
    background: linear-gradient(135deg, #2f4f80 0%, var(--accent) 100%);
    color: #ffffff;
    font-weight: 700;
    cursor: pointer;
    box-shadow: 0 10px 20px rgba(22, 42, 70, 0.2);
}

button:hover {
    background: linear-gradient(135deg, #294775 0%, var(--accent-strong) 100%);
}

.search-actions {
    display: flex;
    gap: 0.52rem;
}

.ghost-button {
    text-decoration: none;
    color: var(--muted);
    background: linear-gradient(180deg, #fffefc 0%, #f7f1e8 100%);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
}

.ghost-button:hover {
    color: var(--text);
    border-color: #c8b797;
}

.stats-row {
    margin-top: 0.7rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 0.6rem;
    color: var(--muted);
    font-size: 0.9rem;
}

.stats-row strong {
    color: var(--text);
}

.site-friends-panel {
    margin-top: 0.78rem;
    padding: 0.75rem 1rem;
    border: 1px solid var(--border);
    border-radius: 14px;
    background: linear-gradient(180deg, var(--surface-soft) 0%, var(--surface) 100%);
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.58rem;
    box-shadow: var(--shadow-soft);
}

.site-friends-label {
    color: var(--text);
    font-weight: 800;
}

.site-friends-link,
.site-friends-link:visited {
    color: var(--accent-strong);
    font-weight: 700;
    text-decoration: none;
}

.site-friends-link:hover {
    color: var(--accent);
    text-decoration: underline;
    text-underline-offset: 3px;
}

.movie-grid {
    margin-top: 1rem;
    display: grid;
    gap: 0.88rem;
    grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
}

.movie-card {
    display: block;
    overflow: hidden;
    text-decoration: none;
    color: inherit;
    background: linear-gradient(180deg, #fffefb 0%, #fffaf2 100%);
    border: 1px solid var(--border);
    border-radius: 14px;
    box-shadow: var(--shadow-soft);
    transition: transform 0.16s ease, box-shadow 0.16s ease, border-color 0.16s ease;
    animation: none;
    content-visibility: auto;
    contain-intrinsic-size: 310px;
}

.movie-card:hover {
    transform: translateY(-2px);
    border-color: #c8b797;
    box-shadow: 0 18px 34px rgba(20, 32, 52, 0.15);
}

.poster-wrap {
    aspect-ratio: 16 / 9;
    background: linear-gradient(140deg, #ebf0f8 0%, #f5f7fc 100%);
}

.poster-wrap img,
.detail-poster img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.poster-wrap img.deferred-media {
    opacity: 0;
    transition: opacity 0.18s ease;
}

.poster-wrap img.deferred-media.is-ready {
    opacity: 1;
}

.movie-card:hover .poster-wrap img {
    transform: scale(1.03);
    transition: transform 0.28s ease;
}

.movie-meta {
    padding: 0.62rem 0.7rem 0.72rem;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.28rem;
}

.movie-meta h3 {
    margin: 0;
    font-size: 0.93rem;
    line-height: 1.3;
    min-height: 2.4em;
    font-weight: 700;
    letter-spacing: 0.01em;
    width: 100%;
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
    overflow: hidden;
}

.movie-date {
    margin: 0;
    width: 100%;
    color: var(--muted);
    font-size: 0.79rem;
    font-style: italic;
    line-height: 1.2;
}

.pagination {
    margin-top: 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.55rem;
}

.pagination-link,
.pagination .disabled,
.current-page {
    border: 1px solid var(--border);
    border-radius: 12px;
    background: var(--surface);
    padding: 0.5rem 0.78rem;
    font-size: 0.9rem;
}

.pagination-link {
    color: var(--accent-strong);
    text-decoration: none;
    font-weight: 700;
}

.pagination-link:hover {
    border-color: #c8b797;
}

.pagination .disabled,
.current-page {
    color: var(--muted);
}

.is-hidden {
    display: none !important;
}

.infinite-sentinel {
    width: 100%;
    height: 1px;
    margin-top: 0.5rem;
}

.infinite-loader,
.infinite-end {
    margin: 0.7rem 0 0;
    text-align: center;
    color: var(--muted);
    font-size: 0.9rem;
}

.empty-state {
    margin-top: 1rem;
    padding: 1.7rem 1.2rem;
    text-align: center;
}

.empty-state h2 {
    margin: 0;
    font-family: "Fraunces", "Georgia", serif;
}

.empty-state p {
    margin: 0.52rem 0 0;
    color: var(--muted);
}

.back-nav {
    width: auto;
    min-width: 170px;
}

.detail-layout {
    display: grid;
    grid-template-columns: minmax(420px, 1.45fr) minmax(280px, 1fr);
    gap: 1.05rem;
    padding: 1rem;
    align-items: start;
}

.detail-poster {
    width: 100%;
    aspect-ratio: 16 / 9;
    border: 1px solid var(--border);
    border-radius: 14px;
    overflow: hidden;
    background: var(--surface-soft);
}

.detail-content h1 {
    margin: 0;
    font-family: "Fraunces", "Georgia", serif;
    font-size: clamp(1.35rem, 2.35vw, 2rem);
    line-height: 1.2;
}

.details-table {
    margin: 0.92rem 0 0;
    display: grid;
    grid-template-columns: minmax(140px, 180px) 1fr;
    gap: 0.56rem 0.95rem;
}

.details-table dt {
    color: var(--muted);
    font-weight: 600;
}

.details-table dd {
    margin: 0;
    overflow-wrap: anywhere;
}

.details-table a {
    color: var(--accent-strong);
    text-decoration-thickness: 1.5px;
    text-underline-offset: 2px;
}

.clip-scene-summary {
    margin-top: 0.85rem;
    padding: 0.82rem 1rem;
    border-left: 3px solid rgba(255, 144, 0, 0.52);
}

.clip-scene-summary h2 {
    margin: 0 0 0.32rem;
    color: var(--accent-strong);
    font-size: 0.96rem;
    line-height: 1.2;
}

.clip-scene-summary p {
    margin: 0;
    color: var(--muted);
    font-size: 0.88rem;
    line-height: 1.46;
}

.clip-scene-summary strong,
.clip-scene-summary .clip-summary-link {
    color: var(--text);
    font-weight: 900;
}

.clip-scene-summary .clip-summary-link,
.clip-scene-summary .clip-summary-link:visited,
.clip-scene-summary .clip-summary-link:active {
    color: var(--text);
    text-decoration: none;
}

.clip-scene-summary .clip-summary-link:hover {
    color: var(--text);
    text-decoration: underline;
    text-decoration-thickness: 1px;
    text-underline-offset: 2px;
}

.watch-link {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    width: auto;
    min-height: 42px;
    padding: 0.5rem 0.85rem;
    border-radius: 12px;
    border: 1px solid transparent;
    background: linear-gradient(135deg, #ffb84d 0%, #ff9800 100%);
    color: #1f1200 !important;
    font-weight: 800;
    text-decoration: none;
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.22);
}

.watch-link:hover {
    background: linear-gradient(135deg, #ffc066 0%, #ffa726 100%);
}

.watch-link.share-link {
    background: linear-gradient(135deg, #2c2c2c 0%, #121212 100%);
    color: #f7f7f7 !important;
    border-color: #3a3a3a;
}

.watch-link.share-link:hover {
    background: linear-gradient(135deg, #3a3a3a 0%, #1a1a1a 100%);
}

.watch-link-icon {
    width: 1.5rem;
    height: 1.5rem;
    border-radius: 999px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.18);
}

.watch-link-icon svg {
    width: 1rem;
    height: 1rem;
    fill: currentColor;
}

.watch-link-icon-x {
    font-size: 0.84rem;
    font-weight: 800;
    line-height: 1;
    color: #ffffff;
}

.admin-delete-x-button {
    width: 46px !important;
    min-width: 46px;
    min-height: 46px;
    padding: 0 !important;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-color: rgba(255, 47, 47, 0.55);
    background: #161616;
    color: #ff2f2f;
    font-size: 1.35rem;
    font-weight: 900;
    line-height: 1;
}

.admin-delete-x-button:hover {
    border-color: rgba(255, 47, 47, 0.75);
    background: #1d1111;
    color: #ff4a4a;
}

.tag-block {
    margin-top: 1rem;
}

.tag-block h2 {
    margin: 0 0 0.46rem;
    font-size: 1rem;
}

.tag-block p {
    margin: 0;
    color: var(--muted);
}

.chips {
    display: flex;
    flex-wrap: wrap;
    gap: 0.44rem;
}

.chip {
    border: 1px solid var(--border);
    border-radius: 999px;
    background: #f9f4ea;
    color: var(--text);
    padding: 0.34rem 0.58rem;
    font-size: 0.81rem;
}

.chip-link {
    text-decoration: none;
    color: inherit;
    font-weight: 600;
    transition: border-color 0.15s ease, background-color 0.15s ease, color 0.15s ease;
}

.chip-link:visited {
    color: inherit;
}

.chip-link:hover {
    border-color: #c8b797;
    background: #efe4d2;
    color: var(--accent-strong);
}

.chip-link:focus-visible {
    outline: none;
    border-color: #415c85;
    box-shadow: 0 0 0 3px rgba(31, 53, 88, 0.2);
}

.chip-muted {
    background: var(--surface-soft);
    color: var(--muted);
}

.tag-show-more {
    margin-top: 0.55rem;
    width: auto;
    min-height: 34px;
    padding: 0.36rem 0.78rem;
    border-radius: 999px;
    border: 1px solid rgba(255, 144, 0, 0.42);
    background: rgba(255, 144, 0, 0.09);
    color: var(--accent-strong);
    font-size: 0.84rem;
    font-weight: 800;
    cursor: pointer;
}

.tag-show-more:hover {
    border-color: rgba(255, 144, 0, 0.72);
    background: rgba(255, 144, 0, 0.16);
    color: var(--accent-strong);
}

.clip-related-section {
    margin-top: 0.95rem;
    padding: 0.95rem;
    display: grid;
    gap: 1rem;
}

.clip-related-row {
    display: grid;
    gap: 0.68rem;
}

.clip-related-row h2 {
    margin: 0;
    font-family: "Fraunces", "Georgia", serif;
    font-size: clamp(1.05rem, 1.45vw, 1.28rem);
    line-height: 1.16;
    color: var(--accent-strong);
}

.clip-related-description {
    margin: -0.22rem 0 0.12rem;
    color: var(--muted);
    font-size: 0.92rem;
    line-height: 1.45;
}

.clip-related-grid {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 0.72rem;
    align-items: start;
}

.clip-related-carousel {
    padding: 0 2.15rem;
}

.clip-related-page {
    grid-template-columns: repeat(5, minmax(0, 1fr));
}

.recommend-section {
    margin-top: 0.95rem;
    padding: 0.9rem;
}

.recommend-header {
    margin-bottom: 0.7rem;
}

.recommend-header h2 {
    margin: 0;
    font-family: "Fraunces", "Georgia", serif;
    font-size: 1.2rem;
}

.recommend-header p {
    margin: 0.24rem 0 0;
    color: var(--muted);
    font-size: 0.9rem;
}

.recommend-carousel {
    position: relative;
    padding: 0 2.15rem;
}

.recommend-viewport {
    overflow: hidden;
}

.recommend-track {
    display: flex;
    transition: transform 0.28s ease;
    will-change: transform;
}

.recommend-page {
    min-width: 100%;
    display: grid;
    gap: 0.72rem;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    align-items: start;
}

.recommend-arrow {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    z-index: 2;
    width: 2.1rem;
    height: 2.1rem;
    border-radius: 999px;
    border: 1px solid var(--border);
    background: rgba(255, 253, 250, 0.95);
    color: var(--accent-strong);
    font-size: 1rem;
    font-weight: 700;
    cursor: pointer;
    display: inline-flex;
    box-shadow: var(--shadow-soft);
}

.recommend-arrow[hidden] {
    display: none !important;
}

.recommend-arrow:hover:not(:disabled) {
    border-color: #c8b797;
}

.recommend-arrow:disabled {
    opacity: 0.35;
    cursor: default;
}

.recommend-arrow-left {
    left: 0;
}

.recommend-arrow-right {
    right: 0;
}

.recommendation-card .movie-meta h3 {
    min-height: 2.5em;
}

.recommendation-card {
    content-visibility: visible;
    contain-intrinsic-size: auto;
    height: auto;
}

@media (max-width: 980px) {
    .topbar {
        align-items: flex-start;
        flex-direction: column;
        gap: 0.8rem;
    }

    .topbar > div:first-child {
        flex: 0 1 auto;
    }

    .topbar-side {
        flex-wrap: wrap;
        justify-content: flex-start;
        white-space: normal;
    }

    .search-main-row {
        grid-template-columns: 1fr 1fr;
    }

    .search-actions {
        grid-column: 1 / -1;
    }

    .recommend-page {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    .clip-related-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

@media (max-width: 760px) {
    .catalog-hero {
        grid-template-columns: 1fr;
        gap: 0.55rem;
        padding: 0.85rem 0.9rem;
    }

    .catalog-hero h1 {
        font-size: clamp(1.25rem, 7vw, 1.7rem);
        line-height: 1.08;
    }

    .catalog-hero p {
        font-size: 0.86rem;
        line-height: 1.46;
    }

    .search-main-row {
        grid-template-columns: 1fr;
    }

    .list-toolbar {
        justify-content: flex-start;
    }

    .sort-inline-form select {
        width: min(210px, 100%);
    }

    .search-actions {
        grid-column: auto;
    }

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

    .detail-poster {
        max-width: none;
    }

    .stats-row {
        flex-direction: column;
        align-items: flex-start;
    }

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

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

    .recommend-carousel {
        padding: 0 1.8rem;
    }

    .recommend-arrow {
        width: 1.9rem;
        height: 1.9rem;
    }
}

@media (max-width: 520px) {
    .recommend-page {
        grid-template-columns: 1fr;
    }

    .clip-related-grid {
        grid-template-columns: 1fr;
    }
}

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

@keyframes card-in {
    from {
        opacity: 0;
        transform: translateY(5px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Pornhub-inspired theme */
:root {
    --bg: #000000;
    --bg-accent: #1a1a1a;
    --bg-accent-2: #101010;
    --surface: #121212;
    --surface-soft: #1b1b1b;
    --surface-strong: #252525;
    --text: #f7f7f7;
    --muted: #b3b3b3;
    --accent: #ff9000;
    --accent-strong: #ffb14a;
    --premium: #ff9000;
    --premium-soft: #ffc16b;
    --border: #2f2f2f;
    --border-strong: #ff9000;
    --shadow: 0 18px 38px rgba(0, 0, 0, 0.45);
    --shadow-soft: 0 10px 22px rgba(0, 0, 0, 0.35);
}

body {
    background:
        radial-gradient(920px 320px at -6% -15%, rgba(255, 144, 0, 0.18) 0%, transparent 62%),
        radial-gradient(760px 260px at 100% -15%, rgba(255, 144, 0, 0.12) 0%, transparent 58%),
        #000000;
}

.logo {
    color: var(--text);
}

.panel {
    background: rgba(18, 18, 18, 0.94);
    border-color: var(--border);
}

.search-panel {
    border-top: 2px solid var(--accent);
}

.site-friends-panel {
    background: linear-gradient(180deg, #1a1a1a 0%, #151515 100%);
    border-color: var(--border);
}

.top-pill {
    border-color: var(--border);
    background: #1a1a1a;
}

.top-pill-muted {
    color: var(--muted);
    background: #1f1f1f;
}

input::placeholder {
    color: #9e9e9e;
}

input[type="search"],
select {
    border-color: var(--border);
    background: #0f0f0f;
    color: var(--text);
}

input[type="search"]:focus,
select:focus,
button:focus,
.ghost-button:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(255, 153, 0, 0.24);
}

button {
    background: linear-gradient(135deg, #ffad33 0%, #ff9000 100%);
    color: #1a1a1a;
}

button:hover {
    background: linear-gradient(135deg, #ffad33 0%, #e68a00 100%);
}

.ghost-button {
    color: var(--text);
    border-color: var(--border);
    background: #171717;
}

.ghost-button:hover {
    color: #ffffff;
    border-color: var(--accent);
}

.sort-inline-form select {
    border-color: var(--border);
    background-image:
        linear-gradient(45deg, transparent 50%, #d7d7d7 50%),
        linear-gradient(135deg, #d7d7d7 50%, transparent 50%),
        linear-gradient(180deg, #0f0f0f 0%, #0f0f0f 100%) !important;
    background-color: #0f0f0f !important;
}

.movie-card {
    border-color: var(--border);
    background: #111111;
}

.movie-card:hover {
    border-color: var(--accent);
    box-shadow: 0 16px 30px rgba(0, 0, 0, 0.5);
}

.poster-wrap {
    background: #1c1c1c;
}

.pagination-link,
.pagination .disabled,
.current-page {
    border-color: var(--border);
    background: #131313;
}

.pagination-link:hover {
    border-color: var(--accent);
}

.detail-poster {
    border-color: var(--border);
    background: #131313;
}

.details-table a {
    color: var(--accent-strong);
}

.chip {
    border-color: var(--border);
    background: #171717;
    color: var(--text);
}

.chip-link:hover {
    border-color: var(--accent);
    background: #212121;
    color: var(--accent-strong);
}

.recommend-arrow {
    border-color: var(--border);
    background: #161616;
    color: var(--accent-strong);
}

.recommend-arrow:hover:not(:disabled) {
    border-color: var(--accent);
}

.subtitle,
.stats-row,
.movie-date,
.details-table dt,
.tag-block p,
.recommend-header p,
.infinite-loader,
.infinite-end,
.top-pill-muted {
    color: var(--muted);
}

.movie-meta h3,
.detail-content h1,
.stats-row strong,
.tag-block h2,
.recommend-header h2 {
    color: var(--text);
}

.top-action-button {
    width: auto;
    min-height: 42px;
    min-width: auto;
    padding: 0.5rem 0.9rem;
    white-space: nowrap;
}

.topbar-side .top-pill {
    min-width: 220px;
}

.photo-search-cta {
    min-width: 178px;
}

.photo-search-cta {
    position: relative;
    isolation: isolate;
    overflow: hidden;
    color: #fff7e8;
    border-color: rgba(255, 179, 58, 0.9);
    background: linear-gradient(180deg, #30210d 0%, #1a1712 100%);
    box-shadow:
        inset 0 1px 0 rgba(255, 215, 149, 0.12),
        0 8px 18px rgba(255, 160, 28, 0.14);
}

.photo-search-cta::before {
    content: "";
    position: absolute;
    inset: 0;
    z-index: 0;
    border-radius: inherit;
    background:
        linear-gradient(
            115deg,
            transparent 0%,
            transparent 34%,
            rgba(255, 255, 255, 0.02) 42%,
            rgba(255, 231, 183, 0.42) 50%,
            rgba(255, 255, 255, 0.04) 58%,
            transparent 66%,
            transparent 100%
        );
    transform: translateX(-180%) skewX(-18deg);
    pointer-events: none;
    animation: photo-search-sheen 3.4s ease-in-out infinite;
}

.photo-search-cta > * ,
.photo-search-cta {
    z-index: 1;
}

.photo-search-cta:hover {
    transform: translateY(-1px);
    color: #ffffff;
    border-color: #ffba4c;
    background: linear-gradient(180deg, #56350d 0%, #24180b 100%);
    box-shadow:
        inset 0 1px 0 rgba(255, 226, 171, 0.18),
        0 0 0 0.25rem rgba(255, 160, 28, 0.1),
        0 10px 24px rgba(255, 160, 28, 0.2);
}

@keyframes photo-search-sheen {
    0% {
        transform: translateX(-180%) skewX(-18deg);
        opacity: 0;
    }
    8% {
        opacity: 0.95;
    }
    28% {
        transform: translateX(180%) skewX(-18deg);
        opacity: 0.95;
    }
    36%,
    100% {
        transform: translateX(180%) skewX(-18deg);
        opacity: 0;
    }
}

@media (prefers-reduced-motion: reduce) {
    .photo-search-cta {
        box-shadow:
            inset 0 1px 0 rgba(255, 215, 149, 0.12),
            0 8px 18px rgba(255, 160, 28, 0.14);
    }

    .photo-search-cta::before {
        animation: none;
        opacity: 0;
    }

    .photo-search-cta:hover {
        transform: none;
    }
}

.tabs-row .top-action-button.is-active-tab {
    background: var(--accent);
    border-color: var(--accent);
    color: #121212;
}

.ai-search-panel {
    position: static !important;
    top: auto !important;
    padding: 1rem;
    border-top: 2px solid var(--accent);
}

.ai-builder {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    align-items: stretch;
    gap: 1rem;
}

.ai-builder-col {
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 0.9rem;
    background: rgba(20, 20, 20, 0.96);
    min-height: 300px;
    min-width: 0;
    display: flex;
    flex-direction: column;
}

.ai-builder-col h2 {
    margin: 0;
    font-size: 1.24rem;
    font-family: "Manrope", "Nunito Sans", "Trebuchet MS", sans-serif;
}

.ai-input-row {
    margin-top: 0.62rem;
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 0.48rem;
}

.ai-add-button {
    width: auto;
    min-width: 78px;
    min-height: 46px;
    padding-inline: 0.95rem;
}

.ai-suggestions {
    margin-top: 0.48rem;
    display: none;
    flex-wrap: wrap;
    gap: 0.4rem;
    border: 1px solid var(--border);
    border-radius: 12px;
    background: #0e0e0e;
    padding: 0.5rem;
    min-height: 48px;
}

.ai-suggestions.is-open {
    display: flex;
}

.ai-suggestion-item {
    width: auto;
    min-height: 34px;
    border-radius: 999px;
    border: 1px solid var(--border);
    background: #181818;
    color: var(--text);
    padding: 0.32rem 0.7rem;
    font-size: 0.82rem;
    box-shadow: none;
}

.ai-suggestion-item:hover {
    border-color: var(--accent);
    background: #222222;
}

.ai-selected-list {
    margin-top: 0.56rem;
    min-height: 52px;
    align-content: flex-start;
}

.ai-source-filter-row {
    margin-top: 0.56rem;
    margin-bottom: 0.1rem;
}

.ai-source-palette {
    display: flex;
    flex-wrap: wrap;
    gap: 0.42rem;
    max-height: 190px;
    overflow-y: auto;
    padding-right: 0.15rem;
    scrollbar-width: thin;
    scrollbar-color: #ff9800 rgba(255, 152, 0, 0.18);
}

.ai-source-palette::-webkit-scrollbar,
.ai-suggestions::-webkit-scrollbar {
    width: 12px;
    height: 12px;
    -webkit-appearance: none;
}

.ai-source-palette::-webkit-scrollbar-track,
.ai-suggestions::-webkit-scrollbar-track {
    background: rgba(255, 152, 0, 0.16);
    border-radius: 999px;
}

.ai-source-palette::-webkit-scrollbar-thumb,
.ai-suggestions::-webkit-scrollbar-thumb {
    background: #ff9800;
    background-image: linear-gradient(180deg, #ffc96f 0%, #ff9800 58%, #ff7b00 100%);
    border-radius: 999px;
    border: 2px solid rgba(14, 14, 14, 0.92);
    box-shadow: 0 0 0 1px rgba(255, 152, 0, 0.18);
}

.ai-source-palette::-webkit-scrollbar-thumb:hover,
.ai-suggestions::-webkit-scrollbar-thumb:hover {
    background: #ffa726;
    background-image: linear-gradient(180deg, #ffd27f 0%, #ffa726 58%, #ff9100 100%);
}

.ai-selected-chip {
    width: auto;
    min-height: 32px;
    padding: 0.28rem 0.58rem;
    border-radius: 999px;
    border: 1px solid var(--border);
    background: #181818;
    color: var(--text);
    box-shadow: none;
    display: inline-flex;
    align-items: center;
    gap: 0.42rem;
}

.ai-selected-chip strong {
    font-size: 0.92rem;
    line-height: 1;
}

.ai-selected-chip:hover {
    border-color: var(--accent);
    background: #212121;
}

.ai-source-chip {
    width: auto;
    min-height: 32px;
    padding: 0.28rem 0.62rem;
    border-radius: 999px;
    border: 1px solid var(--border);
    background: #151515;
    color: var(--text);
    box-shadow: none;
    transition: background 0.18s ease, border-color 0.18s ease, color 0.18s ease;
}

.ai-source-chip:hover {
    border-color: var(--accent);
    background: #202020;
}

.ai-source-chip.is-active {
    border-color: rgba(255, 152, 0, 0.58);
    background: rgba(255, 152, 0, 0.14);
    color: #ffd39a;
}

.ai-count {
    margin: auto 0 0;
    color: var(--muted);
    font-size: 0.83rem;
    font-weight: 600;
}

.ai-submit-button {
    width: auto;
    min-width: 170px;
    letter-spacing: 0.05em;
}

.ai-top-toolbar {
    margin-top: 0.66rem;
    justify-content: center;
}

.ai-warning {
    margin: 0.8rem 0 0;
    color: var(--accent-strong);
    font-weight: 600;
}

.ai-results-panel {
    margin-top: 0.9rem;
    padding: 0.9rem;
    min-height: 520px;
}

.ai-results-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    border-bottom: 1px solid var(--border);
    padding-bottom: 0.7rem;
}

.ai-results-summary {
    font-size: 0.95rem;
    color: var(--muted);
}

.ai-results-summary strong {
    color: var(--text);
}

.ai-results-toolbar {
    margin-top: 0.58rem;
    margin-bottom: 0.08rem;
}

.ai-results-toolbar .sort-inline-form select {
    width: 220px !important;
    min-width: 220px;
}

.ai-results-grid {
    margin-top: 0.86rem;
}

.ai-results-placeholder,
.ai-empty-inline {
    margin-top: 0.84rem;
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 0.95rem;
    background: rgba(16, 16, 16, 0.9);
    color: var(--muted);
}

.ai-results-footer {
    margin-top: 0.8rem;
    display: flex;
    justify-content: flex-end;
}

@media (max-width: 920px) {
    .ai-builder {
        grid-template-columns: 1fr;
        justify-content: stretch;
    }

    .ai-builder-col {
        min-height: 0;
    }

    .ai-results-header {
        align-items: flex-start;
        flex-direction: column;
    }
}

@media (max-width: 760px) {
    .top-action-button {
        width: auto;
    }

    .ai-results-toolbar .sort-inline-form select {
        width: min(220px, 100%) !important;
        min-width: 0;
    }

    .ai-results-footer {
        justify-content: flex-start;
    }
}

.photo-ai-page-wrap {
    width: min(1240px, 94vw);
    margin: 1rem auto 2.75rem;
}

.photo-ai-intro {
    padding: 1rem;
}

.photo-ai-intro h1 {
    margin: 0;
    color: var(--text);
    font-family: "Fraunces", "Georgia", serif;
    font-size: clamp(1.65rem, 2.4vw, 2.2rem);
    line-height: 1.05;
}

.photo-ai-intro .subtitle {
    margin-top: 0.55rem;
    max-width: 70ch;
    color: var(--muted);
}

.photo-ai-layout {
    display: grid;
    grid-template-columns: minmax(280px, 340px) minmax(0, 1fr);
    gap: 1rem;
    margin-top: 1rem;
    align-items: start;
}

.photo-ai-controls-panel,
.photo-ai-result-panel,
.photo-ai-info-panel,
.photo-ai-stage-panel {
    padding: 1rem;
    width: 100%;
    max-width: none;
}

.photo-ai-controls-panel {
    position: sticky;
    top: 0.9rem;
}

.photo-ai-controls-panel.photo-ai-controls-panel-static {
    position: static;
    top: auto;
}

.photo-ai-sidebar-actions {
    display: flex;
    align-items: stretch;
    gap: 0.55rem;
    flex-wrap: nowrap;
}

.photo-ai-share-box {
    margin-top: 0.9rem;
    padding: 0.9rem 0.95rem;
    border: 1px solid var(--border);
    border-radius: 16px;
    background: var(--surface-soft);
    display: grid;
    gap: 0.68rem;
}

.photo-ai-ad-box {
    margin-bottom: 0.9rem;
    padding: 0.85rem;
    border: 1px solid var(--border);
    border-radius: 16px;
    background: var(--surface-soft);
    overflow: hidden;
}

.photo-ai-ad-frame {
    display: block;
    width: min(100%, 320px);
    max-width: 100%;
    height: 260px;
    margin-inline: auto;
    border: 0;
    background: transparent;
    overflow: hidden;
    border-radius: 12px;
}

.photo-ai-share-copy {
    margin: 0;
    color: var(--muted);
    font-size: 0.85rem;
    line-height: 1.45;
}

.photo-ai-share-copy strong {
    color: var(--text);
}

.photo-ai-share-label {
    display: block;
    margin: 0;
    color: var(--text);
    font-size: 0.78rem;
    font-weight: 800;
    letter-spacing: 0.1em;
    text-transform: uppercase;
}

.photo-ai-share-row {
    display: grid;
    grid-template-columns: 1fr;
    gap: 0.55rem;
    align-items: stretch;
}

.photo-ai-share-input {
    width: 100%;
    min-width: 0;
    min-height: 44px;
    padding: 0.72rem 0.85rem;
    border: 1px solid var(--border);
    border-radius: 14px;
    background: rgba(255,255,255,0.04);
    color: var(--text);
    font-size: 0.8rem;
    line-height: 1.3;
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

.photo-ai-share-input::selection {
    background: rgba(255, 152, 0, 0.28);
}

.photo-ai-copy-button {
    width: 100%;
    min-width: 0;
    min-height: 44px;
}

.photo-ai-share-note {
    margin: 0;
    color: var(--muted);
    font-size: 0.8rem;
    line-height: 1.4;
}

.photo-ai-usage-inline {
    color: var(--text);
    font-weight: 700;
}

.photo-ai-usage-panel {
    margin-top: 0.9rem;
}

#photo-ai-copy-status {
    color: var(--accent-strong);
    font-weight: 700;
}

.photo-ai-consent-warning {
    margin: 0.55rem 0 0;
    color: #ff4d4f;
    font-size: 0.84rem;
    font-weight: 800;
    line-height: 1.35;
}

.photo-ai-consent {
    display: flex;
    align-items: flex-start;
    gap: 0.65rem;
    margin-top: 0.85rem;
    padding: 0.8rem 0.9rem;
    border: 1px solid var(--border);
    border-radius: 14px;
    background: var(--surface-soft);
    color: var(--muted);
    font-size: 0.88rem;
    line-height: 1.45;
}

.photo-ai-consent input {
    flex: 0 0 auto;
    width: 18px;
    height: 18px;
    margin: 0.08rem 0 0;
    accent-color: #ff9800;
}

.photo-ai-consent span {
    min-width: 0;
}

.photo-ai-consent a {
    color: var(--accent);
    font-weight: 700;
    text-decoration: none;
}

.photo-ai-consent a:hover {
    text-decoration: underline;
}

.photo-ai-dropzone {
    display: grid;
    gap: 0.45rem;
    justify-items: start;
    padding: 0.9rem 1rem;
    border: 1px dashed var(--border-strong);
    border-radius: 14px;
    background: var(--surface-soft);
    transition: border-color 0.18s ease, box-shadow 0.18s ease, background 0.18s ease;
}

.photo-ai-dropzone:hover,
.photo-ai-dropzone.is-dragover {
    border-color: #b9975d;
    box-shadow: var(--shadow-soft);
    background: #fbf5ea;
}

.photo-ai-dropzone strong {
    color: var(--text);
    font-size: 0.95rem;
}

.photo-ai-dropzone span {
    color: var(--muted);
    line-height: 1.4;
    font-size: 0.88rem;
}

.photo-ai-load-button {
    width: auto;
    min-width: 108px;
    min-height: 36px;
    padding: 0.36rem 0.76rem;
    pointer-events: auto;
}

.photo-ai-load-actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
    gap: 0.5rem;
}

.photo-ai-paste-catcher {
    width: min(620px, 100%);
    min-height: 46px;
    padding: 0.66rem 0.82rem;
    border-radius: 12px;
    border: 1px dashed var(--border-strong);
    background: rgba(8, 10, 16, 0.6);
    color: var(--text);
    text-align: left;
    font-size: 0.9rem;
    line-height: 1.4;
    cursor: text;
    outline: none;
}

.photo-ai-paste-catcher:focus {
    border-color: #b9975d;
    box-shadow: var(--shadow-soft);
}

.photo-ai-paste-catcher:empty::before {
    content: attr(data-placeholder);
    color: var(--muted);
}

.photo-ai-load-button-wrap {
    position: relative;
    display: inline-block;
}

.photo-ai-file-proxy {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    cursor: pointer;
    z-index: 2;
}

.photo-ai-search-button {
    flex: 1 1 0;
    width: auto;
    min-width: 0;
    min-height: 40px;
    padding: 0.52rem 0.72rem;
}

.photo-ai-clear-button {
    flex: 1 1 0;
    width: auto;
    min-width: 0;
    min-height: 40px;
    padding: 0.52rem 0.72rem;
}

.photo-ai-result {
    margin-top: 0;
    padding: 0.85rem 0.95rem;
    border: 1px solid var(--border);
    border-radius: 16px;
    background: var(--surface-soft);
}

.photo-ai-result-label {
    margin: 0 0 0.35rem;
    font-size: 0.77rem;
    font-weight: 800;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--muted);
}

.photo-ai-result strong {
    display: block;
    color: var(--text);
    font-size: 1.02rem;
    line-height: 1.35;
}

.photo-ai-result strong a {
    color: var(--accent);
    text-decoration: none;
}

.photo-ai-result strong a:hover {
    text-decoration: underline;
}

.photo-ai-result-meta {
    margin: 0.35rem 0 0;
}

.photo-ai-result-list {
    margin: 0.65rem 0 0;
    padding-left: 0;
    list-style: none;
    display: grid;
    gap: 0.72rem;
    color: var(--muted);
}

.photo-ai-face-result-card {
    position: relative;
    padding: 0.85rem 0.95rem 0.92rem;
    border-radius: 14px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-left: 4px solid var(--photo-ai-face-accent, #e04646);
    background: rgba(16, 18, 23, 0.96);
    color: #f4f5f7;
    box-shadow:
        0 10px 18px rgba(0, 0, 0, 0.28),
        0 0 0 1px var(--photo-ai-face-fill, rgba(224, 70, 70, 0.08));
    transition: transform 0.16s ease, box-shadow 0.16s ease, border-color 0.16s ease;
    cursor: pointer;
}

.photo-ai-face-result-card:hover {
    transform: translateY(-1px);
}

.photo-ai-face-result-card.is-matched {
    border-color: var(--photo-ai-face-glow, rgba(224, 70, 70, 0.20));
}

.photo-ai-face-result-card.is-uncertain {
    border-color: rgba(255, 255, 255, 0.08);
}

.photo-ai-face-result-card.is-error {
    border-color: rgba(224, 70, 70, 0.34);
    box-shadow:
        0 10px 18px rgba(0, 0, 0, 0.28),
        0 0 0 1px rgba(224, 70, 70, 0.12);
}

.photo-ai-face-result-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 0.6rem;
    margin-bottom: 0.48rem;
    padding-right: 2rem;
}

.photo-ai-face-result-badge {
    display: inline-flex;
    align-items: center;
    padding: 0.2rem 0.48rem;
    border-radius: 999px;
    background: var(--photo-ai-face-accent, rgba(224, 70, 70, 0.92));
    color: #ffffff;
    font-size: 0.7rem;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.photo-ai-face-result-remove {
    position: absolute;
    top: 0.78rem;
    right: 0.78rem;
    flex: 0 0 auto;
    width: 1.42rem;
    height: 1.42rem;
    min-height: 1.42rem;
    padding: 0;
    border-radius: 999px;
    border: 1px solid var(--photo-ai-face-accent, #e04646);
    background: rgba(11, 18, 27, 0.92);
    color: var(--photo-ai-face-accent, #e04646);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    font-weight: 900;
    line-height: 1;
    cursor: pointer;
    box-shadow: 0 6px 14px rgba(14, 24, 39, 0.12);
    transition: transform 0.15s ease, background 0.15s ease, border-color 0.15s ease;
}

.photo-ai-face-result-remove:hover {
    transform: translateY(-1px);
    background: rgba(26, 36, 50, 0.98);
}

.photo-ai-face-result-remove:focus-visible {
    outline: 2px solid var(--photo-ai-face-accent, #e04646);
    outline-offset: 2px;
}

.photo-ai-face-result-state {
    color: var(--muted);
    font-size: 0.74rem;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.photo-ai-face-result-summary {
    display: block;
    color: #f4f5f7;
    font-size: 1.01rem;
    font-weight: 700;
    line-height: 1.35;
}

.photo-ai-face-result-summary a {
    color: var(--photo-ai-face-accent, #ffb84d);
    text-decoration: none;
}

.photo-ai-face-result-summary a:hover {
    text-decoration: underline;
}

.photo-ai-face-result-meta {
    margin: 0.35rem 0 0;
    color: rgba(255, 255, 255, 0.68);
}

.photo-ai-face-result-actions {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 0.5rem;
    margin-top: 0.8rem;
}

.photo-ai-face-result-copy {
    width: auto;
    min-width: 92px;
    min-height: 38px;
    padding: 0.45rem 0.9rem;
    border-radius: 999px;
    border: 1px solid rgba(224, 70, 70, 0.18);
    background: var(--button-primary);
    color: var(--button-primary-text);
    box-shadow: 0 6px 14px rgba(14, 24, 39, 0.12);
}

.photo-ai-result-top-matches {
    margin: 0.6rem 0 0;
    padding-left: 1.05rem;
    color: rgba(255, 255, 255, 0.72);
}

.photo-ai-result-top-matches li + li {
    margin-top: 0.26rem;
}

.photo-ai-result-top-matches a {
    color: var(--photo-ai-face-accent, #ffb84d);
    text-decoration: none;
}

.photo-ai-result-top-matches a:hover {
    text-decoration: underline;
}

.photo-ai-result-list a {
    color: var(--accent);
    text-decoration: none;
}

.photo-ai-result-list a:hover {
    text-decoration: underline;
}

.photo-ai-result-admin-actions {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    margin-top: 0.8rem;
}

.photo-ai-result-copy-button {
    width: auto;
    min-width: 92px;
    min-height: 38px;
    padding: 0.45rem 0.9rem;
}

.photo-ai-result-copy-status {
    color: var(--accent-strong);
    font-size: 0.8rem;
    font-weight: 700;
}

.photo-ai-result.is-error {
    border-color: rgba(224, 70, 70, 0.32);
}

.photo-ai-stat-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.7rem;
}

.photo-ai-stat-card {
    padding: 0.82rem 0.86rem;
    border-radius: 16px;
    border: 1px solid var(--border);
    background: var(--surface-soft);
}

.photo-ai-stat-label {
    display: block;
    margin-bottom: 0.28rem;
    font-size: 0.77rem;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--muted);
}

.photo-ai-stat-card strong {
    display: block;
    color: var(--text);
    font-size: 1rem;
    line-height: 1.35;
}

.photo-ai-range-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 0.5rem;
}

.photo-ai-range-header label,
.photo-ai-range-header span {
    color: var(--text);
    font-weight: 700;
}

.photo-ai-size-slider {
    width: 100%;
    min-height: 0;
    padding: 0;
    border: 0;
    background: transparent;
    appearance: none;
}

.photo-ai-size-slider::-webkit-slider-runnable-track {
    height: 8px;
    border-radius: 999px;
    background: linear-gradient(90deg, #f5c176 0%, #ea6d67 100%);
}

.photo-ai-size-slider::-webkit-slider-thumb {
    appearance: none;
    width: 20px;
    height: 20px;
    margin-top: -6px;
    border-radius: 999px;
    border: 2px solid #fff;
    background: var(--accent-strong);
    box-shadow: 0 6px 14px rgba(14, 24, 39, 0.2);
}

.photo-ai-size-slider::-moz-range-track {
    height: 8px;
    border-radius: 999px;
    background: linear-gradient(90deg, #f5c176 0%, #ea6d67 100%);
}

.photo-ai-size-slider::-moz-range-thumb {
    width: 20px;
    height: 20px;
    border-radius: 999px;
    border: 2px solid #fff;
    background: var(--accent-strong);
    box-shadow: 0 6px 14px rgba(14, 24, 39, 0.2);
}

.photo-ai-button-row {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.6rem;
    margin-top: 0.8rem;
}

.photo-ai-secondary-button {
    min-height: 42px;
}

.photo-ai-secondary-button[disabled] {
    opacity: 0.45;
    cursor: not-allowed;
}

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

.photo-ai-stage-label {
    margin: 0 0 0.24rem;
    font-size: 0.8rem;
    font-weight: 800;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--muted);
}

.photo-ai-stage-toolbar h2 {
    margin: 0;
    color: var(--text);
    font-family: "Fraunces", "Georgia", serif;
    font-size: 1.55rem;
}

.photo-ai-stage-shell {
    width: 100%;
    border-radius: 18px;
    border: 1px solid var(--border);
    background: transparent;
    overflow: hidden;
    position: relative;
}

.photo-ai-stage-shell.is-empty {
    min-height: 150px;
}

.photo-ai-stage-empty {
    width: 100%;
    min-height: 0;
    padding: 0;
}

.photo-ai-empty-dropzone {
    display: grid;
    gap: 0.38rem;
    width: 100%;
    max-width: min(920px, 100%);
    min-height: clamp(180px, 28vw, 260px);
    padding: clamp(1rem, 2.8vw, 1.55rem);
    border: 1px dashed var(--border-strong);
    border-radius: 14px;
    background: var(--surface-soft);
    text-align: center;
    justify-items: center;
    align-content: center;
    box-shadow: none;
    transition: border-color 0.18s ease, box-shadow 0.18s ease, background 0.18s ease;
}

.photo-ai-empty-dropzone.is-blocked {
    border-style: solid;
    border-color: rgba(217, 119, 6, 0.45);
    background: rgba(217, 119, 6, 0.08);
    box-shadow: inset 0 0 0 1px rgba(217, 119, 6, 0.16);
}

.photo-ai-empty-dropzone strong {
    color: var(--text);
    font-size: 0.98rem;
}

.photo-ai-empty-dropzone span {
    color: var(--muted);
    line-height: 1.42;
    font-size: 0.9rem;
}

.photo-ai-empty-dropzone.is-dragover {
    border-color: #b9975d;
    box-shadow: var(--shadow-soft);
    background: #fbf5ea;
}

.photo-ai-empty-dropzone.is-blocked strong {
    color: #fff4db;
}

.photo-ai-empty-dropzone.is-blocked span {
    color: #ffd9a8;
}

.photo-ai-blocked-note {
    max-width: 34rem;
    font-size: 0.88rem;
    color: #ffe7c2;
}

.photo-ai-stage-shell.is-empty .photo-ai-stage-empty {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    min-height: clamp(220px, 30vw, 320px);
    padding: 0.85rem;
}

.photo-ai-stage-frame {
    width: 100%;
    min-height: 0;
    display: grid;
    place-items: center;
    padding: 0.75rem;
}

.photo-ai-stage-frame[hidden],
.photo-ai-stage-empty[hidden],
.photo-ai-selection[hidden],
.photo-ai-result[hidden] {
    display: none !important;
}

.photo-ai-stage-surface {
    position: relative;
    width: fit-content;
    max-width: 100%;
    border-radius: 18px;
    overflow: hidden;
    background: #111418;
    box-shadow: var(--shadow);
    touch-action: none;
}

.photo-ai-stage-surface img {
    display: block;
    width: auto;
    max-width: min(100%, 1024px);
    max-height: calc(100vh - 240px);
    height: auto;
    user-select: none;
    -webkit-user-drag: none;
}

.photo-ai-selection {
    position: absolute;
    top: 0;
    left: 0;
    border: 3px solid var(--photo-ai-face-accent, #e04646);
    background: var(--photo-ai-face-fill, rgba(224, 70, 70, 0.08));
    border-radius: 18px;
    box-shadow: 0 0 0 2px var(--photo-ai-face-glow, rgba(224, 70, 70, 0.18));
    cursor: grab;
    touch-action: none;
    z-index: 3;
}

.photo-ai-selection.is-active {
    cursor: grabbing;
    box-shadow: 0 0 0 3px var(--photo-ai-face-glow, rgba(224, 70, 70, 0.34));
    z-index: 5;
}

.photo-ai-stage-surface.has-multiple-faces .photo-ai-selection.is-active {
    box-shadow: 0 0 0 3px var(--photo-ai-face-glow, rgba(224, 70, 70, 0.35));
}

.photo-ai-stage-surface.has-multiple-faces .photo-ai-selection {
    box-shadow: 0 0 0 2px var(--photo-ai-face-glow, rgba(224, 70, 70, 0.16));
}

.photo-ai-selection.is-inactive {
    border-style: dashed;
    opacity: 0.95;
    box-shadow: 0 0 0 2px var(--photo-ai-face-glow, rgba(224, 70, 70, 0.08));
}

.photo-ai-selection:hover {
    opacity: 1;
    border-color: var(--photo-ai-face-accent, #ff8080);
}

.photo-ai-selection-label {
    position: absolute;
    top: 8px;
    left: 8px;
    padding: 0.24rem 0.45rem;
    border-radius: 999px;
    background: var(--photo-ai-face-accent, rgba(224, 70, 70, 0.92));
    color: #ffffff;
    font-size: 0.72rem;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    pointer-events: none;
}

.photo-ai-selection-handle {
    position: absolute;
    right: -10px;
    bottom: -10px;
    width: 20px;
    height: 20px;
    border-radius: 999px;
    border: 2px solid #ffffff;
    background: var(--photo-ai-face-accent, #e04646);
    box-shadow: 0 6px 14px rgba(14, 24, 39, 0.2);
    cursor: nwse-resize;
}

@media (max-width: 1080px) {
    .photo-ai-layout {
        grid-template-columns: 1fr;
    }

    .photo-ai-controls-panel {
        position: static;
        top: auto;
    }

    .photo-ai-stage-shell.is-empty,
    .photo-ai-stage-shell.is-empty .photo-ai-stage-empty {
        min-height: 180px;
    }
}

@media (max-width: 760px) {
    .photo-ai-load-button {
        width: 100%;
    }

    .photo-ai-stage-toolbar {
        flex-direction: column;
        align-items: flex-start;
    }

    .photo-ai-stage-shell.is-empty,
    .photo-ai-stage-shell.is-empty .photo-ai-stage-empty {
        min-height: 160px;
    }

    .photo-ai-stage-frame {
        padding: 0.65rem;
    }

    .photo-ai-empty-dropzone {
        min-height: 150px;
        padding: 1rem;
    }

    .photo-ai-sidebar-actions {
        gap: 0.5rem;
    }

    .photo-ai-share-copy,
    .photo-ai-share-note {
        font-size: 0.8rem;
    }

    .photo-ai-consent-warning {
        font-size: 0.8rem;
    }

    .photo-ai-consent {
        font-size: 0.84rem;
        padding: 0.75rem 0.8rem;
    }
}
