:root {
  --bg: #f6f7f9;
  --card: #ffffff;
  --text: #1c1f24;
  --muted: #5d6470;
  --line: #d9dde3;
  --accent: #4b55c8;
  --err: #b4232f;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #14161a;
    --card: #1d2026;
    --text: #e6e8eb;
    --muted: #a0a6b0;
    --line: #333842;
    --accent: #8f97ff;
    --err: #ff7a85;
    color-scheme: dark;
  }
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font: 16px/1.45 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 48px 16px;
}
.box {
  width: 100%;
  max-width: 420px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 24px;
}
h1 { margin: 0 0 16px; font-size: 22px; }
h2 { margin: 24px 0 8px; font-size: 16px; }
p, li { color: var(--text); }
ol { padding-left: 20px; }
label { display: block; margin: 12px 0; color: var(--muted); font-size: 14px; }
input {
  display: block;
  width: 100%;
  margin-top: 4px;
  padding: 10px 12px;
  font-size: 16px;
  color: var(--text);
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 8px;
}
input:focus { outline: 2px solid var(--accent); outline-offset: 1px; }
button {
  margin-top: 8px;
  min-height: 44px;
  padding: 10px 18px;
  font-size: 16px;
  color: #fff;
  background: var(--accent);
  border: 0;
  border-radius: 8px;
  cursor: pointer;
}
.err { color: var(--err); }
.qr { background: #fff; border-radius: 8px; padding: 8px; width: 220px; margin: 8px 0; }
.qr svg { display: block; width: 100%; height: auto; }
.secret code { font-size: 14px; word-break: break-all; }
.logins { padding-left: 18px; color: var(--muted); font-size: 14px; }

.page { width: 100%; max-width: 1100px; }
.top { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 8px; }
.top h1 { margin: 0; }
.who { color: var(--muted); font-size: 14px; }
.who button { margin: 0 0 0 8px; min-height: 32px; padding: 4px 12px; font-size: 14px; }
.muted { color: var(--muted); font-size: 14px; }
.switch { margin: 8px 0 16px; font-size: 14px; color: var(--muted); }
.switch a { display: inline-block; margin-left: 6px; padding: 4px 10px; border: 1px solid var(--line); border-radius: 999px;
  color: var(--text); text-decoration: none; }
.switch a.on { background: var(--accent); border-color: var(--accent); color: #fff; }
.tile { background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 16px 18px; margin-bottom: 16px; }
.tile h2 { margin: 0 0 12px; font-size: 16px; }
.tile summary { cursor: pointer; font-weight: 600; }
.grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 12px; }
.cell { border: 1px solid var(--line); border-radius: 10px; padding: 12px; }
.cell .t { color: var(--muted); font-size: 13px; }
.cell .v { font-size: 26px; font-weight: 600; margin: 4px 0; font-variant-numeric: tabular-nums; }
.cell .s { color: var(--muted); font-size: 13px; }
.delta { font-size: 14px; font-weight: 500; color: var(--muted); }
.delta.up { color: #1f8a4c; }
.delta.down { color: var(--err); }
.status { font-size: 18px; font-weight: 600; margin-bottom: 8px; }
.alerts { list-style: none; padding: 0; margin: 0 0 8px; }
.alerts li { padding: 4px 0; }
.alerts li.sevY { color: var(--muted); }

.menu a { margin-right: 6px; padding: 4px 12px; border-radius: 999px; color: var(--text); text-decoration: none;
  border: 1px solid var(--line); font-size: 14px; }
.menu a.on { background: var(--accent); border-color: var(--accent); color: #fff; }
.scroll { overflow-x: auto; }
table.fleet { width: 100%; border-collapse: collapse; font-size: 14px; }
table.fleet th { text-align: left; color: var(--muted); font-weight: 500; font-size: 12px; padding: 6px 8px;
  border-bottom: 1px solid var(--line); white-space: nowrap; }
table.fleet td { padding: 8px; border-bottom: 1px solid var(--line); vertical-align: top; }
table.fleet td.num { font-variant-numeric: tabular-nums; white-space: nowrap; }
table.fleet .muted { font-size: 12px; }
.warn { color: #b26b00; font-weight: 600; }
.bad { color: var(--err); font-weight: 600; }

.board { min-height: 120px; }
.boardhead { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px; margin-bottom: 8px; }
.tabs { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { margin: 0; min-height: 30px; padding: 4px 12px; font-size: 13px; color: var(--text); background: transparent;
  border: 1px solid var(--line); border-radius: 999px; cursor: pointer; }
.chip.on { background: var(--accent); border-color: var(--accent); color: #fff; }
.chip.add { border-style: dashed; }
.legend { display: flex; flex-wrap: wrap; gap: 4px 16px; font-size: 13px; margin: 4px 0 8px; align-items: center; }
.lg { display: inline-flex; align-items: center; gap: 4px; margin: 0; color: var(--text); font-size: 13px; cursor: pointer; }
.lg input { width: auto; margin: 0; }
.lg.empty { opacity: .55; }
.swatch { display: inline-block; width: 12px; height: 3px; border-radius: 2px; }
.lgtime { margin-left: auto; }
.chartbox { height: 380px; width: 100%; }
@media (max-width: 700px) {
  .chartbox { height: 280px; }
  .top { flex-wrap: wrap; }
  .top h1 { flex: 1 0 100%; }
}
.msg { min-height: 1em; }
.flagbar { display: flex; flex-wrap: wrap; gap: 6px; margin: 10px 0 6px; }
.flagchip { display: inline-flex; align-items: center; gap: 6px; }
.dot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; background: #999; }
.dot[data-kind="Событие"] { background: #2962ff; }
.dot[data-kind="Пиар"] { background: #1f9d55; }
.dot[data-kind="Фича"] { background: #8e44ad; }
.dot[data-kind="Сбой"] { background: #e53935; }
.flagform { border: 1px solid var(--line); border-radius: 10px; padding: 12px; margin: 8px 0; max-width: 520px; }
.flagform select, .flagform textarea { display: block; width: 100%; margin-top: 4px; padding: 8px 10px; font: inherit;
  color: var(--text); background: var(--bg); border: 1px solid var(--line); border-radius: 8px; }
.flagform .row { display: flex; gap: 8px; }
button.secondary { background: transparent; color: var(--text); border: 1px solid var(--line); }
.flaglist { display: grid; gap: 8px; margin-top: 8px; }
.fitem { border: 1px solid var(--line); border-radius: 10px; padding: 8px 10px; transition: box-shadow .3s; }
.fitem.hl { box-shadow: 0 0 0 2px var(--accent); }
.fhead { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; font-size: 13px; }
.ftitle { margin-top: 2px; }
.fcomment { margin-top: 4px; color: var(--muted); font-size: 13px; white-space: pre-wrap; }
button.linkish { margin: 0; min-height: 0; padding: 0; background: none; border: 0; color: var(--accent); font-size: 13px;
  cursor: pointer; text-decoration: underline; }
button.linkish.danger { color: var(--err); }
.note { margin-top: 24px; }
.note a, table.fleet a { color: inherit; }
table.fleet a { text-decoration: none; }
