/* feedgate — player and console. Grayscale with one accent. */
:root {
  --bg: #f6f7f8;
  --surface: #ffffff;
  --surface-2: #eef0f2;
  --text: #16191d;
  --muted: #5b636d;
  --line: #dde1e5;
  --accent: #2563c9;
  --accent-soft: #e5eefb;
  --danger: #b42318;
  --danger-soft: #fbeceb;
  --ok: #1f7a4d;
  --radius: 10px;
  --stage: #0d0f12;
  font-family: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0f1114;
    --surface: #171a1e;
    --surface-2: #1f2328;
    --text: #e8eaed;
    --muted: #9aa3ad;
    --line: #2b3036;
    --accent: #6b9ff0;
    --accent-soft: #1b2a42;
    --danger: #f0857c;
    --danger-soft: #3a1d1b;
    --ok: #5cc28f;
    color-scheme: dark;
  }
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--text); }
body { font-size: 15px; line-height: 1.5; }
a { color: var(--accent); text-decoration: none; }
a:hover { color: var(--text); }
h1 { font-size: 1.35rem; font-weight: 600; margin: 0; letter-spacing: -0.01em; }
h2 { font-size: 1.05rem; font-weight: 600; margin: 0 0 12px; }
.muted { color: var(--muted); }
.mono { font-family: ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace; font-size: 0.86em; }
main.narrow { max-width: 420px; margin: 12vh auto; padding: 0 16px; }

/* Buttons and fields */
button, .btn {
  font: inherit; font-weight: 500; border-radius: 8px; border: 1px solid var(--line);
  background: var(--surface); color: var(--text); padding: 7px 14px; cursor: pointer;
  transition: background 0.15s, border-color 0.15s, color 0.15s;
}
button:hover, .btn:hover { background: var(--surface-2); }
button.primary { background: var(--accent); border-color: var(--accent); color: #fff; }
button.primary:hover { filter: brightness(1.08); background: var(--accent); }
button.danger { color: var(--danger); }
button.danger:hover { background: var(--danger-soft); border-color: var(--danger); }
button:disabled { opacity: 0.5; cursor: default; }
input, select {
  font: inherit; width: 100%; padding: 8px 10px; border-radius: 8px;
  border: 1px solid var(--line); background: var(--surface); color: var(--text);
}
input:focus, select:focus, button:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
label { display: block; font-weight: 500; margin: 12px 0 4px; }
.check { display: inline-flex; align-items: center; gap: 6px; font-weight: 400; margin: 4px 16px 4px 0; }
.check input { width: auto; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; }
.error { color: var(--danger); }

/* ── Player ─────────────────────────────────────────────── */
body.player { background: var(--stage); color: #e8eaed; min-height: 100vh; }
.player header {
  display: flex; flex-wrap: wrap; align-items: center; gap: 10px 16px;
  padding: 14px 16px; border-bottom: 1px solid #23272d;
}
.player header .title { flex: 1 1 auto; min-width: 0; }
.player header h1 { color: #f2f4f6; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.live {
  display: inline-flex; align-items: center; gap: 6px; font-size: 0.8rem; font-weight: 600;
  padding: 3px 9px; border-radius: 999px; background: #2a2f36; color: #c9d1da;
}
.live::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: #7b8592; }
.live.on { background: #183a2b; color: #9be3bd; }
.live.on::before { background: #3ecf8e; }
.note { padding: 10px 16px; background: #171a1f; color: #c3cad3; font-size: 0.9rem; border-bottom: 1px solid #23272d; }
.note strong { color: #f2f4f6; font-weight: 600; }
.layout { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 16px; padding: 16px; }
@media (max-width: 860px) { .layout { grid-template-columns: 1fr; } }
.stage { position: relative; background: #000; border-radius: var(--radius); overflow: hidden; aspect-ratio: 16 / 9; }
.stage video { width: 100%; height: 100%; display: block; object-fit: contain; background: #000; }
.stage canvas.wm { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
.stage .badge {
  position: absolute; right: 10px; bottom: 10px; pointer-events: none;
  background: rgba(0, 0, 0, 0.55); color: #fff; font-size: 0.8rem; padding: 4px 9px; border-radius: 6px;
}
.stage .msg {
  position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center;
  text-align: center; gap: 6px; padding: 24px; background: rgba(8, 9, 11, 0.82); color: #e8eaed;
}
.stage .msg[hidden] { display: none; }
.stage .msg .big { font-size: 1.15rem; font-weight: 600; }
.panel { background: #14171b; border: 1px solid #23272d; border-radius: var(--radius); padding: 16px; }
.panel h2 { color: #f2f4f6; }
.kv { display: grid; grid-template-columns: auto 1fr; gap: 6px 12px; font-size: 0.92rem; }
.kv dt { color: #8f98a3; }
.kv dd { margin: 0; text-align: right; color: #e8eaed; font-variant-numeric: tabular-nums; }
.player footer { padding: 4px 16px 20px; color: #8f98a3; font-size: 0.85rem; }

/* ── Console ────────────────────────────────────────────── */
.topbar {
  display: flex; align-items: center; gap: 16px; padding: 14px 20px;
  background: var(--surface); border-bottom: 1px solid var(--line);
}
.topbar .grow { flex: 1; }
.wrap { max-width: 1120px; margin: 0 auto; padding: 20px 16px 48px; display: grid; gap: 18px; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
@media (max-width: 860px) { .grid2 { grid-template-columns: 1fr; } }
table { width: 100%; border-collapse: collapse; font-size: 0.92rem; }
th { text-align: left; font-weight: 500; color: var(--muted); padding: 6px 8px; border-bottom: 1px solid var(--line); }
td { padding: 8px; border-bottom: 1px solid var(--line); vertical-align: middle; }
tr:last-child td { border-bottom: none; }
.scroll { overflow-x: auto; }
.pill { display: inline-block; font-size: 0.78rem; padding: 2px 8px; border-radius: 999px; background: var(--surface-2); color: var(--muted); }
.pill.ok { background: var(--accent-soft); color: var(--accent); }
.pill.bad { background: var(--danger-soft); color: var(--danger); }
.row { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.link-out { margin-top: 14px; padding: 12px; border-radius: 8px; background: var(--accent-soft); word-break: break-all; }
.small { font-size: 0.85rem; }
