:root {
  --bg: #121212;
  --panel: #1a1a1a;
  --line: #2c2c2c;
  --text: #d8d8d8;
  --dim: #8a8a8a;
  --accent: #f0f0f0;
}

* { box-sizing: border-box; }

html, body {
  height: 100%;
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 13px/1.4 "Segoe UI", system-ui, sans-serif;
}

body { display: flex; flex-direction: column; }

header, footer {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 8px 14px;
  background: var(--panel);
  border-color: var(--line);
  border-style: solid;
  border-width: 0;
}
header { border-bottom-width: 1px; }
footer { border-top-width: 1px; }

.title { font-weight: 600; letter-spacing: 0.02em; }
.group { display: flex; gap: 8px; align-items: center; }
.spacer { flex: 1; }
#status { color: var(--dim); }

button {
  background: transparent;
  color: var(--text);
  border: 1px solid var(--line);
  border-radius: 3px;
  padding: 5px 12px;
  font: inherit;
  cursor: pointer;
}
button:hover { border-color: var(--dim); }
button:disabled { color: var(--dim); cursor: default; }

select {
  background: var(--panel);
  color: var(--text);
  border: 1px solid var(--line);
  border-radius: 3px;
  padding: 5px 8px;
  font: inherit;
  max-width: 220px;
}

body:not(.desktop) .desktop-only { display: none !important; }
body.desktop .web-only { display: none !important; }
body.dragging main { outline: 2px dashed var(--dim); outline-offset: -8px; }

.seg { display: flex; }
.seg button { border-radius: 0; margin-left: -1px; }
.seg button:first-child { border-radius: 3px 0 0 3px; margin-left: 0; }
.seg button:last-child { border-radius: 0 3px 3px 0; }
.seg button.active {
  background: var(--accent);
  color: #111;
  border-color: var(--accent);
  position: relative;
}

main { flex: 1; display: flex; min-height: 0; }

aside {
  width: 220px;
  padding: 12px;
  background: var(--panel);
  border-right: 1px solid var(--line);
  overflow-y: auto;
}
aside section { margin-bottom: 20px; }
aside h2 {
  margin: 0 0 8px;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--dim);
}
aside label { display: block; padding: 2px 0; }
aside label:has(input:disabled) { color: var(--dim); }
input[type="checkbox"] { accent-color: #cfcfcf; margin-right: 6px; }

#runList { list-style: none; margin: 0; padding: 0; }
#runList li {
  padding: 4px 8px;
  border-radius: 3px;
  cursor: pointer;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
#runList li:hover { background: #242424; }
#runList li.active { background: #2e2e2e; color: var(--accent); }
#runList li.empty { color: var(--dim); cursor: default; }
#runList li.empty:hover { background: none; }
#runList li { display: flex; align-items: center; gap: 4px; }
#runList li .nm { flex: 1; overflow: hidden; text-overflow: ellipsis; }
#runList li .act { display: none; padding: 0 5px; line-height: 1.3; font-size: 12px; }
#runList li:hover .act { display: inline-block; }
#runList li input { flex: 1; min-width: 0; background: #0e0e0e; color: var(--text); border: 1px solid var(--dim); border-radius: 3px; padding: 1px 4px; font: inherit; }

dl { display: grid; grid-template-columns: auto 1fr; gap: 2px 12px; margin: 0; }
dt { color: var(--dim); }
dd { margin: 0; text-align: right; font-variant-numeric: tabular-nums; }

#stage {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 0;
  padding: 12px;
}
canvas { background: #0e0e0e; border: 1px solid var(--line); }

#scrub { flex: 1; accent-color: #cfcfcf; }
#timeLabel { min-width: 110px; text-align: right; font-variant-numeric: tabular-nums; color: var(--dim); }
#btnPlay { width: 70px; }

#charts { height: 220px; padding: 0 12px 8px; background: var(--bg); border-top: 1px solid var(--line); }
#chart { width: 100%; height: 100%; display: block; cursor: pointer; border: 0; background: transparent; }

.sw { display: inline-block; width: 10px; height: 10px; margin-right: 6px; border-radius: 2px; }
.empty { color: var(--dim); }
aside label.lall { border-bottom: 1px solid var(--line); margin-bottom: 4px; padding-bottom: 4px; }
aside summary { cursor: pointer; color: var(--dim); font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.08em; margin-bottom: 6px; }
.pall, .pgroup { font-weight: 600; }
.pitem { padding-left: 16px !important; }
