:root {
  --bg: #0f1115; --panel: #171a21; --panel2: #1e222b; --line: #2a2f3a; --text: #e8eaf0; --muted: #8d94a3;
  --accent: #1e88ff; --accent2: #4aa3ff; --ok: #2ecc71; --warn: #f5b400; --bad: #ff5a5f; --r: 14px;
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; background: var(--bg); color: var(--text);
  font: 15px/1.45 -apple-system, "Segoe UI", Roboto, system-ui, sans-serif; }
a { color: var(--accent2); text-decoration: none; }
header { position: sticky; top: 0; z-index: 5; display: flex; align-items: center; gap: 10px;
  padding: calc(10px + env(safe-area-inset-top)) 14px 10px; background: rgba(15,17,21,.92);
  backdrop-filter: blur(10px); border-bottom: 1px solid var(--line); }
#title { font-weight: 700; font-size: 17px; flex: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
#back { font-size: 28px; line-height: 1; padding: 0 6px 2px 0; color: var(--text); }
main { max-width: 860px; margin: 0 auto; padding: 14px 14px calc(40px + env(safe-area-inset-bottom)); }
.pad { padding: 30px 0; } .center { text-align: center; } .muted { color: var(--muted); }
.small { font-size: 13px; } .row { display: flex; gap: 10px; align-items: center; } .wrap { flex-wrap: wrap; }
.grow { flex: 1; } .gap { height: 12px; }
h2 { font-size: 18px; margin: 18px 0 10px; } h3 { font-size: 15px; margin: 14px 0 6px; }
.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--r); padding: 14px; margin-bottom: 12px; }
.card.hl { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent) inset; }
button, .btn { appearance: none; border: 0; border-radius: 10px; padding: 11px 16px; font: inherit; font-weight: 600;
  background: var(--accent); color: #fff; cursor: pointer; display: inline-flex; align-items: center; gap: 6px; }
button:disabled { opacity: .45; cursor: default; }
button.ghost { background: var(--panel2); color: var(--text); border: 1px solid var(--line); }
button.ok { background: var(--ok); color: #06210f; } button.bad { background: transparent; color: var(--bad); border: 1px solid #5a2a2e; }
button.small { padding: 6px 10px; font-size: 13px; border-radius: 8px; }
button.full { width: 100%; justify-content: center; }
input, textarea, select { width: 100%; background: var(--panel2); color: var(--text); border: 1px solid var(--line);
  border-radius: 10px; padding: 11px 12px; font: inherit; }
textarea { min-height: 84px; resize: vertical; }
input:focus, textarea:focus { outline: 2px solid var(--accent); border-color: transparent; }
.pill { display: inline-block; font-size: 12px; font-weight: 600; padding: 3px 9px; border-radius: 99px;
  background: var(--panel2); border: 1px solid var(--line); color: var(--muted); white-space: nowrap; }
.pill.s-published { background: #0f3a22; color: #6ff0a4; border-color: #1c6b40; }
.pill.s-edit_done, .pill.s-script_draft { background: #3a2f08; color: #ffd45a; border-color: #6b5a10; }
.pill.s-approved, .pill.s-uploaded_private { background: #0d2a4d; color: #8cc4ff; border-color: #1d4e85; }
.pill.run { background: #0d2a4d; color: #8cc4ff; } .pill.done { background: #0f3a22; color: #6ff0a4; }
.pill.failed, .pill.stopped, .pill.cancelled { background: #3d1518; color: #ff8a8e; }
.chan { display: flex; gap: 14px; align-items: center; cursor: pointer; }
.chan img { width: 64px; height: 64px; border-radius: 50%; background: #fff; object-fit: cover; }
.vid { display: flex; gap: 12px; align-items: center; cursor: pointer; }
.vid .th { width: 54px; height: 96px; border-radius: 8px; background: var(--panel2) center/cover no-repeat; flex: none; }
.vid .t { font-weight: 600; } .vid .id { color: var(--muted); font-size: 12px; }
.steps { display: flex; gap: 4px; margin: 4px 0 14px; }
.steps i { flex: 1; height: 5px; border-radius: 3px; background: var(--line); }
.steps i.on { background: var(--accent); } .steps i.now { background: var(--warn); }
.tabs { display: flex; gap: 6px; overflow-x: auto; margin: 0 -14px 12px; padding: 0 14px; scrollbar-width: none; }
.tabs button { background: var(--panel2); color: var(--muted); border: 1px solid var(--line); white-space: nowrap; }
.tabs button.on { background: var(--text); color: #111; border-color: var(--text); }
.md table { width: 100%; border-collapse: collapse; font-size: 13.5px; display: block; overflow-x: auto; }
.md th, .md td { border-bottom: 1px solid var(--line); padding: 7px 6px; text-align: left; vertical-align: top; }
.md th { color: var(--muted); font-weight: 600; } .md p { margin: 8px 0; } .md h1 { font-size: 18px; }
.md pre { position: relative; background: #0b0d11; border: 1px solid var(--line); border-radius: 10px; padding: 12px;
  white-space: pre-wrap; word-break: break-word; font-size: 12.5px; }
.md pre button { position: absolute; top: 8px; right: 8px; }
.md code { background: var(--panel2); padding: 1px 5px; border-radius: 5px; }
.imgs { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 10px; }
.imgs .im { background: var(--panel2); border: 1px solid var(--line); border-radius: 10px; overflow: hidden; }
.imgs img { width: 100%; aspect-ratio: 9/16; object-fit: cover; display: block; }
.imgs .bar { display: flex; gap: 6px; padding: 6px; align-items: center; }
.imgs select { padding: 4px; font-size: 13px; }
video, .cover { width: 100%; max-width: 360px; border-radius: 12px; background: #000; display: block; margin: 0 auto; }
.log { background: #0b0d11; border: 1px solid var(--line); border-radius: 10px; padding: 10px; font-size: 13px;
  max-height: 55vh; overflow-y: auto; white-space: pre-wrap; word-break: break-word; }
.log div { padding: 3px 0; border-bottom: 1px dashed #1d2129; }
.idea { cursor: pointer; } .idea:hover { border-color: var(--accent); }
.stars { color: var(--warn); letter-spacing: 1px; }
#toast { position: fixed; left: 50%; bottom: calc(20px + env(safe-area-inset-bottom)); transform: translateX(-50%);
  background: #2b313d; color: #fff; padding: 10px 16px; border-radius: 10px; z-index: 20; max-width: 90vw; }
.drop { border: 2px dashed var(--line); border-radius: 12px; padding: 18px; text-align: center; color: var(--muted); }
.spin { display: inline-block; width: 12px; height: 12px; border: 2px solid currentColor; border-right-color: transparent;
  border-radius: 50%; animation: s 0.8s linear infinite; } @keyframes s { to { transform: rotate(360deg); } }

[hidden] { display: none !important; }

.secret { -webkit-text-security: disc; text-security: disc; }
.showpw { display: flex; align-items: center; gap: 8px; margin-top: 10px; }
.showpw input { width: auto; }
