/* StreamForge CMS */
:root {
  --bg: #0b0d14;
  --bg-2: #10131c;
  --surface: #151925;
  --surface-2: #1b2030;
  --surface-3: #232a3d;
  --line: #262d40;
  --line-2: #323a52;
  --text: #e8ebf4;
  --text-2: #a7aec4;
  --text-3: #6f7791;
  --accent: #7c5cff;
  --accent-2: #9d85ff;
  --accent-soft: rgba(124, 92, 255, .14);
  --ok: #2fd18b;
  --ok-soft: rgba(47, 209, 139, .13);
  --warn: #f5b84a;
  --warn-soft: rgba(245, 184, 74, .13);
  --bad: #ff5d73;
  --bad-soft: rgba(255, 93, 115, .13);
  --info: #48b3ff;
  --info-soft: rgba(72, 179, 255, .13);
  --radius: 14px;
  --radius-sm: 9px;
  --shadow: 0 20px 50px rgba(0, 0, 0, .35);
  --font: "Inter", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --mono: ui-monospace, "Cascadia Code", Consolas, monospace;
  color-scheme: dark;
}
@media (prefers-color-scheme: light) {
  :root:not([data-theme="dark"]) {
    --bg: #f4f5fa; --bg-2: #eceef6; --surface: #ffffff; --surface-2: #f6f7fb; --surface-3: #eceff7;
    --line: #e2e5ef; --line-2: #d3d8e6; --text: #151827; --text-2: #4c536b; --text-3: #8189a2;
    --accent-soft: rgba(124, 92, 255, .1); --shadow: 0 20px 50px rgba(20, 24, 40, .12);
    color-scheme: light;
  }
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body { background: var(--bg); color: var(--text); font: 14px/1.5 var(--font); -webkit-font-smoothing: antialiased; }
a { color: var(--accent-2); text-decoration: none; }
a:hover { text-decoration: underline; }
svg { width: 18px; height: 18px; fill: currentColor; flex: none; }
h1, h2, h3, h4 { margin: 0; line-height: 1.25; }
p { margin: 0; }
code, .mono { font-family: var(--mono); font-size: 12.5px; }
[hidden] { display: none !important; }
.muted { color: var(--text-2); }
.faint { color: var(--text-3); }
.small { font-size: 12.5px; }
.nowrap { white-space: nowrap; }
.ellipsis { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ---------- layout ---------- */
.app { display: grid; grid-template-columns: 248px minmax(0, 1fr); min-height: 100vh; }
.sidebar {
  position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; gap: 18px;
  padding: 20px 14px; background: var(--bg-2); border-right: 1px solid var(--line); overflow-y: auto;
}
.brand { display: flex; align-items: center; gap: 11px; color: var(--text); font-weight: 700; font-size: 16px; padding: 4px 8px; }
.brand:hover { text-decoration: none; }
.brand small { display: block; font-weight: 500; font-size: 11.5px; color: var(--text-3); letter-spacing: .02em; }
.brand-mark {
  width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; color: #fff;
  background: linear-gradient(135deg, var(--accent), #ff5ca8); box-shadow: 0 6px 18px rgba(124, 92, 255, .35);
}
.brand-lg { font-size: 19px; justify-content: center; margin-bottom: 22px; }
.brand-lg .brand-mark { width: 42px; height: 42px; }
.nav { display: flex; flex-direction: column; gap: 2px; flex: 1; }
.nav a {
  display: flex; align-items: center; gap: 11px; padding: 9px 12px; border-radius: 10px; color: var(--text-2); font-weight: 500;
}
.nav a:hover { background: var(--surface); color: var(--text); text-decoration: none; }
.nav a.is-on { background: var(--accent-soft); color: var(--text); }
.nav a.is-on svg { color: var(--accent-2); }
.nav-label { margin: 14px 12px 4px; font-size: 11px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--text-3); }
.nav-badge { margin-left: auto; min-width: 20px; padding: 1px 7px; border-radius: 99px; background: var(--accent); color: #fff; font-size: 11px; text-align: center; }
.sidebar-foot { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 12px 8px 0; border-top: 1px solid var(--line); }
.who { display: flex; align-items: center; gap: 10px; min-width: 0; font-weight: 600; }
.who small { display: block; font-weight: 400; font-size: 11.5px; color: var(--text-3); }
.avatar { width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; background: var(--surface-3); color: var(--accent-2); font-weight: 700; }
.main { min-width: 0; padding: 22px 30px 60px; }
.topbar { display: flex; align-items: center; gap: 14px; margin-bottom: 24px; min-height: 52px; }
.topbar > div:nth-child(2) { flex: 1; min-width: 0; }
.topbar h1 { font-size: 23px; font-weight: 700; letter-spacing: -.01em; }
.eyebrow { font-size: 11.5px; font-weight: 600; letter-spacing: .09em; text-transform: uppercase; color: var(--text-3); }
.topbar-actions { display: flex; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }
.icon-btn.menu-btn { display: none; }
.scrim { display: none; }

/* ---------- buttons / inputs ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px; height: 38px; padding: 0 15px;
  border: 1px solid var(--line-2); border-radius: 10px; background: var(--surface-2); color: var(--text);
  font: 600 13.5px var(--font); cursor: pointer; white-space: nowrap; transition: background .15s, border-color .15s, opacity .15s;
}
.btn:hover { background: var(--surface-3); text-decoration: none; }
.btn:disabled { opacity: .55; cursor: default; }
.btn.primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn.primary:hover { background: #6b49ff; }
.btn.danger { color: var(--bad); }
.btn.danger:hover { background: var(--bad-soft); border-color: var(--bad); }
.btn.ghost { background: transparent; }
.btn.sm { height: 31px; padding: 0 11px; font-size: 12.5px; border-radius: 8px; }
.btn.block { width: 100%; }
.btn svg { width: 16px; height: 16px; }
.icon-btn {
  width: 34px; height: 34px; display: inline-grid; place-items: center; border: 1px solid transparent; border-radius: 9px;
  background: transparent; color: var(--text-2); cursor: pointer;
}
.icon-btn:hover { background: var(--surface-2); color: var(--text); border-color: var(--line); }
.btn.is-busy::before {
  content: ""; width: 14px; height: 14px; border-radius: 50%; border: 2px solid currentColor; border-right-color: transparent; animation: spin .7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.field > span { font-size: 12.5px; font-weight: 600; color: var(--text-2); }
.field > span em { font-style: normal; font-weight: 400; color: var(--text-3); }
.field input, .field select, .field textarea, .input {
  width: 100%; height: 40px; padding: 0 12px; border: 1px solid var(--line-2); border-radius: 10px;
  background: var(--bg-2); color: var(--text); font: 14px var(--font); outline: none; transition: border-color .15s, box-shadow .15s;
}
.field textarea { height: auto; min-height: 90px; padding: 10px 12px; resize: vertical; }
.field input:focus, .field select:focus, .field textarea:focus, .input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.field .hint { font-size: 12px; color: var(--text-3); }
.input-row { display: flex; gap: 8px; }
.input-row > :first-child { flex: 1; min-width: 0; }
.check { display: inline-flex; align-items: center; gap: 9px; cursor: pointer; color: var(--text); font-weight: 500; }
.check input { width: 17px; height: 17px; accent-color: var(--accent); margin: 0; }
.switch { position: relative; display: inline-flex; align-items: center; gap: 9px; cursor: pointer; }
.switch input { position: absolute; opacity: 0; width: 0; height: 0; }
.switch i { width: 36px; height: 21px; border-radius: 99px; background: var(--surface-3); border: 1px solid var(--line-2); position: relative; transition: background .15s; flex: none; }
.switch i::after { content: ""; position: absolute; top: 2px; left: 2px; width: 15px; height: 15px; border-radius: 50%; background: var(--text-2); transition: transform .15s, background .15s; }
.switch input:checked + i { background: var(--accent); border-color: var(--accent); }
.switch input:checked + i::after { transform: translateX(15px); background: #fff; }
.switch input:focus-visible + i { box-shadow: 0 0 0 3px var(--accent-soft); }
.grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.stack { display: flex; flex-direction: column; gap: 14px; }
.row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.row.end { justify-content: flex-end; }
.spacer { flex: 1; }

/* ---------- cards ---------- */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; min-width: 0; }
.card + .card { margin-top: 16px; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 16px; }
.card-head h2, .card-head h3 { font-size: 15.5px; font-weight: 650; }
.card-head p { font-size: 12.5px; color: var(--text-3); margin-top: 2px; }
.section-title { font-size: 12px; font-weight: 650; letter-spacing: .08em; text-transform: uppercase; color: var(--text-3); margin: 26px 0 10px; }
.layout-2 { display: grid; grid-template-columns: minmax(0, 1.55fr) minmax(0, 1fr); gap: 16px; align-items: start; }
.layout-2 > .card + .card, .layout-2 .card + .card { margin-top: 0; }
.col { display: flex; flex-direction: column; gap: 16px; min-width: 0; }

.stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; margin-bottom: 16px; }
.stat { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 18px; position: relative; overflow: hidden; }
.stat span { font-size: 12.5px; font-weight: 600; color: var(--text-2); }
.stat strong { display: block; font-size: 28px; font-weight: 700; letter-spacing: -.02em; margin: 6px 0 2px; }
.stat small { font-size: 12px; color: var(--text-3); }
.stat .stat-icon { position: absolute; right: 14px; top: 14px; width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent-2); }
.stat .stat-icon.ok { background: var(--ok-soft); color: var(--ok); }
.stat .stat-icon.warn { background: var(--warn-soft); color: var(--warn); }
.stat .stat-icon.info { background: var(--info-soft); color: var(--info); }

.hero {
  display: flex; align-items: center; justify-content: space-between; gap: 18px; padding: 22px 24px; margin-bottom: 16px;
  border-radius: var(--radius); border: 1px solid var(--line);
  background: radial-gradient(120% 140% at 0% 0%, rgba(124, 92, 255, .28), transparent 55%), radial-gradient(120% 140% at 100% 100%, rgba(255, 92, 168, .16), transparent 55%), var(--surface);
}
.hero h2 { font-size: 20px; font-weight: 700; }
.hero p { color: var(--text-2); margin-top: 4px; max-width: 560px; }

/* ---------- chips / progress ---------- */
.chip { display: inline-flex; align-items: center; gap: 6px; height: 23px; padding: 0 9px; border-radius: 99px; font-size: 11.5px; font-weight: 650; background: var(--surface-3); color: var(--text-2); white-space: nowrap; }
.chip::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.chip.plain::before { display: none; }
.chip.ok { background: var(--ok-soft); color: var(--ok); }
.chip.warn { background: var(--warn-soft); color: var(--warn); }
.chip.bad { background: var(--bad-soft); color: var(--bad); }
.chip.info { background: var(--info-soft); color: var(--info); }
.chip.accent { background: var(--accent-soft); color: var(--accent-2); }
.chip.live::before { animation: pulse 1.2s ease-in-out infinite; }
@keyframes pulse { 50% { opacity: .25; } }
.bar { height: 6px; border-radius: 99px; background: var(--surface-3); overflow: hidden; }
.bar > i { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--accent), #ff5ca8); transition: width .6s ease; }
.bar.ok > i { background: var(--ok); }
.bar.bad > i { background: var(--bad); }

/* ---------- lists / tables ---------- */
.list { display: flex; flex-direction: column; }
.list-item { display: flex; align-items: center; gap: 14px; padding: 13px 0; border-top: 1px solid var(--line); min-width: 0; }
.list-item:first-child { border-top: 0; padding-top: 0; }
.list-item:last-child { padding-bottom: 0; }
.list-main { flex: 1; min-width: 0; }
.list-main strong { display: block; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.list-main small { display: block; color: var(--text-3); font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.list-main .bar { margin-top: 8px; }
.list-side { display: flex; align-items: center; gap: 8px; flex: none; }
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
table.table { width: 100%; border-collapse: collapse; min-width: 640px; }
.table th { text-align: left; padding: 11px 16px; font-size: 11.5px; font-weight: 650; letter-spacing: .06em; text-transform: uppercase; color: var(--text-3); background: var(--surface-2); border-bottom: 1px solid var(--line); white-space: nowrap; }
.table td { padding: 12px 16px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.table tr:last-child td { border-bottom: 0; }
.table tr:hover td { background: rgba(124, 92, 255, .035); }
.table td strong { font-weight: 600; }
.table td small { display: block; color: var(--text-3); font-size: 12px; }
.table .actions { text-align: right; white-space: nowrap; }
.table .actions .btn { margin-left: 4px; }
.cell-title { max-width: 360px; }
.cell-title strong, .cell-title small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.toolbar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 14px; }
.toolbar .input, .toolbar select.input { width: auto; min-width: 200px; height: 36px; }
.seg { display: inline-flex; padding: 3px; border-radius: 11px; background: var(--surface-2); border: 1px solid var(--line); gap: 2px; flex-wrap: wrap; }
.seg button { height: 30px; padding: 0 13px; border: 0; border-radius: 8px; background: transparent; color: var(--text-2); font: 600 12.5px var(--font); cursor: pointer; }
.seg button:hover { color: var(--text); }
.seg button.is-on { background: var(--surface-3); color: var(--text); box-shadow: 0 1px 2px rgba(0, 0, 0, .25); }

.empty { text-align: center; padding: 40px 20px; color: var(--text-2); }
.empty .empty-icon { width: 52px; height: 52px; margin: 0 auto 12px; border-radius: 16px; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent-2); }
.empty .empty-icon svg { width: 24px; height: 24px; }
.empty h3 { color: var(--text); font-size: 15.5px; margin-bottom: 4px; }
.empty .btn { margin-top: 14px; }
.skeleton { height: 120px; border-radius: var(--radius); background: linear-gradient(90deg, var(--surface) 25%, var(--surface-2) 50%, var(--surface) 75%); background-size: 200% 100%; animation: shimmer 1.3s infinite; }
@keyframes shimmer { to { background-position: -200% 0; } }

/* ---------- anime grid ---------- */
.poster-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(168px, 1fr)); gap: 16px; }
.poster { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; display: flex; flex-direction: column; transition: transform .15s, border-color .15s; }
.poster:hover { transform: translateY(-2px); border-color: var(--line-2); }
.poster-img { aspect-ratio: 2 / 3; background: var(--surface-3) center / cover no-repeat; position: relative; }
.poster-img .chip { position: absolute; top: 8px; left: 8px; backdrop-filter: blur(6px); }
.poster-img .poster-count { position: absolute; bottom: 8px; right: 8px; padding: 2px 8px; border-radius: 99px; background: rgba(0, 0, 0, .65); color: #fff; font-size: 11.5px; font-weight: 600; }
.poster-body { padding: 11px 12px 12px; display: flex; flex-direction: column; gap: 8px; flex: 1; }
.poster-body strong { font-weight: 650; line-height: 1.3; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.poster-body small { color: var(--text-3); font-size: 11.5px; }
.poster-body .row { margin-top: auto; gap: 6px; }
.poster-fallback { position: absolute; inset: 0; display: grid; place-items: center; font-size: 34px; font-weight: 800; color: var(--text-3); }

.thumb { width: 40px; height: 56px; border-radius: 7px; flex: none; display: grid; place-items: center; background: var(--surface-3) center / cover no-repeat; color: var(--text-3); font-weight: 800; font-size: 13px; }

/* ---------- chrome windows ---------- */
.chrome-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 14px; }
.chrome-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; display: flex; flex-direction: column; gap: 12px; }
.chrome-card header { display: flex; align-items: center; gap: 11px; }
.chrome-card header .chrome-icon { width: 38px; height: 38px; border-radius: 11px; display: grid; place-items: center; background: var(--info-soft); color: var(--info); }
.chrome-card header .chrome-icon.off { background: var(--surface-3); color: var(--text-3); }
.chrome-card header div { flex: 1; min-width: 0; }
.chrome-card header strong { display: block; font-weight: 650; }
.chrome-card header small { color: var(--text-3); font-size: 12px; }
.chrome-card ul { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 5px; font-size: 13px; color: var(--text-2); }
.chrome-card ul li { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chrome-card .row { margin-top: auto; gap: 6px; }
.add-card { border-style: dashed; align-items: center; justify-content: center; text-align: center; color: var(--text-2); cursor: pointer; min-height: 170px; background: transparent; font: inherit; }
.add-card:hover { border-color: var(--accent); color: var(--text); background: var(--accent-soft); }
.add-card .chrome-icon { width: 44px; height: 44px; border-radius: 13px; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent-2); }

.account { border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); overflow: hidden; }
.account + .account { margin-top: 12px; }
.account-head { display: flex; align-items: center; gap: 12px; padding: 14px 16px; flex-wrap: wrap; }
.account-head .avatar { width: 36px; height: 36px; }
.account-head .list-main { min-width: 180px; }
.account-blogs { border-top: 1px solid var(--line); padding: 6px 16px 12px; background: var(--surface-2); }
.blog-row { display: flex; align-items: center; gap: 12px; padding: 8px 0; border-bottom: 1px solid var(--line); min-width: 0; }
.blog-row:last-of-type { border-bottom: 0; }
.blog-row .list-main strong { font-weight: 550; }
.blog-add { display: flex; gap: 8px; margin-top: 10px; flex-wrap: wrap; }
.blog-add .input { flex: 1; min-width: 200px; height: 34px; }
details.account > summary { list-style: none; cursor: pointer; }
details.account > summary::-webkit-details-marker { display: none; }
details.account[open] .caret { transform: rotate(180deg); }
.caret { transition: transform .15s; color: var(--text-3); }

/* ---------- new job ---------- */
.source-tabs { margin-bottom: 18px; }
.source-panel { display: flex; flex-direction: column; gap: 14px; }
.drop {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; min-height: 170px; padding: 24px;
  border: 1.5px dashed var(--line-2); border-radius: var(--radius); background: var(--bg-2); color: var(--text-2); cursor: pointer; text-align: center;
}
.drop:hover, .drop.is-over { border-color: var(--accent); background: var(--accent-soft); color: var(--text); }
.drop input { display: none; }
.drop .drop-icon { width: 46px; height: 46px; border-radius: 14px; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent-2); }
.drop strong { color: var(--text); }
.options { display: flex; flex-direction: column; gap: 6px; max-height: 340px; overflow-y: auto; padding-right: 2px; }
.option {
  display: flex; align-items: center; gap: 12px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 11px; background: var(--bg-2); cursor: pointer;
}
.option:hover { border-color: var(--line-2); }
.option:has(input:checked) { border-color: var(--accent); background: var(--accent-soft); }
.option input { width: 17px; height: 17px; accent-color: var(--accent); margin: 0; }
.option .list-main strong { font-weight: 600; }
.option .size { color: var(--text-3); font-size: 12.5px; white-space: nowrap; }
.lang-groups { display: flex; flex-direction: column; gap: 14px; }
.lang-group h4 { font-size: 12px; font-weight: 650; letter-spacing: .06em; text-transform: uppercase; color: var(--text-3); margin-bottom: 7px; display: flex; align-items: center; gap: 8px; }
.summary { display: flex; flex-direction: column; gap: 9px; font-size: 13px; }
.summary div { display: flex; justify-content: space-between; gap: 12px; }
.summary div span:first-child { color: var(--text-3); }
.summary div span:last-child { text-align: right; font-weight: 550; overflow: hidden; text-overflow: ellipsis; }
.notice { display: flex; gap: 10px; padding: 11px 13px; border-radius: 11px; background: var(--info-soft); color: var(--text); font-size: 13px; }
.notice svg { color: var(--info); margin-top: 1px; }
.notice.warn { background: var(--warn-soft); }
.notice.warn svg { color: var(--warn); }
.notice.bad { background: var(--bad-soft); }
.notice.bad svg { color: var(--bad); }
.notice.ok { background: var(--ok-soft); }
.notice.ok svg { color: var(--ok); }
.preview-title { font-family: var(--mono); font-size: 12.5px; padding: 9px 11px; border-radius: 9px; background: var(--bg-2); border: 1px solid var(--line); word-break: break-all; color: var(--text-2); }

/* ---------- requirements ---------- */
.req { display: flex; align-items: center; gap: 12px; padding: 11px 0; border-top: 1px solid var(--line); }
.req:first-child { border-top: 0; padding-top: 0; }
.req .dot { width: 26px; height: 26px; border-radius: 8px; display: grid; place-items: center; flex: none; background: var(--ok-soft); color: var(--ok); }
.req .dot.bad { background: var(--bad-soft); color: var(--bad); }
.req .dot.warn { background: var(--warn-soft); color: var(--warn); }
.req .dot svg { width: 15px; height: 15px; }

.key-box { display: flex; gap: 8px; align-items: center; }
.key-box code { flex: 1; min-width: 0; padding: 9px 12px; border-radius: 9px; background: var(--bg-2); border: 1px solid var(--line); overflow-x: auto; white-space: nowrap; }
pre.code { margin: 0; padding: 12px 14px; border-radius: 10px; background: var(--bg-2); border: 1px solid var(--line); font: 12.5px/1.6 var(--mono); overflow-x: auto; color: var(--text-2); white-space: pre; }

/* ---------- modal / toasts ---------- */
.modal { position: fixed; inset: 0; z-index: 50; display: grid; place-items: center; padding: 20px; background: rgba(5, 7, 12, .66); backdrop-filter: blur(3px); animation: fade .15s; }
.modal-card { width: min(620px, 100%); max-height: calc(100vh - 40px); overflow-y: auto; background: var(--surface); border: 1px solid var(--line-2); border-radius: 18px; box-shadow: var(--shadow); padding: 22px; animation: rise .18s ease; }
.modal-card.wide { width: min(860px, 100%); }
.modal-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin-bottom: 18px; }
.modal-head h2 { font-size: 18px; }
.modal-head p { color: var(--text-3); font-size: 13px; margin-top: 3px; }
.modal-foot { display: flex; justify-content: flex-end; align-items: center; gap: 8px; margin-top: 20px; flex-wrap: wrap; }
.modal-foot .form-error { margin-right: auto; }
@keyframes fade { from { opacity: 0; } }
@keyframes rise { from { opacity: 0; transform: translateY(10px) scale(.98); } }
.toasts { position: fixed; right: 18px; bottom: 18px; z-index: 60; display: flex; flex-direction: column; gap: 8px; align-items: flex-end; }
.toast { max-width: 380px; padding: 11px 15px; border-radius: 11px; background: var(--surface-3); border: 1px solid var(--line-2); color: var(--text); box-shadow: var(--shadow); font-weight: 500; animation: rise .18s ease; }
.toast.ok { border-color: rgba(47, 209, 139, .5); }
.toast.bad { border-color: rgba(255, 93, 115, .55); }
.form-error { color: var(--bad); font-size: 13px; font-weight: 500; }

/* ---------- auth ---------- */
.auth-body { min-height: 100vh; display: grid; place-items: center; padding: 20px;
  background: radial-gradient(60% 50% at 20% 10%, rgba(124, 92, 255, .22), transparent), radial-gradient(50% 45% at 90% 90%, rgba(255, 92, 168, .14), transparent), var(--bg); }
.auth-card { width: min(400px, 100%); background: var(--surface); border: 1px solid var(--line); border-radius: 20px; padding: 32px 28px; box-shadow: var(--shadow); }
.auth-card h1 { font-size: 20px; text-align: center; margin-bottom: 6px; }
.auth-card > .muted { text-align: center; margin-bottom: 20px; }
.auth-form { display: flex; flex-direction: column; gap: 14px; margin-top: 18px; }

/* ---------- responsive ---------- */
@media (max-width: 1180px) {
  .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .layout-2 { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 860px) {
  .app { grid-template-columns: minmax(0, 1fr); }
  .sidebar { position: fixed; z-index: 40; left: 0; top: 0; width: 264px; transform: translateX(-102%); transition: transform .2s ease; }
  .app.nav-open .sidebar { transform: none; box-shadow: var(--shadow); }
  .app.nav-open .scrim { display: block; position: fixed; inset: 0; z-index: 30; background: rgba(0, 0, 0, .5); }
  .icon-btn.menu-btn { display: inline-grid; }
  .main { padding: 14px 16px 50px; }
  .topbar { flex-wrap: wrap; margin-bottom: 16px; }
  .topbar-actions { width: 100%; justify-content: flex-start; }
  .grid-2, .grid-3 { grid-template-columns: minmax(0, 1fr); }
  .hero { flex-direction: column; align-items: flex-start; }
  .poster-grid { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 12px; }
}
@media (max-width: 520px) {
  .stats { grid-template-columns: minmax(0, 1fr); }
  .card { padding: 16px; }
  .toolbar .input, .toolbar select.input { min-width: 0; flex: 1; }
}
.lang-group h4 .chip { text-transform: none; letter-spacing: 0; }
.grid-4 { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; }
@media (max-width: 860px) { .grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
