:root {
  --bg: #0d1117; --panel: #161b22; --panel2: #1f2630; --line: #2b3340;
  --txt: #e6edf3; --muted: #8b949e; --accent: #1f8bff; --accent2: #0a6ad6;
  --ok: #2ea043; --off: #6e7681; --err: #f85149;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; background: var(--bg); color: var(--txt); font: 15px/1.45 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif; }
a { color: var(--accent); }
.hidden { display: none !important; }
header.top { display: flex; align-items: center; gap: 12px; padding: 12px 16px; background: var(--panel); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 5; }
header.top .brand { font-weight: 700; letter-spacing: .3px; }
header.top .brand span { color: var(--accent); }
header.top .sp { flex: 1; }
main { max-width: 960px; margin: 0 auto; padding: 16px; }
.card { background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 18px; }
.center { min-height: 100%; display: grid; place-items: center; padding: 16px; }
.login { width: 100%; max-width: 360px; }
.login h1 { margin: 0 0 4px; font-size: 22px; }
.login p.sub { margin: 0 0 18px; color: var(--muted); }
label { display: block; font-size: 13px; color: var(--muted); margin: 10px 0 4px; }
input, select { width: 100%; padding: 10px 12px; background: var(--panel2); color: var(--txt); border: 1px solid var(--line); border-radius: 8px; font-size: 16px; }
input:focus, select:focus { outline: 2px solid var(--accent); border-color: transparent; }
button, .btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; padding: 10px 14px; border-radius: 8px; border: 1px solid var(--line); background: var(--panel2); color: var(--txt); font-size: 15px; cursor: pointer; text-decoration: none; }
button.primary { background: var(--accent); border-color: var(--accent); color: #fff; font-weight: 600; }
button.primary:hover { background: var(--accent2); }
button.danger { color: var(--err); }
button.full { width: 100%; margin-top: 16px; }
button:disabled { opacity: .5; cursor: default; }
.msg { margin-top: 12px; color: var(--err); min-height: 1.2em; font-size: 14px; }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 14px; }
.machine .head { display: flex; align-items: center; gap: 10px; }
.machine .name { font-weight: 650; font-size: 17px; }
.machine .meta { color: var(--muted); font-size: 13px; margin: 6px 0 14px; }
.machine .actions { display: flex; gap: 8px; flex-wrap: wrap; }
.dot { width: 10px; height: 10px; border-radius: 50%; background: var(--off); flex: none; }
.dot.on { background: var(--ok); box-shadow: 0 0 8px var(--ok); }
.os { font-size: 11px; text-transform: uppercase; padding: 2px 6px; border: 1px solid var(--line); border-radius: 4px; color: var(--muted); margin-left: auto; }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th, td { text-align: left; padding: 8px 6px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { color: var(--muted); font-weight: 500; }
.tabs { display: flex; gap: 6px; margin-bottom: 14px; flex-wrap: wrap; }
.tabs button.active { background: var(--accent); border-color: var(--accent); color: #fff; }
.row { display: grid; grid-template-columns: 1fr 1fr; gap: 0 12px; }
@media (max-width: 600px) { .row { grid-template-columns: 1fr; } }
dialog { background: var(--panel); color: var(--txt); border: 1px solid var(--line); border-radius: 12px; width: min(520px, 94vw); padding: 18px; }
dialog::backdrop { background: rgba(0,0,0,.6); }
.chk { display: flex; align-items: center; gap: 8px; margin: 6px 0; color: var(--txt); font-size: 14px; }
.chk input { width: auto; }
.qr { display: block; margin: 12px auto; background: #fff; padding: 8px; border-radius: 8px; }
code { background: var(--panel2); padding: 2px 6px; border-radius: 4px; word-break: break-all; }
/* Visor */
body.viewer { overflow: hidden; }
#bar { position: fixed; top: 0; left: 0; right: 0; height: 44px; display: flex; align-items: center; gap: 8px; padding: 0 10px; background: rgba(22,27,34,.95); border-bottom: 1px solid var(--line); z-index: 10; transition: transform .2s; }
#bar.hide { transform: translateY(-40px); }
#bar button { padding: 6px 10px; font-size: 14px; }
#bar .title { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
#bar .status { color: var(--muted); font-size: 13px; }
#screen { position: fixed; top: 44px; left: 0; right: 0; bottom: 0; background: #000; }
#kbd { position: absolute; left: -1000px; opacity: 0; }
