/* ===== Tokens ===== */
:root {
    --bg: #0b0c10;
    --surface: #14161d;
    --surface-2: #1b1e27;
    --line: #2a2e3a;
    --text: #f3f4f6;
    --muted: #8b90a0;
    --accent: #f4b740;
    --brand-blue: #2f6bff;
    --radius: 10px;
    --radius-lg: 18px;
    --gap: 12px;
    --container: 1200px;
    --font: "Plus Jakarta Sans", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
    margin: 0;
    background: var(--bg);
    color: var(--text);
    font-family: var(--font);
    font-size: 15px;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }
img, svg, iframe { display: block; max-width: 100%; }
button { font: inherit; color: inherit; cursor: pointer; }
h1, h2, h3 { margin: 0; letter-spacing: -0.02em; }

:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 6px; }

.container {
    width: 100%;
    max-width: var(--container);
    margin: 0 auto;
    padding: 0 40px;
}

.muted { color: var(--muted); }

/* ===== Top bar ===== */
.topbar {
    position: sticky;
    top: 0;
    z-index: 50;
    background: rgba(11, 12, 16, 0.86);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    border-bottom: 1px solid #16181f;
}

.topbar-inner {
    display: flex;
    align-items: center;
    gap: 36px;
    height: 64px;
}

.logo {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    flex-shrink: 0;
}

.logo-mark {
    width: 32px;
    height: 32px;
    flex-shrink: 0;
    border-radius: 9px;
    box-shadow: 0 4px 14px rgba(243, 154, 44, .28);
    transition: transform .2s ease;
}

.logo:hover .logo-mark { transform: rotate(-6deg) scale(1.05); }

.logo-word {
    font-size: 22px;
    font-weight: 800;
    letter-spacing: -0.05em;
    line-height: 1;
}

.logo-small { gap: 8px; }
.logo-small .logo-mark { width: 24px; height: 24px; border-radius: 7px; box-shadow: none; }
.logo-small .logo-word { font-size: 17px; }

.main-nav { display: flex; gap: 22px; }

.main-nav a {
    position: relative;
    font-size: 14px;
    color: var(--muted);
    padding: 20px 0;
    white-space: nowrap;
    transition: color .15s;
}

.main-nav a:hover { color: var(--text); }
.main-nav a.is-active { color: var(--text); font-weight: 600; }

.main-nav a.is-active::after {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    bottom: 12px;
    height: 2px;
    border-radius: 2px;
    background: var(--accent);
}

.topbar-actions {
    margin-left: auto;
    display: flex;
    align-items: center;
    gap: 8px;
}

.icon-btn {
    position: relative;
    display: inline-grid;
    place-items: center;
    width: 38px;
    height: 38px;
    border: 0;
    border-radius: 50%;
    background: transparent;
    transition: background .15s;
}

.icon-btn:hover { background: var(--surface-2); }

.icon-btn svg {
    width: 20px;
    height: 20px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.has-dot::after {
    content: "";
    position: absolute;
    top: 9px;
    right: 10px;
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--accent);
    border: 2px solid var(--bg);
}

.avatar {
    display: grid;
    place-items: center;
    width: 34px;
    height: 34px;
    margin-left: 6px;
    border-radius: 9px;
    background: var(--accent);
    font-weight: 700;
    font-size: 14px;
}

.search { display: flex; align-items: center; }

.search input {
    width: 0;
    padding: 0;
    border: 1px solid transparent;
    border-radius: 999px;
    background: var(--surface-2);
    color: var(--text);
    font: inherit;
    font-size: 14px;
    height: 36px;
    opacity: 0;
    transition: width .25s, padding .25s, opacity .2s;
}

.search.is-open input {
    width: 220px;
    padding: 0 14px;
    border-color: var(--line);
    opacity: 1;
}

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

/* ===== Buttons ===== */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    height: 44px;
    padding: 0 22px;
    border-radius: 999px;
    border: 1px solid transparent;
    font-size: 14px;
    font-weight: 700;
    white-space: nowrap;
    transition: transform .15s, background .15s, border-color .15s;
}

.btn:active { transform: scale(.97); }
.btn svg { width: 14px; height: 14px; fill: currentColor; }

.btn-primary { background: var(--accent); color: #17130a; }
.btn-primary:hover { background: #ffc85a; }

.btn-ghost {
    background: rgba(255, 255, 255, .1);
    border-color: rgba(255, 255, 255, .25);
    color: #fff;
    backdrop-filter: blur(6px);
}

.btn-ghost:hover { background: rgba(255, 255, 255, .18); }

.ml-icon { position: relative; width: 12px; height: 12px; }

.ml-icon::before, .ml-icon::after {
    content: "";
    position: absolute;
    background: currentColor;
    border-radius: 2px;
    transition: transform .2s;
}

.ml-icon::before { left: 5px; top: 0; width: 2px; height: 12px; }
.ml-icon::after { left: 0; top: 5px; width: 12px; height: 2px; }

/* Turns the plus into a tick once added. */
.is-added .ml-icon::before { left: 7px; top: -1px; height: 13px; transform: rotate(40deg); }
.is-added .ml-icon::after { left: 0; top: 7px; width: 6px; transform: rotate(45deg); }

.link-more {
    font-size: 14px;
    font-weight: 600;
    text-decoration: underline;
    text-underline-offset: 4px;
    text-decoration-thickness: 1.5px;
}

/* ===== Hero (backdrop image + gradient) ===== */
.hero {
    position: relative;
    overflow: hidden;
    margin-top: 18px;
    min-height: 460px;
    display: flex;
    align-items: flex-end;
    border-radius: var(--radius-lg);
    background: var(--surface);
    color: #fff;
    isolation: isolate;
}

.hero-media {
    position: absolute;
    inset: 0;
    z-index: -1;
}

.hero-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center 25%;
}

/* Darkens the left and bottom so text stays readable on any image. */
.hero-media::after {
    content: "";
    position: absolute;
    inset: 0;
    background:
        linear-gradient(90deg, rgba(8, 9, 12, .94) 0%, rgba(8, 9, 12, .78) 32%, rgba(8, 9, 12, .2) 62%, rgba(8, 9, 12, 0) 80%),
        linear-gradient(0deg, rgba(8, 9, 12, .85) 0%, rgba(8, 9, 12, 0) 45%);
}

.hero-content {
    position: relative;
    max-width: 580px;
    padding: 48px 44px 44px;
}

.eyebrow {
    margin: 0 0 12px;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: .14em;
    text-transform: uppercase;
    color: rgba(255, 255, 255, .85);
}

.eyebrow span { color: var(--accent); }

.hero-title {
    font-size: clamp(36px, 6vw, 66px);
    line-height: .98;
    font-weight: 800;
    letter-spacing: -0.045em;
    margin-bottom: 18px;
    text-shadow: 0 2px 24px rgba(0, 0, 0, .4);
}

.hero-meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px 14px;
    margin: 0 0 14px;
    padding: 0;
    list-style: none;
    font-size: 12px;
    color: rgba(255, 255, 255, .9);
}

.rating {
    display: inline-block;
    padding: 0 6px;
    border: 1px solid currentColor;
    border-radius: 4px;
    font-size: 11px;
    line-height: 17px;
}

.hero-desc {
    margin: 0 0 24px;
    max-width: 460px;
    font-size: 14px;
    line-height: 1.6;
    color: rgba(255, 255, 255, .88);
}

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

.hero-actions .link-more { margin-left: 10px; }

/* ===== Chips ===== */
.chips {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 22px 0 6px;
}

.chip {
    display: inline-flex;
    align-items: center;
    height: 32px;
    padding: 0 14px;
    border: 1px solid var(--line);
    border-radius: 999px;
    font-size: 12px;
    font-weight: 600;
    white-space: nowrap;
    transition: background .15s, border-color .15s;
}

.chip:hover { border-color: #4a5063; background: var(--surface); }
.chip.is-active { background: #f3f4f6; border-color: #f3f4f6; color: #111; }
.chip-sm { height: 26px; padding: 0 10px; font-size: 11px; }

/* ===== Rows ===== */
.row { margin-top: 34px; }

.row-head {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 12px;
}

.row-head h2 { font-size: 17px; font-weight: 700; }

.see-all {
    flex-shrink: 0;
    font-size: 11px;
    font-weight: 600;
    color: var(--accent);
    text-decoration: underline;
    text-underline-offset: 3px;
}

/* Horizontal scrolling rows: column count changes per breakpoint. */
.scroller {
    --cols: 7;
    display: grid;
    grid-auto-flow: column;
    grid-auto-columns: calc((100% - (var(--cols) - 1) * var(--gap)) / var(--cols));
    gap: var(--gap);
    margin: 0;
    padding: 0 0 6px;
    list-style: none;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    scrollbar-width: none;
    overscroll-behavior-x: contain;
    overflow-y: hidden;
}

.scroller::-webkit-scrollbar { display: none; }
.scroller > * { scroll-snap-align: start; }

/* ===== Cards & posters ===== */
.card { position: relative; min-width: 0; }

.poster {
    position: relative;
    display: block;
    overflow: hidden;
    aspect-ratio: 2 / 3;
    border-radius: 8px;
    background: linear-gradient(160deg, #262a36, #15171e);
    transition: transform .2s ease, box-shadow .2s ease;
}

.poster img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.poster::after {
    content: "";
    position: absolute;
    inset: 0;
    border-radius: inherit;
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .06);
    pointer-events: none;
}

/* Title shown only when the image is missing or fails to load. */
.poster-fallback {
    position: absolute;
    inset: auto 10px 10px;
    font-size: 15px;
    font-weight: 800;
    line-height: 1.1;
    letter-spacing: -0.02em;
    visibility: hidden;
}

.no-img .poster-fallback { visibility: visible; }

.card:hover .poster,
.top10-item:hover .poster {
    transform: translateY(-3px);
    box-shadow: 0 14px 28px rgba(0, 0, 0, .5);
}

.badge-new {
    position: absolute;
    top: 8px;
    left: 8px;
    padding: 2px 7px;
    border-radius: 4px;
    background: var(--accent);
    color: #17130a;
    font-size: 10px;
    font-weight: 800;
    letter-spacing: .04em;
    text-transform: uppercase;
}

.card-meta {
    display: flex;
    flex-direction: column;
    margin-top: 8px;
    font-size: 12px;
    line-height: 1.35;
}

.card-meta a { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.card-meta span { color: var(--muted); font-size: 11px; }

.card-play {
    position: absolute;
    top: 8px;
    right: 8px;
    z-index: 2;
    display: grid;
    place-items: center;
    width: 34px;
    height: 34px;
    border: 0;
    border-radius: 50%;
    background: rgba(10, 11, 15, .75);
    color: #fff;
    opacity: 0;
    transform: scale(.85);
    transition: opacity .2s, transform .2s, background .15s;
}

.card-play svg { width: 15px; height: 15px; fill: currentColor; margin-left: 0px; }
.card-play:hover { background: var(--accent); color: #17130a; }
.card:hover .card-play, .card-play:focus-visible { opacity: 1; transform: none; }

@media (hover: none) {
    .card-play { opacity: 1; transform: none; width: 30px; height: 30px; }
}

/* ===== Top 10 ===== */
.top10 { --cols: 6; }

.top10-item {
    position: relative;
    display: flex;
    align-items: flex-end;
}

.rank {
    flex-shrink: 0;
    width: 42%;
    margin-right: -10%;
    font-size: clamp(100px, 13vw, 168px);
    font-weight: 800;
    line-height: .78;
    letter-spacing: -0.08em;
    color: var(--bg);
    -webkit-text-stroke: 2px #4a5063;
    text-align: right;
    user-select: none;
}

.top10-item:nth-child(10) .rank { letter-spacing: -0.14em; width: 54%; margin-right: -6%; }

.top10-item .poster { flex: 1; min-width: 0; z-index: 1; }

/* ===== Channels ===== */
.channels {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: var(--gap);
}

.channel {
    display: grid;
    place-items: center;
    min-height: 68px;
    padding: 12px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--surface);
    font-size: 15px;
    font-weight: 800;
    letter-spacing: -0.02em;
    text-align: center;
    transition: background .15s, border-color .15s, transform .15s;
}

.channel:hover { background: var(--surface-2); border-color: #454b5e; transform: translateY(-2px); }

/* ===== Browse page ===== */
.page-head {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 16px;
    margin-top: 32px;
}

.page-head h1 { font-size: clamp(26px, 4vw, 38px); font-weight: 800; }
.page-head p { margin: 0; color: var(--muted); font-size: 13px; }

.grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 24px var(--gap);
    margin-top: 24px;
}

.empty {
    max-width: 420px;
    margin: 60px auto 20px;
    padding: 40px 24px;
    border: 1px dashed var(--line);
    border-radius: var(--radius-lg);
    text-align: center;
}

.empty h2 { font-size: 20px; margin-bottom: 6px; }
.empty p { margin: 0 0 20px; color: var(--muted); }

/* ===== Title page ===== */
.hero-detail { min-height: 480px; }

.hero-detail .hero-content {
    display: flex;
    align-items: flex-end;
    gap: 32px;
    max-width: 900px;
}

.detail-poster {
    flex: 0 0 200px;
    box-shadow: 0 18px 40px rgba(0, 0, 0, .55);
}

.detail-text { min-width: 0; }

.detail-grid {
    display: grid;
    grid-template-columns: minmax(0, 2fr) minmax(0, 1fr);
    gap: 32px;
    margin-top: 34px;
}

.detail-grid h2 { font-size: 17px; margin-bottom: 12px; }
.trailer-block .link-more { display: inline-block; margin-top: 12px; color: var(--muted); }

.video-frame {
    position: relative;
    aspect-ratio: 16 / 9;
    overflow: hidden;
    border-radius: var(--radius);
    background: #000;
}

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

.facts {
    padding: 20px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--surface);
    align-self: start;
}

.facts dl {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 12px 18px;
    margin: 0;
    font-size: 14px;
}

.facts dt { color: var(--muted); }
.facts dd { margin: 0; font-weight: 600; }
.tag-list { display: flex; flex-wrap: wrap; gap: 6px; }

/* ===== Footer ===== */
.footer {
    margin-top: 56px;
    border-top: 1px solid #16181f;
}

.footer-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px 24px;
    padding-top: 26px;
    padding-bottom: 26px;
}

.footer-links { display: flex; flex-wrap: wrap; gap: 6px 20px; }

.footer-links a {
    font-size: 11px;
    color: #b5b9c6;
    text-decoration: underline;
    text-underline-offset: 3px;
}

.footer-links a:hover { color: var(--text); }
.copyright { margin: 0; font-size: 11px; color: var(--muted); }

/* ===== Trailer modal ===== */
.modal {
    position: fixed;
    inset: 0;
    z-index: 100;
    display: grid;
    place-items: center;
    padding: 20px;
}

.modal[hidden] { display: none; }

.modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(4, 5, 8, .82);
    backdrop-filter: blur(4px);
    animation: fade .2s ease;
}

.modal-dialog {
    position: relative;
    width: min(960px, 100%);
    padding: 14px;
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    background: var(--surface);
    animation: pop .22s ease;
}

.modal-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 0 2px 10px 6px;
}

.modal-head h2 { font-size: 16px; }

@keyframes fade { from { opacity: 0; } }
@keyframes pop { from { opacity: 0; transform: translateY(12px) scale(.98); } }

body.modal-open { overflow: hidden; }

/* ===== Responsive ===== */
@media (max-width: 1100px) {
    .scroller { --cols: 6; }
    .top10 { --cols: 5; }
    .channels { grid-template-columns: repeat(3, 1fr); }
}

@media (max-width: 900px) {
    .container { padding: 0 24px; }

    /* Nav drops to its own scrollable line under the logo. */
    .topbar-inner { flex-wrap: wrap; height: auto; gap: 0 16px; padding-top: 10px; }
    .main-nav {
        order: 3;
        gap: 20px;
        overflow-x: auto;
        scrollbar-width: none;
        margin: 0 -24px;
        padding: 0 24px;
        width: calc(100% + 48px);
    }
    .main-nav::-webkit-scrollbar { display: none; }
    .main-nav a { padding: 12px 0 14px; }
    .main-nav a.is-active::after { bottom: 6px; }

    .scroller { --cols: 4.4; }
    .top10 { --cols: 3.5; }

    .hero { min-height: 400px; }
    .hero-content { padding: 36px 28px 30px; }
    .hero-media::after {
        background:
            linear-gradient(90deg, rgba(8, 9, 12, .9) 0%, rgba(8, 9, 12, .55) 50%, rgba(8, 9, 12, .1) 100%),
            linear-gradient(0deg, rgba(8, 9, 12, .9) 0%, rgba(8, 9, 12, 0) 55%);
    }

    .detail-poster { flex-basis: 150px; }
    .detail-grid { grid-template-columns: 1fr; }
}

@media (max-width: 640px) {
    :root { --gap: 10px; }
    .container { padding: 10px 16px; }
    .main-nav { margin: 0 -16px; padding: 0 16px; width: calc(100% + 32px); }

    .search.is-open input { width: min(46vw, 200px); }
    .topbar-inner { gap: 0 8px; }

    /* Hero stacks: backdrop on top, text below it. */
    .hero {
        display: block;
        min-height: 0;
        margin-top: 12px;
        background: var(--surface);
    }
    .hero-media { position: relative; aspect-ratio: 16 / 10; z-index: 0; }
    .hero-media::after { background: linear-gradient(0deg, var(--surface) 0%, rgba(20, 22, 29, 0) 55%); }
    .hero-content { max-width: none; margin-top: -48px; padding: 0 18px 22px; }
    .hero-actions .btn { flex: 1 1 auto; justify-content: center; }
    .hero-actions .link-more { margin: 4px 0 0; width: 100%; text-align: center; }

    .hero-detail .hero-content { display: block; }
    .detail-poster { display: none; }

    /* Chips become a single swipeable line. */
    .chips {
        flex-wrap: nowrap;
        overflow-x: auto;
        scrollbar-width: none;
        margin-left: -16px;
        margin-right: -16px;
        padding: 0 16px;
    }
    .chips::-webkit-scrollbar { display: none; }

    .row { margin-top: 28px; }
    .row-head h2 { font-size: 16px; }

    /* Let rows bleed to the screen edge for a natural swipe. */
    .scroller {
        --cols: 2.7;
        margin: 0 -16px;
        padding: 0 16px 6px;
        scroll-padding: 0 16px;
        grid-auto-columns: calc((100% - 32px - (var(--cols) - 1) * var(--gap)) / var(--cols));
    }
    .top10 { --cols: 2.1; }

    .channels { grid-template-columns: repeat(2, 1fr); }
    .channel { min-height: 58px; font-size: 14px; }

    .grid { grid-template-columns: repeat(auto-fill, minmax(104px, 1fr)); gap: 18px var(--gap); }

    .footer-inner { flex-direction: column; text-align: center; }
    .footer-links { justify-content: center; }

    .modal { padding: 10px; }
    .modal-dialog { padding: 10px; }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { transition: none !important; animation: none !important; }
}

/* ===== Loading states (content arrives from api.php) ===== */
.sk {
    display: block;
    border-radius: 6px;
    background: linear-gradient(90deg, #171a22 0%, #232734 50%, #171a22 100%);
    background-size: 200% 100%;
    animation: shimmer 1.3s linear infinite;
}

@keyframes shimmer { to { background-position: -200% 0; } }

.sk-line { height: 10px; margin-top: 8px; width: 80%; }
.sk-line.short { width: 50%; }
.sk-title { height: 52px; width: min(420px, 80%); margin: 14px 0 6px; border-radius: 10px; }

.hero-skeleton { background: var(--surface); }
.hero-skeleton .hero-content { width: 100%; }

.card-skeleton .poster::after { display: none; }

.load-more {
    min-height: 1px;
    padding: 24px 0 0;
    text-align: center;
    color: var(--muted);
    font-size: 13px;
}

.load-error {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 12px 16px;
    margin: 20px 0;
    padding: 18px;
    border: 1px dashed var(--line);
    border-radius: var(--radius);
    color: var(--muted);
    font-size: 14px;
    text-align: center;
}

.load-error p { margin: 0; }

@media (max-width: 640px) {
    .hero-skeleton { min-height: 340px; display: flex; align-items: flex-end; }
    .hero-skeleton .hero-content { margin-top: 0; padding: 22px 18px; }
}

/* ===== Watch Now / Download buttons on the title page ===== */
.facts-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid var(--line);
}

.facts-actions .btn { justify-content: center; padding: 0 14px; }

.stroke-icon {
    fill: none !important;
    stroke: currentColor;
    stroke-width: 2.2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.btn .stroke-icon { width: 16px; height: 16px; }

/* ===== Processing page (watch.php) ===== */
.process {
    position: relative;
    overflow: hidden;
    display: grid;
    place-items: center;
    min-height: calc(100vh - 220px);
    margin-top: 18px;
    padding: 48px 20px;
    border-radius: var(--radius-lg);
    background: var(--surface);
    isolation: isolate;
}

.process-bg { position: absolute; inset: 0; z-index: -1; }

.process-bg img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    filter: blur(18px) saturate(1.2);
    transform: scale(1.12);
    opacity: .45;
}

.process-bg::after {
    content: "";
    position: absolute;
    inset: 0;
    background: radial-gradient(ellipse at center, rgba(11, 12, 16, .55) 0%, rgba(11, 12, 16, .92) 75%);
}

.process-card {
    display: flex;
    gap: 32px;
    width: min(760px, 100%);
    padding: 28px;
    border: 1px solid rgba(255, 255, 255, .08);
    border-radius: var(--radius-lg);
    background: rgba(17, 19, 26, .78);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    box-shadow: 0 30px 60px rgba(0, 0, 0, .45);
}

.process-skeleton .process-card { display: block; }

.process-poster {
    flex: 0 0 180px;
    align-self: flex-start;
    box-shadow: 0 16px 34px rgba(0, 0, 0, .5);
}

.process-body { flex: 1; min-width: 0; }
.process-title { font-size: clamp(26px, 3.6vw, 36px); font-weight: 800; letter-spacing: -0.035em; line-height: 1.05; margin-bottom: 12px; }

.process-status {
    display: flex;
    align-items: center;
    gap: 18px;
    margin: 18px 0 16px;
}

.ring { position: relative; width: 92px; height: 92px; flex-shrink: 0; }
.ring svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.ring circle { fill: none; stroke-width: 8; }
.ring-track { stroke: rgba(255, 255, 255, .1); }
.ring-fill { stroke: var(--accent); stroke-linecap: round; transition: stroke-dashoffset .1s linear; }

.ring-value {
    position: absolute;
    inset: 0;
    display: grid;
    place-items: center;
    font-size: 19px;
    font-weight: 800;
    letter-spacing: -0.02em;
}

.is-complete .ring-fill { stroke: #3ccf7a; }

.process-label { margin: 0 0 2px; font-size: 16px; font-weight: 700; }
.process-text .muted { margin: 0; font-size: 13px; }
.is-complete .process-text .muted,
.is-failed .process-text .muted { display: none; }

.steps {
    display: grid;
    gap: 9px;
    margin: 0 0 18px;
    padding: 0;
    list-style: none;
    font-size: 13px;
    color: var(--muted);
}

.steps li { display: flex; align-items: center; gap: 10px; transition: color .2s; }

.step-dot {
    position: relative;
    width: 18px;
    height: 18px;
    flex-shrink: 0;
    border: 2px solid var(--line);
    border-radius: 50%;
    transition: border-color .2s, background .2s;
}

.steps li.is-active { color: var(--text); }
.steps li.is-active .step-dot { border-color: var(--accent); border-top-color: transparent; animation: spin .8s linear infinite; }
.steps li.is-done { color: var(--text); }
.steps li.is-done .step-dot { border-color: #3ccf7a; background: #3ccf7a; }

/* Tick mark inside completed steps. */
.steps li.is-done .step-dot::after {
    content: "";
    position: absolute;
    left: 4.5px;
    top: 1.5px;
    width: 4px;
    height: 8px;
    border: solid #0b0c10;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}

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

.process-done {
    margin-bottom: 16px;
    padding: 16px;
    border: 1px solid rgba(60, 207, 122, .3);
    border-radius: var(--radius);
    background: rgba(60, 207, 122, .07);
    animation: pop .25s ease;
}

.process-done p { margin: 0 0 12px; font-size: 14px; }
.process-actions { display: flex; flex-wrap: wrap; gap: 10px; }
.process-back { display: inline-block; color: var(--muted); font-size: 13px; }

@media (max-width: 640px) {
    .process { padding: 0; min-height: 0; margin-top: 12px; background: transparent; border-radius: 0; overflow: visible; }
    .process-bg { border-radius: var(--radius-lg); overflow: hidden; }
    .process-card { flex-direction: column; gap: 18px; padding: 20px; }
    .process-poster { flex-basis: auto; width: 110px; }
    .ring { width: 78px; height: 78px; }
    .process-actions .btn { flex: 1 1 auto; justify-content: center; }
    .facts-actions { grid-template-columns: 1fr; }
}

/* ===== "File not available" (step 2 with no file) ===== */
.is-failed .ring-fill { stroke: #ef5350; }
.is-failed .process-label { color: #ff8a80; }

.steps li.is-failed { color: #ff8a80; }
.steps li.is-failed .step-dot { border-color: #ef5350; background: #ef5350; }

/* Cross mark inside the failed step. */
.steps li.is-failed .step-dot::before,
.steps li.is-failed .step-dot::after {
    content: "";
    position: absolute;
    left: 6px;
    top: 2.5px;
    width: 2px;
    height: 9px;
    border-radius: 1px;
    background: #0b0c10;
    transform: rotate(45deg);
}

.steps li.is-failed .step-dot::after { transform: rotate(-45deg); }

.process-done.is-failed {
    border-color: rgba(239, 83, 80, .35);
    background: rgba(239, 83, 80, .08);
}

/* User icon inside the avatar button. */
.avatar svg {
    width: 20px;
    height: 20px;
    fill: none;
    stroke: #fff;
    stroke-width: 2;
    stroke-linecap: round;
}

/* ===== My List: remove button ===== */
.card-remove {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    width: 100%;
    height: 32px;
    margin-top: 10px;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: transparent;
    color: var(--muted);
    font-size: 12px;
    font-weight: 600;
    transition: color .15s, border-color .15s, background .15s;
}

.card-remove .stroke-icon { width: 13px; height: 13px; }

.card-remove:hover,
.card-remove:focus-visible {
    color: #ff8a80;
    border-color: rgba(239, 83, 80, .5);
    background: rgba(239, 83, 80, .08);
}

.card.is-removing {
    opacity: 0;
    transform: scale(.94);
    transition: opacity .25s ease, transform .25s ease;
    pointer-events: none;
}

/* ===== Footer: current page ===== */
.footer-links a.is-active { color: var(--text); text-decoration-color: var(--accent); }

/* ===== Legal pages (privacy.php, terms.php) ===== */
.doc-head {
    max-width: 760px;
    margin-top: 40px;
    padding-bottom: 28px;
    border-bottom: 1px solid var(--line);
}

.doc-head h1 { font-size: clamp(32px, 5vw, 50px); font-weight: 800; letter-spacing: -0.04em; line-height: 1.05; }
.doc-updated { margin: 10px 0 0; color: var(--muted); font-size: 13px; }
.doc-intro { margin-top: 18px; font-size: 16px; line-height: 1.7; color: #d4d7df; }
.doc-intro p { margin: 0; }
.doc-intro a { color: var(--accent); text-decoration: underline; text-underline-offset: 3px; }

.doc-body {
    display: grid;
    grid-template-columns: 240px minmax(0, 1fr);
    gap: 48px;
    margin-top: 32px;
}

.doc-toc { position: relative; }

.doc-toc details {
    position: sticky;
    top: 88px;
    padding: 18px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--surface);
}

.doc-toc summary {
    list-style: none;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: .12em;
    text-transform: uppercase;
    color: var(--muted);
    cursor: default;
}

.doc-toc summary::-webkit-details-marker { display: none; }

/* Always open on desktop (the sticky sidebar); toggleable on small screens. */
@media (min-width: 901px) {
    .doc-toc summary { pointer-events: none; }
}

.doc-toc ol {
    display: grid;
    gap: 2px;
    margin: 12px 0 0;
    padding: 0;
    list-style: none;
    counter-reset: toc;
}

.doc-toc li { counter-increment: toc; }

.doc-toc a {
    display: flex;
    gap: 10px;
    padding: 6px 8px;
    border-radius: 6px;
    font-size: 13px;
    color: #c3c7d1;
    transition: background .15s, color .15s;
}

.doc-toc a::before { content: counter(toc); min-width: 14px; color: var(--muted); font-variant-numeric: tabular-nums; }
.doc-toc a:hover { background: var(--surface-2); color: var(--text); }

.prose { max-width: 720px; font-size: 15px; line-height: 1.75; color: #d4d7df; }
.prose section { scroll-margin-top: 90px; padding-bottom: 28px; margin-bottom: 28px; border-bottom: 1px solid #1c1f28; }
.prose section:last-child { border-bottom: 0; margin-bottom: 0; }

.prose h2 {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 12px;
    font-size: 20px;
    font-weight: 700;
    color: var(--text);
}

.doc-num {
    display: grid;
    place-items: center;
    width: 28px;
    height: 28px;
    flex-shrink: 0;
    border-radius: 8px;
    background: rgba(244, 183, 64, .12);
    color: var(--accent);
    font-size: 13px;
    font-weight: 800;
}

.prose p { margin: 0 0 12px; }
.prose ul { margin: 0 0 12px; padding-left: 20px; }
.prose li { margin-bottom: 6px; }
.prose li::marker { color: var(--accent); }
.prose strong { color: var(--text); }

.prose a {
    color: var(--accent);
    text-decoration: underline;
    text-underline-offset: 3px;
    text-decoration-thickness: 1px;
}

.prose code {
    padding: 1px 6px;
    border-radius: 4px;
    background: var(--surface-2);
    font-size: 13px;
    color: #f3d9a4;
    overflow-wrap: anywhere;
}

.check-list { list-style: none; padding-left: 0 !important; }
.check-list li { position: relative; padding-left: 28px; }

.check-list li::before {
    content: "";
    position: absolute;
    left: 2px;
    top: 7px;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: rgba(60, 207, 122, .15);
    box-shadow: inset 0 0 0 1.5px #3ccf7a;
}

.check-list li::after {
    content: "";
    position: absolute;
    left: 7px;
    top: 9.5px;
    width: 4px;
    height: 7px;
    border: solid #3ccf7a;
    border-width: 0 1.5px 1.5px 0;
    transform: rotate(45deg);
}

.table-wrap { overflow-x: auto; margin: 4px 0 14px; border: 1px solid var(--line); border-radius: var(--radius); }
.prose table { width: 100%; min-width: 520px; border-collapse: collapse; font-size: 14px; line-height: 1.5; }
.prose th, .prose td { padding: 12px 14px; text-align: left; vertical-align: top; border-bottom: 1px solid var(--line); }
.prose th { background: var(--surface); color: var(--muted); font-size: 12px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; }
.prose tr:last-child td { border-bottom: 0; }

/* ===== About page ===== */
.about-hero {
    position: relative;
    overflow: hidden;
    display: grid;
    grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr);
    align-items: center;
    gap: 32px;
    margin-top: 18px;
    padding: 56px 48px;
    border: 1px solid #1d2029;
    border-radius: var(--radius-lg);
    background:
        radial-gradient(circle at 85% 30%, rgba(243, 154, 44, .22), transparent 45%),
        linear-gradient(135deg, #171a23, #101219);
}

.about-hero h1 { font-size: clamp(34px, 5.4vw, 58px); font-weight: 800; letter-spacing: -0.045em; line-height: 1.02; margin-bottom: 18px; }
.lede { margin: 0 0 26px; max-width: 540px; font-size: 16px; line-height: 1.7; color: #c9ccd5; }

.about-hero-art { display: grid; place-items: center; }

.about-hero-art .logo-mark {
    width: min(220px, 60%);
    height: auto;
    aspect-ratio: 1;
    border-radius: 28%;
    box-shadow: 0 30px 80px rgba(243, 154, 44, .35);
    transform: rotate(-8deg);
}

.about-section { margin-top: 56px; }
.about-section > h2 { font-size: clamp(22px, 3vw, 28px); font-weight: 800; letter-spacing: -0.03em; margin-bottom: 20px; }

.feature-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; }

.feature {
    padding: 22px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--surface);
    transition: border-color .2s, transform .2s;
}

.feature:hover { border-color: #3a3f4f; transform: translateY(-2px); }

.feature-icon {
    display: grid;
    place-items: center;
    width: 42px;
    height: 42px;
    margin-bottom: 16px;
    border-radius: 12px;
    background: rgba(244, 183, 64, .12);
}

.feature-icon svg { width: 22px; height: 22px; fill: none; stroke: var(--accent); stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.feature h3, .steps-row h3, .value h3 { font-size: 16px; font-weight: 700; margin-bottom: 6px; }
.feature p, .steps-row p, .value p { margin: 0; font-size: 14px; line-height: 1.6; color: var(--muted); }

.steps-row {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 14px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.steps-row li {
    padding: 22px;
    border-top: 2px solid var(--accent);
    border-radius: var(--radius);
    background: linear-gradient(180deg, var(--surface), transparent);
}

.step-num {
    display: block;
    margin-bottom: 10px;
    font-size: 36px;
    font-weight: 800;
    line-height: 1;
    letter-spacing: -0.05em;
    color: transparent;
    -webkit-text-stroke: 1.5px var(--accent);
}

.values { display: grid; grid-template-columns: repeat(3, 1fr); gap: 32px; }
.value { padding-left: 18px; border-left: 2px solid var(--line); }

.about-cta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px 32px;
    margin-top: 56px;
    padding: 28px 32px;
    border: 1px solid rgba(244, 183, 64, .25);
    border-radius: var(--radius-lg);
    background: rgba(244, 183, 64, .06);
}

.about-cta h2 { font-size: 20px; font-weight: 800; margin-bottom: 6px; }
.about-cta p { margin: 0; color: #c9ccd5; font-size: 14px; }
.about-cta a:not(.btn) { color: var(--accent); text-decoration: underline; text-underline-offset: 3px; overflow-wrap: anywhere; }
.about-note { margin: 24px 0 0; font-size: 12px; line-height: 1.6; color: var(--muted); }

@media (max-width: 1100px) {
    .feature-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 900px) {
    .doc-body { grid-template-columns: 1fr; gap: 24px; }
    .doc-toc details { position: static; }
    .doc-toc summary { cursor: pointer; display: flex; justify-content: space-between; }
    .doc-toc summary::after { content: "+"; font-size: 16px; line-height: 1; }
    .doc-toc details[open] summary::after { content: "\2013"; }

    .about-hero { grid-template-columns: 1fr; padding: 40px 28px; }
    .about-hero-art { display: none; }
    .steps-row, .values { grid-template-columns: 1fr; }
    .values { gap: 20px; }
}

@media (max-width: 640px) {
    .doc-head { margin-top: 28px; }
    .doc-intro { font-size: 15px; }
    .prose { font-size: 14.5px; }
    .prose h2 { font-size: 18px; }
    .prose table { min-width: 0; }

    .about-hero { margin-top: 12px; padding: 32px 20px; }
    .about-section { margin-top: 40px; }
    .feature-grid { grid-template-columns: 1fr; }
    .about-cta { flex-direction: column; align-items: flex-start; padding: 22px 20px; margin-top: 40px; }
}
