:root {
    --bg: #f5f6f8;
    --surface: #ffffff;
    --surface-2: #eef0f4;
    --line: #e3e6ec;
    --text: #12141a;
    --muted: #5f6675;
    --accent: #e8590c;
    --accent-2: #f03e78;
    --accent-ink: #fff;
    --accent-soft: #fff0e6;
    --easynews: #1c6fd6;
    --eweka: #12965a;
    --warn: #d12c45;
    --warn-soft: #fdebee;
    --focus: #3b82f6;
    --radius: 16px;
    --shadow: 0 1px 2px rgb(16 20 30 / .05), 0 10px 30px -14px rgb(16 20 30 / .18);
    --shadow-lg: 0 2px 6px rgb(16 20 30 / .06), 0 24px 60px -20px rgb(16 20 30 / .28);
    --grad: linear-gradient(135deg, var(--accent), var(--accent-2));
    --glass: rgb(255 255 255 / .72);
    --ease: cubic-bezier(.2, .8, .2, 1);
    --mono: ui-monospace, "SF Mono", "JetBrains Mono", Menlo, Consolas, monospace;
    --sans: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
    color-scheme: light;
}

@media (prefers-color-scheme: dark) {
    :root {
        --bg: #0b0d12;
        --surface: #13161d;
        --surface-2: #1c2029;
        --line: #262b36;
        --text: #eef1f6;
        --muted: #98a1b2;
        --accent: #ff7a3d;
        --accent-2: #ff4d8d;
        --accent-ink: #160905;
        --accent-soft: #2e1c16;
        --easynews: #6cb4ff;
        --eweka: #4fe0a0;
        --warn: #ff7b8b;
        --warn-soft: #34171d;
        --focus: #6cb4ff;
        --shadow: 0 1px 2px rgb(0 0 0 / .5), 0 12px 32px -16px rgb(0 0 0 / .8);
        --shadow-lg: 0 2px 8px rgb(0 0 0 / .5), 0 28px 70px -24px rgb(0 0 0 / .9);
        --glass: rgb(19 22 29 / .7);
        color-scheme: dark;
    }
}

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

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

body {
    margin: 0;
    background: var(--bg);
    color: var(--text);
    font: 15px/1.5 var(--sans);
    -webkit-font-smoothing: antialiased;
}

.wrap { width: min(1080px, 100% - 32px); margin-inline: auto; }

.visually-hidden {
    position: absolute !important;
    width: 1px; height: 1px;
    overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap;
}

.skip {
    position: absolute; left: 16px; top: -48px; z-index: 40;
    padding: 8px 14px; border-radius: 8px;
    background: var(--accent); color: var(--accent-ink); text-decoration: none;
}
.skip:focus { top: 12px; }

:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }

/* Header */
.top { border-bottom: 1px solid var(--line); }
.top .wrap {
    display: flex; align-items: center; justify-content: space-between; gap: 16px;
    min-height: 60px; flex-wrap: wrap;
}
.brand {
    display: inline-flex; align-items: center; gap: 10px;
    color: var(--text); text-decoration: none;
    font-weight: 700; font-size: 17px; letter-spacing: -.01em;
}
.brand-mark {
    width: 22px; height: 22px; border-radius: 7px;
    background:
        radial-gradient(circle at 35% 35%, transparent 4px, var(--accent-ink) 4.5px 6.5px, transparent 7px),
        var(--accent);
}
.brand-dot { color: var(--accent); }
.src { font-weight: 600; }
.src-en { color: var(--easynews); }
.src-ew { color: var(--eweka); }

/* Search */
.search { padding-block: 28px 8px; }
.search-box {
    position: relative; display: flex; align-items: center; gap: 8px;
    padding: 6px 6px 6px 46px;
    background: var(--surface); border: 1px solid var(--line); border-radius: 999px;
    box-shadow: var(--shadow);
    transition: border-color .15s, box-shadow .15s;
}
.search-box:focus-within { border-color: var(--accent); box-shadow: var(--shadow), 0 0 0 4px var(--accent-soft); }
.search-icon {
    position: absolute; left: 17px; width: 20px; height: 20px;
    fill: none; stroke: var(--muted); stroke-width: 2; stroke-linecap: round;
}
.search-box input {
    flex: 1; min-width: 0; height: 44px;
    border: 0; background: transparent; color: inherit;
    font: inherit; font-size: 17px; outline: none;
}
.search-box input::-webkit-search-cancel-button { cursor: pointer; }
.hint {
    padding: 1px 7px; border: 1px solid var(--line); border-radius: 6px;
    color: var(--muted); font: 12px var(--mono);
}
.search-box:focus-within .hint { display: none; }

button { font: inherit; cursor: pointer; }
.btn-primary {
    height: 44px; padding: 0 22px; border: 0; border-radius: 999px;
    background: var(--accent); color: var(--accent-ink); font-weight: 600;
    transition: filter .15s, transform .1s;
}
.btn-primary:hover { filter: brightness(1.08); }
.btn-primary:active { transform: translateY(1px); }
.btn-ghost {
    height: 36px; padding: 0 14px; border: 1px solid var(--line); border-radius: 10px;
    background: var(--surface); color: var(--text);
}
.btn-ghost:hover:not(:disabled) { border-color: var(--muted); }
.btn-ghost:disabled { opacity: .45; cursor: default; }

/* Filters */
.filters {
    display: flex; flex-wrap: wrap; align-items: flex-end; gap: 10px 14px;
    margin: 18px 0 0; padding: 0; border: 0; min-width: 0;
}
.seg {
    display: inline-flex; padding: 3px; gap: 2px;
    background: var(--surface-2); border-radius: 11px;
}
.seg label { position: relative; }
.seg input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.seg span {
    display: block; padding: 6px 12px; border-radius: 8px;
    color: var(--muted); font-size: 14px; font-weight: 500; white-space: nowrap;
    transition: background .15s, color .15s;
}
.seg input:checked + span { background: var(--surface); color: var(--text); box-shadow: var(--shadow); }
.seg input:focus-visible + span { outline: 2px solid var(--focus); outline-offset: 1px; }

.field { display: grid; gap: 3px; }
.field > span { color: var(--muted); font-size: 12px; font-weight: 500; padding-left: 2px; }
.field select {
    height: 36px; padding: 0 30px 0 11px;
    border: 1px solid var(--line); border-radius: 10px;
    background: var(--surface) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12'%3E%3Cpath d='M3 4.5 6 7.5 9 4.5' fill='none' stroke='%23888' stroke-width='1.6' stroke-linecap='round'/%3E%3C/svg%3E") no-repeat right 10px center / 12px;
    color: var(--text); font: inherit; font-size: 14px;
    appearance: none; cursor: pointer;
}
.field select.is-set { border-color: var(--accent); background-color: var(--accent-soft); }

/* Newsgroup filter chip */
.group-filter {
    display: inline-flex; align-items: center; gap: 6px; align-self: end;
    height: 36px; padding: 0 4px 0 12px; max-width: 100%;
    border: 1px solid var(--accent); border-radius: 10px; background: var(--accent-soft);
    font-size: 14px;
}
.group-filter[hidden] { display: none; }
.group-filter-label { color: var(--muted); font-size: 12px; font-weight: 500; }
.group-filter-name { font-family: var(--mono); font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.group-filter-clear {
    width: 28px; height: 28px; border: 0; border-radius: 7px;
    background: transparent; color: var(--muted); font-size: 18px; line-height: 1; cursor: pointer;
}
.group-filter-clear:hover { background: var(--surface); color: var(--text); }
.group-filter-clear:focus-visible { outline: 2px solid var(--focus); outline-offset: 1px; }

/* Status + view switch */
.results-head {
    display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 16px;
    margin: 22px 0 10px;
}
.status { min-height: 22px; margin: 0; color: var(--muted); font-size: 13px; }
.service-alert {
    display: flex; align-items: center; gap: 12px;
    margin: 16px 0 0; padding: 10px 12px 10px 14px;
    border: 1px solid color-mix(in srgb, var(--warn) 30%, transparent); border-radius: 12px;
    background: var(--warn-soft); color: var(--warn); font-size: 14px;
}
.service-alert[hidden] { display: none; }
.service-alert svg {
    width: 20px; height: 20px; flex: none;
    fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round;
}
.service-alert p { flex: 1; min-width: 0; margin: 0; }
.service-alert strong { font-weight: 600; }
.service-alert-text { color: var(--text); }
.service-alert .btn-ghost { flex: none; }
@media (max-width: 560px) {
    .service-alert { flex-wrap: wrap; }
    .service-alert .btn-ghost { margin-left: 32px; }
}
.view-tools { display: flex; align-items: center; gap: 14px; margin-left: auto; }
.view-tools[hidden], .view-size[hidden] { display: none; }
.seg-icons span { display: inline-flex; align-items: center; gap: 6px; padding: 5px 10px; font-size: 13px; }
.seg-icons b { font-weight: 500; }
.seg-icons svg, .view-size svg {
    width: 16px; height: 16px; flex: none;
    fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round;
}
.view-size { display: inline-flex; align-items: center; gap: 8px; color: var(--muted); }
.view-size input { width: 88px; margin: 0; accent-color: var(--accent); cursor: pointer; }
.status strong { color: var(--text); }
.status .tag {
    margin-left: 6px; padding: 1px 7px; border-radius: 999px;
    background: var(--surface-2); font-size: 11px;
}

/* Results */
.results { display: grid; gap: 8px; outline: none; }
.results[aria-busy="true"] .item { opacity: .45; }

.item {
    display: grid; grid-template-columns: 64px 1fr auto; gap: 14px; align-items: center;
    padding: 12px 16px 12px 12px;
    background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
    transition: border-color .15s, transform .15s;
}
.item:hover { border-color: color-mix(in srgb, var(--accent) 45%, var(--line)); }

.item-res {
    display: grid; place-items: center; height: 44px; border-radius: 10px;
    background: var(--surface-2); color: var(--muted);
    font: 700 13px var(--mono); letter-spacing: -.02em;
}
.item-res[data-tier="uhd"] { background: var(--accent); color: var(--accent-ink); }
.item-res[data-tier="fhd"] { background: var(--accent-soft); color: var(--accent); }

.item-body { min-width: 0; }
.item-title {
    margin: 0; font: 500 14.5px/1.35 var(--mono);
    overflow-wrap: anywhere;
}
.item-title .ext { color: var(--muted); }
.item-orig {
    margin: 2px 0 0; color: var(--muted);
    font: 12px/1.35 var(--mono); overflow-wrap: anywhere;
}
.item[data-probe] .item-orig { animation: probe-pulse 1.2s ease-in-out infinite alternate; }
@keyframes probe-pulse { from { opacity: .45; } to { opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .item[data-probe] .item-orig { animation: none; } }
.item-meta {
    display: flex; flex-wrap: wrap; gap: 4px 12px;
    margin: 5px 0 0; padding: 0; list-style: none;
    color: var(--muted); font-size: 12.5px;
}
.meta-groups { display: inline-flex; flex-wrap: wrap; gap: 2px 8px; }
.item-group, .item-group-more {
    padding: 0; border: 0; background: none; color: inherit; font: inherit; cursor: pointer;
    text-decoration: underline dotted; text-underline-offset: 3px;
}
.item-group:hover, .item-group-more:hover { color: var(--accent); text-decoration-style: solid; }
.item-group:focus-visible, .item-group-more:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; border-radius: 3px; }

/* Release tags */
.item-tags {
    display: flex; flex-wrap: wrap; gap: 4px;
    margin: 6px 0 0; padding: 0; list-style: none;
}
.chip {
    display: inline-block; padding: 1px 7px; border-radius: 6px;
    background: var(--surface-2); color: var(--muted);
    font: 600 11px/1.6 var(--mono); letter-spacing: .01em; white-space: nowrap;
}
.chip-src { background: color-mix(in srgb, var(--easynews) 14%, var(--surface)); color: var(--easynews); }
.chip-hdr { background: var(--accent-soft); color: var(--accent); }
.chip-lang { background: color-mix(in srgb, var(--eweka) 14%, var(--surface)); color: var(--eweka); }
.chip-bad { background: var(--warn-soft); color: var(--warn); }
.chip[title] { cursor: help; }

/* Merged copies */
.copies { margin-top: 6px; font-size: 12.5px; }
.copies summary {
    display: inline-block; color: var(--muted); cursor: pointer; border-radius: 6px;
    list-style: none;
}
.copies summary::-webkit-details-marker { display: none; }
.copies summary::before { content: "▸ "; }
.copies[open] summary::before { content: "▾ "; }
.copies summary:hover { color: var(--text); }
.copies ul { display: grid; gap: 4px; margin: 6px 0 0; padding: 0 0 0 10px; list-style: none; border-left: 2px solid var(--line); }
.copies li { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 12px; color: var(--muted); }
.copy-name { flex: 1 1 200px; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-family: var(--mono); }
.copy-size { color: var(--text); font-weight: 600; font-variant-numeric: tabular-nums; }
.copies li.is-hidden { opacity: .7; }

/* Hidden-results toggle */
.link {
    padding: 0; border: 0; background: none;
    color: var(--accent); font-size: inherit; text-decoration: underline; text-underline-offset: 2px;
}
.link:hover { text-decoration-thickness: 2px; }
.empty .link { margin-top: 12px; font-size: 14px; }

.item-side { display: grid; justify-items: end; gap: 2px; text-align: right; white-space: nowrap; }
.item-size { font-weight: 700; font-variant-numeric: tabular-nums; }
.item-date { color: var(--muted); font-size: 12.5px; }

.item-actions { display: flex; gap: 6px; margin-bottom: 4px; }
.item-play, .item-dl, .item-check {
    display: inline-flex; align-items: center; gap: 5px;
    height: 30px; padding: 0 12px 0 9px; border: 0; border-radius: 999px;
    background: var(--accent-soft); color: var(--accent); font-size: 13px; font-weight: 600;
    transition: background .15s, color .15s;
}
.item-play svg { width: 14px; height: 14px; fill: currentColor; }
.item-view svg { width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linejoin: round; }
.item-play:hover { background: var(--accent); color: var(--accent-ink); }
.item-dl { background: color-mix(in srgb, var(--eweka) 14%, var(--surface)); color: var(--eweka); }
.item-dl svg, .icon-btn svg, .dl-open svg {
    width: 15px; height: 15px; fill: none; stroke: currentColor;
    stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round;
}
.item-dl:hover:not(:disabled) { background: var(--eweka); color: var(--surface); }
.item-dl:disabled { cursor: default; }
.item-dl[aria-busy="true"] { opacity: .7; cursor: progress; }
.item-dl.is-done { background: var(--surface-2); color: var(--eweka); }
.item-check { background: var(--surface-2); color: var(--muted); }
.item-check svg { width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.item-check:hover { color: var(--eweka); }
.item-check[aria-busy="true"] { opacity: .7; cursor: progress; }

/* Header downloads button */
.top-end { display: flex; align-items: center; gap: 16px; }
.dl-open {
    display: inline-flex; align-items: center; gap: 7px;
    height: 36px; padding: 0 12px; border: 1px solid var(--line); border-radius: 999px;
    background: var(--surface); color: var(--text); font-size: 14px; font-weight: 500;
    text-decoration: none;
}
.dl-open:hover { border-color: var(--eweka); }
.dl-open[hidden] { display: none; }
.dl-open.is-active svg { color: var(--eweka); animation: bob 1.4s ease-in-out infinite; }
@keyframes bob { 50% { transform: translateY(2px); } }
.dl-badge {
    min-width: 20px; height: 20px; padding: 0 6px; border-radius: 999px;
    background: var(--eweka); color: var(--surface);
    font: 700 11px/20px var(--mono); text-align: center;
}

/* Downloads drawer */
.drawer {
    position: fixed; inset: 0 0 0 auto; margin: 0;
    width: min(480px, 100vw); height: 100dvh; max-width: none; max-height: none;
    padding: 0; border: 0; border-left: 1px solid var(--line);
    background: var(--surface); color: var(--text); box-shadow: var(--shadow);
}
.drawer[open] { animation: slide-in .18s ease-out; }
@keyframes slide-in { from { transform: translateX(24px); opacity: 0; } }
.drawer::backdrop { background: rgb(10 8 5 / .45); }
.drawer-inner { display: flex; flex-direction: column; gap: 14px; min-height: 100%; padding: 0 18px 18px; }
.drawer-head {
    position: sticky; top: 0; z-index: 1;
    display: flex; align-items: center; gap: 12px; margin: 0 -18px; padding: 12px 10px 12px 18px;
    background: var(--surface); border-bottom: 1px solid var(--line);
}
.drawer-title { flex: 1; margin: 0; font-size: 17px; font-weight: 600; }
.drawer-title .src { margin-left: 4px; font-size: 13px; }
.drawer-sub {
    margin: 0 0 8px; color: var(--muted);
    font-size: 12px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase;
}
.drawer-foot { margin-top: auto; font-size: 13px; }
.drawer-foot a { color: var(--muted); }
.drawer-foot a:hover { color: var(--text); }
.dl-summary { margin: 0; min-height: 20px; color: var(--muted); font-size: 13px; font-variant-numeric: tabular-nums; }
.dl-error { margin: 0; padding: 8px 12px; border-radius: 10px; background: var(--warn-soft); color: var(--warn); font-size: 13px; }

.dl-list { display: grid; gap: 8px; margin: 0; padding: 0; list-style: none; }
.dl-empty { padding: 14px; border: 1px dashed var(--line); border-radius: 12px; color: var(--muted); font-size: 13px; }
.dl-row { display: grid; gap: 7px; padding: 10px 10px 10px 12px; border: 1px solid var(--line); border-radius: 12px; background: var(--bg); }
.dl-top { display: flex; align-items: flex-start; gap: 8px; }
.dl-name { flex: 1; min-width: 0; padding-top: 4px; font: 500 13px/1.35 var(--mono); overflow-wrap: anywhere; }
.dl-ops { display: flex; flex: none; gap: 2px; }
.icon-btn {
    display: grid; place-items: center; width: 28px; height: 28px;
    border: 0; border-radius: 8px; background: transparent; color: var(--muted);
}
.icon-btn:hover { background: var(--surface-2); color: var(--text); }
.icon-btn[data-op="delete"]:hover { background: var(--warn-soft); color: var(--warn); }
.icon-btn[aria-disabled="true"] { opacity: .4; cursor: progress; }
.dl-bar { height: 6px; border-radius: 999px; background: var(--surface-2); overflow: hidden; }
.dl-bar > span { display: block; height: 100%; width: 0; border-radius: inherit; background: var(--eweka); transition: width .5s ease; }
.dl-row.is-paused .dl-bar > span { background: var(--muted); }
.dl-info {
    display: flex; flex-wrap: wrap; align-items: center; gap: 2px 12px;
    color: var(--muted); font-size: 12px; font-variant-numeric: tabular-nums;
}
.dl-path, .dl-err { margin: 0; font-size: 12px; overflow-wrap: anywhere; }
.dl-path { display: flex; align-items: center; gap: 8px; color: var(--muted); }
.dl-path-text { flex: 1; min-width: 0; font-family: var(--mono); user-select: all; }
.dl-browse {
    display: inline-flex; flex: none; align-items: center; gap: 5px;
    height: 28px; padding: 0 10px; border-radius: 8px; font-size: 12px; font-weight: 500;
}
.dl-browse svg { width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linejoin: round; }
.dl-browse[aria-disabled="true"] { opacity: .5; cursor: progress; }
.dl-err { color: var(--warn); }
.chip-ok { background: color-mix(in srgb, var(--eweka) 14%, var(--surface)); color: var(--eweka); }

.toast {
    position: fixed; inset: auto auto 20px 50%; z-index: 20; transform: translateX(-50%);
    width: max-content; max-width: calc(100vw - 32px); height: auto; margin: 0; padding: 10px 16px; overflow: visible;
    border: 0; border-radius: 12px; background: var(--text); color: var(--bg);
    font-size: 14px; box-shadow: var(--shadow);
}
.toast.is-error { background: var(--warn); color: #fff; }

/* Favourites */
.item-fav, .lib-fav { color: var(--muted); }
.item-fav {
    display: grid; place-items: center; width: 30px; height: 30px; padding: 0;
    border: 0; border-radius: 999px; background: var(--surface-2);
    transition: background .15s, color .15s;
}
.item-fav svg, .lib-fav svg, .lib-open svg {
    width: 15px; height: 15px; fill: none; stroke: currentColor;
    stroke-width: 2; stroke-linejoin: round;
}
.item-fav:hover, .lib-fav:hover { color: var(--accent); }
.item-fav[aria-pressed="true"], .lib-fav[aria-pressed="true"] { color: var(--accent); }
.item-fav[aria-pressed="true"] { background: var(--accent-soft); }
.item-fav[aria-pressed="true"] svg, .lib-fav[aria-pressed="true"] svg { fill: currentColor; }
.item-fav[aria-disabled="true"] { opacity: .5; cursor: progress; }
.item-fav[aria-pressed="true"] svg { animation: pop .25s ease-out; }
@keyframes pop { 50% { transform: scale(1.25); } }
.meta-seen { color: var(--eweka); font-weight: 600; }
.meta-integrity { font-weight: 600; cursor: help; white-space: nowrap; font-variant-numeric: tabular-nums; }
.meta-integrity::before {
    content: ""; display: inline-block; width: 7px; height: 7px; margin-right: 5px;
    border-radius: 50%; background: currentColor; vertical-align: 1px;
}
.meta-integrity[data-level="good"] { color: var(--eweka); }
.meta-integrity[data-level="fair"] { color: color-mix(in srgb, var(--warn) 55%, var(--eweka)); }
.meta-integrity[data-level="bad"] { color: var(--warn); }
.lib-open:hover { border-color: var(--accent); }
.lib-open svg { color: var(--accent); }

/* Library drawer */
.tabs {
    display: flex; gap: 2px; padding: 3px;
    border: 1px solid var(--line); border-radius: 12px; background: var(--bg);
}
.tabs [role="tab"] {
    flex: 1; display: inline-flex; align-items: center; justify-content: center; gap: 6px;
    height: 34px; padding: 0 10px; border: 0; border-radius: 9px;
    background: transparent; color: var(--muted); font-size: 14px; font-weight: 500;
}
.tabs [role="tab"]:hover { color: var(--text); }
.tabs [aria-selected="true"] { background: var(--surface); color: var(--text); box-shadow: var(--shadow); }
.tab-n:not(:empty) {
    min-width: 20px; padding: 0 6px; border-radius: 999px;
    background: var(--surface-2); color: var(--muted); font: 600 11px/18px var(--mono);
}
.tabs [aria-selected="true"] .tab-n { background: var(--accent-soft); color: var(--accent); }
.lib-panel { display: grid; gap: 10px; }
.lib-panel[hidden] { display: none; }
.lib-filter { display: flex; flex-wrap: wrap; gap: 6px; }
.lib-filter button {
    height: 28px; padding: 0 12px; border: 1px solid var(--line); border-radius: 999px;
    background: transparent; color: var(--muted); font-size: 13px;
}
.lib-filter button:hover { color: var(--text); }
.lib-filter [aria-pressed="true"] { border-color: var(--text); background: var(--text); color: var(--bg); }
.lib-actions { margin: 0; }
.lib-actions :is(.item-play, .item-check, .item-dl) { height: 28px; font-size: 12.5px; }
.lib-q {
    flex: 1; min-width: 0; padding: 4px 0 0; border: 0; background: none;
    color: var(--text); font: 600 14px/1.35 var(--sans); text-align: left; overflow-wrap: anywhere;
}
.lib-q:hover { color: var(--accent); text-decoration: underline; text-underline-offset: 2px; }
.lib-foot { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px; color: var(--muted); }
.lib-foot .link { font-size: 13px; color: var(--warn); }

/* Player */
.player {
    width: min(1100px, 100vw - 32px); max-height: calc(100dvh - 32px);
    padding: 0; border: 1px solid var(--line); border-radius: var(--radius);
    background: var(--surface); color: var(--text); box-shadow: var(--shadow);
}
.player::backdrop { background: rgb(10 8 5 / .72); backdrop-filter: blur(3px); }
.player-inner { display: grid; }
.player-head { display: flex; align-items: center; gap: 12px; padding: 10px 10px 10px 18px; }
.player-title {
    flex: 1; min-width: 0; margin: 0;
    font: 500 14px/1.35 var(--mono); overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.player-close {
    display: grid; place-items: center; flex: none;
    width: 34px; height: 34px; border: 0; border-radius: 10px;
    background: transparent; color: var(--muted);
}
.player-close:hover { background: var(--surface-2); color: var(--text); }
.player-close svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; }
.player-video { display: block; width: 100%; max-height: calc(100dvh - 160px); aspect-ratio: 16 / 9; background: #000; }
.player-seek { display: flex; align-items: center; gap: 12px; padding: 10px 18px 0; }
.player-seek[hidden] { display: none; }
.player-range { flex: 1; min-width: 0; margin: 0; accent-color: var(--accent); }
.player-range[hidden] { display: none; }
.player-time { flex: none; color: var(--muted); font: 13px/1 var(--mono); font-variant-numeric: tabular-nums; }
.player-note {
    margin: 0; padding: 10px 18px;
    background: var(--warn-soft); color: var(--warn); font-size: 13.5px;
}
.player-foot {
    display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px 16px;
    padding: 12px 18px;
}
.player-meta { color: var(--muted); font-size: 13px; font-variant-numeric: tabular-nums; }
.player-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.player-actions .btn-ghost { display: inline-flex; align-items: center; font-size: 14px; text-decoration: none; }

.item.is-hidden { border-style: dashed; }
.item.is-hidden .item-title, .item.is-hidden .item-res { opacity: .6; }
.item.is-flagged { border-color: color-mix(in srgb, var(--warn) 40%, var(--line)); background: color-mix(in srgb, var(--warn-soft) 45%, var(--surface)); }

/* Thumbnails (every layout) */
.item-thumb {
    position: relative; display: block; overflow: hidden;
    padding: 0; border: 0; border-radius: 10px;
    background: var(--surface-2); cursor: zoom-in;
}
.item[data-type="VIDEO"] .item-thumb { cursor: pointer; }
.item-thumb img {
    display: block; width: 100%; height: 100%; object-fit: cover;
    transition: transform .35s cubic-bezier(.2, .7, .2, 1);
}
.item-thumb:hover img { transform: scale(1.05); }
.item-thumb.is-failed img { display: none; }
.item-thumb .item-res {
    position: absolute; left: 5px; bottom: 5px; height: auto; padding: 1px 6px; border-radius: 6px;
    background: rgb(12 10 8 / .66); color: #fff; font-size: 10.5px; backdrop-filter: blur(4px);
}
.item-thumb .item-res[data-tier="fhd"] { background: rgb(12 10 8 / .66); color: #ffb48a; }
.item-thumb.is-failed .item-res { position: static; display: grid; height: 100%; background: none; color: var(--muted); font-size: 13px; backdrop-filter: none; }
.item-thumb:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
.item.is-hidden .item-thumb { opacity: .6; }

/* Easynews image thumbs are ~160 px, so sizes stay close to that to avoid blurry upscaling. */
.results { --tile: 210px; --row: 160px; }
.results[data-size="1"] { --tile: 160px; --row: 118px; }
.results[data-size="3"] { --tile: 280px; --row: 220px; }
.results > .empty, .results > .error { grid-column: 1 / -1; flex: 1 1 100%; }

/* List layout: a small preview takes the badge column */
.item.has-thumb { grid-template-columns: 84px 1fr auto; }
.item.has-thumb .item-thumb { width: 84px; aspect-ratio: 4 / 3; }

/* Hover peek: enlarged preview of a list thumbnail, follows the pointer */
.thumb-peek {
    position: fixed; left: 0; top: 0; z-index: 30;
    padding: 4px; border: 1px solid var(--line); border-radius: 12px;
    background: var(--surface); box-shadow: var(--shadow);
    pointer-events: none; visibility: hidden; opacity: 0;
    transition: opacity .15s, visibility 0s .15s;
}
.thumb-peek.is-open { visibility: visible; opacity: 1; transition: opacity .15s; }
.thumb-peek img {
    display: block; border-radius: 8px;
    min-width: 240px; max-width: min(480px, 60vw); max-height: min(480px, 70vh);
    width: auto; height: auto; object-fit: contain;
}
@media (prefers-reduced-motion: reduce) { .thumb-peek, .thumb-peek.is-open { transition: none; } }

/* Card layout */
.results[data-view="card"] { grid-template-columns: repeat(auto-fill, minmax(min(var(--tile), 100%), 1fr)); gap: 14px; }
.results[data-view="card"] .item {
    display: flex; flex-direction: column; align-items: stretch; gap: 10px;
    padding: 8px 8px 12px; transition: border-color .15s, box-shadow .2s, transform .2s;
}
.results[data-view="card"] .item:hover { transform: translateY(-2px); box-shadow: var(--shadow); }
.results[data-view="card"] .item-thumb,
.results[data-view="card"] .item > .item-res { width: 100%; height: auto; aspect-ratio: 4 / 3; }
.results[data-view="card"] .item > .item-res { font-size: 20px; }
.results[data-view="card"] .item-body { flex: 1; padding: 0 4px; }
.results[data-view="card"] .item-title {
    font-size: 13px;
    display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; line-clamp: 2; overflow: hidden;
}
.results[data-view="card"] .item-orig { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.results[data-view="card"] .item-meta { font-size: 12px; }
.results[data-view="card"] .item-group { text-align: left; overflow-wrap: anywhere; }
.results[data-view="card"] .item-side {
    display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px;
    padding: 0 4px; text-align: left; white-space: normal;
}
.results[data-view="card"] .item-actions { order: 3; flex-wrap: wrap; margin: 0 0 0 auto; }
/* The preview itself opens the viewer/player; no second button needed on a card. */
.results[data-view="card"] .item.has-thumb .item-play { display: none; }
.results[data-view="card"] .skeleton { height: auto; aspect-ratio: 4 / 5; }

/* Gallery layout: justified rows, every row the same height, aspect ratios kept */
.results[data-view="grid"] { display: flex; flex-wrap: wrap; gap: 6px; }
.results[data-view="grid"]::after { content: ""; flex: 999 1 0; }
.results[data-view="grid"] .item {
    position: relative; display: block; min-width: 0; padding: 0; overflow: hidden;
    flex: var(--ar, 1.333) 1 calc(var(--ar, 1.333) * var(--row));
    border: 0; border-radius: 10px; background: var(--surface-2);
}
.results[data-view="grid"] .item-thumb,
.results[data-view="grid"] .item > .item-res { width: 100%; height: auto; aspect-ratio: var(--ar, 1.333); border-radius: 0; }
.results[data-view="grid"] .item > .item-res { font-size: 18px; }
.results[data-view="grid"] .item-thumb:hover img { transform: scale(1.03); }
.results[data-view="grid"] .item-thumb .item-res { opacity: 0; transition: opacity .18s; }
.results[data-view="grid"] .item-thumb.is-failed .item-res { opacity: 1; }
.results[data-view="grid"] .item-tags,
.results[data-view="grid"] .item-meta,
.results[data-view="grid"] .item-orig,
.results[data-view="grid"] .copies,
.results[data-view="grid"] .item-date,
.results[data-view="grid"] .item-play { display: none; }
.results[data-view="grid"] .item-body {
    position: absolute; inset: auto 0 0; padding: 30px 74px 8px 10px; pointer-events: none;
    background: linear-gradient(transparent, rgb(8 6 4 / .82));
}
.results[data-view="grid"] .item-title {
    color: #fff; font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.results[data-view="grid"] .item-title .ext { color: rgb(255 255 255 / .65); }
.results[data-view="grid"] .item-side { display: contents; }
.results[data-view="grid"] .item-size {
    position: absolute; right: 10px; bottom: 8px; pointer-events: none;
    color: #fff; font-size: 12px;
}
.results[data-view="grid"] .item-actions { position: absolute; top: 6px; right: 6px; margin: 0; gap: 4px; }
.results[data-view="grid"] .item-actions button {
    background: rgb(12 10 8 / .58); color: #fff; backdrop-filter: blur(6px);
}
.results[data-view="grid"] .item-fav[aria-pressed="true"] { color: #ffb48a; background: rgb(12 10 8 / .58); }
.results[data-view="grid"] :is(.item-dl, .item-check) { width: 30px; padding: 0; justify-content: center; gap: 0; font-size: 0; }
.results[data-view="grid"] .item-dl.is-done { color: #8ce99a; }
.results[data-view="grid"] .item-body,
.results[data-view="grid"] .item-size,
.results[data-view="grid"] .item-actions { opacity: 0; transition: opacity .18s, transform .18s; }
.results[data-view="grid"] .item-body { transform: translateY(6px); }
.results[data-view="grid"] .item:is(:hover, :focus-within) :is(.item-body, .item-size, .item-actions, .item-thumb .item-res) { opacity: 1; transform: none; }
@media (hover: none) {
    .results[data-view="grid"] :is(.item-body, .item-size, .item-actions) { opacity: 1; transform: none; }
}
.results[data-view="grid"] .item.is-hidden { outline: 1px dashed var(--muted); outline-offset: -1px; }
.results[data-view="grid"] .item.is-flagged { background: var(--warn-soft); }
.results[data-view="grid"] .skeleton { flex: 1.333 1 calc(1.333 * var(--row)); height: var(--row); border-radius: 10px; }

/* Image viewer: always dark, like any photo viewer */
.viewer {
    width: min(1400px, 100vw - 32px); height: calc(100dvh - 32px); max-width: none; max-height: none;
    padding: 0; border: 1px solid #2c2925; border-radius: var(--radius);
    background: #0f0e0c; color: #f1ece3; box-shadow: var(--shadow);
}
.viewer::backdrop { background: rgb(6 5 4 / .86); backdrop-filter: blur(4px); }
.viewer-inner { display: grid; grid-template-rows: auto minmax(0, 1fr) auto auto; height: 100%; }
.viewer-head { display: flex; align-items: center; gap: 12px; padding: 10px 10px 10px 18px; border-bottom: 1px solid #24211d; }
.viewer-count { flex: none; color: #a39b8d; font: 13px var(--mono); font-variant-numeric: tabular-nums; }
.viewer .player-close { color: #a39b8d; }
.viewer .player-close:hover { background: #26231f; color: #fff; }
.viewer-body { position: relative; min-height: 0; }
/* Flex + auto margins: centred when it fits, fully scrollable when zoomed past the edges. */
.viewer-stage { position: absolute; inset: 0; display: flex; overflow: auto; overscroll-behavior: contain; }
.viewer-img { display: block; margin: auto; max-width: 100%; max-height: 100%; object-fit: contain; user-select: none; transition: filter .25s; }
.viewer.is-loading .viewer-img { filter: blur(8px) brightness(.85); }
.viewer.is-zoomable .viewer-img { cursor: zoom-in; }
.viewer.is-zoomed .viewer-img { max-width: none; max-height: none; cursor: zoom-out; }
.viewer.is-loading .viewer-body::after {
    content: ""; position: absolute; top: 50%; left: 50%; width: 30px; height: 30px; margin: -15px 0 0 -15px;
    border: 3px solid rgb(255 255 255 / .22); border-top-color: #fff; border-radius: 50%;
    animation: spin .8s linear infinite; pointer-events: none;
}
@keyframes spin { to { transform: rotate(360deg); } }
.viewer-nav {
    position: absolute; top: 50%; z-index: 1; transform: translateY(-50%);
    display: grid; place-items: center; width: 46px; height: 46px;
    border: 0; border-radius: 999px; background: rgb(255 255 255 / .1); color: #fff;
    backdrop-filter: blur(6px); transition: background .15s, opacity .15s;
}
.viewer-nav[data-nav="-1"] { left: 14px; }
.viewer-nav[data-nav="1"] { right: 14px; }
.viewer-nav:hover:not(:disabled) { background: rgb(255 255 255 / .22); }
.viewer-nav:disabled { opacity: .2; cursor: default; }
.viewer-nav[hidden] { display: none; }
.viewer-nav svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
.viewer .player-foot { border-top: 1px solid #24211d; }
.viewer .player-meta { color: #a39b8d; }
.viewer .btn-ghost { border-color: #34302a; background: transparent; color: #f1ece3; }
.viewer .btn-ghost:hover { border-color: #a39b8d; }
.viewer-note { margin: 0; background: #3b1d20; color: #ff8787; }

.skeleton { height: 70px; border-radius: var(--radius); background: var(--surface-2); animation: pulse 1.2s ease-in-out infinite; }
@keyframes pulse { 50% { opacity: .5; } }

.empty, .error {
    padding: 48px 20px; text-align: center; color: var(--muted);
    border: 1px dashed var(--line); border-radius: var(--radius);
}
.empty-title { margin: 0 0 4px; color: var(--text); font-size: 18px; font-weight: 600; }
.empty p { margin: 0; }
.error { border-style: solid; border-color: color-mix(in srgb, var(--warn) 50%, var(--line)); background: var(--warn-soft); color: var(--warn); }

.pager {
    display: flex; align-items: center; justify-content: center; gap: 14px;
    margin: 22px 0 48px; color: var(--muted); font-size: 14px; font-variant-numeric: tabular-nums;
}
.pager[hidden] { display: none; }

/* Upload drawer */
.up-open:hover { border-color: var(--accent); }
.up-open svg { color: var(--accent); }
.up-open.is-active svg { animation: rise 1.4s ease-in-out infinite; }
@keyframes rise { 50% { transform: translateY(-2px); } }
.up-badge { background: var(--accent); color: var(--accent-ink); }
.up-form { display: grid; gap: 12px; }
.up-drop {
    display: grid; justify-items: center; gap: 4px; padding: 22px 16px;
    border: 1.5px dashed var(--line); border-radius: var(--radius); background: var(--bg);
    text-align: center; cursor: pointer; transition: border-color .15s, background .15s;
}
.up-drop:hover, .up-drop.is-over { border-color: var(--accent); background: var(--accent-soft); }
.up-drop:focus-within { outline: 2px solid var(--focus); outline-offset: 2px; }
.up-drop svg {
    width: 26px; height: 26px; margin-bottom: 4px; fill: none; stroke: var(--accent);
    stroke-width: 2; stroke-linecap: round; stroke-linejoin: round;
}
.up-drop.is-over svg { animation: rise .8s ease-in-out infinite; }
.up-drop-title { font-weight: 600; }
.up-drop-sub { color: var(--muted); font-size: 13px; }
.up-files {
    display: grid; gap: 2px; max-height: 200px; margin: 0; padding: 4px; overflow-y: auto;
    list-style: none; border: 1px solid var(--line); border-radius: 12px;
}
.up-files[hidden] { display: none; }
.up-file { display: flex; align-items: center; gap: 8px; padding: 2px 2px 2px 8px; border-radius: 8px; font-size: 13px; }
.up-file:hover { background: var(--surface-2); }
.up-file-name { flex: 1; min-width: 0; overflow: hidden; font-family: var(--mono); text-overflow: ellipsis; white-space: nowrap; }
.up-file-size { flex: none; color: var(--muted); font-variant-numeric: tabular-nums; }
.up-total { padding: 4px 8px 2px; color: var(--muted); font-size: 12px; font-weight: 600; }
.up-fields { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 10px 14px; }
.up-wide { flex: 1 1 100%; }
.field input[type="text"] {
    height: 36px; padding: 0 11px; border: 1px solid var(--line); border-radius: 10px;
    background: var(--surface); color: var(--text); font: inherit; font-size: 14px;
}
.field input[type="text"]:focus { border-color: var(--accent); outline: 2px solid var(--accent-soft); }
.up-switch { position: relative; display: inline-flex; align-items: center; gap: 9px; height: 36px; cursor: pointer; }
.up-switch input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.up-switch-ui {
    position: relative; width: 38px; height: 22px; border-radius: 999px;
    background: var(--surface-2); border: 1px solid var(--line); transition: background .15s;
}
.up-switch-ui::after {
    content: ""; position: absolute; top: 2px; left: 2px; width: 16px; height: 16px;
    border-radius: 50%; background: var(--surface); box-shadow: var(--shadow); transition: transform .15s;
}
.up-switch input:checked + .up-switch-ui { background: var(--accent); border-color: var(--accent); }
.up-switch input:checked + .up-switch-ui::after { transform: translateX(16px); }
.up-switch input:focus-visible + .up-switch-ui { outline: 2px solid var(--focus); outline-offset: 2px; }
.up-switch-text { font-size: 14px; font-weight: 500; }
.up-hint { margin: 0; color: var(--muted); font-size: 13px; line-height: 1.45; }
.up-actions { display: flex; gap: 10px; align-items: center; }
.up-actions .btn-primary:disabled { opacity: .45; cursor: default; filter: none; }
.dl-row .dl-bar.is-local > span { background: var(--accent); }
.up-links { display: flex; flex-wrap: wrap; gap: 6px 14px; font-size: 13px; }
.up-links a, .up-links button { padding: 0; border: 0; background: none; color: var(--eweka); font-weight: 500; text-decoration: none; }
.up-links a:hover, .up-links button:hover { text-decoration: underline; }
.icon-btn[data-op="cancel"]:hover { background: var(--warn-soft); color: var(--warn); }

@media (max-width: 640px) {
    .search { padding-top: 18px; }
    .hint { display: none; }
    .btn-primary { padding: 0 16px; }
    .seg { width: 100%; overflow-x: auto; }
    .seg label { flex: 1; text-align: center; }
    .seg span { padding-inline: 8px; }
    .field { flex: 1 1 calc(50% - 7px); }
    .field select { width: 100%; }
    .item { grid-template-columns: 52px minmax(0, 1fr); gap: 10px 12px; }
    .item-side { grid-column: 2; display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; white-space: normal; }
    .item-actions { margin-bottom: 0; flex-wrap: wrap; }
    .results[data-view="list"] .item.has-thumb { grid-template-columns: 72px minmax(0, 1fr); }
    .results[data-view="list"] .item.has-thumb .item-thumb { width: 72px; }
    .seg.seg-icons { width: auto; }
    .seg-icons b { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
    .view-size input { width: 64px; }
    .results { --tile: 150px; --row: 110px; }
    .results[data-size="1"] { --tile: 110px; --row: 84px; }
    .results[data-size="3"] { --tile: 100%; --row: 160px; }
    .results[data-view="card"] { gap: 10px; }
    .viewer { width: 100vw; height: 100dvh; border: 0; border-radius: 0; }
    .viewer-nav { width: 40px; height: 40px; }
    .viewer-nav[data-nav="-1"] { left: 8px; }
    .viewer-nav[data-nav="1"] { right: 8px; }
}

@media (max-width: 560px) {
    .top-end { gap: 6px; }
    .dl-open { padding: 0 10px; }
    .dl-open > span:not(.dl-badge) { display: none; }
}

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

/* Login */
.logout-form { display: contents; }
.logout-btn:hover { border-color: var(--warn); }
.auth-page { min-height: 100vh; min-height: 100dvh; display: grid; place-items: center; padding: 24px 16px;
    background: radial-gradient(120% 80% at 50% -10%, var(--accent-soft), transparent 60%), var(--bg); }
.auth { width: min(400px, 100%); }
.auth-card {
    display: grid; gap: 14px; padding: 32px 28px 28px;
    background: var(--surface); border: 1px solid var(--line); border-radius: calc(var(--radius) + 4px);
    box-shadow: var(--shadow);
}
.auth-brand { margin-bottom: 6px; }
.auth-title { margin: 0; font-size: 22px; letter-spacing: -.02em; }
.auth-sub { margin: -8px 0 4px; color: var(--muted); font-size: 14px; }
.auth-error {
    margin: 0; padding: 10px 12px; border-radius: 10px;
    background: var(--warn-soft); color: var(--warn); font-size: 14px; font-weight: 500;
}
.auth-field { display: grid; gap: 5px; }
.auth-field > span { color: var(--muted); font-size: 13px; font-weight: 500; padding-left: 2px; }
.auth-field input {
    height: 44px; padding: 0 14px; border: 1px solid var(--line); border-radius: 12px;
    background: var(--bg); color: var(--text); font: inherit; font-size: 16px;
    transition: border-color .15s, box-shadow .15s;
}
.auth-field input:focus { border-color: var(--accent); outline: none; box-shadow: 0 0 0 4px var(--accent-soft); }
.auth-remember { display: inline-flex; align-items: center; gap: 8px; color: var(--muted); font-size: 14px; cursor: pointer; }
.auth-remember input { width: 16px; height: 16px; margin: 0; accent-color: var(--accent); }
.auth-submit { width: 100%; margin-top: 4px; }
@media (max-width: 640px) { .logout-btn span { display: none; } }

/* Watch list (saved searches scanned in the background) */
.watch-this { display: inline-flex; align-items: center; gap: 7px; }
.watch-this svg { width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.watch-this:hover { border-color: var(--accent); color: var(--accent); }
.watch-this[hidden] { display: none; }
.lib-badge { background: var(--accent); color: var(--accent-ink); }
.lib-badge[hidden] { display: none; }
.watch-sched {
    display: flex; flex-wrap: wrap; align-items: center; gap: 4px 6px; margin: 0; padding: 8px 12px;
    border-radius: 10px; background: var(--surface-2); color: var(--muted); font-size: 12.5px; line-height: 1.45;
}
.watch-sched:empty { display: none; }
.watch-sched::before { content: ""; flex: none; width: 8px; height: 8px; border-radius: 50%; background: var(--muted); }
.watch-sched[data-state="ok"]::before { background: var(--eweka); box-shadow: 0 0 0 3px color-mix(in srgb, var(--eweka) 22%, transparent); }
.watch-sched[data-state="stale"], .watch-sched[data-state="off"] { background: var(--warn-soft); color: var(--warn); }
.watch-sched[data-state="stale"]::before, .watch-sched[data-state="off"]::before { background: var(--warn); }
.watch-sched code { padding: 1px 6px; border-radius: 6px; background: var(--surface); color: var(--text); font: 12px var(--mono); user-select: all; }
.watch-bar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px; }
.watch-bar .link { font-size: 13px; }
.watch-form { padding: 14px; border: 1px solid var(--line); border-radius: 12px; background: var(--bg); }
.watch-form[hidden] { display: none; }
.watch-form .drawer-sub { margin: 0; }
.watch-form .field { flex: 1 1 calc(50% - 7px); }
.watch-form .field select { width: 100%; }
.watch-langs { display: flex; flex-wrap: wrap; gap: 6px; margin: 0; padding: 0; border: 0; min-width: 0; }
.watch-langs legend { margin-bottom: 4px; padding: 0 0 0 2px; color: var(--muted); font-size: 12px; font-weight: 500; }
.watch-langs legend small { font-weight: 400; }
.watch-langs label { position: relative; cursor: pointer; }
.watch-langs input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.watch-langs span {
    display: inline-flex; align-items: center; height: 28px; padding: 0 11px;
    border: 1px solid var(--line); border-radius: 999px; background: var(--surface); color: var(--muted); font-size: 13px;
}
.watch-langs label:hover span { color: var(--text); }
.watch-langs input:checked + span { border-color: var(--eweka); background: color-mix(in srgb, var(--eweka) 14%, var(--surface)); color: var(--eweka); font-weight: 600; }
.watch-langs input:focus-visible + span { outline: 2px solid var(--focus); outline-offset: 2px; }
.watch-row.is-paused .watch-q { color: var(--muted); }
.watch-err { margin: 0; font-size: 12px; color: var(--warn); overflow-wrap: anywhere; }
.icon-btn[data-wop="delete"]:hover { background: var(--warn-soft); color: var(--warn); }
.icon-btn[data-wop="run"][aria-busy="true"] { cursor: progress; color: var(--accent); }
.icon-btn[data-wop="run"][aria-busy="true"] svg { animation: spin 1s linear infinite; }
.hit-row.is-unseen { border-color: color-mix(in srgb, var(--accent) 45%, var(--line)); box-shadow: inset 3px 0 0 var(--accent); }
@media (prefers-reduced-motion: reduce) { .icon-btn[data-wop="run"][aria-busy="true"] svg { animation: none; } }
@media (max-width: 560px) {
    .watch-form .field { flex-basis: 100%; }
    .tabs [role="tab"] { min-width: 0; gap: 4px; padding: 0 4px; font-size: 13px; }
}

/* Titles view: one card per film / series (TMDB poster and overview) */
.results[data-view="media"] { gap: 14px; }
.results[aria-busy="true"] .title-card { opacity: .45; }
.title-card {
    position: relative; isolation: isolate; overflow: hidden;
    display: grid; grid-template-columns: 132px 1fr; gap: 18px; align-items: start;
    padding: 16px; border: 1px solid var(--line); border-radius: var(--radius);
    background: var(--surface);
}
/* Backdrop: a faint wash behind the header, never behind the release rows */
.title-card.has-info::before {
    content: ""; position: absolute; inset: 0 0 auto; height: 220px; z-index: -1;
    background: var(--backdrop, none) center 25% / cover no-repeat;
    opacity: .14; mask-image: linear-gradient(to bottom, #000 30%, transparent);
}
.tc-poster, .cw-poster {
    position: relative; display: grid; place-items: center; overflow: hidden;
    aspect-ratio: 2 / 3; border-radius: 10px;
    background: linear-gradient(150deg, var(--accent-soft), var(--surface-2));
}
.tc-poster img, .cw-poster img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: 0; transition: opacity .3s; }
.has-img > img { opacity: 1; }
.poster-initial { color: var(--accent); font: 700 34px/1 var(--sans); opacity: .55; }
.has-img > .poster-initial { visibility: hidden; }
.tc-body { min-width: 0; }
.tc-title { margin: 0; font-size: 20px; line-height: 1.25; font-weight: 700; letter-spacing: -.01em; }
.tc-year { color: var(--muted); font-weight: 500; }
.tc-meta { margin: 4px 0 0; color: var(--muted); font-size: 13px; }
.tc-link { color: inherit; text-underline-offset: 2px; }
.tc-link:hover { color: var(--accent); }
.tc-overview {
    display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 3; overflow: hidden;
    max-width: 72ch; margin: 10px 0 0; font-size: 14px; line-height: 1.55; cursor: pointer;
}
.tc-overview.is-open { display: block; }
.tc-content { margin-top: 14px; }

.tc-seasons { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 10px; }
.tc-seasons button {
    height: 30px; padding: 0 12px; border: 1px solid var(--line); border-radius: 999px;
    background: var(--surface); color: var(--muted); font-size: 13px; font-weight: 600;
}
.tc-seasons button:hover { color: var(--text); border-color: var(--muted); }
.tc-seasons button[aria-pressed="true"] { background: var(--text); border-color: var(--text); color: var(--surface); }

.tc-episodes { display: grid; gap: 12px; margin: 0; padding: 0; list-style: none; }
.ep-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 10px; margin-bottom: 6px; }
.ep-num { color: var(--accent); font: 700 12.5px var(--mono); }
.ep-name { font-weight: 600; font-size: 14px; }
.ep-air { color: var(--muted); font-size: 12.5px; }
.ep-head[title] { cursor: help; }

.tc-releases { display: grid; gap: 6px; margin: 0; padding: 0; list-style: none; }
.rel {
    display: grid; grid-template-columns: 56px minmax(0, 1fr) auto auto; gap: 12px; align-items: center;
    padding: 8px 10px; border: 1px solid var(--line); border-radius: 10px;
    background: color-mix(in srgb, var(--surface-2) 40%, var(--surface));
}
.rel:hover { border-color: color-mix(in srgb, var(--accent) 45%, var(--line)); }
.rel.is-hidden { border-style: dashed; opacity: .75; }
.rel-res {
    display: grid; place-items: center; height: 30px; border-radius: 8px;
    background: var(--surface-2); color: var(--muted); font: 700 12px var(--mono);
}
.rel-res[data-tier="uhd"] { background: var(--accent); color: var(--accent-ink); }
.rel-res[data-tier="fhd"] { background: var(--accent-soft); color: var(--accent); }
.rel-body { min-width: 0; }
.rel-name { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font: 12.5px/1.4 var(--mono); color: var(--muted); }
.rel .item-tags { margin-top: 4px; }
.rel-side { display: grid; justify-items: end; text-align: right; white-space: nowrap; }
.rel-size { font-weight: 700; font-size: 13.5px; font-variant-numeric: tabular-nums; }
.rel-date { color: var(--muted); font-size: 12px; }
.rel .item-actions { margin: 0; }
.tc-more-rel { margin: 8px 0 0 2px; font-size: 13px; }

/* Resume indicator */
.resume { display: flex; align-items: center; gap: 8px; margin-top: 6px; color: var(--muted); font-size: 12px; }
.resume-bar {
    position: relative; flex: 0 1 160px; height: 4px; border-radius: 4px; background: var(--line); overflow: hidden;
}
.resume-bar::after { content: ""; position: absolute; inset: 0 auto 0 0; width: calc(var(--p, 0) * 100%); background: var(--accent); }
.resume.is-done { color: var(--eweka); font-weight: 600; }
.resume.is-done::before { content: "✓"; }

.media-rest { margin: 10px 0 0; color: var(--muted); font-size: 14px; font-weight: 600; }

/* Continue watching (home) */
.continue { margin-bottom: 18px; }
.continue-title { margin: 0 0 10px; font-size: 16px; font-weight: 700; }
.continue-list {
    display: grid; grid-auto-flow: column; grid-auto-columns: 160px; gap: 14px;
    margin: 0; padding: 2px 2px 10px; list-style: none; overflow-x: auto; scroll-snap-type: x proximity;
}
.cw-card { scroll-snap-align: start; }
.cw-open {
    display: grid; gap: 6px; width: 100%; padding: 0; border: 0; background: none; color: inherit; text-align: left;
}
.cw-poster { transition: transform .2s; box-shadow: var(--shadow); }
.cw-open:hover .cw-poster { transform: translateY(-2px); }
.cw-open:focus-visible { outline: none; }
.cw-open:focus-visible .cw-poster { outline: 2px solid var(--focus); outline-offset: 2px; }
.cw-bar { position: relative; height: 4px; border-radius: 4px; background: var(--line); overflow: hidden; }
.cw-bar::after { content: ""; position: absolute; inset: 0 auto 0 0; width: calc(var(--p, 0) * 100%); background: var(--accent); }
.cw-text { display: grid; min-width: 0; }
.cw-title { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; font-size: 14px; }
.cw-sub { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; overflow: hidden; color: var(--muted); font-size: 12.5px; line-height: 1.35; }

/* Home shelves: trending, new episodes, watch-list hits */
/* Grid items default to min-width:auto, so a wide row would stretch the page; pin home blocks to the full row. */
.continue, .shelf { grid-column: 1 / -1; flex: 1 1 100%; min-width: 0; }
.shelf { margin-bottom: 22px; container-type: inline-size; }
.shelf-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 12px; margin-bottom: 12px; }
.shelf-head .continue-title { margin: 0; }
.shelf-note { margin: 0; color: var(--muted); font-size: 13px; }
.shelf-more { margin-left: auto; font-size: 13px; font-weight: 600; white-space: nowrap; }
/* Wrapping poster grid: two rows by default, the rest behind "Tümünü göster". */
.shelf-list {
    grid-auto-flow: row; grid-auto-columns: auto; grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 18px 14px; padding: 2px; overflow: visible; scroll-snap-type: none;
}
.shelf-list:not(.is-open) > li:nth-child(n+5) { display: none; }
.shelf:not(:has(.shelf-list > li:nth-child(5))) .shelf-more { display: none; }
@container (min-width: 520px) {
    .shelf-list { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .shelf-list:not(.is-open) > li:nth-child(n+5) { display: grid; }
    .shelf-list:not(.is-open) > li:nth-child(n+7) { display: none; }
    .shelf:not(:has(.shelf-list > li:nth-child(7))) .shelf-more { display: none; }
}
@container (min-width: 700px) {
    .shelf-list { grid-template-columns: repeat(4, minmax(0, 1fr)); }
    .shelf-list:not(.is-open) > li:nth-child(n+7) { display: grid; }
    .shelf-list:not(.is-open) > li:nth-child(n+9) { display: none; }
    .shelf:not(:has(.shelf-list > li:nth-child(9))) .shelf-more { display: none; }
}
@container (min-width: 880px) {
    .shelf-list { grid-template-columns: repeat(5, minmax(0, 1fr)); }
    .shelf-list:not(.is-open) > li:nth-child(n+9) { display: grid; }
    .shelf-list:not(.is-open) > li:nth-child(n+11) { display: none; }
    .shelf:not(:has(.shelf-list > li:nth-child(11))) .shelf-more { display: none; }
}
@container (min-width: 1060px) {
    .shelf-list { grid-template-columns: repeat(6, minmax(0, 1fr)); }
    .shelf-list:not(.is-open) > li:nth-child(n+11) { display: grid; }
    .shelf-list:not(.is-open) > li:nth-child(n+13) { display: none; }
    .shelf:not(:has(.shelf-list > li:nth-child(13))) .shelf-more { display: none; }
}
.shelf-empty {
    margin: 0; padding: 14px 16px; border: 1px dashed var(--line); border-radius: 12px;
    color: var(--muted); font-size: 14px;
}
.shelf-empty .link { font-size: inherit; }
.sh-card { display: grid; align-content: start; gap: 8px; }
.sh-card .cw-poster.skeleton { box-shadow: none; }
.sh-rating {
    position: absolute; top: 8px; left: 8px; padding: 2px 7px; border-radius: 999px;
    background: rgb(10 12 16 / .72); color: #fff; font-size: 12px; font-weight: 700;
    font-variant-numeric: tabular-nums; backdrop-filter: blur(4px);
}
.sh-new { background: var(--grad); }
.sh-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.sh-actions > button { justify-content: center; min-width: 0; padding: 0 8px; font-size: 12.5px; white-space: nowrap; overflow: hidden; }
.sh-actions > button[aria-busy="true"] { cursor: progress; opacity: .75; }
.sh-actions svg { flex: none; }

/* Player: resume line and subtitle picker */
.player-resume { margin: 0; padding: 8px 18px; background: var(--accent-soft); color: var(--text); font-size: 13.5px; }
.player-resume .link { font-size: inherit; }
.player-subs { padding: 12px 18px; border-top: 1px solid var(--line); }
.player-subs[hidden] { display: none; }
.subs-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 16px; }
.subs-title { font-size: 14px; }
.subs-delay { display: inline-flex; align-items: center; gap: 6px; }
.subs-delay .btn-ghost { height: 30px; padding: 0 10px; font-size: 13px; }
.subs-delay-val { min-width: 54px; text-align: center; color: var(--muted); font: 13px var(--mono); font-variant-numeric: tabular-nums; }
.subs-status { margin: 8px 0 0; color: var(--muted); font-size: 13px; }
.subs-status:empty { display: none; }
.subs-list { display: grid; gap: 4px; max-height: 220px; margin: 8px 0 0; padding: 0; overflow-y: auto; list-style: none; }
.subs-opt {
    display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 4px 12px;
    width: 100%; padding: 7px 10px; border: 1px solid transparent; border-radius: 8px;
    background: none; color: inherit; text-align: left; font-size: 13.5px;
}
.subs-opt:hover { background: var(--surface-2); }
.subs-opt[aria-pressed="true"] { border-color: var(--accent); background: var(--accent-soft); }
.subs-name { min-width: 0; overflow-wrap: anywhere; }
.subs-meta { display: inline-flex; flex-wrap: wrap; align-items: center; gap: 6px; color: var(--muted); font-size: 12px; }
.player-video::cue { font-family: var(--sans); background: rgb(0 0 0 / .62); }

@media (max-width: 640px) {
    .title-card { grid-template-columns: 76px minmax(0, 1fr); gap: 12px; padding: 12px; }
    .title-card .tc-content { grid-column: 1 / -1; }
    .tc-body { display: contents; }
    .tc-head { grid-column: 2; }
    .tc-overview { grid-column: 1 / -1; margin-top: 0; }
    .tc-title { font-size: 17px; }
    .rel { grid-template-columns: 48px minmax(0, 1fr) auto; gap: 8px 10px; }
    .rel .item-actions { grid-column: 1 / -1; flex-wrap: wrap; justify-content: flex-end; }
    .continue-list { grid-auto-columns: 120px; }
    .sh-actions { grid-template-columns: 1fr; }
}
@media (prefers-reduced-motion: reduce) {
    .cw-poster, .tc-poster img, .cw-poster img { transition: none; }
}

/* =====================================================================
   Modern katman — yalnızca görünüm; sınıf adları ve davranış aynı.
   ===================================================================== */
::selection { background: color-mix(in srgb, var(--accent) 28%, transparent); }
html { scrollbar-color: color-mix(in srgb, var(--muted) 45%, transparent) transparent; }
body {
    background:
        radial-gradient(900px 480px at 12% -8%, color-mix(in srgb, var(--accent) 9%, transparent), transparent 70%),
        radial-gradient(760px 420px at 92% -12%, color-mix(in srgb, var(--accent-2) 7%, transparent), transparent 70%),
        var(--bg);
    background-attachment: fixed;
    font-feature-settings: "cv11", "ss01";
    text-rendering: optimizeLegibility;
}
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { border: 3px solid transparent; border-radius: 999px; background: color-mix(in srgb, var(--muted) 40%, transparent) padding-box; }
::-webkit-scrollbar-thumb:hover { background-color: var(--muted); }
::-webkit-scrollbar-track { background: transparent; }
:focus-visible { outline-color: var(--focus); outline-offset: 3px; border-radius: 6px; }

/* Header: yapışkan cam şerit */
.top {
    position: sticky; top: 0; z-index: 15;
    background: var(--glass); border-bottom-color: color-mix(in srgb, var(--line) 70%, transparent);
    backdrop-filter: saturate(180%) blur(16px); -webkit-backdrop-filter: saturate(180%) blur(16px);
}
.top .wrap { min-height: 64px; }
.brand { font-size: 18px; letter-spacing: -.025em; }
.brand-mark {
    width: 28px; height: 28px; border-radius: 9px;
    background:
        radial-gradient(circle at 42% 42%, transparent 4.6px, #fff 5.2px 7.4px, transparent 8px),
        var(--grad);
    box-shadow: 0 6px 16px -6px color-mix(in srgb, var(--accent) 70%, transparent), inset 0 1px 0 rgb(255 255 255 / .35);
    transition: transform .4s var(--ease);
}
.brand:hover .brand-mark { transform: rotate(-8deg) scale(1.06); }
.brand-dot { background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.top-end { gap: 6px; }
.dl-open {
    height: 38px; padding: 0 13px; border-color: transparent; background: transparent;
    color: var(--muted); transition: background .2s, color .2s, border-color .2s;
}
.dl-open:hover, .lib-open:hover, .up-open:hover { border-color: var(--line); background: var(--surface); color: var(--text); }
.dl-open[aria-current="page"] { color: var(--text); }
.logout-btn:hover { color: var(--warn); border-color: color-mix(in srgb, var(--warn) 35%, var(--line)); }
.dl-badge { box-shadow: 0 0 0 2px var(--bg); }
.up-badge, .lib-badge { background: var(--grad); color: #fff; }

/* Arama: kahraman alan */
.search { padding-block: clamp(28px, 6vw, 56px) 8px; }
.search-box {
    padding: 7px 7px 7px 52px; border-color: var(--line);
    box-shadow: var(--shadow-lg);
    transition: border-color .2s, box-shadow .25s var(--ease), transform .25s var(--ease);
}
.search-box:focus-within {
    border-color: color-mix(in srgb, var(--accent) 60%, var(--line));
    box-shadow: var(--shadow-lg), 0 0 0 5px color-mix(in srgb, var(--accent) 16%, transparent);
    transform: translateY(-1px);
}
.search-icon { left: 20px; width: 21px; height: 21px; transition: stroke .2s; }
.search-box:focus-within .search-icon { stroke: var(--accent); }
.search-box input { height: 48px; font-size: 17.5px; letter-spacing: -.01em; }
.search-box input::placeholder { color: color-mix(in srgb, var(--muted) 80%, transparent); }
.hint { background: var(--surface-2); border-color: transparent; }

.btn-primary {
    position: relative; height: 46px; padding: 0 26px;
    background: var(--grad); color: #fff; letter-spacing: .01em;
    box-shadow: 0 8px 20px -8px color-mix(in srgb, var(--accent) 75%, transparent), inset 0 1px 0 rgb(255 255 255 / .25);
    transition: filter .2s, transform .15s var(--ease), box-shadow .2s;
}
.btn-primary:hover:not(:disabled) { filter: brightness(1.06) saturate(1.05); transform: translateY(-1px); box-shadow: 0 12px 26px -10px color-mix(in srgb, var(--accent) 85%, transparent), inset 0 1px 0 rgb(255 255 255 / .25); }
.btn-primary:active:not(:disabled) { transform: translateY(0) scale(.98); }
.btn-ghost {
    border-radius: 11px; font-size: 14px; font-weight: 500;
    transition: border-color .2s, background .2s, color .2s, transform .15s var(--ease);
}
.btn-ghost:hover:not(:disabled) { border-color: color-mix(in srgb, var(--text) 25%, var(--line)); background: var(--surface-2); }
.btn-ghost:active:not(:disabled) { transform: scale(.98); }

/* Filtreler */
.filters { gap: 12px 14px; margin-top: 22px; }
.seg { padding: 4px; border-radius: 13px; background: color-mix(in srgb, var(--surface-2) 85%, transparent); box-shadow: inset 0 0 0 1px var(--line); }
.seg span { padding: 7px 14px; border-radius: 9px; transition: background .2s var(--ease), color .2s, box-shadow .2s; }
.seg label:hover input:not(:checked) + span { color: var(--text); }
.seg input:checked + span { color: var(--text); font-weight: 600; box-shadow: 0 1px 2px rgb(0 0 0 / .08), 0 4px 12px -6px rgb(0 0 0 / .2); }
.field > span { font-size: 11.5px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; }
.field select, .field input[type="text"] {
    height: 38px; border-radius: 11px; transition: border-color .2s, box-shadow .2s, background-color .2s;
}
.field select:hover { border-color: color-mix(in srgb, var(--text) 22%, var(--line)); }
.field select:focus-visible, .field input[type="text"]:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 16%, transparent); }
.field select.is-set { border-color: color-mix(in srgb, var(--accent) 55%, var(--line)); color: var(--accent); font-weight: 600; }
.group-filter { height: 38px; border-radius: 11px; border-color: color-mix(in srgb, var(--accent) 45%, var(--line)); }

/* Sonuç başlığı */
.results-head { margin: 26px 0 12px; }
.status { font-size: 13.5px; }
.status .tag { background: var(--accent-soft); color: var(--accent); font-weight: 600; }
.service-alert { border-radius: 14px; box-shadow: var(--shadow); }

/* Sonuç satırları */
.results { gap: 10px; }
.item {
    border-color: color-mix(in srgb, var(--line) 80%, transparent); border-radius: var(--radius);
    box-shadow: 0 1px 2px rgb(16 20 30 / .03);
    transition: border-color .2s, box-shadow .25s var(--ease), transform .25s var(--ease);
}
.item:hover {
    border-color: color-mix(in srgb, var(--accent) 35%, var(--line));
    box-shadow: var(--shadow); transform: translateY(-1px);
}
.results > .item, .results > .title-card { animation: fade-up .4s var(--ease) both; }
.results > :nth-child(2) { animation-delay: .02s; } .results > :nth-child(3) { animation-delay: .04s; }
.results > :nth-child(4) { animation-delay: .06s; } .results > :nth-child(5) { animation-delay: .08s; }
.results > :nth-child(6) { animation-delay: .1s; }  .results > :nth-child(n+7) { animation-delay: .12s; }
@keyframes fade-up { from { opacity: 0; transform: translateY(6px); } }
.item-res { border-radius: 11px; }
.item-res[data-tier="uhd"], .rel-res[data-tier="uhd"] { background: var(--grad); color: #fff; box-shadow: 0 6px 14px -8px color-mix(in srgb, var(--accent) 80%, transparent); }
.item-title { font-weight: 550; letter-spacing: -.005em; }
.chip { border-radius: 7px; padding: 1px 8px; }
.item-size { font-size: 15px; letter-spacing: -.01em; }

.item-play, .item-dl, .item-check {
    height: 32px; padding: 0 13px 0 10px;
    transition: background .2s, color .2s, transform .15s var(--ease), box-shadow .2s;
}
.item-play:hover { background: var(--grad); color: #fff; box-shadow: 0 6px 16px -8px color-mix(in srgb, var(--accent) 80%, transparent); }
.item-play:active, .item-dl:active:not(:disabled), .item-check:active, .item-fav:active { transform: scale(.95); }
.item-fav { width: 32px; height: 32px; }

/* Kart / galeri */
.results[data-view="card"] { gap: 16px; }
.results[data-view="card"] .item { padding: 8px 8px 12px; border-radius: 18px; }
.results[data-view="card"] .item:hover { transform: translateY(-4px); box-shadow: var(--shadow-lg); }
.results[data-view="card"] .item-thumb, .results[data-view="card"] .item > .item-res { border-radius: 12px; }
.results[data-view="grid"] { gap: 8px; }
.results[data-view="grid"] .item { border-radius: 14px; }
.results[data-view="grid"] .item:hover { transform: none; box-shadow: var(--shadow-lg); }
.item-thumb { border-radius: 12px; }

/* Başlık kartları */
.title-card { border-radius: 20px; padding: 20px; box-shadow: 0 1px 2px rgb(16 20 30 / .03); }
.title-card:hover { box-shadow: var(--shadow); }
.title-card.has-info::before { opacity: .18; height: 260px; }
.tc-poster { border-radius: 12px; box-shadow: var(--shadow-lg); }
.tc-title { font-size: 22px; letter-spacing: -.02em; }
.tc-seasons button { height: 32px; transition: background .2s, color .2s, border-color .2s; }
.tc-seasons button[aria-pressed="true"] { background: var(--grad); border-color: transparent; color: #fff; }
.rel { border-radius: 12px; transition: border-color .2s, background .2s; }
.rel:hover { background: var(--surface); }
.cw-poster { border-radius: 12px; }

/* Boş / hata / iskelet */
.empty {
    padding: clamp(40px, 8vw, 72px) 24px; border: 1px dashed color-mix(in srgb, var(--muted) 30%, var(--line));
    border-radius: 22px; background: color-mix(in srgb, var(--surface) 55%, transparent);
}
.empty::before {
    content: ""; display: block; width: 64px; height: 64px; margin: 0 auto 18px; border-radius: 20px;
    background:
        url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='2' stroke-linecap='round'%3E%3Ccircle cx='11' cy='11' r='6.5'/%3E%3Cpath d='m20 20-4-4'/%3E%3C/svg%3E") center / 30px no-repeat,
        var(--grad);
    box-shadow: 0 16px 34px -14px color-mix(in srgb, var(--accent) 80%, transparent);
}
.empty-title { font-size: 20px; letter-spacing: -.02em; margin-bottom: 6px; }
.empty p:not(.empty-title) { max-width: 46ch; margin-inline: auto; }
.error { border-radius: 18px; }
.skeleton {
    background: linear-gradient(90deg, var(--surface-2) 0%, color-mix(in srgb, var(--surface-2) 40%, var(--surface)) 50%, var(--surface-2) 100%) 0 0 / 200% 100%;
    animation: shimmer 1.3s linear infinite;
}
@keyframes shimmer { to { background-position: -200% 0; } }

.pager { gap: 16px; }
.pager .btn-ghost { height: 40px; padding: 0 18px; border-radius: 999px; }

/* Çekmeceler ve diyaloglar */
.drawer {
    inset: 10px 10px 10px auto; width: min(500px, 100vw - 20px); height: calc(100dvh - 20px);
    border: 1px solid var(--line); border-radius: 22px; box-shadow: var(--shadow-lg); overflow: auto;
}
.drawer[open] { animation: drawer-in .32s var(--ease); }
@keyframes drawer-in { from { transform: translateX(32px); opacity: 0; } }
.drawer::backdrop, .player::backdrop { background: rgb(6 8 12 / .5); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); }
.drawer-inner { padding: 0 20px 20px; gap: 16px; }
.drawer-head { margin: 0 -20px; padding: 14px 12px 14px 20px; background: var(--glass); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); }
.drawer-title { font-size: 18px; letter-spacing: -.02em; }
.dl-row { border-radius: 14px; background: color-mix(in srgb, var(--surface-2) 45%, var(--surface)); transition: border-color .2s; }
.dl-row:hover { border-color: color-mix(in srgb, var(--text) 18%, var(--line)); }
.dl-bar { height: 7px; }
.dl-bar > span { background: linear-gradient(90deg, var(--eweka), color-mix(in srgb, var(--eweka) 60%, var(--easynews))); }
.dl-empty { border-radius: 14px; text-align: center; padding: 20px 14px; }
.tabs { border-radius: 14px; padding: 4px; }
.tabs [role="tab"] { border-radius: 10px; transition: background .2s, color .2s; }
.player { border-radius: 22px; box-shadow: var(--shadow-lg); overflow: hidden; }
.player[open], .viewer[open] { animation: pop-in .3s var(--ease); }
@keyframes pop-in { from { transform: translateY(10px) scale(.985); opacity: 0; } }
.player-close { border-radius: 11px; transition: background .2s, color .2s; }
.viewer { border-radius: 22px; background: #0a0c10; border-color: #1f232c; }
.viewer-head, .viewer .player-foot { border-color: #1b1f27; }
.up-drop { border-radius: 18px; padding: 28px 16px; }
.up-switch input:checked + .up-switch-ui { background: var(--grad); border-color: transparent; }

.toast {
    bottom: 24px; padding: 12px 18px; border-radius: 14px; font-weight: 500;
    background: color-mix(in srgb, var(--text) 92%, transparent); box-shadow: var(--shadow-lg);
    backdrop-filter: blur(10px); animation: toast-in .3s var(--ease);
}
@keyframes toast-in { from { opacity: 0; transform: translate(-50%, 10px); } }

/* Giriş */
.auth-page {
    background:
        radial-gradient(700px 420px at 20% 0%, color-mix(in srgb, var(--accent) 18%, transparent), transparent 70%),
        radial-gradient(640px 420px at 85% 100%, color-mix(in srgb, var(--accent-2) 14%, transparent), transparent 70%),
        var(--bg);
}
.auth-card { padding: 36px 30px 30px; border-radius: 26px; box-shadow: var(--shadow-lg); background: var(--glass); backdrop-filter: blur(18px); -webkit-backdrop-filter: blur(18px); animation: pop-in .45s var(--ease); }
.auth-title { font-size: 26px; letter-spacing: -.03em; }
.auth-field input { height: 48px; border-radius: 13px; }
.auth-submit { height: 48px; }

@media (max-width: 640px) {
    .search-box { padding-left: 44px; }
    .search-icon { left: 16px; }
    .drawer { inset: 0 0 0 auto; width: 100vw; height: 100dvh; border-radius: 0; border: 0; }
    .player { border-radius: 16px; }
    .title-card { padding: 12px; border-radius: 16px; }
}
@media (prefers-reduced-transparency: reduce) {
    .top, .drawer-head, .auth-card { background: var(--surface); backdrop-filter: none; }
}
@media (prefers-color-scheme: dark) {
    .seg input:checked + span, .tabs [aria-selected="true"] { background: color-mix(in srgb, var(--text) 11%, var(--surface)); }
}
@media (max-width: 560px) {
    .top .wrap { flex-wrap: nowrap; gap: 8px; min-height: 58px; }
    .brand > span:not(.brand-mark) { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
    .top-end { gap: 2px; min-width: 0; overflow-x: auto; scrollbar-width: none; }
    .dl-open { padding: 0 10px; flex: none; }
}
