:root {
  --bg: #0c0e12;
  --panel: #141820;
  --panel2: #1a1f2a;
  --line: #2a3140;
  --text: #e8eaed;
  --muted: #8b93a7;
  --accent: #7dd3fc;
  --accent2: #a78bfa;
  --ok: #4ade80;
  --warn: #fbbf24;
  --bad: #f87171;
  --radius: 14px;
  --font: "Segoe UI", system-ui, -apple-system, sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; background: var(--bg); color: var(--text); font-family: var(--font); }
body { min-height: 100vh; }
a { color: var(--accent); }

.app { max-width: 920px; margin: 0 auto; padding: 1.25rem 1rem 3rem; }

.top {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between;
  gap: 1rem; margin-bottom: 1.25rem;
}
.brand { display: flex; gap: .85rem; align-items: center; }
.mark {
  width: 44px; height: 44px; border-radius: 12px;
  background: linear-gradient(135deg, var(--accent), var(--accent2));
  color: #0c0e12; font-weight: 800; display: grid; place-items: center;
  letter-spacing: -0.04em;
}
.brand h1 { margin: 0; font-size: 1.25rem; letter-spacing: -0.02em; }
.sub { margin: .15rem 0 0; color: var(--muted); font-size: .82rem; }

.status-pills { display: flex; gap: .4rem; flex-wrap: wrap; }
.pill {
  font-size: .72rem; padding: .28rem .55rem; border-radius: 999px;
  border: 1px solid var(--line); color: var(--muted); background: var(--panel);
}
.pill.ok { color: var(--ok); border-color: rgba(74,222,128,.35); }
.pill.bad { color: var(--bad); border-color: rgba(248,113,113,.35); }
.pill.warn { color: var(--warn); border-color: rgba(251,191,36,.35); }

.card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.25rem 1.2rem 1.4rem;
  margin-bottom: 1rem;
  box-shadow: 0 12px 40px rgba(0,0,0,.25);
}
.step-label {
  text-transform: uppercase; letter-spacing: .08em;
  font-size: .68rem; color: var(--accent); font-weight: 700; margin-bottom: .35rem;
}
.card h2 { margin: 0 0 .5rem; font-size: 1.35rem; letter-spacing: -0.02em; }
.card h3 { margin: 0 0 .4rem; font-size: 1rem; }
.hint { color: var(--muted); font-size: .9rem; line-height: 1.45; margin: 0 0 1rem; }
.hint.tiny { font-size: .8rem; margin-top: .6rem; }
.muted { color: var(--muted); font-weight: 400; }

.lbl {
  display: block; font-size: .78rem; color: var(--muted);
  margin: 0 0 .35rem; font-weight: 600;
}
textarea, .title-input {
  width: 100%; background: var(--panel2); color: var(--text);
  border: 1px solid var(--line); border-radius: 10px;
  padding: .75rem .85rem; font: inherit; line-height: 1.45;
  resize: vertical; outline: none;
}
textarea:focus, .title-input:focus { border-color: var(--accent); }
.title-input { margin: .75rem 0; }

.row { display: flex; flex-wrap: wrap; align-items: center; }
.gap { gap: .6rem; margin-top: .85rem; }

.btn {
  border: 1px solid var(--line); background: var(--panel2); color: var(--text);
  border-radius: 10px; padding: .6rem 1rem; font: inherit; font-weight: 600;
  cursor: pointer; transition: .15s ease;
}
.btn:hover:not(:disabled) { border-color: var(--accent); color: #fff; }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn.primary {
  background: linear-gradient(135deg, #38bdf8, #818cf8);
  color: #0c0e12; border: none;
}
.btn.primary:hover:not(:disabled) { filter: brightness(1.06); color: #0c0e12; }
.btn.ghost { background: transparent; }
.btn.lg { width: 100%; padding: .85rem 1rem; font-size: 1rem; margin-top: .25rem; }
.btn.sm { padding: .4rem .7rem; font-size: .8rem; }
.btn.danger { border-color: rgba(248,113,113,.4); color: var(--bad); }

.enhance-box {
  margin-top: 1.1rem; padding-top: 1rem;
  border-top: 1px solid var(--line);
}
.hidden { display: none !important; }

.job-banner {
  margin-top: 1rem; padding: .85rem 1rem; border-radius: 10px;
  background: rgba(125,211,252,.08); border: 1px solid rgba(125,211,252,.25);
  font-size: .9rem;
}
.job-banner.err {
  background: rgba(248,113,113,.08); border-color: rgba(248,113,113,.35); color: #fecaca;
}
.job-banner .bar {
  height: 6px; background: #243041; border-radius: 99px; margin-top: .55rem; overflow: hidden;
}
.job-banner .bar > i {
  display: block; height: 100%; width: 0%;
  background: linear-gradient(90deg, var(--accent), var(--accent2));
  transition: width .3s ease;
}

.series-head {
  display: flex; justify-content: space-between; gap: 1rem; align-items: flex-start;
  margin-bottom: 1rem;
}
.block { margin-top: 1.25rem; }

.char-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: .75rem;
}
.char-card {
  background: var(--panel2); border: 1px solid var(--line); border-radius: 12px;
  overflow: hidden;
}
.char-card img {
  width: 100%; aspect-ratio: 9/12; object-fit: cover; display: block; background: #0a0c10;
}
.char-card .meta { padding: .65rem .7rem .75rem; }
.char-card .name { font-weight: 700; margin: 0; }
.char-card .meta p { margin: .2rem 0 0; font-size: .75rem; color: var(--muted); line-height: 1.35; }
.lock {
  display: inline-block; font-size: .65rem; font-weight: 700; letter-spacing: .04em;
  color: var(--ok); text-transform: uppercase; margin-bottom: .2rem;
}

.ep-list { display: flex; flex-direction: column; gap: .65rem; }
.ep {
  display: grid; grid-template-columns: 48px 1fr auto; gap: .75rem; align-items: center;
  background: var(--panel2); border: 1px solid var(--line); border-radius: 12px;
  padding: .75rem .85rem;
}
.ep-num {
  width: 48px; height: 48px; border-radius: 10px; background: #0f131a;
  border: 1px solid var(--line); display: grid; place-items: center;
  font-weight: 800; color: var(--accent);
}
.ep h4 { margin: 0; font-size: .95rem; }
.ep p { margin: .2rem 0 0; font-size: .8rem; color: var(--muted); }
.ep-actions { display: flex; flex-wrap: wrap; gap: .35rem; justify-content: flex-end; }
.badge {
  display: inline-block; font-size: .68rem; padding: .15rem .4rem; border-radius: 6px;
  border: 1px solid var(--line); color: var(--muted); margin-left: .35rem; vertical-align: middle;
}
.badge.ready { color: var(--ok); border-color: rgba(74,222,128,.35); }
.badge.rendering { color: var(--warn); border-color: rgba(251,191,36,.35); }
.badge.error { color: var(--bad); border-color: rgba(248,113,113,.35); }

.phone {
  max-width: 320px; margin: .5rem auto 0;
  border: 1px solid var(--line); border-radius: 18px; overflow: hidden;
  background: #000; aspect-ratio: 9/16;
}
.phone video { width: 100%; height: 100%; object-fit: contain; display: block; background: #000; }

.library { display: flex; flex-direction: column; gap: .5rem; }
.lib-item {
  display: flex; justify-content: space-between; gap: .75rem; align-items: center;
  padding: .7rem .8rem; border-radius: 10px; border: 1px solid var(--line);
  background: var(--panel2); cursor: pointer;
}
.lib-item:hover { border-color: var(--accent); }
.lib-item h4 { margin: 0; font-size: .92rem; }
.lib-item p { margin: .15rem 0 0; font-size: .75rem; color: var(--muted); }

footer {
  margin-top: 1.5rem; display: flex; justify-content: space-between; gap: 1rem;
  flex-wrap: wrap; font-size: .78rem; color: var(--muted);
}

.ok-line { color: var(--ok); font-size: .9rem; margin: .4rem 0 .6rem; }
.yt-setup details { border: 1px solid var(--line); border-radius: 10px; padding: .75rem 1rem; background: var(--panel2); }
.yt-setup summary { cursor: pointer; font-weight: 600; color: var(--accent); }
.steps { margin: .75rem 0; padding-left: 1.2rem; color: var(--muted); font-size: .88rem; line-height: 1.5; }
.steps code { color: var(--text); font-size: .78rem; word-break: break-all; }
#seoBlock textarea, #seoBlock .title-input { margin-bottom: .55rem; }

@media (max-width: 640px) {
  .ep { grid-template-columns: 40px 1fr; }
  .ep-actions { grid-column: 1 / -1; justify-content: flex-start; }
}
