
:root {
    --bg: #07050b;
    --panel: rgba(18, 13, 27, 0.78);
    --panel-2: rgba(26, 16, 43, 0.74);
    --text: #f5edff;
    --muted: #bba9d6;
    --purple: #a84acb;
    --purple-2: #6f2cff;
    --danger: #ff4d80;
    --success: #62ffa9;
    --border: rgba(196, 119, 255, 0.22);
    --shadow: 0 24px 80px rgba(92, 27, 171, 0.25);
}
* { box-sizing: border-box; }
body {
    margin: 0;
    min-height: 100vh;
    color: var(--text);
    background:
        radial-gradient(circle at 20% 20%, rgba(168,74,203,.22), transparent 32%),
        radial-gradient(circle at 78% 0%, rgba(111,44,255,.18), transparent 28%),
        var(--bg);
    font-family: Inter, Segoe UI, Arial, sans-serif;
}
.hive-bg {
    position: fixed;
    inset: 0;
    z-index: -1;
    opacity: .34;
    background-image:
        linear-gradient(30deg, rgba(168,74,203,.18) 12%, transparent 12.5%, transparent 87%, rgba(168,74,203,.18) 87.5%, rgba(168,74,203,.18)),
        linear-gradient(150deg, rgba(168,74,203,.18) 12%, transparent 12.5%, transparent 87%, rgba(168,74,203,.18) 87.5%, rgba(168,74,203,.18)),
        linear-gradient(30deg, rgba(168,74,203,.18) 12%, transparent 12.5%, transparent 87%, rgba(168,74,203,.18) 87.5%, rgba(168,74,203,.18)),
        linear-gradient(150deg, rgba(168,74,203,.18) 12%, transparent 12.5%, transparent 87%, rgba(168,74,203,.18) 87.5%, rgba(168,74,203,.18));
    background-size: 76px 133px;
    background-position: 0 0, 0 0, 38px 66px, 38px 66px;
    animation: hiveDrift 28s linear infinite;
}
@keyframes hiveDrift { from { transform: translate3d(0,0,0); } to { transform: translate3d(-76px, -66px, 0); } }
.page-shell { width: min(1180px, calc(100% - 28px)); margin: 0 auto; padding: 22px 0 60px; }
.glass { background: var(--panel); border: 1px solid var(--border); box-shadow: var(--shadow); backdrop-filter: blur(18px); }
.topbar { position: sticky; top: 14px; z-index: 10; display: flex; justify-content: space-between; align-items: center; border-radius: 20px; padding: 14px 18px; }
.brand { color: var(--text); text-decoration: none; display: flex; align-items: center; gap: 10px; font-weight: 800; letter-spacing: .4px; }
.brand-mark { color: var(--purple); text-shadow: 0 0 18px var(--purple); }
.nav-links { display: flex; gap: 14px; align-items: center; flex-wrap: wrap; }
a { color: var(--text); } .nav-links a { color: var(--muted); text-decoration: none; transition: .2s; } .nav-links a:hover { color: #fff; text-shadow: 0 0 14px var(--purple); }
main { margin-top: 26px; }
.hero, .panel, .auth-card { border-radius: 28px; padding: 30px; margin-bottom: 22px; }
.hero { min-height: 360px; display: flex; flex-direction: column; justify-content: center; }
.eyebrow { color: var(--purple); text-transform: uppercase; letter-spacing: 2px; font-size: .78rem; font-weight: 800; }
h1 { font-size: clamp(2rem, 5vw, 4.2rem); margin: 10px 0 12px; line-height: 1.02; } h2 { margin: 4px 0 18px; } h3 { margin: 0 0 8px; }
p { color: var(--muted); line-height: 1.65; }
.hero-actions, .button-row { display: flex; gap: 12px; flex-wrap: wrap; }
.btn, button.btn, .link-button { appearance: none; border: 1px solid var(--border); background: rgba(255,255,255,.04); color: var(--text); padding: 12px 18px; border-radius: 14px; text-decoration: none; cursor: pointer; transition: .2s ease; font-weight: 700; }
.btn:hover, .link-button:hover { transform: translateY(-2px); border-color: rgba(168,74,203,.7); box-shadow: 0 0 24px rgba(168,74,203,.22); }
.btn.primary { background: linear-gradient(135deg, var(--purple), var(--purple-2)); border-color: transparent; box-shadow: 0 10px 30px rgba(168,74,203,.25); }
.btn.danger { border-color: rgba(255,77,128,.35); color: #ffd5df; }
.btn.small { padding: 8px 11px; font-size: .86rem; }
.link-button { padding: 0; border: 0; background: transparent; color: var(--muted); }
.inline-form { display: inline; }
.auth-card { max-width: 500px; margin: 40px auto; }
.form-grid, .search-grid, .settings-grid { display: grid; gap: 14px; }
.search-grid { grid-template-columns: repeat(4, minmax(140px, 1fr)); align-items: end; }
.settings-grid { grid-template-columns: repeat(3, minmax(180px, 1fr)); align-items: end; }
label { display: grid; gap: 7px; color: var(--muted); font-weight: 700; font-size: .9rem; }
input, select { width: 100%; background: rgba(255,255,255,.06); border: 1px solid var(--border); color: var(--text); border-radius: 13px; padding: 12px 13px; outline: none; }
input:focus, select:focus { border-color: var(--purple); box-shadow: 0 0 0 4px rgba(168,74,203,.12); }
select option { background: #130d20; color: var(--text); }
.alert { padding: 12px 14px; border-radius: 14px; margin: 12px 0; border: 1px solid var(--border); } .alert.danger { color: #ffdbe4; border-color: rgba(255,77,128,.35); background: rgba(255,77,128,.1); } .alert.success { color: #d8ffe8; border-color: rgba(98,255,169,.35); background: rgba(98,255,169,.08); }
.muted { color: var(--muted); }
.section-head { display: flex; justify-content: space-between; gap: 16px; align-items: center; margin-bottom: 18px; }
.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 16px; }
.card { display: block; background: var(--panel-2); border: 1px solid var(--border); border-radius: 20px; padding: 20px; text-decoration: none; transition: .2s ease; }
.card:hover { transform: translateY(-4px); border-color: rgba(168,74,203,.7); box-shadow: 0 16px 40px rgba(168,74,203,.18); }
.table-wrap { overflow-x: auto; } table { width: 100%; border-collapse: collapse; } th, td { text-align: left; padding: 12px 10px; border-bottom: 1px solid rgba(255,255,255,.08); vertical-align: top; } th { color: var(--purple); font-size: .85rem; text-transform: uppercase; letter-spacing: .08em; }
.result-list { display: grid; gap: 14px; } .result-card { display: flex; justify-content: space-between; gap: 18px; align-items: center; padding: 18px; border-radius: 20px; background: var(--panel-2); border: 1px solid var(--border); transition: .2s; } .result-card:hover { border-color: rgba(168,74,203,.7); transform: translateY(-2px); }
.meta { display: flex; flex-wrap: wrap; gap: 8px; } .meta span { color: var(--muted); border: 1px solid rgba(255,255,255,.08); border-radius: 999px; padding: 4px 9px; background: rgba(255,255,255,.04); font-size: .82rem; }
.actions-cell form { margin-bottom: 8px; } .reset-form { display: flex; gap: 8px; }
@media (max-width: 850px) { .search-grid, .settings-grid { grid-template-columns: 1fr; } .section-head, .result-card, .topbar { align-items: stretch; flex-direction: column; } .nav-links { gap: 10px; } }


.rich-result-card { justify-content: flex-start; align-items: stretch; position: relative; overflow: hidden; }
.rich-result-card::before { content: ""; position: absolute; inset: 0; background: radial-gradient(circle at 15% 20%, rgba(168,74,203,.18), transparent 35%); pointer-events: none; }
.poster-tile { position: relative; flex: 0 0 92px; min-height: 126px; border-radius: 18px; border: 1px solid rgba(196,119,255,.28); background: linear-gradient(145deg, rgba(168,74,203,.22), rgba(9,6,14,.88)); display: grid; place-items: center; overflow: hidden; box-shadow: inset 0 0 24px rgba(168,74,203,.14); }
.poster-icon { position: absolute; top: 9px; left: 10px; font-size: 1.05rem; opacity: .9; }
.poster-initials { font-size: 1.8rem; font-weight: 900; letter-spacing: .08em; color: #fff; text-shadow: 0 0 18px rgba(168,74,203,.75); z-index: 1; }
.poster-glow { position: absolute; width: 110px; height: 110px; border-radius: 999px; background: rgba(168,74,203,.22); filter: blur(22px); bottom: -40px; right: -40px; }
.result-main { flex: 1; min-width: 0; z-index: 1; }
.result-main h3 { font-size: 1.05rem; line-height: 1.35; word-break: break-word; }
.result-actions { z-index: 1; display: flex; align-items: center; justify-content: center; min-width: 150px; }
.stacked-actions { flex-direction: column; gap: 8px; align-items: stretch; }
.enhanced-meta span { display: inline-flex; align-items: center; gap: 5px; }
.download-stats { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 16px; }
.download-stats span { border: 1px solid rgba(255,255,255,.08); background: rgba(255,255,255,.04); color: var(--muted); padding: 7px 10px; border-radius: 999px; }
.progress { min-width: 140px; height: 9px; background: rgba(255,255,255,.08); border-radius: 999px; overflow: hidden; border: 1px solid rgba(196,119,255,.18); margin-bottom: 5px; }
.progress span { display: block; height: 100%; background: linear-gradient(90deg, var(--purple), var(--purple-2)); box-shadow: 0 0 16px rgba(168,74,203,.45); }
.admin-wish-card { border-color: rgba(168,74,203,.36); }
@media (max-width: 850px) { .rich-result-card { flex-direction: column; } .poster-tile { width: 100%; min-height: 90px; flex-basis: auto; } .result-actions { justify-content: flex-start; } }


/* v4 media grouping, covers and flag badges */
.search-grid-wide {
    grid-template-columns: repeat(5, minmax(130px, 1fr));
}
.media-group-list {
    display: grid;
    gap: 18px;
}
.media-group-card {
    display: grid;
    grid-template-columns: 136px 1fr;
    gap: 18px;
    padding: 18px;
    border: 1px solid var(--border);
    border-radius: 22px;
    background: linear-gradient(135deg, rgba(255,255,255,.06), rgba(168,74,203,.06));
    transition: .22s ease;
}
.media-group-card:hover {
    transform: translateY(-2px);
    border-color: rgba(168,74,203,.7);
    box-shadow: 0 0 35px rgba(168,74,203,.2);
}
.media-cover {
    width: 124px;
    min-height: 184px;
    border-radius: 18px;
    overflow: hidden;
    border: 1px solid rgba(168,74,203,.28);
    background: rgba(255,255,255,.04);
    align-self: start;
}
.media-cover img {
    width: 100%;
    height: 100%;
    min-height: 184px;
    object-fit: cover;
    display: block;
}
.small-cover {
    width: 82px;
    min-height: 118px;
}
.small-cover img {
    min-height: 118px;
}
.poster-large {
    width: 100%;
    min-height: 184px;
}
.media-title-row {
    display: flex;
    gap: 10px;
    align-items: center;
    flex-wrap: wrap;
}
.media-title-row h3 {
    font-size: 1.35rem;
}
.pill {
    display: inline-flex;
    gap: 6px;
    align-items: center;
    padding: 6px 9px;
    border: 1px solid var(--border);
    border-radius: 999px;
    color: var(--muted);
    background: rgba(255,255,255,.04);
    font-size: .82rem;
    font-weight: 800;
}
.pill.success {
    color: #d8ffe8;
    border-color: rgba(98,255,169,.35);
    background: rgba(98,255,169,.08);
}
.overview {
    margin: 10px 0 12px;
}
.release-details {
    margin-top: 12px;
}
.release-details summary {
    cursor: pointer;
    color: var(--text);
    font-weight: 800;
    padding: 10px 0;
}
.release-list {
    display: grid;
    gap: 10px;
}
.release-row {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 12px;
    align-items: center;
    padding: 12px;
    border-radius: 16px;
    background: rgba(255,255,255,.04);
    border: 1px solid rgba(168,74,203,.14);
}
.lang-badge {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    margin-right: 6px;
    white-space: nowrap;
}
.flag {
    display: inline-block;
    width: 24px;
    height: 15px;
    border-radius: 3px;
    box-shadow: 0 0 0 1px rgba(255,255,255,.22), 0 4px 12px rgba(0,0,0,.2);
    overflow: hidden;
    vertical-align: middle;
}
.flag-de {
    background: linear-gradient(to bottom, #000 0 33.333%, #dd0000 33.333% 66.666%, #ffce00 66.666% 100%);
}
.flag-en {
    background:
        linear-gradient(90deg, transparent 42%, #fff 42% 58%, transparent 58%),
        linear-gradient(0deg, transparent 38%, #fff 38% 62%, transparent 62%),
        linear-gradient(90deg, transparent 46%, #c8102e 46% 54%, transparent 54%),
        linear-gradient(0deg, transparent 43%, #c8102e 43% 57%, transparent 57%),
        #012169;
}
.flag-multi {
    background: linear-gradient(135deg, #6f2cff, #a84acb, #62ffa9);
}
.flag-unknown {
    background: linear-gradient(135deg, #333, #777);
}
@media (max-width: 800px) {
    .search-grid-wide { grid-template-columns: 1fr; }
    .media-group-card { grid-template-columns: 1fr; }
    .media-cover { width: 110px; min-height: 160px; }
    .release-row { grid-template-columns: 1fr; }
}


/* v4.3 search diagnostics */
.debug-box {
    margin-top: 16px;
    padding: 14px;
    border: 1px solid rgba(168,74,203,.25);
    border-radius: 18px;
    background: rgba(255,255,255,.04);
}
.debug-box summary {
    cursor: pointer;
    font-weight: 800;
    color: var(--text);
}
.debug-grid {
    display: grid;
    gap: 12px;
    margin-top: 12px;
}
.debug-card {
    border: 1px solid rgba(168,74,203,.16);
    border-radius: 14px;
    padding: 12px;
    background: rgba(0,0,0,.16);
}
.debug-card p {
    margin: 6px 0;
    font-size: .9rem;
}


/* v4.5 local filtering */
#localFilterStatus {
    margin-top: 14px;
    padding: 10px 12px;
    border-radius: 14px;
    border: 1px solid rgba(168,74,203,.18);
    background: rgba(255,255,255,.035);
}
.release-row[style*="display: none"] {
    display: none !important;
}


/* v4.7 indexer groups */
.indexer-edit-list {
    display: grid;
    gap: 18px;
}
.indexer-edit-card {
    padding: 18px;
    border: 1px solid var(--border);
    border-radius: 22px;
    background: rgba(255,255,255,.035);
}
.indexer-edit-card .button-row {
    margin-top: 14px;
}


/* v4.8 */
.download-stats span {
    display: inline-flex;
    align-items: center;
    margin-right: 10px;
}


/* v4.9 counts, quota, pagination */
.quota-strip {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin: 12px 0;
}
.quota-strip span {
    padding: 8px 11px;
    border-radius: 999px;
    border: 1px solid rgba(168,74,203,.2);
    background: rgba(255,255,255,.04);
    color: var(--muted);
}
.pagination {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 18px;
}
.btn.disabled {
    opacity: .4;
    pointer-events: none;
}
.mini-form {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
    margin-top: 8px;
    align-items: center;
}


/* v4.11 UI refresh: centered glass layout, mobile-first polish */
:root {
    --glass-strong: rgba(20, 14, 34, .70);
    --glass-soft: rgba(255,255,255,.055);
    --line-soft: rgba(255,255,255,.10);
    --line-purple: rgba(196,119,255,.30);
    --radius-lg: 30px;
    --radius-md: 20px;
}

html {
    scroll-behavior: smooth;
}

body {
    overflow-x: hidden;
}

.aurora-bg,
.noise-bg {
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: -1;
}

.aurora-bg {
    opacity: .9;
    background:
        radial-gradient(circle at 14% 14%, rgba(168,74,203,.34), transparent 24%),
        radial-gradient(circle at 84% 12%, rgba(88,54,255,.26), transparent 24%),
        radial-gradient(circle at 50% 86%, rgba(168,74,203,.18), transparent 30%);
    filter: blur(6px);
    animation: auroraFloat 16s ease-in-out infinite alternate;
}

.noise-bg {
    opacity: .08;
    background-image:
        repeating-linear-gradient(0deg, rgba(255,255,255,.08) 0 1px, transparent 1px 2px);
    mix-blend-mode: screen;
}

@keyframes auroraFloat {
    0% { transform: translate3d(-1.5%, -1%, 0) scale(1); }
    100% { transform: translate3d(1.5%, 1%, 0) scale(1.04); }
}

.page-shell {
    width: min(1240px, calc(100% - 36px));
    padding: 24px 0 80px;
}

main {
    display: grid;
    gap: 22px;
}

.glass,
.panel,
.hero,
.auth-card,
.card,
.media-group-card,
.result-card,
.indexer-edit-card {
    backdrop-filter: blur(22px) saturate(1.25);
    -webkit-backdrop-filter: blur(22px) saturate(1.25);
}

.topbar {
    top: 16px;
    border-radius: 999px;
    background: linear-gradient(135deg, rgba(18,13,27,.74), rgba(35,18,58,.54));
    box-shadow: 0 20px 70px rgba(0,0,0,.34), inset 0 1px 0 rgba(255,255,255,.08);
}

.brand-mark {
    display: grid;
    place-items: center;
    width: 34px;
    height: 34px;
    border-radius: 12px;
    background: radial-gradient(circle at 40% 30%, rgba(255,255,255,.16), transparent 34%), linear-gradient(135deg, var(--purple), var(--purple-2));
    color: #fff;
    box-shadow: 0 0 26px rgba(168,74,203,.45);
}

.nav-links a,
.link-button {
    padding: 8px 10px;
    border-radius: 999px;
}

.nav-links a:hover,
.link-button:hover {
    background: rgba(255,255,255,.07);
}

.panel,
.hero,
.auth-card {
    position: relative;
    overflow: hidden;
    background:
        linear-gradient(145deg, rgba(255,255,255,.07), rgba(255,255,255,.025)),
        linear-gradient(135deg, rgba(20,14,34,.82), rgba(31,16,53,.62));
    border: 1px solid var(--line-purple);
    border-radius: var(--radius-lg);
    box-shadow:
        0 24px 90px rgba(0,0,0,.34),
        0 18px 70px rgba(92,27,171,.18),
        inset 0 1px 0 rgba(255,255,255,.08);
}

.panel::before,
.hero::before,
.auth-card::before {
    content: "";
    position: absolute;
    inset: 0;
    background:
        radial-gradient(circle at 12% 0%, rgba(168,74,203,.18), transparent 28%),
        linear-gradient(120deg, transparent, rgba(255,255,255,.045), transparent);
    pointer-events: none;
}

.panel > *,
.hero > *,
.auth-card > * {
    position: relative;
    z-index: 1;
}

.section-head {
    align-items: flex-start;
}

h1 {
    letter-spacing: -.055em;
    text-wrap: balance;
}

h2, h3 {
    letter-spacing: -.025em;
}

.search-grid {
    grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
    align-items: end;
    padding: 14px;
    border-radius: 24px;
    background: rgba(255,255,255,.035);
    border: 1px solid rgba(255,255,255,.075);
}

.search-grid label:first-child {
    grid-column: span 2;
}

input,
select {
    min-height: 46px;
    background: rgba(5, 3, 10, .34);
    border-color: rgba(196,119,255,.20);
    box-shadow: inset 0 1px 0 rgba(255,255,255,.045);
    transition: border-color .18s ease, box-shadow .18s ease, background .18s ease, transform .18s ease;
}

input:hover,
select:hover {
    background: rgba(255,255,255,.075);
    border-color: rgba(196,119,255,.36);
}

input:focus,
select:focus {
    transform: translateY(-1px);
}

.btn,
button.btn {
    min-height: 44px;
    border-radius: 999px;
    box-shadow: inset 0 1px 0 rgba(255,255,255,.07);
}

.btn.primary {
    background:
        radial-gradient(circle at 30% 20%, rgba(255,255,255,.22), transparent 28%),
        linear-gradient(135deg, #b14ed6, #6f2cff);
}

.btn.primary:hover {
    box-shadow: 0 0 0 4px rgba(168,74,203,.13), 0 18px 45px rgba(168,74,203,.34);
}

.quota-strip,
.api-status-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 10px;
    margin: 14px 0;
}

.quota-strip span,
.api-status {
    padding: 11px 13px;
    border-radius: 18px;
    border: 1px solid rgba(255,255,255,.10);
    background: rgba(255,255,255,.045);
    box-shadow: inset 0 1px 0 rgba(255,255,255,.055);
}

.api-status {
    display: grid;
    gap: 4px;
}

.api-status span {
    color: var(--muted);
    font-size: .92rem;
}

.api-status.ok,
.api-status.cache {
    border-color: rgba(98,255,169,.28);
    background: linear-gradient(135deg, rgba(98,255,169,.08), rgba(255,255,255,.035));
}

.api-status.paused,
.api-status.offline {
    border-color: rgba(255,204,92,.30);
    background: linear-gradient(135deg, rgba(255,204,92,.08), rgba(255,255,255,.035));
}

.api-status.error {
    border-color: rgba(255,77,128,.34);
    background: linear-gradient(135deg, rgba(255,77,128,.10), rgba(255,255,255,.035));
}

.media-group-list {
    display: grid;
    gap: 18px;
}

.media-group-card {
    position: relative;
    overflow: hidden;
    transform: translateZ(0);
    transition: transform .22s ease, border-color .22s ease, box-shadow .22s ease, background .22s ease;
}

.media-group-card:hover {
    transform: translateY(-3px);
    border-color: rgba(196,119,255,.50);
    box-shadow: 0 22px 70px rgba(0,0,0,.30), 0 12px 42px rgba(168,74,203,.18);
}

.media-group-card::after {
    content: "";
    position: absolute;
    inset: auto -18% -40% auto;
    width: 260px;
    height: 260px;
    border-radius: 999px;
    background: rgba(168,74,203,.12);
    filter: blur(22px);
    pointer-events: none;
}

.release-row {
    transition: background .18s ease, transform .18s ease, border-color .18s ease;
}

.release-row:hover {
    background: rgba(255,255,255,.055);
    transform: translateX(2px);
}

.poster-tile,
.media-cover img {
    box-shadow: 0 22px 48px rgba(0,0,0,.34), 0 0 40px rgba(168,74,203,.12);
}

.debug-box {
    border-radius: 20px;
    background: rgba(0,0,0,.16);
}

.pagination {
    justify-content: center;
}

.table-wrap {
    border-radius: 20px;
    border: 1px solid rgba(255,255,255,.07);
    background: rgba(255,255,255,.025);
}

table {
    min-width: 720px;
}

@media (max-width: 900px) {
    .page-shell {
        width: min(100% - 22px, 760px);
        padding-top: 12px;
    }

    .topbar {
        position: relative;
        top: 0;
        border-radius: 24px;
        align-items: stretch;
        gap: 12px;
    }

    .nav-links {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 8px;
    }

    .nav-links a,
    .link-button {
        display: flex;
        justify-content: center;
        padding: 10px 8px;
        background: rgba(255,255,255,.045);
        border: 1px solid rgba(255,255,255,.06);
    }

    .inline-form,
    .inline-form .link-button {
        width: 100%;
    }

    .hero,
    .panel,
    .auth-card {
        padding: 20px;
        border-radius: 24px;
    }

    .section-head {
        flex-direction: column;
    }

    .search-grid {
        grid-template-columns: 1fr;
        padding: 12px;
    }

    .search-grid label:first-child {
        grid-column: auto;
    }

    .search-grid .btn.primary {
        width: 100%;
        min-height: 50px;
    }

    .quota-strip,
    .api-status-grid {
        grid-template-columns: 1fr;
    }

    .media-group-card {
        grid-template-columns: 1fr !important;
    }

    .media-cover {
        max-width: 180px;
        width: 55%;
        margin: 0 auto 12px;
    }

    .release-row {
        grid-template-columns: 1fr !important;
        gap: 12px;
    }

    .result-actions,
    .result-actions form,
    .result-actions .btn {
        width: 100%;
    }

    .result-actions {
        justify-content: stretch;
    }

    .pagination .btn {
        flex: 1 1 42%;
        text-align: center;
    }
}

@media (max-width: 520px) {
    body {
        font-size: 15px;
    }

    .page-shell {
        width: calc(100% - 14px);
    }

    .hero,
    .panel,
    .auth-card {
        padding: 16px;
        border-radius: 20px;
    }

    .brand {
        justify-content: center;
    }

    .nav-links {
        grid-template-columns: 1fr 1fr;
    }

    h1 {
        font-size: clamp(2rem, 12vw, 3rem);
    }

    .meta span,
    .pill {
        font-size: .78rem;
    }

    .media-title-row {
        gap: 6px;
    }

    .media-title-row h3 {
        width: 100%;
    }

    .release-list {
        gap: 10px;
    }

    input,
    select,
    .btn {
        font-size: 16px;
    }
}

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


/* v4.12 Savflix polish, floating dock and wishlist toasts */
.page-shell {
    width: min(1280px, calc(100% - 42px));
}

.topbar {
    min-height: 70px;
    padding: 16px 22px;
    border-radius: 28px;
    transition: transform .25s ease, box-shadow .25s ease, border-color .25s ease, background .25s ease;
}

.topbar:hover {
    transform: translateY(-2px);
    border-color: rgba(205,135,255,.46);
    background: linear-gradient(135deg, rgba(29, 18, 47, .82), rgba(46, 22, 76, .66));
    box-shadow: 0 24px 90px rgba(0,0,0,.42), 0 0 38px rgba(168,74,203,.20);
}

.brand {
    font-size: 1.04rem;
}

.brand-mark {
    animation: brandPulse 3.2s ease-in-out infinite;
}

@keyframes brandPulse {
    0%, 100% { box-shadow: 0 0 20px rgba(168,74,203,.32); transform: scale(1); }
    50% { box-shadow: 0 0 34px rgba(168,74,203,.62); transform: scale(1.04); }
}

.nav-links {
    gap: 8px;
}

.nav-links a,
.link-button {
    position: relative;
    padding: 11px 14px;
    border-radius: 999px;
    transition: color .2s ease, background .2s ease, transform .2s ease, box-shadow .2s ease;
}

.nav-links a::after,
.link-button::after {
    content: "";
    position: absolute;
    left: 14px;
    right: 14px;
    bottom: 6px;
    height: 2px;
    border-radius: 999px;
    background: linear-gradient(90deg, transparent, var(--purple), transparent);
    opacity: 0;
    transform: scaleX(.4);
    transition: opacity .2s ease, transform .2s ease;
}

.nav-links a:hover,
.link-button:hover {
    color: #fff;
    background: rgba(168,74,203,.13);
    transform: translateY(-2px);
    box-shadow: inset 0 0 0 1px rgba(196,119,255,.18), 0 10px 26px rgba(168,74,203,.16);
}

.nav-links a:hover::after,
.link-button:hover::after {
    opacity: 1;
    transform: scaleX(1);
}

.savflix-hero {
    min-height: 410px;
    display: grid;
    align-content: center;
    max-width: 100%;
}

.savflix-hero h1 {
    max-width: 820px;
}

.savflix-hero p {
    max-width: 820px;
    font-size: 1.06rem;
}

.hero-subcopy {
    margin-top: -2px;
}

.btn.ghost {
    background: rgba(255,255,255,.035);
}

.floating-dock {
    position: fixed;
    right: 22px;
    bottom: 22px;
    z-index: 80;
    display: grid;
    gap: 12px;
}

.dock-item {
    position: relative;
    display: flex;
    justify-content: flex-end;
}

.dock-button {
    width: 54px;
    height: 54px;
    border-radius: 18px;
    border: 1px solid rgba(196,119,255,.35);
    color: #fff;
    cursor: pointer;
    background:
        radial-gradient(circle at 28% 20%, rgba(255,255,255,.22), transparent 30%),
        linear-gradient(135deg, rgba(168,74,203,.70), rgba(72,33,160,.72));
    box-shadow: 0 20px 45px rgba(0,0,0,.34), 0 0 28px rgba(168,74,203,.22);
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
    font-weight: 900;
    font-size: 1.18rem;
    transition: transform .22s ease, border-color .22s ease, box-shadow .22s ease;
}

.dock-button:hover,
.dock-button:focus {
    transform: translateY(-3px) scale(1.04);
    border-color: rgba(255,255,255,.38);
    box-shadow: 0 22px 58px rgba(0,0,0,.40), 0 0 42px rgba(168,74,203,.42);
}

.dock-card {
    position: absolute;
    right: 66px;
    bottom: 0;
    width: min(300px, calc(100vw - 116px));
    padding: 16px 17px;
    border-radius: 22px;
    border: 1px solid rgba(196,119,255,.28);
    background: rgba(14, 9, 24, .74);
    box-shadow: 0 24px 72px rgba(0,0,0,.42), inset 0 1px 0 rgba(255,255,255,.08);
    backdrop-filter: blur(22px) saturate(1.25);
    -webkit-backdrop-filter: blur(22px) saturate(1.25);
    transform: translateX(16px) translateY(6px) scale(.96);
    opacity: 0;
    pointer-events: none;
    transition: opacity .2s ease, transform .2s ease;
}

.dock-card.wide {
    width: min(380px, calc(100vw - 116px));
}

.dock-card strong {
    color: #fff;
}

.dock-card p {
    margin: 6px 0 0;
    font-size: .92rem;
    line-height: 1.5;
}

.dock-item:hover .dock-card,
.dock-item:focus-within .dock-card {
    opacity: 1;
    pointer-events: auto;
    transform: translateX(0) translateY(0) scale(1);
}

.toast-stack {
    position: fixed;
    right: 22px;
    bottom: 154px;
    z-index: 90;
    display: grid;
    gap: 10px;
    width: min(360px, calc(100vw - 34px));
}

.toast {
    display: grid;
    grid-template-columns: 40px 1fr auto;
    gap: 12px;
    align-items: center;
    padding: 13px 13px;
    border-radius: 22px;
    border: 1px solid rgba(98,255,169,.25);
    background: rgba(13, 10, 22, .82);
    box-shadow: 0 22px 70px rgba(0,0,0,.44), 0 0 34px rgba(98,255,169,.08);
    backdrop-filter: blur(22px) saturate(1.25);
    -webkit-backdrop-filter: blur(22px) saturate(1.25);
    animation: toastIn .28s ease both;
}

.toast.warning {
    border-color: rgba(255,204,92,.35);
    box-shadow: 0 22px 70px rgba(0,0,0,.44), 0 0 34px rgba(255,204,92,.08);
}

.toast.leaving {
    animation: toastOut .26s ease both;
}

.toast-icon {
    width: 38px;
    height: 38px;
    border-radius: 14px;
    display: grid;
    place-items: center;
    background: linear-gradient(135deg, rgba(98,255,169,.22), rgba(168,74,203,.18));
    color: #fff;
    font-weight: 900;
}

.toast.warning .toast-icon {
    background: linear-gradient(135deg, rgba(255,204,92,.24), rgba(168,74,203,.16));
}

.toast-content {
    display: grid;
    gap: 2px;
}

.toast-content span {
    color: var(--muted);
    font-size: .9rem;
}

.toast-close {
    width: 30px;
    height: 30px;
    border: 0;
    border-radius: 999px;
    cursor: pointer;
    color: var(--muted);
    background: rgba(255,255,255,.06);
}

.toast-close:hover {
    color: #fff;
    background: rgba(255,255,255,.10);
}

@keyframes toastIn {
    from { opacity: 0; transform: translateY(14px) scale(.96); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

@keyframes toastOut {
    from { opacity: 1; transform: translateY(0) scale(1); }
    to { opacity: 0; transform: translateY(10px) scale(.96); }
}

.result-actions .btn:disabled {
    opacity: .65;
    cursor: wait;
}

@media (max-width: 900px) {
    .topbar {
        min-height: auto;
    }

    .floating-dock {
        right: 12px;
        bottom: 12px;
    }

    .dock-button {
        width: 50px;
        height: 50px;
        border-radius: 17px;
    }

    .dock-card {
        right: 60px;
        width: min(300px, calc(100vw - 92px));
    }

    .toast-stack {
        right: 12px;
        bottom: 132px;
        width: min(350px, calc(100vw - 24px));
    }
}

@media (max-width: 520px) {
    .page-shell {
        width: calc(100% - 14px);
    }

    .topbar {
        padding: 13px;
    }

    .brand {
        font-size: 1rem;
    }

    .nav-links a,
    .link-button {
        padding: 10px 8px;
        min-height: 42px;
    }

    .savflix-hero {
        min-height: 360px;
    }

    .floating-dock {
        grid-auto-flow: column;
        right: 10px;
        bottom: 10px;
    }

    .dock-card {
        right: 0;
        bottom: 60px;
        width: calc(100vw - 20px);
    }

    .toast-stack {
        left: 10px;
        right: 10px;
        bottom: 128px;
        width: auto;
    }
}


/* v4.13 approval buttons + dock placement fix */
.decision-actions {
    display: inline-flex;
    gap: 10px;
    flex-wrap: wrap;
    align-items: center;
}

.btn.approve {
    border-color: rgba(98,255,169,.38);
    color: #e8fff2;
    background:
        radial-gradient(circle at 28% 18%, rgba(255,255,255,.18), transparent 30%),
        linear-gradient(135deg, rgba(35,190,112,.92), rgba(18,124,76,.82));
    box-shadow: 0 12px 32px rgba(35,190,112,.16);
}

.btn.approve:hover {
    border-color: rgba(155,255,202,.72);
    box-shadow: 0 0 0 4px rgba(98,255,169,.12), 0 18px 42px rgba(35,190,112,.24);
}

.btn.reject {
    border-color: rgba(255,77,128,.40);
    color: #fff0f4;
    background:
        radial-gradient(circle at 28% 18%, rgba(255,255,255,.16), transparent 30%),
        linear-gradient(135deg, rgba(255,77,128,.86), rgba(145,30,72,.78));
    box-shadow: 0 12px 32px rgba(255,77,128,.14);
}

.btn.reject:hover {
    border-color: rgba(255,148,178,.78);
    box-shadow: 0 0 0 4px rgba(255,77,128,.12), 0 18px 42px rgba(255,77,128,.22);
}

/* Keep the login/info dock on the right side and above the page, even with browser cache/layout quirks. */
.floating-dock {
    left: auto !important;
    right: max(18px, env(safe-area-inset-right)) !important;
    bottom: max(18px, env(safe-area-inset-bottom)) !important;
    position: fixed !important;
}

.dock-card {
    left: auto !important;
}

@media (max-width: 560px) {
    .decision-actions {
        display: grid;
        grid-template-columns: 1fr 1fr;
        width: 100%;
    }

    .decision-actions .btn {
        width: 100%;
    }
}


/* v4.14 Savlix branding + refined admin buttons */
.brand-mark.image-mark {
    width: 42px;
    height: 42px;
    padding: 0;
    overflow: hidden;
    background: rgba(255,255,255,.03);
    box-shadow: 0 0 24px rgba(168,74,203,.25);
}
.brand-mark.image-mark img {
    width: 100%;
    height: 100%;
    display: block;
}

.auth-layout {
    display: grid;
    grid-template-columns: 1.08fr .92fr;
    gap: 22px;
    align-items: stretch;
}
.auth-brand-card,
.login-form-card {
    margin: 0;
    max-width: none;
}
.login-logo-wrap {
    width: 86px;
    height: 86px;
    border-radius: 28px;
    padding: 10px;
    background: linear-gradient(135deg, rgba(255,255,255,.08), rgba(255,255,255,.03));
    border: 1px solid rgba(255,255,255,.08);
    box-shadow: 0 18px 44px rgba(0,0,0,.24), 0 0 32px rgba(168,74,203,.18);
    margin-bottom: 16px;
}
.login-logo {
    width: 100%;
    height: 100%;
    display: block;
}
.info-panel.soft-card,
.login-form-card .login-help {
    margin-top: 18px;
}
.soft-card {
    background: rgba(255,255,255,.045);
    border: 1px solid rgba(255,255,255,.08);
    border-radius: 22px;
    padding: 18px 18px 16px;
}
.soft-card h3 {
    margin-bottom: 10px;
}
.soft-card p {
    margin: 8px 0;
}
.login-form-card h2 {
    margin: 6px 0 8px;
}
.login-help {
    padding-top: 12px;
    border-top: 1px solid rgba(255,255,255,.08);
}

.actions-cell form {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 10px;
}
.actions-cell .btn,
.decision-actions .btn {
    min-height: 38px;
    padding: 8px 12px;
    border-radius: 12px;
    font-size: .84rem;
    line-height: 1.2;
}
.btn.approve {
    border-color: rgba(98,255,169,.22);
    color: #e7fff1;
    background: linear-gradient(135deg, rgba(35,190,112,.16), rgba(18,124,76,.10));
    box-shadow: none;
}
.btn.approve:hover {
    border-color: rgba(98,255,169,.40);
    box-shadow: 0 8px 24px rgba(35,190,112,.14);
}
.btn.reject,
.btn.danger.reject {
    border-color: rgba(255,77,128,.22);
    color: #ffe9ef;
    background: linear-gradient(135deg, rgba(255,77,128,.14), rgba(145,30,72,.09));
    box-shadow: none;
}
.btn.reject:hover,
.btn.danger.reject:hover {
    border-color: rgba(255,122,159,.40);
    box-shadow: 0 8px 24px rgba(255,77,128,.12);
}
.btn.subtle {
    background: rgba(255,255,255,.045);
    border-color: rgba(196,119,255,.18);
    color: var(--text);
}
.btn.subtle:hover {
    border-color: rgba(196,119,255,.36);
}
.reset-form {
    align-items: center;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}
.reset-form input {
    min-width: 190px;
    flex: 1 1 220px;
}
.table-wrap table td strong {
    color: #fff;
}

.dock-card p strong,
.info-panel p strong {
    color: #fff;
}

@media (max-width: 980px) {
    .auth-layout {
        grid-template-columns: 1fr;
    }
}
@media (max-width: 640px) {
    .actions-cell form,
    .reset-form {
        display: grid;
        grid-template-columns: 1fr;
    }
    .actions-cell .btn,
    .reset-form .btn,
    .reset-form input {
        width: 100%;
    }
    .login-logo-wrap {
        width: 74px;
        height: 74px;
        border-radius: 24px;
    }
}


/* v4.15 filter status */
.active-filter-bar {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
    margin: 14px 0;
    padding: 12px 13px;
    border-radius: 18px;
    border: 1px solid rgba(196,119,255,.18);
    background: rgba(255,255,255,.04);
}
.active-filter-bar strong {
    margin-right: 4px;
}
.active-filter-bar span {
    color: #f8efff;
    border: 1px solid rgba(196,119,255,.22);
    background: rgba(168,74,203,.10);
    border-radius: 999px;
    padding: 5px 9px;
    font-size: .85rem;
    font-weight: 700;
}


/* v4.17 user logo integration */
.brand-mark.image-mark {
    width: 48px;
    height: 48px;
    border-radius: 16px;
    padding: 2px;
    background: rgba(0,0,0,.35);
    border: 1px solid rgba(196,119,255,.18);
    overflow: hidden;
}
.brand-mark.image-mark img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
}
.login-logo-wrap {
    width: min(260px, 70vw);
    height: auto;
    aspect-ratio: 1 / 1;
    border-radius: 34px;
    padding: 8px;
    background: rgba(0,0,0,.28);
}
.login-logo {
    width: 100%;
    height: 100%;
    object-fit: contain;
    border-radius: 28px;
}
@media (max-width: 640px) {
    .brand-mark.image-mark {
        width: 42px;
        height: 42px;
    }
    .login-logo-wrap {
        width: min(220px, 74vw);
    }
}


/* v4.18 cooldown/search tuning */
.api-status.warning {
    border-color: rgba(255,204,92,.30);
    background: linear-gradient(135deg, rgba(255,204,92,.08), rgba(255,255,255,.035));
}
.cooldown-row {
    margin: 10px 0 16px;
}
.btn.subtle {
    background: rgba(255,255,255,.045);
    border-color: rgba(196,119,255,.18);
}
