:root {
    --bg: #080a0f;
    --bg-soft: #0c0f16;
    --panel: #10141c;
    --panel-2: #161b25;
    --panel-3: #1c2230;
    --line: rgba(255, 255, 255, .07);
    --line-strong: rgba(255, 255, 255, .14);
    --text: #eef1f7;
    --muted: #8b95ab;
    --muted-dim: #626c80;
    --accent: #6d8cff;
    --accent-soft: rgba(109, 140, 255, .14);
    --accent-strong: #a9bcff;
    --success: #3ddc97;
    --success-soft: rgba(61, 220, 151, .1);
    --danger: #ff6b78;
    --warning: #f2bd58;
    --radius: 16px;
    --radius-sm: 10px;
    --radius-xs: 8px;
    --shadow: 0 1px 0 rgba(255,255,255,.03) inset, 0 18px 40px rgba(0, 0, 0, .45);
    --shadow-sm: 0 8px 20px rgba(0, 0, 0, .35);
    --font-display: ui-rounded, "SF Pro Rounded", "Segoe UI", system-ui, sans-serif;
    --font-body: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    --font-mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;
}

* { box-sizing: border-box; }
html { background: var(--bg); color: var(--text); font-family: var(--font-body); -webkit-text-size-adjust: 100%; }
body {
    margin: 0;
    min-height: 100vh;
    background:
        radial-gradient(120% 60% at 50% -10%, rgba(109, 140, 255, .10), transparent 60%),
        var(--bg);
    background-attachment: fixed;
    font-size: 15px;
    line-height: 1.5;
    text-wrap: pretty;
}
a { color: var(--accent-strong); text-decoration: none; }
a:hover { color: var(--text); }
.brand, .nav a, .button, .back-link { color: inherit; }
button, input, select { font: inherit; }
button { cursor: pointer; }
img { display: block; max-width: 100%; }
::selection { background: rgba(109, 140, 255, .32); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 6px; }

@media (prefers-reduced-motion: no-preference) {
    .show-card, .button, .panel, .stat, .nav a, .nav-action, .source-status, .tmdb-result { transition: transform .16s cubic-bezier(.2,.7,.3,1), box-shadow .16s ease, border-color .16s ease, background-color .16s ease, color .16s ease; }
}

.shell { width: min(1280px, calc(100% - 40px)); margin-inline: auto; }

/* ---------- top bar ---------- */
.topbar {
    position: sticky; top: 0; z-index: 20;
    border-bottom: 1px solid var(--line);
    background: rgba(8, 10, 15, .72);
    backdrop-filter: saturate(160%) blur(20px);
    padding-top: env(safe-area-inset-top);
}
.topbar-inner { min-height: 64px; display: flex; align-items: center; justify-content: space-between; gap: 24px; }
.brand { display: flex; align-items: center; gap: 11px; font-family: var(--font-display); font-weight: 700; font-size: .98rem; letter-spacing: -.01em; }
.brand-mark {
    display: grid; place-items: center; width: 32px; height: 32px; border-radius: 9px;
    background: linear-gradient(160deg, #8ba1ff, var(--accent) 55%, #6b5cff);
    color: #fff; font-family: var(--font-display); font-size: 11px; font-weight: 800; letter-spacing: .04em;
    box-shadow: 0 6px 16px rgba(109, 140, 255, .35), 0 0 0 1px rgba(255,255,255,.09) inset;
}
.nav {
    display: flex; gap: 2px; flex-wrap: wrap; align-items: center;
    padding: 3px; border: 1px solid var(--line); border-radius: 12px; background: rgba(255,255,255,.03);
}
.nav-form { display: flex; margin: 0; }
.nav a, .nav-action { padding: 8px 14px; border-radius: 9px; color: var(--muted); font-weight: 600; font-size: .85rem; }
.nav-action { border: 0; background: transparent; }
.nav a:hover, .nav-action:hover { color: var(--text); background: rgba(255,255,255,.055); }
.nav a.is-active { color: var(--text); background: var(--panel-2); box-shadow: 0 1px 0 rgba(255,255,255,.06) inset, 0 2px 8px rgba(0,0,0,.3); }
.page { padding-block: 44px 80px; }

/* ---------- headings ---------- */
.hero { display: flex; justify-content: space-between; align-items: end; gap: 32px; margin-bottom: 36px; }
h1, h2, h3, p { margin-top: 0; }
h1, h2, h3 { font-family: var(--font-display); }
h1 { margin-bottom: 12px; font-size: clamp(1.9rem, 4vw, 2.7rem); font-weight: 800; line-height: 1.05; letter-spacing: -.035em; }
h2 { margin-bottom: 0; font-size: 1.08rem; font-weight: 700; letter-spacing: -.015em; }
h3 { margin-bottom: 5px; font-size: .98rem; font-weight: 700; letter-spacing: -.01em; }
.eyebrow { margin-bottom: 12px; color: var(--muted); text-transform: uppercase; letter-spacing: .16em; font-size: .68rem; font-weight: 700; }
.hero-copy, .page-heading p { color: var(--muted); margin-bottom: 0; max-width: 54ch; font-size: .92rem; line-height: 1.6; }

.stats { display: flex; gap: 0; border: 1px solid var(--line); border-radius: var(--radius); background: rgba(255,255,255,.025); overflow: hidden; }
.stat {
    min-width: 96px; padding: 13px 20px 14px; border: 0; border-left: 1px solid var(--line); border-radius: 0;
    background: transparent; text-align: center;
}
.stat:first-child { border-left: 0; }
.stat:hover { background: rgba(255,255,255,.03); }
.stat strong { display: block; font-family: var(--font-display); font-size: 1.5rem; font-weight: 800; letter-spacing: -.03em; font-variant-numeric: tabular-nums; }
.stat span { color: var(--muted-dim); font-size: .7rem; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; }

/* ---------- toolbar / inputs ---------- */
.toolbar { display: flex; justify-content: space-between; align-items: end; gap: 16px; margin-bottom: 22px; }
.toolbar-actions, .card-actions, .form-actions, .inline-form { display: flex; align-items: center; gap: 9px; }
.dashboard-meta-state { color: var(--muted-dim); font-size: .76rem; white-space: nowrap; }
.search-field { flex: 1; max-width: 460px; }
.search-field span, .field span { display: block; margin-bottom: 7px; color: var(--muted); font-size: .78rem; font-weight: 600; }
input, select {
    width: 100%; min-height: 44px; border: 1px solid var(--line); border-radius: var(--radius-sm);
    padding: 10px 14px; color: var(--text); background: rgba(255,255,255,.035); outline: none; font-size: .92rem;
}
input:hover, select:hover { border-color: var(--line-strong); }
input:focus, select:focus { border-color: var(--accent); background: rgba(255,255,255,.05); box-shadow: 0 0 0 3px rgba(109,140,255,.16); outline: none; }
input::placeholder { color: var(--muted-dim); }

.button {
    min-height: 42px; display: inline-flex; align-items: center; justify-content: center; gap: 8px;
    border: 1px solid var(--line-strong); border-radius: var(--radius-sm); padding: 9px 16px; color: var(--text);
    background: var(--panel-2); font-weight: 650; font-size: .86rem; white-space: nowrap;
}
.button:hover { background: var(--panel-3); border-color: rgba(255,255,255,.22); }
.button:active { transform: scale(.985); }
.button:disabled { opacity: .55; cursor: wait; transform: none; box-shadow: none; }
.button-primary { border-color: transparent; background: var(--accent); color: #060810; font-weight: 700; box-shadow: 0 1px 0 rgba(255,255,255,.25) inset, 0 6px 18px rgba(109,140,255,.3); }
.button-primary:hover { background: #829eff; box-shadow: 0 1px 0 rgba(255,255,255,.3) inset, 0 8px 22px rgba(109,140,255,.4); }
.button-danger { border-color: rgba(255,107,120,.3); color: #ff9ca5; background: rgba(255,107,120,.08); }
.button-danger:hover { border-color: rgba(255,107,120,.5); background: rgba(255,107,120,.14); }

/* ---------- show cards ---------- */
.card-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(360px, 1fr)); gap: 16px; }
.show-card {
    display: grid; grid-template-columns: 132px minmax(0, 1fr); overflow: hidden;
    border: 1px solid var(--line); border-radius: var(--radius);
    background: var(--panel);
    box-shadow: var(--shadow);
}
.show-card:hover { border-color: var(--line-strong); transform: translateY(-2px); box-shadow: 0 1px 0 rgba(255,255,255,.05) inset, 0 24px 48px rgba(0,0,0,.5); }
.show-card[hidden] { display: none; }
.poster-wrap { position: relative; min-height: 100%; background: #0b0e14; }
.poster { width: 100%; height: 100%; object-fit: cover; }
.poster-placeholder { display: grid; place-items: center; color: #4c5568; font-family: var(--font-display); font-size: 1.05rem; font-weight: 800; letter-spacing: .06em; background: linear-gradient(155deg, #1a2030, #0c1018); }
.poster-wrap .status-badge { position: absolute; left: 8px; top: 8px; }
.poster-wrap::after { content: ""; position: absolute; inset: 0; box-shadow: inset -1px 0 0 var(--line); background: linear-gradient(180deg, rgba(0,0,0,.35) 0%, transparent 30%, transparent 62%, rgba(0,0,0,.4)); pointer-events: none; }
.status-badge { display: inline-flex; align-items: center; padding: 4px 9px; border-radius: 999px; font-size: .66rem; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; backdrop-filter: blur(8px); }
.status-on { background: rgba(61,220,151,.16); color: #6df0b3; border: 1px solid rgba(61,220,151,.28); }
.status-off { background: rgba(12,16,24,.7); color: #99a3b6; border: 1px solid rgba(255,255,255,.14); }
.show-content { min-width: 0; display: flex; flex-direction: column; padding: 16px 18px 15px; }
.show-heading { display: flex; justify-content: space-between; gap: 10px; margin-bottom: 14px; }
.filter-name { margin-bottom: 4px; color: var(--muted-dim); font-family: var(--font-mono); font-size: .68rem; letter-spacing: .01em; }
.id-badge { height: fit-content; padding: 3px 7px; border-radius: 6px; color: var(--muted-dim); background: rgba(255,255,255,.05); font-family: var(--font-mono); font-size: .68rem; font-weight: 600; }

.episode-grid {
    display: grid; grid-template-columns: 1fr 1fr; gap: 1px; margin: 0 0 12px;
    border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--line); overflow: hidden;
}
.episode-grid div { padding: 9px 11px; border-radius: 0; background: var(--panel); }
dt { color: var(--muted-dim); font-size: .66rem; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; }
dd { margin: 4px 0 0; font-weight: 700; font-size: .88rem; letter-spacing: -.01em; font-variant-numeric: tabular-nums; }
.muted, .hint { color: var(--muted); font-size: .78rem; }
.line-clamp { overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.next-info { margin-bottom: 14px; font-size: .82rem; }
.next-info span { color: var(--muted); }
.hint { padding: 9px 11px; border-radius: var(--radius-sm); background: rgba(255,255,255,.035); line-height: 1.45; }
.hint-error { color: #ff9ca5; }
.card-actions { margin-top: auto; padding-top: 10px; }
.inline-form { margin: 0; }

/* ---------- alerts ---------- */
.alert { margin-bottom: 18px; border: 1px solid var(--line); border-left: 3px solid var(--line-strong); border-radius: var(--radius-sm); padding: 12px 15px; background: var(--panel); font-size: .88rem; }
.alert-success { border-color: rgba(61,220,151,.24); border-left-color: var(--success); color: #8ce8b9; background: var(--success-soft); }
.alert-error { border-color: rgba(255,107,120,.26); border-left-color: var(--danger); color: #ff9ca5; background: rgba(255,107,120,.07); }
.alert-warning { border-color: rgba(242,189,88,.26); border-left-color: var(--warning); color: #ffd886; background: rgba(242,189,88,.07); }
.alert.compact { padding: 10px 12px; font-size: .82rem; }

/* ---------- panels / forms ---------- */
.page-heading { display: flex; justify-content: space-between; align-items: end; gap: 18px; margin-bottom: 28px; }
.page-heading h1 { margin: 8px 0 0; font-size: clamp(1.8rem, 3.4vw, 2.4rem); }
.back-link { display: inline-flex; align-items: center; gap: 6px; color: var(--muted); font-size: .82rem; font-weight: 600; }
.back-link:hover { color: var(--text); }
.two-column { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(320px, .85fr); gap: 16px; }
.create-layout { align-items: start; }
.panel { border: 1px solid var(--line); border-radius: var(--radius); padding: 22px; background: var(--panel); box-shadow: var(--shadow-sm); }
.panel-heading { display: flex; justify-content: space-between; align-items: start; gap: 15px; margin-bottom: 18px; padding-bottom: 14px; border-bottom: 1px solid var(--line); }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.field-wide { grid-column: 1 / -1; }
.field { display: block; }
.check-row { display: flex; align-items: center; gap: 10px; min-height: 34px; }
.check-row input { width: 18px; min-height: 18px; accent-color: var(--accent); }
.check-row span { margin: 0; color: var(--text); }
.metadata-list { display: grid; gap: 0; margin-top: 20px; padding-top: 0; border-top: 1px solid var(--line); }
.metadata-list div { display: flex; justify-content: space-between; gap: 20px; padding: 9px 0; border-bottom: 1px solid var(--line); font-size: .82rem; }
.metadata-list div:last-child { border-bottom: 0; }
.metadata-list span { color: var(--muted); }
.metadata-list strong { text-align: right; font-weight: 650; }
.top-gap { margin-top: 18px; }

/* ---------- tmdb ---------- */
.tmdb-current { display: grid; grid-template-columns: 84px minmax(0,1fr); gap: 14px; align-items: start; padding: 14px; border: 1px solid var(--line); border-radius: var(--radius-sm); background: rgba(255,255,255,.03); }
.tmdb-current p { margin-bottom: 6px; color: var(--muted); font-size: .8rem; }
.tmdb-thumb { width: 84px; aspect-ratio: 2/3; object-fit: cover; border-radius: 8px; }
.tmdb-search { display: grid; grid-template-columns: 1fr auto; gap: 10px; margin-top: 18px; align-items: end; }
.tmdb-results { grid-column: 1 / -1; display: grid; gap: 8px; margin-top: 6px; }
.tmdb-result { display: grid; grid-template-columns: 68px minmax(0, 1fr); gap: 12px; padding: 10px; border: 1px solid var(--line); border-radius: var(--radius-sm); background: rgba(255,255,255,.025); }
.tmdb-result:hover { border-color: var(--line-strong); background: rgba(255,255,255,.045); }
.tmdb-result-poster { width: 68px; aspect-ratio: 2/3; object-fit: cover; border-radius: 6px; }
.tmdb-result-content h3 { font-size: .92rem; }
.tmdb-overview { display: -webkit-box; overflow: hidden; -webkit-line-clamp: 3; -webkit-box-orient: vertical; color: var(--muted); font-size: .77rem; line-height: 1.5; }
.selected-tmdb { padding: 12px; border: 1px dashed var(--line-strong); border-radius: var(--radius-sm); color: var(--muted); font-size: .84rem; }
.selected-tmdb.selected { border-style: solid; border-color: rgba(61,220,151,.3); background: var(--success-soft); color: #8ce8b9; }

/* ---------- wizard ---------- */
.series-wizard { display: grid; gap: 16px; }
.wizard-steps { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 6px; margin: 0; padding: 0; list-style: none; }
.wizard-steps li { display: flex; align-items: center; gap: 8px; min-width: 0; padding: 9px 11px; border: 1px solid var(--line); border-radius: var(--radius-sm); color: var(--muted-dim); background: rgba(255,255,255,.02); font-size: .7rem; font-weight: 650; }
.wizard-steps li span { display: grid; place-items: center; flex: 0 0 22px; width: 22px; height: 22px; border-radius: 50%; background: rgba(255,255,255,.06); color: var(--muted); font-size: .68rem; font-weight: 700; }
.wizard-steps li.is-active { border-color: rgba(109,140,255,.4); color: var(--text); background: var(--accent-soft); }
.wizard-steps li.is-active span { background: var(--accent); color: #060810; }
.wizard-steps li.is-complete { border-color: rgba(61,220,151,.22); color: #8ce8b9; }
.wizard-steps li.is-complete span { background: rgba(61,220,151,.16); color: #8ce8b9; }
.wizard-panel { scroll-margin-top: 92px; }
.wizard-search { margin-top: 0; }
.wizard-selected { display: flex; align-items: center; gap: 14px; margin-bottom: 18px; padding: 13px; border: 1px solid rgba(61,220,151,.22); border-radius: var(--radius-sm); background: var(--success-soft); }
.wizard-selected-poster { width: 58px; aspect-ratio: 2/3; object-fit: cover; border-radius: 7px; }
.wizard-selected-text .eyebrow { margin-bottom: 5px; color: #8ce8b9; }
.wizard-selected-text h3, .wizard-selected-text p { margin-bottom: 4px; }
.wizard-season-row { display: grid; grid-template-columns: minmax(180px, .35fr) minmax(0, 1fr); gap: 14px; align-items: end; }
.wizard-season-row .hint { margin-bottom: 0; }
.wizard-loading { margin-top: 18px; padding: 16px; border-radius: var(--radius-sm); color: var(--accent-strong); background: var(--accent-soft); font-size: .86rem; }
.wizard-preview { display: grid; gap: 12px; margin-top: 18px; }
.wizard-info-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.wizard-info-card { min-width: 0; padding: 14px; border: 1px solid var(--line); border-radius: var(--radius-sm); background: rgba(255,255,255,.025); }
.wizard-info-card.is-ok { border-color: rgba(61,220,151,.2); }
.wizard-info-card.is-warning { border-color: rgba(242,189,88,.26); }
.wizard-info-label { display: block; margin-bottom: 7px; color: var(--muted-dim); font-size: .66rem; font-weight: 700; text-transform: uppercase; letter-spacing: .09em; }
.wizard-info-value { display: block; margin-bottom: 5px; font-family: var(--font-display); font-size: 1rem; font-weight: 700; }
.wizard-info-card p { margin-bottom: 0; line-height: 1.5; }
.wizard-target { padding: 20px; border: 1px solid rgba(109,140,255,.3); border-radius: var(--radius); background: linear-gradient(140deg, rgba(109,140,255,.13), rgba(109,140,255,.04)); }
.wizard-target-code { display: block; margin-bottom: 8px; font-family: var(--font-display); font-size: clamp(1.7rem, 4.5vw, 2.5rem); font-weight: 800; letter-spacing: -.04em; }
.wizard-target p, .wizard-final-target { margin-bottom: 0; color: #c6cee8; font-size: .86rem; }
.wizard-final-target { padding: 12px 14px; border-radius: var(--radius-sm); background: var(--success-soft); color: #8ce8b9; }
.wizard-final-target.is-warning { background: rgba(242,189,88,.07); color: #ffd886; }
.wizard-duplicate-warning a { color: inherit; font-weight: 800; text-decoration: underline; text-underline-offset: 2px; }

/* ---------- tables ---------- */
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius); }
table { width: 100%; border-collapse: collapse; }
th, td { padding: 12px 14px; border-bottom: 1px solid var(--line); text-align: left; font-size: .82rem; vertical-align: top; }
tbody tr:last-child td { border-bottom: 0; }
tbody tr:hover { background: rgba(255,255,255,.02); }
th { position: sticky; top: 0; color: var(--muted-dim); background: var(--panel); font-size: .68rem; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; }
.release-cell { min-width: 360px; word-break: break-word; font-family: var(--font-mono); font-size: .76rem; }
.empty-state { padding: 48px 30px; border: 1px dashed var(--line-strong); border-radius: var(--radius); color: var(--muted); text-align: center; font-size: .88rem; }
.footer { margin-top: 8px; border-top: 1px solid var(--line); color: var(--muted-dim); font-size: .74rem; padding-bottom: env(safe-area-inset-bottom); }
.footer-inner { min-height: 72px; display: flex; justify-content: space-between; align-items: center; gap: 18px; }

/* ---------- sources / info ---------- */
.source-status { display: flex; justify-content: space-between; align-items: center; gap: 16px; margin-bottom: 18px; padding: 14px 16px; border: 1px solid rgba(61,220,151,.22); border-radius: var(--radius); background: var(--success-soft); }
.source-status strong { display: block; margin-bottom: 3px; color: #8ce8b9; font-size: .92rem; }
.source-status span { color: var(--muted); font-size: .78rem; }
code { padding: 2px 6px; border-radius: 5px; background: rgba(255,255,255,.06); color: #cfd6e8; font-family: var(--font-mono); font-size: .86em; }
.source-actions { display: flex; align-items: center; gap: 9px; flex-wrap: wrap; }
.source-warning { display: block; margin-top: 4px; color: #ffd886 !important; }

.source-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 12px; margin-bottom: 12px; }
.source-grid .source-status { margin-bottom: 0; }
.source-status-off { border-color: var(--line); background: rgba(255,255,255,.025); }
.source-status-off strong { color: var(--muted); }
.source-actions-main { justify-content: flex-end; margin-bottom: 20px; }
.cover-badge { position: absolute; right: 8px; bottom: 8px; z-index: 2; padding: 3px 8px; border-radius: 999px; background: rgba(8,11,16,.78); border: 1px solid rgba(255,255,255,.16); color: #cdd6ee; font-size: .6rem; font-weight: 700; letter-spacing: .07em; text-transform: uppercase; backdrop-filter: blur(6px); }
.info-hero { margin-bottom: 24px; }
.info-source-grid { align-items: stretch; }
.info-source-grid .source-status { min-height: 112px; }
.info-actions-panel { margin-top: 18px; }
.info-actions { justify-content: flex-start; }
.danger-zone { border-color: rgba(255,107,120,.26); background: linear-gradient(150deg, rgba(48,18,24,.6), var(--panel) 60%); }
.danger-eyebrow { color: #ff9ca5; }
.danger-copy { max-width: 74ch; color: #c3a2a8; line-height: 1.6; font-size: .88rem; }
.delete-filter-form { display: grid; grid-template-columns: minmax(260px, 520px) auto; gap: 12px; align-items: end; margin-top: 18px; }
.delete-confirm-field span strong { color: #ffb1b9; }
.delete-confirm-field input[aria-invalid="true"] { border-color: rgba(255,107,120,.55); box-shadow: 0 0 0 3px rgba(255,107,120,.12); }
.delete-filter-form .button:disabled { cursor: not-allowed; }

/* ---------- season / sync ---------- */
.season-info { margin: 0 0 8px; color: #b9c2d6; font-size: .76rem; line-height: 1.5; }
.season-next { color: var(--accent-strong); font-weight: 600; }
.sync-state {
    display: inline-flex; align-items: center; gap: 7px;
    margin: 0 0 10px; padding: 6px 10px; border-radius: 999px;
    background: rgba(255,255,255,.04); color: var(--muted); font-size: .69rem; font-weight: 600; line-height: 1.35;
}
.sync-state::before { content: ""; flex: 0 0 6px; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.sync-applied { color: #84e8b5; background: var(--success-soft); }
.sync-planned { color: #ffd886; background: rgba(242,189,88,.09); }
.sync-waiting { color: var(--accent-strong); background: var(--accent-soft); }
.sync-error { color: #ff9ca5; background: rgba(255,107,120,.09); }
.sync-unmapped { color: #ffd886; background: rgba(242,189,88,.09); }
.sync-resolution_error { color: #ff9ca5; background: rgba(255,107,120,.09); }

/* ---------- responsive ---------- */
@media (max-width: 860px) {
    .hero, .toolbar, .page-heading { align-items: stretch; flex-direction: column; }
    .stats { width: 100%; }
    .stat { flex: 1; min-width: 0; padding-inline: 10px; }
    .toolbar-actions { flex-wrap: wrap; }
    .search-field { max-width: none; }
    .two-column { grid-template-columns: 1fr; }
    .wizard-steps { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

@media (max-width: 700px) {
    .source-status { align-items: stretch; flex-direction: column; }
    .source-status form, .source-status .button { width: 100%; }
    .source-actions, .source-actions form, .source-actions .button { width: 100%; }
    .table-wrap { border: 0; }
    table thead { display: none; }
    table, tbody, tr, td { display: block; width: 100%; }
    table tr { margin-bottom: 10px; padding: 12px; border: 1px solid var(--line); border-radius: var(--radius-sm); background: rgba(255,255,255,.025); }
    table td { border-bottom: none; padding: 4px 0; }
    table td::before { content: attr(data-label); display: block; margin-bottom: 2px; color: var(--muted-dim); font-size: .66rem; text-transform: uppercase; letter-spacing: .07em; }
    .release-cell { min-width: 0; }
    .wizard-info-grid, .wizard-season-row { grid-template-columns: 1fr; }
    .delete-filter-form { grid-template-columns: 1fr; }
    .delete-filter-form .button { width: 100%; }
}

@media (max-width: 780px) {
    .source-grid { grid-template-columns: 1fr; }
    .source-actions-main, .source-actions-main form, .source-actions-main .button { width: 100%; }
}

@media (max-width: 560px) {
    .shell { width: min(100% - 24px, 1280px); }
    .topbar-inner { min-height: auto; flex-wrap: wrap; padding-block: 10px; gap: 10px; }
    .brand { font-size: .92rem; }
    .nav { width: 100%; overflow-x: auto; gap: 4px; -webkit-overflow-scrolling: touch; scrollbar-width: none; }
    .nav::-webkit-scrollbar { display: none; }
    .nav a, .nav-form, .nav-action { flex: 0 0 auto; }
    .page { padding-top: 26px; }
    .stats { overflow-x: auto; }
    .card-grid { grid-template-columns: 1fr; gap: 12px; }
    .show-card { grid-template-columns: 100px minmax(0, 1fr); }
    .show-content { padding: 14px 15px; }
    .episode-grid { grid-template-columns: 1fr 1fr; }
    .card-actions { align-items: stretch; flex-direction: column; }
    .card-actions .button, .card-actions form, .card-actions form .button { width: 100%; }
    .form-grid { grid-template-columns: 1fr; }
    .field-wide { grid-column: auto; }
    .tmdb-search { grid-template-columns: 1fr; }
    .tmdb-results { grid-column: auto; }
    .wizard-steps { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .wizard-steps li { padding: 8px 9px; }
    .footer-inner { flex-direction: column; align-items: flex-start; padding-block: 18px; }
}

/* ========================================================================== 
   ChatGPT polish layer — v1
   Drop-in refinements for the Claude redesign. No markup / JS changes needed.
   ========================================================================== */

:root {
    --panel-glass: rgba(16, 20, 28, .84);
    --accent-glow: rgba(109, 140, 255, .20);
    --success-glow: rgba(61, 220, 151, .16);
}

/* Native controls / scrollbars */
html { color-scheme: dark; scroll-behavior: smooth; }
body { overflow-x: hidden; }
* { scrollbar-width: thin; scrollbar-color: rgba(139,149,171,.38) transparent; }
*::-webkit-scrollbar { width: 10px; height: 10px; }
*::-webkit-scrollbar-track { background: transparent; }
*::-webkit-scrollbar-thumb { background: rgba(139,149,171,.28); border: 3px solid transparent; background-clip: padding-box; border-radius: 999px; }
*::-webkit-scrollbar-thumb:hover { background: rgba(169,188,255,.45); border: 3px solid transparent; background-clip: padding-box; }

/* Slightly richer page depth without turning the UI into a gradient demo */
body::before {
    content: "";
    position: fixed;
    inset: 0;
    z-index: -1;
    pointer-events: none;
    background:
        radial-gradient(900px 420px at 15% -10%, rgba(109,140,255,.09), transparent 68%),
        radial-gradient(700px 380px at 88% 4%, rgba(102,76,255,.055), transparent 72%);
}

.topbar {
    box-shadow: 0 1px 0 rgba(255,255,255,.025), 0 12px 32px rgba(0,0,0,.18);
}
.topbar-inner { min-height: 66px; }
.brand-mark {
    position: relative;
    overflow: hidden;
}
.brand-mark::after {
    content: "";
    position: absolute;
    inset: 1px 4px auto;
    height: 42%;
    border-radius: inherit;
    background: linear-gradient(180deg, rgba(255,255,255,.24), transparent);
    pointer-events: none;
}
.nav { box-shadow: 0 1px 0 rgba(255,255,255,.025) inset, 0 6px 16px rgba(0,0,0,.15); }
.nav a.is-active { border: 1px solid rgba(255,255,255,.055); }

/* Headline/stat hierarchy */
.hero { margin-bottom: 32px; }
.hero-copy, .page-heading p { color: #929db3; }
.stats {
    box-shadow: 0 1px 0 rgba(255,255,255,.035) inset, 0 10px 30px rgba(0,0,0,.18);
}
.stat strong { color: #f7f8fc; }
.stat:hover strong { color: var(--accent-strong); }

/* Inputs feel more tactile */
input, select {
    box-shadow: 0 1px 0 rgba(255,255,255,.025) inset;
}
input:focus, select:focus {
    box-shadow: 0 0 0 3px rgba(109,140,255,.14), 0 8px 24px rgba(0,0,0,.20);
}

.button {
    box-shadow: 0 1px 0 rgba(255,255,255,.045) inset, 0 4px 12px rgba(0,0,0,.18);
}
.button:hover {
    transform: translateY(-1px);
    box-shadow: 0 1px 0 rgba(255,255,255,.07) inset, 0 8px 18px rgba(0,0,0,.24);
}
.button:active { transform: translateY(0) scale(.985); }
.button-primary { color: #fff; text-shadow: 0 1px 1px rgba(0,0,0,.18); }
.button-primary:hover { color: #fff; }

/* Series cards: stronger visual hierarchy, still compact */
.card-grid { gap: 18px; }
.show-card {
    position: relative;
    isolation: isolate;
    background: linear-gradient(145deg, rgba(18,23,33,.98), rgba(13,17,25,.98));
    box-shadow: 0 1px 0 rgba(255,255,255,.035) inset, 0 14px 34px rgba(0,0,0,.34);
}
.show-card::before {
    content: "";
    position: absolute;
    inset: 0;
    z-index: -1;
    pointer-events: none;
    border-radius: inherit;
    background: linear-gradient(120deg, rgba(109,140,255,.035), transparent 36%);
    opacity: 0;
    transition: opacity .18s ease;
}
.show-card:hover::before { opacity: 1; }
.show-card:hover {
    border-color: rgba(169,188,255,.22);
    transform: translateY(-3px);
    box-shadow: 0 1px 0 rgba(255,255,255,.055) inset, 0 25px 54px rgba(0,0,0,.50), 0 0 0 1px rgba(109,140,255,.035);
}
.poster-wrap { overflow: hidden; }
.poster {
    transition: transform .35s cubic-bezier(.2,.7,.3,1), filter .25s ease;
    filter: saturate(.96) contrast(1.02);
}
.show-card:hover .poster { transform: scale(1.025); filter: saturate(1.04) contrast(1.04); }
.poster-wrap::after {
    background: linear-gradient(180deg, rgba(0,0,0,.42) 0%, transparent 30%, transparent 58%, rgba(0,0,0,.50));
}
.show-content { background: linear-gradient(110deg, rgba(255,255,255,.012), transparent 55%); }
.show-heading h2 { color: #f6f7fb; }
.filter-name { opacity: .9; }
.id-badge { border: 1px solid rgba(255,255,255,.045); }

/* Episode cells read more like a compact status block */
.episode-grid {
    box-shadow: 0 1px 0 rgba(255,255,255,.02) inset;
}
.episode-grid div {
    background: rgba(8,11,17,.38);
}
.episode-grid dd { color: #f3f5fa; }

/* This also gives the new TMDB countdown a visible, but quiet home */
.next-info {
    position: relative;
    margin: 0 0 13px;
    padding: 9px 11px 9px 12px;
    border: 1px solid rgba(109,140,255,.10);
    border-radius: 9px;
    background: rgba(109,140,255,.045);
    line-height: 1.45;
}
.next-info::before {
    content: "";
    position: absolute;
    left: -1px;
    top: 8px;
    bottom: 8px;
    width: 2px;
    border-radius: 999px;
    background: var(--accent);
    opacity: .7;
}
.next-info strong { color: #dce3ff; }
.next-info span { color: #929db3; }

.hint {
    border: 1px solid rgba(255,255,255,.035);
    background: rgba(255,255,255,.025);
}
.card-actions .button { min-height: 38px; padding: 8px 13px; }

/* Status badges / sync pills */
.status-badge { box-shadow: 0 4px 12px rgba(0,0,0,.24); }
.status-on { box-shadow: 0 4px 14px rgba(61,220,151,.09); }
.sync-state { border: 1px solid rgba(255,255,255,.035); }
.sync-state::before { box-shadow: 0 0 0 3px color-mix(in srgb, currentColor 12%, transparent); }

/* Panels / info page */
.panel {
    background: linear-gradient(145deg, rgba(17,21,30,.98), rgba(13,17,24,.98));
    box-shadow: 0 1px 0 rgba(255,255,255,.035) inset, 0 12px 28px rgba(0,0,0,.28);
}
.panel-heading { border-bottom-color: rgba(255,255,255,.055); }
.metadata-list div { transition: background-color .14s ease; }
.metadata-list div:hover { background: rgba(255,255,255,.018); }

.source-status {
    box-shadow: 0 1px 0 rgba(255,255,255,.025) inset;
}
.source-status:not(.source-status-off) { box-shadow: 0 1px 0 rgba(255,255,255,.025) inset, 0 12px 28px rgba(61,220,151,.045); }

/* TMDB results / wizard */
.tmdb-result:hover { transform: translateY(-1px); box-shadow: 0 8px 20px rgba(0,0,0,.22); }
.wizard-steps { position: relative; }
.wizard-steps li.is-active { box-shadow: 0 0 0 1px rgba(109,140,255,.08) inset, 0 8px 20px rgba(109,140,255,.08); }
.wizard-target {
    box-shadow: 0 1px 0 rgba(255,255,255,.045) inset, 0 14px 34px rgba(109,140,255,.08);
}

/* Tables */
.table-wrap { background: rgba(12,15,22,.42); box-shadow: 0 10px 26px rgba(0,0,0,.18); }
th { backdrop-filter: blur(10px); background: rgba(16,20,28,.94); }
tbody tr { transition: background-color .14s ease; }
tbody tr:hover { background: rgba(109,140,255,.035); }

/* Footer disappears visually into the page instead of looking like another card */
.footer { margin-top: 26px; border-top-color: rgba(255,255,255,.045); }
.footer-inner { min-height: 64px; }

/* Small desktop: let cards breathe instead of forcing overly wide minimums */
@media (max-width: 1100px) and (min-width: 701px) {
    .card-grid { grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); }
    .show-card { grid-template-columns: 118px minmax(0, 1fr); }
}

@media (max-width: 700px) {
    .page { padding-bottom: 56px; }
    .show-card:hover { transform: none; }
    .show-card:hover .poster { transform: none; }
    .next-info { padding-block: 8px; }
    table tr { box-shadow: 0 8px 20px rgba(0,0,0,.16); }
}

@media (max-width: 560px) {
    .hero { margin-bottom: 24px; }
    .show-card { border-radius: 14px; }
    .show-content { padding: 13px 14px; }
    .episode-grid div { padding: 8px 9px; }
    .stats { scroll-snap-type: x proximity; }
    .stat { scroll-snap-align: start; }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { scroll-behavior: auto !important; transition-duration: .001ms !important; animation-duration: .001ms !important; animation-iteration-count: 1 !important; }
}

/* Anmeldung (v1.8.0) */
.login-body { min-height: 100vh; display: grid; place-items: center; padding: 24px 16px; }
.login-shell { width: 100%; max-width: 380px; display: grid; gap: 20px; }
.login-brand { justify-content: center; }
.login-panel h1 { margin: 0 0 16px; font-size: 1.35rem; }
.login-form { display: grid; gap: 14px; }
.login-form .field input { width: 100%; }
.login-submit { width: 100%; justify-content: center; margin-top: 4px; }
.nav-user { white-space: nowrap; }
