:root {
  --bg: #f6f7f9; --card: #fff; --text: #1d2330; --muted: #6b7280; --line: #e5e7eb;
  --accent: #6d28d9; --ok: #15803d; --ok-bg: #dcfce7; --bad: #b91c1c; --bad-bg: #fee2e2;
  --warn: #a16207; --warn-bg: #fef9c3;
}
* { box-sizing: border-box; }
body { margin: 0; font: 15px/1.5 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif; background: var(--bg); color: var(--text); }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
.topbar { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap;
  padding: 12px 20px; background: var(--card); border-bottom: 1px solid var(--line); }
.topbar nav { display: flex; gap: 16px; align-items: center; flex-wrap: wrap; }
.brand { font-weight: 700; color: var(--text); }
.container { max-width: 1100px; margin: 0 auto; padding: 20px 16px 60px; }
h1 { font-size: 24px; margin: 8px 0 16px; }
h2 { font-size: 18px; margin: 24px 0 12px; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 16px 18px; margin-bottom: 16px; }
.muted { color: var(--muted); font-size: 13px; }
.row { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.spread { justify-content: space-between; }
.grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; margin-bottom: 16px; }
.stat { background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; }
.stat .num { font-size: 26px; font-weight: 700; }
.stat .lbl { color: var(--muted); font-size: 13px; }
table { width: 100%; border-collapse: collapse; background: var(--card); }
th, td { text-align: left; padding: 8px 10px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { font-size: 12px; text-transform: uppercase; color: var(--muted); font-weight: 600; }
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: 12px; margin-bottom: 16px; }
.table-wrap table { border: 0; }
td.num, th.num { text-align: right; white-space: nowrap; }
label { display: block; font-weight: 600; margin: 12px 0 4px; }
input[type=text], input[type=password], input[type=url], textarea, select {
  width: 100%; padding: 9px 10px; border: 1px solid #cbd0d8; border-radius: 8px; font: inherit; background: #fff; }
textarea { min-height: 80px; }
.check { display: flex; gap: 8px; align-items: center; font-weight: 400; }
.hint { color: var(--muted); font-size: 13px; margin-top: 2px; }
button, .btn { display: inline-block; padding: 8px 14px; border-radius: 8px; border: 1px solid var(--accent);
  background: var(--accent); color: #fff; font: inherit; cursor: pointer; text-decoration: none; }
button.secondary, .btn.secondary { background: #fff; color: var(--accent); }
button.danger { background: #fff; color: var(--bad); border-color: var(--bad); }
button.link { background: none; border: 0; color: var(--accent); padding: 0; }
button:hover, .btn:hover { opacity: .9; text-decoration: none; }
form.inline { display: inline; }
.badge { display: inline-block; padding: 2px 8px; border-radius: 999px; font-size: 12px; font-weight: 600; white-space: nowrap; }
.badge.ok { background: var(--ok-bg); color: var(--ok); }
.badge.bad { background: var(--bad-bg); color: var(--bad); }
.badge.warn { background: var(--warn-bg); color: var(--warn); }
.badge.off { background: #eee; color: #555; }
.flash { padding: 10px 14px; border-radius: 8px; margin-bottom: 12px; background: var(--ok-bg); color: var(--ok); }
.flash.error { background: var(--bad-bg); color: var(--bad); }
.toggle { border: 0; border-radius: 999px; width: 52px; height: 28px; padding: 3px; cursor: pointer; background: #cbd0d8; position: relative; }
.toggle::after { content: ""; display: block; width: 22px; height: 22px; border-radius: 50%; background: #fff; transition: transform .15s; }
.toggle.on { background: var(--ok); }
.toggle.on::after { transform: translateX(24px); }
.thumb { width: 64px; height: 64px; object-fit: cover; border-radius: 8px; background: #ddd; flex-shrink: 0; }
.media { display: flex; gap: 14px; }
.media-body { flex: 1; min-width: 0; }
.kw { display: inline-block; background: #ede9fe; color: #5b21b6; border-radius: 6px; padding: 1px 7px; margin: 1px 2px; font-size: 13px; }
.copy { font-family: ui-monospace, monospace; font-size: 13px; background: #f3f4f6; padding: 8px; border-radius: 8px; word-break: break-all; }
.center-box { max-width: 420px; margin: 60px auto; }
.rule { border-top: 1px dashed var(--line); padding-top: 10px; margin-top: 10px; }
details summary { cursor: pointer; color: var(--accent); }
@media (max-width: 600px) { .media { flex-direction: column; } }
