:root {
  --bg: #f6f7f9; --card: #ffffff; --text: #1b1d21; --muted: #5f6672; --line: #dde1e7;
  --accent: #1f5fbf; --accent-text: #ffffff; --bad: #a3321e; --bad-bg: #fbeae6;
  --good: #24693a; --good-bg: #e7f3ea; --warn: #8a5a00; --warn-bg: #fff4dc;
  --accent-soft: #e3edfb;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #14161a; --card: #1d2026; --text: #e7e9ee; --muted: #9aa1ad; --line: #2e333b;
    --accent: #5b9bf0; --accent-text: #0d1117; --bad: #f08a76; --bad-bg: #3a1f1a;
    --good: #7fd197; --good-bg: #183223; --warn: #f1c66b; --warn-bg: #3a2e12;
    --accent-soft: #1d2f4a;
  }
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--text);
  font: 16px/1.5 system-ui, "Segoe UI", Roboto, Arial, sans-serif; }
a { color: var(--accent); }
.top { display: flex; justify-content: space-between; align-items: center; gap: 12px;
  padding: 12px 16px; border-bottom: 1px solid var(--line); background: var(--card); flex-wrap: wrap; }
.brand { font-weight: 700; color: var(--text); text-decoration: none; }
.nav { display: flex; gap: 14px; align-items: center; flex-wrap: wrap; }
.nav a { text-decoration: none; }
.page { max-width: 1100px; margin: 0 auto; padding: 20px 16px 40px; }
.narrow { max-width: 440px; margin: 0 auto; padding: 32px 16px 40px; }
h1 { font-size: 24px; margin: 0 0 16px; }
h2 { font-size: 19px; margin: 24px 0 10px; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: 10px; padding: 16px; margin: 0 0 16px; }
.center { text-align: center; }
.form { display: flex; flex-direction: column; gap: 12px; }
.form label { display: flex; flex-direction: column; gap: 4px; font-size: 14px; color: var(--muted); }
.form label.check { flex-direction: row; align-items: flex-start; gap: 8px; color: var(--text); }
input, select, textarea { font: inherit; color: var(--text); background: var(--bg);
  border: 1px solid var(--line); border-radius: 8px; padding: 9px 10px; width: 100%; }
input[type=checkbox] { width: auto; margin-top: 4px; }
/* глаз у поля пароля (pw.js) */
.pw-wrap { position: relative; display: block; }
.pw-wrap input { padding-right: 44px; }
button.pw-eye { position: absolute; top: 50%; right: 4px; transform: translateY(-50%); background: none;
  color: var(--muted); padding: 6px; line-height: 0; border-radius: 6px; }
button.pw-eye:hover, button.pw-eye[aria-pressed="true"] { color: var(--accent); }
button.pw-eye:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
button.pw-eye svg { fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
button { font: inherit; border: 0; border-radius: 8px; padding: 10px 14px; cursor: pointer;
  background: var(--accent); color: var(--accent-text); font-weight: 600; }
button.link { background: none; color: var(--accent); padding: 0; font-weight: 400; }
button.danger { background: var(--bad); color: #fff; }
button.secondary { background: none; color: var(--accent); border: 1px solid var(--accent); }
.row .grow { flex: 1 1 260px; min-width: 0; }
form.inline { display: inline; margin: 0; }
.alert { background: var(--bad-bg); color: var(--bad); border-radius: 8px; padding: 10px 12px; }
.notice { background: var(--good-bg); color: var(--good); border-radius: 8px; padding: 10px 12px; }
.warnbox { background: var(--warn-bg); color: var(--warn); border-radius: 8px; padding: 10px 12px; }
.muted { color: var(--muted); font-size: 14px; }
.mono { font-family: ui-monospace, Consolas, monospace; letter-spacing: 1px; word-break: break-all; }
.qr { width: 220px; height: 220px; background: #fff; padding: 6px; border-radius: 8px; }
.steps { padding-left: 20px; }
.prose { white-space: pre-wrap; }
.foot { max-width: 1100px; margin: 0 auto; padding: 16px; color: var(--muted); font-size: 13px;
  display: flex; gap: 16px; flex-wrap: wrap; border-top: 1px solid var(--line); }
table { border-collapse: collapse; width: 100%; font-size: 14px; }
th, td { text-align: left; padding: 7px 8px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { color: var(--muted); font-weight: 600; }
.tablewrap { overflow-x: auto; }
.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.pos { color: var(--good); } .neg { color: var(--bad); }
.tag { display: inline-block; padding: 1px 8px; border-radius: 10px; font-size: 13px; background: var(--bg); border: 1px solid var(--line); }
.tag.bad { background: var(--bad-bg); color: var(--bad); border-color: transparent; }
.tag.good { background: var(--good-bg); color: var(--good); border-color: transparent; }
.tag.warn { background: var(--warn-bg); color: var(--warn); border-color: transparent; }
.grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 12px; }
.tile .label { color: var(--muted); font-size: 13px; }
.tile .value { font-size: 22px; font-weight: 700; font-variant-numeric: tabular-nums; }
.tabs { display: flex; gap: 6px; flex-wrap: wrap; margin: 0 0 16px; }
.tabs a { padding: 6px 12px; border-radius: 8px; text-decoration: none; border: 1px solid var(--line); background: var(--card); }
.tabs a.on { background: var(--accent); color: var(--accent-text); border-color: var(--accent); }
/* второй уровень: выбранный пункт — светлый фон и рамка цвета акцента, чтобы не спутать с разделом */
.tabs.sub a.on { background: var(--accent-soft); color: var(--accent); border-color: var(--accent); font-weight: 600; }
.row-bad td { background: var(--bad-bg); }
.row-warn td { background: var(--warn-bg); }
.row { display: flex; gap: 10px; flex-wrap: wrap; margin: 8px 0; }
.big { font-size: 22px; }
.progress { display: flex; flex-wrap: wrap; gap: 6px; list-style: none; padding: 0; margin: 0 0 16px; counter-reset: st; }
.progress li { counter-increment: st; padding: 4px 10px; border-radius: 14px; border: 1px solid var(--line); font-size: 13px; color: var(--muted); background: var(--card); }
.progress li::before { content: counter(st) ". "; }
.progress li.done { background: var(--good-bg); color: var(--good); border-color: transparent; }
.progress li.now { background: var(--accent); color: var(--accent-text); border-color: var(--accent); }
.msg { padding: 8px 10px; border-radius: 8px; margin: 0 0 8px; border: 1px solid var(--line); }
.msg.mine { background: var(--bg); }
.msg.unread { border-left: 4px solid var(--bad); }
.chart { width: 100%; height: auto; display: block; }
.chart-line { fill: none; stroke-width: 2; }
.chart-line.pos { stroke: var(--good); } .chart-line.neg { stroke: var(--bad); }
.chart-zero { stroke: var(--line); stroke-dasharray: 4 4; }
.chart-axis, .chart-note { fill: var(--muted); font-size: 12px; }
.badge { display: inline-block; min-width: 20px; padding: 0 6px; border-radius: 10px; background: var(--bad); color: #fff;
  font-size: 12px; font-weight: 700; line-height: 20px; text-align: center; vertical-align: middle; }
.steps-status li { margin: 4px 0; }
.steps-status .done::marker { color: var(--good); }
.statusbox { border-left: 4px solid var(--accent); }
.statusbox.bad { border-left-color: var(--bad); }
.statusbox.good { border-left-color: var(--good); }
[hidden] { display: none !important; }

/* шапка: кто вошёл — кружок с буквами, никнейм и ID; щелчок — профиль */
.me { display: inline-flex; align-items: center; gap: 8px; text-decoration: none; color: inherit; }
.me:hover .me-name { text-decoration: underline; }
.avatar { display: inline-flex; align-items: center; justify-content: center; width: 32px; height: 32px; flex: none;
  border-radius: 50%; background: var(--accent); color: var(--accent-text); font-size: 13px; font-weight: 700; letter-spacing: .5px; }
.avatar.big { width: 64px; height: 64px; font-size: 24px; }
.me-text { display: flex; flex-direction: column; line-height: 1.15; min-width: 0; }
.me-name { max-width: 180px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.me-id { font-size: 12px; color: var(--muted); }
@media (max-width: 600px) { .me-name { display: none; } }
.profile-head { display: flex; align-items: center; gap: 16px; }
.profile-head .value { font-size: 20px; font-weight: 700; }
.muted-card { opacity: .65; }
.bot-link { display: flex; gap: 18px; align-items: flex-start; flex-wrap: wrap; margin: 10px 0; }
.bot-link .qr { background: #fff; padding: 6px; border-radius: 8px; flex: 0 0 auto; }
.bot-link > div { flex: 1 1 260px; }
a.button { display: inline-block; padding: 9px 14px; border-radius: 8px; background: var(--accent); color: var(--accent-text);
  font-weight: 600; text-decoration: none; }
.money-left { font-weight: 600; margin: 10px 0 4px; }
