:root {
  --bg: #121212;
  --panel: #1b1b1b;
  --panel-2: #232323;
  --line: #2f2f2f;
  --text: #f2eee8;
  --muted: #9b958c;
  --brand: #f18845;
  --brand-ink: #161616;
  --ok: #5cc98a;
  --warn: #e8c15a;
  --bad: #ec6b62;
  --radius: 10px;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  background: var(--bg);
  color: var(--text);
  font: 15px/1.45 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}
a { color: var(--brand); }
h1, h2, h3 { margin: 0 0 12px; line-height: 1.15; }
h1 { font-size: 22px; }
h2 { font-size: 17px; }
h3 { font-size: 15px; }
p { margin: 0 0 10px; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
code, pre { font-family: ui-monospace, "Cascadia Mono", Consolas, monospace; font-size: 12.5px; }

.shell { display: grid; grid-template-columns: 220px 1fr; min-height: 100vh; }
nav {
  background: var(--panel);
  border-right: 1px solid var(--line);
  padding: 18px 12px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
nav .brand { display: flex; align-items: center; gap: 10px; font-weight: 800; letter-spacing: -0.02em; font-size: 17px; padding: 0 8px 16px; }
nav .brand img { width: 28px; height: 28px; }
nav button {
  all: unset;
  cursor: pointer;
  padding: 8px 10px;
  border-radius: 8px;
  color: var(--muted);
  display: flex;
  justify-content: space-between;
  align-items: center;
}
nav button:hover { background: var(--panel-2); color: var(--text); }
nav button.on { background: var(--panel-2); color: var(--text); font-weight: 600; }
nav .count { background: var(--brand); color: var(--brand-ink); border-radius: 99px; padding: 0 7px; font-size: 12px; font-weight: 700; }
nav .spacer { flex: 1; }
nav .who { font-size: 13px; color: var(--muted); padding: 8px 10px; }

main { padding: 26px 30px 60px; max-width: 1180px; width: 100%; }
.page-head { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; margin-bottom: 18px; flex-wrap: wrap; }

.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; margin-bottom: 16px; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.grid3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.stack { display: flex; flex-direction: column; gap: 10px; }

label { display: block; font-size: 13px; color: var(--muted); margin: 10px 0 4px; }
input, select, textarea {
  width: 100%;
  background: var(--panel-2);
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--text);
  padding: 9px 10px;
  font: inherit;
}
textarea { min-height: 90px; resize: vertical; }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--brand); outline-offset: -1px; }
input[type="checkbox"] { width: auto; }

button.btn {
  background: var(--panel-2);
  color: var(--text);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 8px 14px;
  font: inherit;
  font-weight: 600;
  cursor: pointer;
}
button.btn:hover { border-color: #4a4a4a; }
button.btn.primary { background: var(--brand); color: var(--brand-ink); border-color: var(--brand); }
button.btn.danger { color: var(--bad); }
button.btn.small { padding: 4px 10px; font-size: 13px; }
button.btn:disabled { opacity: 0.5; cursor: default; }

.seg { display: inline-flex; background: var(--panel-2); border: 1px solid var(--line); border-radius: 9px; padding: 3px; gap: 3px; }
.seg button { all: unset; cursor: pointer; padding: 6px 14px; border-radius: 7px; color: var(--muted); font-weight: 600; }
.seg button.on { background: var(--brand); color: var(--brand-ink); }

.pill { display: inline-block; padding: 1px 9px; border-radius: 99px; font-size: 12px; font-weight: 700; background: var(--panel-2); color: var(--muted); border: 1px solid var(--line); }
.pill.ok { color: var(--ok); border-color: #2d5a40; }
.pill.warn { color: var(--warn); border-color: #5c4f26; }
.pill.bad { color: var(--bad); border-color: #5e2c29; }
.pill.run { color: var(--brand); border-color: #6b4027; }

table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 9px 8px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { color: var(--muted); font-weight: 600; font-size: 13px; }
tr.click { cursor: pointer; }
tr.click:hover td { background: var(--panel-2); }

.video-item { display: grid; grid-template-columns: 180px 1fr; gap: 18px; }
.video-item video { width: 180px; aspect-ratio: 9 / 16; background: #000; border-radius: 8px; }
.log { background: #0c0c0c; border: 1px solid var(--line); border-radius: 8px; padding: 12px; height: 460px; overflow: auto; white-space: pre-wrap; word-break: break-word; }

.slots { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.slot { background: var(--panel-2); border: 1px solid var(--line); border-radius: 9px; padding: 12px; }
.slot .t { font-size: 20px; font-weight: 800; letter-spacing: -0.02em; }

.toast { position: fixed; right: 20px; bottom: 20px; background: var(--panel); border: 1px solid var(--line); border-left: 4px solid var(--brand); padding: 12px 16px; border-radius: 8px; max-width: 420px; z-index: 9; }
.toast.bad { border-left-color: var(--bad); }

.login { max-width: 360px; margin: 12vh auto; }
.empty { color: var(--muted); padding: 20px 0; text-align: center; }
.spec { white-space: pre-wrap; background: var(--panel-2); border-radius: 8px; padding: 10px; max-height: 260px; overflow: auto; font-size: 13px; }

@media (max-width: 860px) {
  .shell { grid-template-columns: 1fr; }
  nav { flex-direction: row; flex-wrap: wrap; border-right: 0; border-bottom: 1px solid var(--line); }
  nav .spacer, nav .who { display: none; }
  main { padding: 18px 16px 60px; }
  .grid2, .grid3, .slots { grid-template-columns: 1fr; }
  .video-item { grid-template-columns: 1fr; }
}
