:root {
  --bg: #12141d; --panel: #1c2030; --panel2: #232838; --line: #2e3447;
  --text: #e8ecf5; --muted: #9aa3bb; --accent: #2e9b86; --accent2: #ec5a50;
  --ok: #46c277; --warn: #e0b54a; --err: #e0574a;
  --radius: 14px;
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
body {
  margin: 0; font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  background: var(--bg); color: var(--text);
  padding-bottom: calc(72px + env(safe-area-inset-bottom));
}
.topbar {
  position: sticky; top: 0; z-index: 5; display: flex; align-items: center;
  justify-content: space-between; gap: 12px; padding: 14px 16px;
  background: var(--panel); border-bottom: 1px solid var(--line);
}
.brand { font-weight: 700; display: flex; align-items: center; gap: 8px; }
.dot { width: 12px; height: 12px; border-radius: 50%; background: var(--accent2); display: inline-block; }
.stats { font-size: 12px; color: var(--muted); display: flex; gap: 10px; flex-wrap: wrap; }
.view { padding: 16px; max-width: 720px; margin: 0 auto; }

h2 { font-size: 16px; margin: 4px 0 12px; }
.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px; margin-bottom: 12px; }
.row { display: flex; gap: 10px; align-items: center; }
.between { justify-content: space-between; }
.muted { color: var(--muted); font-size: 13px; }
.small { font-size: 12px; }

button, .btn {
  font: inherit; border: 1px solid var(--line); background: var(--panel2); color: var(--text);
  padding: 10px 14px; border-radius: 10px; cursor: pointer;
}
button:active { transform: translateY(1px); }
.btn-primary { background: var(--accent); border-color: var(--accent); color: #06231d; font-weight: 600; }
.btn-danger { background: transparent; border-color: var(--err); color: var(--err); }
.btn-ok { background: var(--ok); border-color: var(--ok); color: #04210f; font-weight: 600; }
.btn-block { width: 100%; }
.btn-sm { padding: 7px 10px; font-size: 13px; }

input, textarea {
  width: 100%; font: inherit; color: var(--text); background: var(--bg);
  border: 1px solid var(--line); border-radius: 10px; padding: 11px 12px; margin-top: 8px;
}
textarea { min-height: 90px; resize: vertical; }

.badge { font-size: 11px; padding: 3px 9px; border-radius: 999px; border: 1px solid var(--line); color: var(--muted); white-space: nowrap; }
.b-running { color: var(--warn); border-color: var(--warn); }
.b-awaiting_review { color: var(--accent); border-color: var(--accent); }
.b-failed { color: var(--err); border-color: var(--err); }
.b-published { color: var(--ok); border-color: var(--ok); }
.b-approved, .b-queued { color: var(--muted); }

.bar { height: 6px; background: var(--panel2); border-radius: 999px; overflow: hidden; margin-top: 10px; }
.bar > i { display: block; height: 100%; background: var(--accent); transition: width .4s; }

.events { margin-top: 10px; border-top: 1px solid var(--line); padding-top: 8px; max-height: 220px; overflow: auto; }
.ev { font-size: 12px; padding: 4px 0; border-bottom: 1px dashed var(--line); display: flex; gap: 8px; }
.ev .lv { font-weight: 700; }
.lv.warn { color: var(--warn); } .lv.error { color: var(--err); } .lv.info { color: var(--muted); }

video { width: 100%; border-radius: 12px; background: #000; aspect-ratio: 9/16; }
.cap { white-space: pre-wrap; background: var(--bg); border: 1px solid var(--line); border-radius: 10px; padding: 10px; font-size: 13px; margin-top: 8px; }
.flag { color: var(--warn); }

.tabs {
  position: fixed; bottom: 0; left: 0; right: 0; display: flex; background: var(--panel);
  border-top: 1px solid var(--line); padding-bottom: env(safe-area-inset-bottom);
}
.tab { flex: 1; border: none; background: none; color: var(--muted); padding: 16px 0; border-radius: 0; font-size: 13px; }
.tab.active { color: var(--text); box-shadow: inset 0 2px 0 var(--accent); }

.toast {
  position: fixed; bottom: 86px; left: 50%; transform: translateX(-50%) translateY(20px);
  background: #000; color: #fff; padding: 10px 16px; border-radius: 999px; font-size: 13px;
  opacity: 0; pointer-events: none; transition: .25s; z-index: 20;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
.empty { text-align: center; color: var(--muted); padding: 40px 0; }
.spin { display: inline-block; animation: s 1s linear infinite; } @keyframes s { to { transform: rotate(360deg); } }
