:root {
    --bg: #0f1214; --panel: #181d20; --panel2: #20272b; --line: #2b3439;
    --text: #e8ecee; --muted: #8b979e; --green: #85c742; --green-d: #6ea934;
    --red: #e5484d; --amber: #f5a524; --blue: #3e9bea;
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--text); font: 15px/1.5 system-ui, "Segoe UI", Roboto, sans-serif; }
a { color: var(--green); }
code { background: var(--panel2); padding: .1em .35em; border-radius: 4px; }
h1, h2, h3 { margin: 0 0 .8rem; font-weight: 650; }
h2 { font-size: 1.1rem; display: flex; gap: .8rem; align-items: baseline; }
h3 { font-size: 1rem; margin-top: 1.4rem; }
.muted { color: var(--muted); }
.small { font-size: .85rem; font-weight: 400; }
.ok { color: var(--green); font-weight: 600; }
.bad { color: var(--red); font-weight: 600; }
.right { text-align: right; }
.nowrap { white-space: nowrap; }

.top { display: flex; align-items: center; gap: 1.5rem; padding: .8rem 1.5rem; background: var(--panel); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 5; flex-wrap: wrap; }
.brand { font-weight: 700; display: flex; align-items: center; gap: .5rem; }
.top nav { display: flex; gap: .25rem; flex: 1; flex-wrap: wrap; }
.top nav a { color: var(--muted); text-decoration: none; padding: .4rem .8rem; border-radius: 8px; }
.top nav a:hover { color: var(--text); background: var(--panel2); }
.top nav a.active { color: var(--text); background: var(--panel2); }
.dot { width: 12px; height: 12px; border-radius: 50%; background: var(--green); display: inline-block; }
.dot.live { background: var(--red); box-shadow: 0 0 0 4px rgba(229, 72, 77, .25); }

main { max-width: 1150px; margin: 0 auto; padding: 1.5rem 16px 4rem; }
.card { background: var(--panel); border: 1px solid var(--line); border-radius: 14px; padding: 1.3rem 1.4rem; margin-bottom: 1.2rem; min-width: 0; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 1.2rem; }
.grid2 > .card { margin: 0 0 1.2rem; }
.grid-side { display: grid; grid-template-columns: 290px 1fr; gap: 1.2rem; align-items: start; }
@media (max-width: 800px) { .grid2, .grid-side { grid-template-columns: 1fr; } }

.flash { padding: .75rem 1rem; border-radius: 10px; margin-bottom: 1rem; background: rgba(133, 199, 66, .12); border: 1px solid rgba(133, 199, 66, .35); }
.flash.err { background: rgba(229, 72, 77, .12); border-color: rgba(229, 72, 77, .4); }
.flash.warn { background: rgba(245, 165, 36, .12); border-color: rgba(245, 165, 36, .4); }

label { display: flex; flex-direction: column; gap: .3rem; font-size: .88rem; color: var(--muted); flex: 1; }
input, select { background: var(--bg); border: 1px solid var(--line); color: var(--text); border-radius: 8px; padding: .55rem .7rem; font: inherit; width: 100%; }
input:focus, select:focus { outline: 2px solid var(--green); outline-offset: -1px; }
input:disabled { opacity: .45; }
label.check { flex-direction: row; align-items: center; gap: .5rem; color: var(--text); }
label.check input { width: auto; }
.stack { display: flex; flex-direction: column; gap: .9rem; }
.row { display: flex; gap: .6rem; align-items: flex-end; }
.row.between { justify-content: space-between; align-items: center; flex-wrap: wrap; }
.form-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: .9rem; align-items: end; }
.form-grid .span2 { grid-column: span 2; }
.form-grid .span4 { grid-column: 1 / -1; display: flex; gap: 1rem; align-items: center; flex-wrap: wrap; }
@media (max-width: 800px) { .form-grid { grid-template-columns: 1fr 1fr; } }
form.inline { display: inline; }
.title-input { font-size: 1.1rem; font-weight: 600; }
.rename input { background: transparent; border-color: transparent; padding: .3rem .4rem; }
.rename input:hover, .rename input:focus { border-color: var(--line); background: var(--bg); }

.btn { background: var(--panel2); color: var(--text); border: 1px solid var(--line); border-radius: 8px; padding: .55rem 1rem; font: inherit; font-weight: 600; cursor: pointer; text-decoration: none; display: inline-block; white-space: nowrap; }
.btn:hover { border-color: var(--muted); }
.btn:disabled { opacity: .4; cursor: not-allowed; }
.btn.primary { background: var(--green); border-color: var(--green); color: #0d1a03; }
.btn.primary:hover { background: var(--green-d); }
.btn.danger { background: var(--red); border-color: var(--red); color: #fff; }
.btn.ghost { background: transparent; }
.btn.sm { padding: .3rem .6rem; font-size: .85rem; }

.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th { text-align: left; color: var(--muted); font-weight: 500; font-size: .82rem; text-transform: uppercase; letter-spacing: .04em; }
th, td { padding: .6rem .5rem; border-bottom: 1px solid var(--line); vertical-align: middle; }
tr:last-child td { border-bottom: 0; }
@media (max-width: 700px) {
    table, tbody, tr, td { display: block; width: 100%; }
    thead { display: none; }
    tr { border-bottom: 1px solid var(--line); padding: .5rem 0; }
    td { border: 0; padding: .2rem 0; }
    .right { text-align: left; }
}

.badge { display: inline-block; padding: .15rem .55rem; border-radius: 99px; font-size: .78rem; font-weight: 600; background: var(--panel2); color: var(--muted); }
.b-pending { background: rgba(62, 155, 234, .15); color: var(--blue); }
.b-live, .b-stopping { background: rgba(229, 72, 77, .18); color: #ff6b6f; }
.b-done { background: rgba(133, 199, 66, .15); color: var(--green); }
.b-error, .b-missed { background: rgba(245, 165, 36, .15); color: var(--amber); }
.msg { font-size: .8rem; color: var(--amber); margin-top: .25rem; max-width: 380px; overflow-wrap: anywhere; }

.status .big { font-size: 1.8rem; font-weight: 800; letter-spacing: .02em; display: flex; align-items: center; gap: .6rem; margin: .3rem 0 .6rem; }
.status.is-live { border-color: rgba(229, 72, 77, .5); }
.status.is-live .big { color: #ff6b6f; }
.pulse { width: 14px; height: 14px; border-radius: 50%; background: var(--red); animation: pulse 1.4s infinite; }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 rgba(229, 72, 77, .6); } 100% { box-shadow: 0 0 0 14px rgba(229, 72, 77, 0); } }

.list { list-style: none; padding: 0; margin: 0 0 1rem; }
.list a { display: flex; justify-content: space-between; gap: .5rem; padding: .5rem .7rem; border-radius: 8px; color: var(--text); text-decoration: none; }
.list a:hover { background: var(--panel2); }
.list li.active a { background: var(--panel2); box-shadow: inset 3px 0 0 var(--green); }
.checklist { max-height: 320px; overflow: auto; border: 1px solid var(--line); border-radius: 8px; padding: .5rem .8rem; display: flex; flex-direction: column; gap: .35rem; }

.drop { border: 2px dashed var(--line); border-radius: 12px; padding: 2rem 1rem; text-align: center; cursor: pointer; color: var(--text); position: relative; }
.drop:hover, .drop.over { border-color: var(--green); background: rgba(133, 199, 66, .05); }
.drop input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.progress { position: relative; height: 26px; background: var(--bg); border-radius: 8px; overflow: hidden; border: 1px solid var(--line); }
.progress div { height: 100%; width: 0; background: var(--green); transition: width .2s; }
.progress span { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; font-size: .85rem; font-weight: 600; mix-blend-mode: difference; }

pre.log { background: #080a0b; border: 1px solid var(--line); border-radius: 8px; padding: 1rem; overflow: auto; max-height: 70vh; font-size: .8rem; white-space: pre-wrap; }

body.auth { display: grid; place-items: center; min-height: 100vh; padding: 16px; }
.auth-card { width: 100%; max-width: 360px; display: flex; flex-direction: column; gap: 1rem; }
.auth-card h1 { font-size: 1.3rem; display: flex; align-items: center; gap: .5rem; }
