:root {
  --bg: #f4f5f7; --card: #ffffff; --text: #1d2330; --muted: #6b7280; --line: #e3e6ea;
  --accent: #2458d6; --accent-text: #ffffff; --ok: #1f9d55; --warn: #d69e2e; --bad: #d64545;
}
@media (prefers-color-scheme: dark) {
  :root { --bg: #14171c; --card: #1d2129; --text: #e7e9ee; --muted: #9aa3b2; --line: #2c323c; --accent: #4c7cf0; }
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--text); font: 16px/1.45 system-ui, "Segoe UI", Roboto, sans-serif; }
.wrap { max-width: 760px; margin: 0 auto; padding: 16px; }
.wrap.wide { max-width: 1200px; }
.top { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
h1 { letter-spacing: .12em; font-size: 26px; margin: 8px 0 16px; }
h2 { font-size: 17px; margin: 16px 0 10px; }
.who { color: var(--muted); font-size: 14px; }
a { color: var(--accent); }
.card { background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 16px 20px; margin-bottom: 16px; }
.hidden { display: none !important; }
.line { margin: 8px 0; }
.dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; background: var(--muted); vertical-align: middle; }
.dot.ok { background: var(--ok); } .dot.warn { background: var(--warn); } .dot.bad { background: var(--bad); }
.avatars { display: flex; flex-wrap: wrap; gap: 12px; margin-bottom: 16px; }
.avatar { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 8px; width: 128px;
  border: 2px solid var(--line); border-radius: 12px; background: transparent; color: var(--text); cursor: pointer; font: inherit; }
.avatar img { width: 108px; height: 108px; border-radius: 8px; object-fit: cover; }
.avatar.selected { border-color: var(--accent); }
button { font: inherit; border-radius: 10px; border: 1px solid var(--line); padding: 8px 14px; background: var(--card); color: var(--text); cursor: pointer; }
button.primary { background: var(--accent); color: var(--accent-text); border-color: var(--accent); }
button.big { width: 100%; padding: 14px; font-size: 18px; font-weight: 600; letter-spacing: .03em; }
button:disabled { opacity: .5; cursor: default; }
form label { display: block; margin-bottom: 10px; }
input, select { display: block; width: 100%; padding: 8px 10px; margin-top: 4px; font: inherit; border: 1px solid var(--line); border-radius: 8px; background: var(--bg); color: var(--text); }
.error { color: var(--bad); min-height: 1.2em; }
.stage { position: relative; padding: 0; overflow: hidden; background: #000; }
.stage #out { display: block; width: 100%; aspect-ratio: 4 / 3; background: #000; }
.stage #self { position: absolute; left: 12px; bottom: 12px; width: 22%; border: 2px solid #fff4; border-radius: 6px; transform: scaleX(-1); }
.diag summary { cursor: pointer; color: var(--muted); }
table { border-collapse: collapse; width: 100%; font-size: 14px; }
td, th { border-bottom: 1px solid var(--line); padding: 5px 8px; text-align: left; vertical-align: top; }
th { color: var(--muted); font-weight: 500; }
.mono { font-family: ui-monospace, monospace; font-size: 13px; word-break: break-all; }
.grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 12px; }
.kpi { font-size: 26px; font-weight: 600; }
.kpi-label { color: var(--muted); font-size: 13px; }
.scroll { overflow-x: auto; }
