:root {
  color-scheme: dark;
  --bg: #10151c;
  --panel: #171e28;
  --line: #2c3847;
  --text: #edf3fa;
  --muted: #a2b1c3;
  --accent: #74e4c3;
  --bad: #ff9a9d;
  font: 15px/1.55 system-ui, "Microsoft YaHei", sans-serif;
  color: var(--text);
  background: var(--bg);
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; }
.shell { max-width: 1160px; padding-inline: 28px; margin: auto; }
.top { background: #121922; border-bottom: 1px solid var(--line); }
.top-inner, .brand, .page-head, .actions, .dialog-head { display: flex; align-items: center; gap: 10px; }
.top-inner { min-height: 64px; justify-content: space-between; }
.brand { font-size: 16px; font-weight: 700; }
.mark { background: #204138; color: var(--accent); display: grid; place-items: center; border-radius: 8px; width: 32px; height: 32px; font: 700 19px ui-monospace, monospace; }
main { padding-block: 34px; }
h1, h2, p { margin: 0; }
h1 { font-size: 28px; line-height: 1.25; }
h2 { font-size: 20px; }
.muted, small { color: var(--muted); }
.page-head { justify-content: space-between; margin-bottom: 20px; gap: 16px; flex-wrap: wrap; }
.page-head p { margin-top: 5px; }
.panel { background: var(--panel); border: 1px solid var(--line); border-radius: 12px; }
.login { max-width: 410px; padding: 26px; margin: clamp(18px,8vh,100px) auto 0; }
.login h1 { margin-bottom: 21px; }
.login .primary { width: 100%; }
button, input, textarea { font: inherit; }
button { cursor: pointer; border: 1px solid var(--line); border-radius: 7px; min-height: 40px; color: var(--text); background: #222d3b; padding: 7px 13px; }
button:hover { border-color: #7c8ea4; }
button:disabled { opacity: .55; cursor: wait; }
.primary { background: var(--accent); border-color: var(--accent); color: #102820; font-weight: 700; }
.primary:hover { background: #a1efdb; }
.quiet { background: transparent; }
.danger { color: var(--bad); }
label { display: grid; gap: 5px; margin-bottom: 13px; font-weight: 600; }
input, textarea { width: 100%; border-radius: 7px; border: 1px solid var(--line); background: #101720; color: var(--text); padding: 9px 10px; }
textarea { resize: vertical; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.fields { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.notice { padding: 9px 12px; border: 1px solid var(--line); border-radius: 8px; color: var(--accent); margin-bottom: 13px; }
.error, .notice.error { color: var(--bad); }
.error:not(:empty) { margin-block: 9px; }
table { width: 100%; border-collapse: collapse; text-align: left; }
th, td { padding: 12px; vertical-align: middle; }
th:first-child, td:first-child { padding-left: 16px; }
th { font-size: 13px; font-weight: 650; color: var(--muted); }
td { border-top: 1px solid var(--line); }
td small { display: block; overflow-wrap: anywhere; }
.device-name { display: block; max-width: 220px; overflow-wrap: anywhere; }
code, .secret { font-family: ui-monospace, Consolas, monospace; }
.online { color: var(--accent); }
.row-actions { flex-wrap: wrap; gap: 6px; }
.row-actions button { font-size: 13px; min-height: 34px; padding: 5px 8px; }
dialog { width: min(480px, calc(100vw - 24px)); color: var(--text); background: var(--panel); padding: 20px; border: 1px solid var(--line); border-radius: 12px; }
dialog::backdrop { background: #000a; }
.dialog-head { justify-content: space-between; margin-bottom: 14px; }
.dialog-actions { justify-content: flex-end; margin-top: 16px; }
.close { font-size: 22px; border: 0; min-height: 36px; padding: 0 10px; }
.secret.pin { color: var(--accent); letter-spacing: .28em; font-size: 28px; padding-left: .28em; text-align: center; }
.dialog-detail { margin-bottom: 12px; }
@media (max-width: 790px) {
  .shell { padding-inline: 14px; }
  main { padding-block: 24px; }
  table, tbody, tr, td { display: block; }
  thead { position: absolute; clip-path: inset(50%); width: 1px; height: 1px; overflow: hidden; }
  tbody tr { padding: 12px 14px; }
  tbody tr + tr { border-top: 1px solid var(--line); }
  td, td:first-child { border: 0; padding: 4px 0; }
  td[data-label] { display: grid; grid-template-columns: 97px minmax(0, 1fr); gap: 8px; }
  td[data-label]::before { content: attr(data-label); color: var(--muted); font-size: 13px; }
  .device-name { max-width: none; }
  .row-actions { margin-top: 6px; }
}
