:root {
  color-scheme: dark;
  --bg: #111110; --surface: #1a1a19; --raised: #232321; --border: #30302d; --border-strong: #46463f;
  --text: #f0efec; --text-2: #c3c2b7; --muted: #8d8c82;
  --accent: #3987e5; --accent-ink: #ffffff;
  --good: #0ca30c; --warning: #fab219; --critical: #e66767;
  --s1: #3987e5; --s2: #d95926; --s3: #199e70; --s4: #c98500;
  --s5: #d55181; --s6: #008300; --s7: #9085e9; --s8: #e66767;
  --radius: 10px;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; background: var(--bg); color: var(--text);
  font: 15px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; }
button, input, select, textarea { font: inherit; color: inherit; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
a.btn, a.btn:hover { color: var(--text); text-decoration: none; }
h1, h2, h3 { margin: 0; font-weight: 600; text-wrap: balance; }
h2 { font-size: 17px; }
h3 { font-size: 15px; }
.num { font-variant-numeric: tabular-nums; }

.top { position: sticky; top: 0; z-index: 5; background: rgba(17, 17, 16, .92); backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--border); }
.top-in { max-width: 1180px; margin: 0 auto; padding: 0 16px; display: flex; align-items: center; gap: 20px;
  height: 56px; }
.brand { font-weight: 700; letter-spacing: .2px; display: flex; align-items: center; gap: 9px; white-space: nowrap; }
.brand i { width: 12px; height: 12px; border-radius: 50%; background: var(--accent); display: inline-block; }
.tabs { display: flex; gap: 4px; flex: 1; overflow-x: auto; }
.tab { background: none; border: 0; padding: 8px 12px; border-radius: 8px; color: var(--text-2); cursor: pointer;
  white-space: nowrap; }
.tab:hover { background: var(--raised); }
.tab[aria-selected="true"] { background: var(--raised); color: var(--text); font-weight: 600; }
.jobpill { font-size: 13px; color: var(--text-2); display: flex; align-items: center; gap: 7px; white-space: nowrap; }
.jobpill b { width: 8px; height: 8px; border-radius: 50%; background: var(--warning); animation: pulse 1.2s infinite; }
@keyframes pulse { 50% { opacity: .3; } }
@media (prefers-reduced-motion: reduce) { .jobpill b { animation: none; } }

main { max-width: 1180px; margin: 0 auto; padding: 20px 16px 80px; display: grid; gap: 16px;
  grid-template-columns: minmax(0, 1fr); }
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px; }
.row { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.spread { justify-content: space-between; }
.grid2 { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr); gap: 16px; align-items: start; }
@media (max-width: 860px) { .grid2 { grid-template-columns: minmax(0, 1fr); } }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.note { color: var(--text-2); font-size: 14px; }
.error { color: var(--critical); font-size: 14px; }
.empty { padding: 28px 8px; text-align: center; color: var(--muted); }

.btn { background: var(--raised); border: 1px solid var(--border-strong); border-radius: 8px; padding: 7px 13px;
  cursor: pointer; white-space: nowrap; }
.btn:hover { border-color: var(--text-2); }
.btn:disabled { opacity: .45; cursor: default; }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); font-weight: 600; }
.btn.ghost { background: none; border-color: transparent; color: var(--text-2); padding: 5px 8px; }
.btn.ghost:hover { background: var(--raised); color: var(--text); }
.btn.danger:hover { border-color: var(--critical); color: var(--critical); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
input[type=text], input[type=number], select, textarea { background: var(--bg); border: 1px solid var(--border-strong);
  border-radius: 8px; padding: 6px 9px; min-width: 0; }
input[type=number] { width: 84px; }
textarea { width: 100%; resize: vertical; min-height: 60px; }
label.f { display: grid; gap: 4px; font-size: 13px; color: var(--text-2); }

.dot { width: 10px; height: 10px; border-radius: 3px; display: inline-block; flex: none; }
.badge { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; padding: 2px 8px; border-radius: 99px;
  background: var(--raised); color: var(--text-2); white-space: nowrap; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; flex: 1 1 300px; justify-content: flex-end; min-width: 0; }
.chip { background: none; border: 1px solid var(--border-strong); border-radius: 99px; padding: 4px 11px; cursor: pointer;
  color: var(--text-2); font-size: 13px; }
.chip[aria-pressed="true"] { background: var(--text); color: var(--bg); border-color: var(--text); font-weight: 600; }

.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; }
.stat { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 12px 14px; }
.stat .v { font-size: 26px; font-weight: 650; line-height: 1.2; }
.stat .l { font-size: 13px; color: var(--muted); }

.bars { display: grid; gap: 10px; margin-top: 14px; }
.bar-row { display: grid; grid-template-columns: 150px minmax(0, 1fr) 96px; gap: 12px; align-items: center; }
.bar-name { display: flex; align-items: center; gap: 8px; min-width: 0; }
.bar-name span:last-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bar-track { height: 18px; border-left: 1px solid var(--border-strong); }
.bar-fill { height: 100%; border-radius: 0 4px 4px 0; min-width: 2px; }
.bar-fill.thin { background-image: repeating-linear-gradient(135deg, transparent 0 5px, rgba(26, 26, 25, .8) 5px 9px); }
.bar-val { text-align: right; white-space: nowrap; }
@media (max-width: 560px) { .bar-row { grid-template-columns: 104px minmax(0, 1fr) 82px; gap: 8px; } }

.chart { width: 100%; height: auto; display: block; margin-top: 10px; }
.chart text { fill: var(--muted); font-size: 12px; }
.legend { display: flex; flex-wrap: wrap; gap: 14px; margin-top: 8px; font-size: 13px; color: var(--text-2); }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.tip { position: fixed; z-index: 20; pointer-events: none; background: #2b2b28; border: 1px solid var(--border-strong);
  border-radius: 8px; padding: 8px 10px; font-size: 13px; max-width: 280px; box-shadow: 0 6px 20px rgba(0, 0, 0, .4); }
.tip b { display: block; margin-bottom: 2px; }
.tip div { display: flex; justify-content: space-between; gap: 14px; color: var(--text-2); }

.tablewrap { overflow-x: auto; margin: 10px -16px -16px; }
table { border-collapse: collapse; width: 100%; font-size: 14px; }
th, td { padding: 8px 10px; text-align: right; white-space: nowrap; border-top: 1px solid var(--border); }
th { color: var(--muted); font-weight: 500; font-size: 13px; cursor: pointer; user-select: none; }
th:first-child, td:first-child { text-align: left; padding-left: 16px; }
td.l, th.l { text-align: left; }
td.title { max-width: 280px; overflow: hidden; text-overflow: ellipsis; color: var(--text-2); }

.fmt { display: grid; gap: 10px; padding: 14px 0; border-top: 1px solid var(--border); }
.fmt:first-of-type { border-top: 0; padding-top: 4px; }
.fmt.off .fmt-body { display: none; }
.fmt.off .fmt-head { opacity: .6; }
.fmt-head { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.fmt-head .name { font-weight: 600; flex: 1; min-width: 120px; display: flex; align-items: center; gap: 8px; }
.stepper { display: inline-flex; align-items: center; border: 1px solid var(--border-strong); border-radius: 8px; overflow: hidden; }
.stepper button { background: var(--raised); border: 0; width: 32px; height: 32px; cursor: pointer; font-size: 17px; }
.stepper output { min-width: 36px; text-align: center; font-weight: 600; }
.fmt-body { display: grid; gap: 10px; padding-left: 18px; }
.kv { display: grid; grid-template-columns: minmax(0, 150px) minmax(0, 1fr) auto; gap: 6px; align-items: center; }
.sub { border: 1px solid var(--border); border-radius: 8px; padding: 10px; display: grid; gap: 8px; }
details > summary { cursor: pointer; color: var(--text-2); font-size: 14px; }
details[open] > summary { margin-bottom: 8px; }

.slots { display: grid; gap: 4px; margin-top: 10px; }
.slot { display: grid; grid-template-columns: 96px minmax(0, 1fr); gap: 10px; align-items: center; font-size: 14px;
  padding: 5px 8px; border-radius: 6px; background: var(--raised); }
.slot .when { color: var(--text-2); }
.slot .what { display: flex; align-items: center; gap: 8px; min-width: 0; }
.sticky { position: sticky; top: 72px; }
.savebar { position: sticky; bottom: 0; background: rgba(17, 17, 16, .94); border-top: 1px solid var(--border);
  padding: 10px 16px; margin: 0 -16px -80px; display: flex; flex-wrap: wrap; gap: 10px; align-items: center; z-index: 4; }

.log { background: var(--bg); border: 1px solid var(--border); border-radius: 8px; padding: 10px; font: 13px/1.5 ui-monospace,
  Consolas, monospace; max-height: 220px; overflow: auto; white-space: pre-wrap; color: var(--text-2); margin-top: 10px; }
.videos { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 14px; margin-top: 12px; }
.video { background: var(--raised); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden;
  display: grid; align-content: start; }
.video.off { opacity: .5; }
.video video, .video .nofile { width: 100%; aspect-ratio: 9 / 16; max-height: 420px; background: #000; display: block;
  object-fit: contain; }
.video .nofile { aspect-ratio: auto; height: 72px; display: grid; place-items: center; color: var(--muted); font-size: 13px; }
.video .body { padding: 10px 12px 12px; display: grid; gap: 8px; }
.video .ttl { font-size: 14px; overflow-wrap: anywhere; }
.video .desc { font-size: 12.5px; color: var(--muted); white-space: pre-wrap; overflow-wrap: anywhere; max-height: 4.6em; overflow: hidden; }
.toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); background: var(--text); color: var(--bg);
  padding: 9px 16px; border-radius: 99px; font-size: 14px; z-index: 30; max-width: calc(100vw - 32px); }
.toast.bad { background: var(--critical); color: #fff; }
.login { min-height: 100vh; display: grid; place-items: center; padding: 16px; }
.login form { width: min(340px, 100%); display: grid; gap: 12px; }
@media (max-width: 560px) { .top-in { gap: 10px; padding: 0 10px; } .tab { padding: 8px 9px; } .jobpill span { display: none; } }
