:root {
  --bg: #0a2a52; --card: #123866; --card-hi: #184683; --blue: #1f6fd1; --sky: #8cc4ff; --amber: #f2b233;
  --fg: #f2f6fc; --muted: #a9bedc; --line: #24508a; --red: #ff8a8a;
  color-scheme: dark;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; background: var(--bg); color: var(--fg);
       font: 16px/1.4 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; }
.wrap { max-width: 900px; margin: 0 auto; padding: 16px; }
.narrow { max-width: 760px; padding-top: 6vh; }
.top { display: flex; justify-content: space-between; align-items: center; }
.brand { display: flex; align-items: center; gap: 10px; font-size: 22px; margin: 4px 0 16px; }
.brand img { border-radius: 8px; }
.link { color: var(--sky); }
.card { background: var(--card); border-radius: 12px; padding: 16px; margin-bottom: 12px; }
.card h2 { font-size: 17px; margin: 0 0 12px; }
.note { background: var(--card-hi); }
.login-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; align-items: start; }
.login-grid .card { margin: 0; }
.qr { background: #fff; border-radius: 10px; width: 100%; max-width: 280px; aspect-ratio: 1; margin: 0 auto 10px; overflow: hidden; }
.qr svg { display: block; width: 100%; height: 100%; }
form label { display: block; margin-bottom: 12px; color: var(--muted); font-size: 14px; }
input { width: 100%; min-width: 0; margin-top: 4px; font: 16px/1.4 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; color: var(--fg);
        background: var(--bg); border: 1px solid var(--line); border-radius: 8px; padding: 10px; }
input:focus { outline: 2px solid var(--sky); }
input[type="checkbox"] { width: auto; margin: 0 8px 0 0; }
.check { display: flex; align-items: center; color: var(--fg); font-size: 16px; }
.btn { font: inherit; font-weight: 700; color: #fff; background: var(--blue); border: 0; border-radius: 10px; padding: 10px 16px; cursor: pointer; }
.btn:disabled { opacity: .6; cursor: default; }
.btn.secondary { background: var(--card-hi); }
form > .btn { width: 100%; }
.inline { display: flex; gap: 8px; margin-bottom: 12px; }
.inline input { margin: 0; flex: 1; }
.inline .btn { width: auto; flex: none; }
.stack .btn { width: auto; }
.hint { color: var(--muted); font-size: 13.5px; margin: 8px 0; }
.hint b { color: var(--fg); }
.msg { color: var(--amber); font-size: 14px; margin: 8px 0 0; }
.msg:empty { display: none; }
.msg.error { color: var(--red); }
.foot { color: var(--muted); font-size: 12.5px; margin-top: 16px; }
.row-between { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 14.5px; }
th { text-align: left; color: var(--muted); font-size: 12.5px; font-weight: 600; padding: 4px 8px; white-space: nowrap; }
td { padding: 8px; border-top: 1px solid var(--line); white-space: nowrap; }
td small { color: var(--amber); }
.actions { text-align: right; }
.link-btn { font: inherit; font-size: 14px; color: var(--sky); background: none; border: 0; padding: 2px 6px; cursor: pointer; text-decoration: underline; }
.link-btn.danger { color: var(--red); }
code { background: var(--bg); padding: 2px 6px; border-radius: 5px; font-size: 16px; user-select: all; overflow-wrap: anywhere; }
@media (max-width: 640px) {
  .login-grid { grid-template-columns: 1fr; }
  .narrow { padding-top: 12px; }
}
.setup { max-width: 440px; padding-top: 6vh; }
