:root {
  --bg: #f4f6f8; --card: #ffffff; --text: #17191c; --muted: #5f6672; --accent: #0b7a5c;
  --accent-text: #ffffff; --border: #d6dbe1; --error-bg: #fdecec; --error: #a4161a; --notice-bg: #eef6f3;
}
@media (prefers-color-scheme: dark) {
  :root { --bg: #111417; --card: #1b1f24; --text: #e8eaed; --muted: #9aa3ad; --accent: #2bb38a;
          --accent-text: #0b1210; --border: #333a42; --error-bg: #3a1618; --error: #ff9a9e; --notice-bg: #17302a; }
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--text);
       font: 16px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; padding: 24px 16px; }
.card { max-width: 440px; margin: 0 auto; background: var(--card); border: 1px solid var(--border);
        border-radius: 14px; padding: 28px 24px; }
.card.wide { max-width: 1100px; }
.brand { font-weight: 700; font-size: 20px; margin-bottom: 18px; }
.logo { background: var(--accent); color: var(--accent-text); border-radius: 8px; padding: 2px 8px; }
h1 { font-size: 24px; margin: 0 0 14px; }
label { display: block; font-weight: 600; margin: 14px 0 6px; }
input, select { width: 100%; padding: 11px 12px; font-size: 16px; border: 1px solid var(--border);
        border-radius: 10px; background: var(--bg); color: var(--text); }
input:focus { outline: 2px solid var(--accent); outline-offset: 1px; }
.btn { display: inline-block; width: 100%; margin-top: 20px; padding: 12px 16px; border: 0; border-radius: 10px;
       background: var(--accent); color: var(--accent-text); font-size: 16px; font-weight: 600;
       text-align: center; text-decoration: none; cursor: pointer; }
.btn.secondary { background: transparent; color: var(--accent); border: 1px solid var(--accent); }
.btn.small { width: auto; margin: 0; padding: 6px 12px; font-size: 14px; }
.btn.danger { background: #b3261e; color: #fff; }
.hint, .muted { color: var(--muted); font-size: 14px; margin: 6px 0; }
.center { text-align: center; margin-top: 18px; }
.error { background: var(--error-bg); color: var(--error); padding: 10px 12px; border-radius: 10px; }
.notice { background: var(--notice-bg); padding: 10px 12px; border-radius: 10px; }
.mxid { font-family: ui-monospace, Consolas, monospace; font-size: 18px; font-weight: 600; word-break: break-all; }
.link code { display: block; padding: 10px; background: var(--bg); border-radius: 8px; word-break: break-all; }
.ok { color: var(--accent); } .bad { color: var(--error); }
.hp { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }
a { color: var(--accent); }
nav.top { display: flex; gap: 16px; flex-wrap: wrap; align-items: center; margin-bottom: 18px; }
nav.top form { margin-left: auto; }
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th, td { text-align: left; padding: 8px; border-bottom: 1px solid var(--border); vertical-align: top; }
.actions { display: flex; gap: 8px; flex-wrap: wrap; margin: 12px 0; }
.actions form { margin: 0; }
.filters { display: flex; gap: 8px; flex-wrap: wrap; }
.filters input, .filters select { width: auto; flex: 1 1 160px; }
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 12px; }
.stat { border: 1px solid var(--border); border-radius: 10px; padding: 12px; }
.stat b { display: block; font-size: 24px; }
