:root {
  --bg: #0f1419; --panel: #182029; --panel2: #1f2a36; --line: #2b3847;
  --text: #e8eef4; --muted: #8b9bab; --accent: #2f9bff; --accent2: #1b7fe0;
  --ok: #33c481; --off: #66727f; --danger: #ef5b5b;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body { background: var(--bg); color: var(--text); font: 15px/1.45 system-ui, "Segoe UI", Roboto, sans-serif; }
button, input { font: inherit; }
button { cursor: pointer; border: 1px solid var(--line); background: var(--panel2); color: var(--text); padding: 8px 14px; border-radius: 8px; }
button:hover { border-color: var(--accent); }
button.primary { background: var(--accent2); border-color: var(--accent2); font-weight: 600; }
button.primary:hover { background: var(--accent); }
button.danger:hover { border-color: var(--danger); color: var(--danger); }
button:disabled { opacity: .45; cursor: not-allowed; }
input { width: 100%; padding: 10px 12px; border-radius: 8px; border: 1px solid var(--line); background: var(--bg); color: var(--text); }
input:focus, button:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
label { display: block; margin: 12px 0 4px; color: var(--muted); font-size: 13px; }
.hidden { display: none !important; }
.err { color: var(--danger); min-height: 1.4em; margin: 10px 0 0; font-size: 14px; }
.muted { color: var(--muted); }

/* login */
.center { min-height: 100%; display: grid; place-items: center; padding: 16px; }
.card { width: 100%; max-width: 380px; background: var(--panel); border: 1px solid var(--line); border-radius: 14px; padding: 28px; }
.brand { font-size: 22px; font-weight: 700; margin: 0 0 4px; }
.brand span { color: var(--accent); }
.card button.primary { width: 100%; margin-top: 18px; padding: 11px; }

/* app */
header { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; padding: 14px 20px; background: var(--panel); border-bottom: 1px solid var(--line); }
header .brand { margin: 0 auto 0 0; font-size: 19px; }
main { max-width: 1100px; margin: 0 auto; padding: 20px 16px 60px; }
.banner { background: #3a2d12; border: 1px solid #7a5b17; color: #ffd98a; padding: 12px 14px; border-radius: 10px; margin-bottom: 16px; display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.banner span { flex: 1 1 260px; }
.summary { color: var(--muted); margin: 0 0 14px; }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 14px; }
.pc { background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 16px; display: flex; flex-direction: column; gap: 8px; }
.pc.offline { opacity: .72; }
.pc h3 { margin: 0; font-size: 17px; display: flex; align-items: center; gap: 9px; overflow-wrap: anywhere; }
.dot { flex: none; width: 11px; height: 11px; border-radius: 50%; background: var(--off); }
.online .dot { background: var(--ok); box-shadow: 0 0 0 4px rgba(51,196,129,.18); }
.state { font-size: 13px; font-weight: 600; color: var(--off); }
.online .state { color: var(--ok); }
.meta { font-size: 13px; color: var(--muted); overflow-wrap: anywhere; }
.pc .row { display: flex; gap: 8px; margin-top: 6px; flex-wrap: wrap; }
.pc .row .primary { flex: 1; }
.empty { text-align: center; color: var(--muted); padding: 50px 16px; border: 1px dashed var(--line); border-radius: 12px; }

dialog { background: var(--panel); color: var(--text); border: 1px solid var(--line); border-radius: 14px; padding: 24px; width: min(520px, calc(100vw - 32px)); }
dialog::backdrop { background: rgba(0,0,0,.6); }
dialog h2 { margin: 0 0 10px; font-size: 19px; }
dialog ol { padding-left: 20px; }
dialog li { margin: 6px 0; }
.actions { display: flex; gap: 8px; justify-content: flex-end; margin-top: 18px; flex-wrap: wrap; }
.qr { display: block; margin: 12px auto; border-radius: 8px; background: #fff; padding: 6px; }
code { background: var(--bg); padding: 2px 6px; border-radius: 5px; overflow-wrap: anywhere; }
table { width: 100%; border-collapse: collapse; font-size: 13px; }
td, th { text-align: left; padding: 6px 8px; border-bottom: 1px solid var(--line); overflow-wrap: anywhere; }
.scroll { max-height: 60vh; overflow: auto; }

/* visor */
body.viewer { overflow: hidden; background: #000; display: flex; flex-direction: column; height: 100vh; height: 100dvh; }
.toolbar { display: flex; gap: 8px; align-items: center; padding: 6px 10px; background: var(--panel); border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.toolbar .title { font-weight: 600; margin-right: auto; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 40vw; }
.toolbar button, .toolbar select { padding: 5px 10px; font-size: 13px; }
.toolbar select { background: var(--panel2); color: var(--text); border: 1px solid var(--line); border-radius: 8px; font: inherit; font-size: 13px; }
.stage { flex: 1; min-height: 0; position: relative; display: grid; place-items: center; }
#screen { max-width: 100%; max-height: 100%; outline: none; cursor: default; touch-action: none; display: block; }
.overlay { position: absolute; inset: 0; display: grid; place-items: center; background: rgba(0,0,0,.72); text-align: center; padding: 20px; font-size: 17px; }
