:root {
  --bg: #f5f6f8; --surface: #fff; --line: #dfe3ea; --text: #1b2330; --muted: #667085; --brand: #233a5e;
  --brand-soft: #e8eef8; --ok: #1f7a4d; --ok-soft: #e6f4ec; --warn: #9a6400; --warn-soft: #fff4dc; --bad: #b42318; --bad-soft: #fdecea;
  --radius: 10px;
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--text); font: 15px/1.45 -apple-system, BlinkMacSystemFont, "Segoe UI", Inter, Roboto, sans-serif; }
a { color: var(--brand); }
header { position: sticky; top: 0; z-index: 5; display: flex; align-items: center; gap: 18px; padding: 10px 20px; background: var(--brand); color: #fff; }
header .logo { color: #fff; font-weight: 700; text-decoration: none; letter-spacing: .02em; }
header nav { display: flex; gap: 4px; flex: 1; flex-wrap: wrap; }
header nav a { color: #d7e1f2; text-decoration: none; padding: 6px 10px; border-radius: 7px; }
header nav a.on, header nav a:hover { background: #ffffff22; color: #fff; }
header .btn { color: #fff; border-color: #ffffff55; }
.testbar { background: var(--warn-soft); color: var(--warn); border-bottom: 1px solid #f0d9a8; padding: 8px 20px; font-size: 13px; font-weight: 600; }
main { max-width: 1180px; margin: 0 auto; padding: 22px 20px 60px; }
h1 { font-size: 22px; margin: 0 0 4px; }
h2 { font-size: 15px; margin: 24px 0 10px; color: var(--text); }
h3 { font-size: 14px; margin: 16px 0 8px; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; }
.sub { color: var(--muted); margin: 0 0 12px; font-size: 14px; }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.grow { flex: 1; min-width: 0; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; }
.card + .card { margin-top: 10px; }
.grid { display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); }
.grid2 { display: grid; gap: 14px; grid-template-columns: 1fr 1fr; }
@media (max-width: 860px) { .grid2 { grid-template-columns: 1fr; } }
.tile { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 14px; text-decoration: none; color: var(--text); }
.tile b { font-size: 24px; display: block; font-variant-numeric: tabular-nums; }
.tile span { color: var(--muted); font-size: 13px; }
.tile.hl { border-color: var(--brand); background: var(--brand-soft); }
.btn { appearance: none; border: 1px solid var(--line); background: var(--surface); color: var(--text); border-radius: 8px; padding: 8px 14px; font: inherit; font-weight: 600; cursor: pointer; text-decoration: none; display: inline-block; }
.btn:hover { border-color: #b9c2d0; }
.btn.primary { background: var(--brand); border-color: var(--brand); color: #fff; }
.btn.ghost { background: transparent; }
.btn.danger { color: var(--bad); }
.btn.small { padding: 5px 10px; font-size: 13px; }
.btn[disabled] { opacity: .5; cursor: default; }
input, select, textarea { font: inherit; border: 1px solid var(--line); border-radius: 8px; padding: 8px 10px; background: #fff; color: var(--text); width: 100%; }
textarea { min-height: 90px; resize: vertical; }
label { display: block; font-size: 13px; color: var(--muted); margin: 10px 0 4px; }
table { width: 100%; border-collapse: collapse; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
th, td { text-align: left; padding: 9px 12px; border-bottom: 1px solid var(--line); font-size: 14px; vertical-align: top; }
th { background: #f0f2f6; font-size: 12px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); }
tr.click { cursor: pointer; }
tr.click:hover td { background: #f7f9fc; }
.pill { display: inline-block; font-size: 12px; padding: 2px 8px; border-radius: 99px; background: #eef1f5; color: var(--muted); white-space: nowrap; }
.pill.ok { background: var(--ok-soft); color: var(--ok); }
.pill.warn { background: var(--warn-soft); color: var(--warn); }
.pill.bad { background: var(--bad-soft); color: var(--bad); }
.pill.brand { background: var(--brand-soft); color: var(--brand); }
.list { list-style: none; margin: 0; padding: 0; }
.list li { padding: 7px 0; border-bottom: 1px dashed var(--line); display: flex; gap: 8px; align-items: flex-start; }
.list li:last-child { border-bottom: 0; }
.ico { width: 18px; flex: none; text-align: center; }
.ok-t { color: var(--ok); } .bad-t { color: var(--bad); } .warn-t { color: var(--warn); }
.tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--line); margin: 16px 0; flex-wrap: wrap; }
.tabs a { padding: 8px 14px; text-decoration: none; color: var(--muted); border-bottom: 2px solid transparent; font-weight: 600; }
.tabs a.on { color: var(--brand); border-bottom-color: var(--brand); }
.drop { border: 2px dashed #b9c2d0; border-radius: var(--radius); padding: 22px; text-align: center; color: var(--muted); background: #fafbfd; }
.drop.over { border-color: var(--brand); background: var(--brand-soft); }
.field { display: grid; grid-template-columns: 230px 1fr auto; gap: 10px; align-items: center; padding: 6px 0; border-bottom: 1px solid #f0f2f6; }
@media (max-width: 700px) { .field { grid-template-columns: 1fr; } }
.field .lab { font-size: 13px; color: var(--muted); }
.src { font-size: 11px; }
.notice { border-radius: 8px; padding: 10px 12px; font-size: 13px; margin: 10px 0; }
.notice.warn { background: var(--warn-soft); color: #6d4700; }
.notice.bad { background: var(--bad-soft); color: var(--bad); }
.notice.info { background: var(--brand-soft); color: var(--brand); }
.auth { max-width: 380px; margin: 10vh auto; }
.err { color: var(--bad); font-size: 14px; min-height: 1em; margin-top: 8px; }
.toast { position: fixed; right: 20px; bottom: 20px; background: var(--text); color: #fff; padding: 10px 16px; border-radius: 8px; z-index: 20; max-width: 420px; }
.qr svg { width: 200px; height: 200px; }
pre.mail { white-space: pre-wrap; background: #fafbfd; border: 1px solid var(--line); border-radius: 8px; padding: 12px; font: 13px/1.5 ui-monospace, Menlo, monospace; }
.muted { color: var(--muted); }
.mono { font-family: ui-monospace, Menlo, monospace; font-size: 13px; }
[hidden] { display: none !important; }
