:root {
  color-scheme: dark;
  --bg: #080b10;
  --panel: rgba(20, 25, 34, .88);
  --panel-2: #171d27;
  --line: rgba(255,255,255,.09);
  --text: #f6f8fb;
  --muted: #8e99aa;
  --accent: #ff4b58;
  --accent-2: #ff7b58;
  --green: #49d39a;
  --yellow: #ffc857;
  --danger: #ff6472;
  --shadow: 0 20px 60px rgba(0,0,0,.28);
}
* { box-sizing: border-box; }
body { margin: 0; min-height: 100vh; background:
  radial-gradient(circle at 12% 0%, rgba(255,75,88,.14), transparent 28%),
  radial-gradient(circle at 90% 18%, rgba(87,122,255,.11), transparent 24%), var(--bg);
  color: var(--text); font: 14px/1.55 Inter, ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif; }
button, input, select { font: inherit; }
button { border: 0; cursor: pointer; }
header { height: 72px; padding: 0 clamp(18px, 4vw, 52px); display: flex; align-items: center; justify-content: space-between; border-bottom: 1px solid var(--line); backdrop-filter: blur(16px); position: sticky; top: 0; z-index: 20; background: rgba(8,11,16,.78); }
.brand { display: flex; gap: 12px; align-items: center; }
.brand strong { display: block; font-size: 16px; letter-spacing: .02em; }
.brand span { display: block; color: var(--muted); font-size: 11px; margin-top: 1px; }
.brand-mark { width: 54px; height: 54px; border-radius: 18px; display: grid; place-items: center; font-weight: 900; letter-spacing: -.06em; background: linear-gradient(135deg,var(--accent),var(--accent-2)); box-shadow: 0 12px 36px rgba(255,75,88,.27); }
.brand-mark.small { width: 38px; height: 38px; border-radius: 12px; font-size: 13px; }
.header-actions { display: flex; gap: 12px; align-items: center; }
.status-dot { color: var(--muted); font-size: 12px; }
.status-dot::before { content: ""; display: inline-block; width: 7px; height: 7px; border-radius: 50%; margin-right: 7px; background: var(--green); box-shadow: 0 0 0 5px rgba(73,211,154,.1); }
main { width: min(1380px, calc(100% - 32px)); margin: 32px auto 64px; }
.panel { border: 1px solid var(--line); background: var(--panel); border-radius: 22px; box-shadow: var(--shadow); backdrop-filter: blur(20px); padding: clamp(18px, 2.8vw, 30px); }
.hero { min-height: 250px; display: grid; align-content: center; background: linear-gradient(120deg, rgba(255,75,88,.13), transparent 45%), var(--panel); }
.eyebrow { display: block; color: var(--accent); font-size: 10px; font-weight: 800; letter-spacing: .22em; margin-bottom: 7px; }
h1,h2,p { margin-top: 0; }
h2 { margin-bottom: 7px; font-size: clamp(21px, 3vw, 32px); letter-spacing: -.035em; }
p { color: var(--muted); }
.parse-form { display: grid; grid-template-columns: 1fr auto; gap: 10px; margin-top: 22px; }
.or-line { display: flex; align-items: center; gap: 12px; color: var(--muted); font-size: 11px; margin: 8px 0 -12px; }
.or-line::before,.or-line::after { content: ""; height: 1px; background: var(--line); flex: 1; }
input, select { width: 100%; border: 1px solid var(--line); color: var(--text); background: #0f141c; border-radius: 12px; padding: 13px 15px; outline: none; }
input:focus, select:focus { border-color: rgba(255,75,88,.7); box-shadow: 0 0 0 4px rgba(255,75,88,.09); }
button { color: #fff; background: linear-gradient(135deg,var(--accent),var(--accent-2)); border-radius: 12px; padding: 12px 18px; font-weight: 750; }
button:hover { filter: brightness(1.06); transform: translateY(-1px); }
button:disabled { opacity: .45; cursor: not-allowed; transform: none; }
.ghost, .secondary { background: #202836; color: #cbd2dd; }
.danger { background: rgba(255,100,114,.14); color: #ff8e98; }
.hidden { display: none !important; }
.error-text { min-height: 20px; color: #ff8791; margin-top: 8px; }
#seriesPanel { margin-top: 18px; }
#searchPanel { margin-top: 18px; }
.search-results { display: grid; grid-template-columns: repeat(auto-fill,minmax(280px,1fr)); gap: 12px; }
.search-card { display: grid; grid-template-columns: 72px 1fr; gap: 13px; padding: 13px; border: 1px solid var(--line); border-radius: 15px; background: rgba(13,18,25,.78); cursor: pointer; text-align: left; }
.search-card:hover { border-color: rgba(255,75,88,.55); background: rgba(255,75,88,.07); }
.search-card img { width: 72px; height: 98px; border-radius: 10px; object-fit: cover; background: var(--panel-2); }
.search-card h3 { font-size: 15px; line-height: 1.35; margin: 1px 0 6px; }
.search-card p { font-size: 11px; line-height: 1.45; margin: 6px 0 0; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.tag-row { display: flex; flex-wrap: wrap; gap: 4px; }
.tag { color: #aeb8c6; background: #202836; border-radius: 5px; padding: 2px 5px; font-size: 9px; }
.series-head { display: grid; grid-template-columns: 82px 1fr 190px; gap: 18px; align-items: center; }
.series-head img { width: 82px; height: 110px; border-radius: 14px; object-fit: cover; background: var(--panel-2); }
.series-copy h2 { font-size: 24px; }
.series-copy p { margin-bottom: 0; }
.quality-box label { color: var(--muted); display: block; font-size: 12px; margin-bottom: 7px; }
.selection-tools { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; padding: 20px 0 13px; }
.selection-tools button { padding: 8px 12px; font-size: 12px; }
.selection-tools input { width: 210px; padding: 8px 12px; font-size: 12px; }
.selected-count { color: var(--muted); margin-left: auto; }
.episode-grid { display: grid; grid-template-columns: repeat(auto-fill,minmax(52px,1fr)); gap: 7px; max-height: 340px; overflow: auto; padding: 6px 3px 12px; }
.episode { padding: 9px 4px; border: 1px solid var(--line); border-radius: 9px; text-align: center; color: var(--muted); background: #101620; cursor: pointer; user-select: none; }
.episode.selected { color: #fff; background: rgba(255,75,88,.17); border-color: rgba(255,75,88,.75); }
.download-btn { width: 100%; margin-top: 12px; padding: 14px; }
.workspace-grid { display: grid; grid-template-columns: 1.12fr .88fr; gap: 18px; margin-top: 18px; align-items: start; }
.section-title { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; }
.section-title h2 { font-size: 20px; margin: 0; }
.section-title .eyebrow { margin-bottom: 2px; }
.section-title button { padding: 7px 12px; font-size: 12px; }
.list.empty { color: #657083; text-align: center; padding: 28px 0; }
.item { border: 1px solid var(--line); background: rgba(13,18,25,.78); border-radius: 15px; padding: 15px; margin-top: 10px; }
.item-top { display: flex; justify-content: space-between; gap: 12px; }
.item-title { font-weight: 750; overflow-wrap: anywhere; }
.meta { color: var(--muted); font-size: 12px; margin-top: 4px; }
.badge { white-space: nowrap; align-self: start; padding: 3px 8px; border-radius: 99px; font-size: 10px; font-weight: 800; background: rgba(142,153,170,.12); color: #b5bfcd; }
.badge.running,.badge.queued { background: rgba(255,200,87,.12); color: var(--yellow); }
.badge.completed { background: rgba(73,211,154,.12); color: var(--green); }
.badge.partial,.badge.interrupted,.badge.cancelled { background: rgba(255,100,114,.12); color: #ff929d; }
.progress { height: 7px; border-radius: 9px; overflow: hidden; background: #222a37; margin: 12px 0 8px; }
.progress > div { height: 100%; background: linear-gradient(90deg,var(--accent),var(--accent-2)); transition: width .3s; }
.actions { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 11px; }
.actions button,.actions a { display: inline-flex; align-items: center; text-decoration: none; border: 0; border-radius: 9px; padding: 6px 10px; font: 700 11px/1.4 inherit; color: #d6dce5; background: #202836; cursor: pointer; }
.logs { margin-top: 10px; border-top: 1px solid var(--line); padding-top: 9px; color: #7f8998; font: 11px/1.5 ui-monospace, SFMono-Regular, Consolas, monospace; white-space: pre-wrap; max-height: 92px; overflow: auto; }
.drama { display: grid; grid-template-columns: 54px 1fr; gap: 12px; }
.drama img { width: 54px; height: 72px; border-radius: 9px; object-fit: cover; background: var(--panel-2); }
.missing { color: var(--yellow); }
.overlay { position: fixed; inset: 0; z-index: 100; display: grid; place-items: center; background: rgba(5,7,10,.88); backdrop-filter: blur(18px); }
.login-card { width: min(380px, calc(100% - 32px)); padding: 34px; border-radius: 24px; background: #141a23; border: 1px solid var(--line); box-shadow: var(--shadow); text-align: center; }
.login-card .brand-mark { margin: 0 auto 18px; }
.login-card h1 { margin-bottom: 6px; }
.login-card button { width: 100%; margin-top: 10px; }
.toast { position: fixed; right: 22px; bottom: 22px; max-width: min(420px,calc(100% - 44px)); color: #fff; background: #252d3a; border: 1px solid var(--line); border-radius: 12px; padding: 12px 16px; box-shadow: var(--shadow); opacity: 0; transform: translateY(12px); pointer-events: none; transition: .25s; }
.toast.show { opacity: 1; transform: translateY(0); }
@media(max-width:850px){ .workspace-grid{grid-template-columns:1fr}.series-head{grid-template-columns:70px 1fr}.series-head img{width:70px;height:94px}.quality-box{grid-column:1/-1}.selected-count{width:100%;margin:2px 0}.parse-form{grid-template-columns:1fr}.hero{min-height:auto}.episode-grid{max-height:280px} }
@media(max-width:520px){ main{width:min(100% - 20px,1380px);margin-top:16px}.panel{border-radius:17px;padding:16px}header{height:62px;padding:0 12px}.status-dot{display:none}.series-copy h2{font-size:19px}.selection-tools input{width:100%}.selection-tools #rangeBtn{width:100%}.episode-grid{grid-template-columns:repeat(6,1fr);gap:5px}.episode{font-size:11px} }
