:root {
  --bg: #0f1216; --panel: #171b21; --panel2: #1e232b; --line: #2a313b;
  --text: #e6e9ee; --muted: #8b95a3; --accent: #e5484d; --accent2: #3b82f6; --ok: #30a46c;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; font-size: 14px;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; background: var(--bg); color: var(--text); }
.hidden { display: none !important; }
.view { height: 100%; display: flex; flex-direction: column; }
.center { align-items: center; justify-content: center; }
.card { background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: 20px; }
.narrow { width: 340px; display: flex; flex-direction: column; gap: 12px; }
.brand { font-weight: 700; font-size: 17px; display: flex; align-items: center; gap: 8px; }
.logo { color: var(--accent); font-size: 20px; }
.muted { color: var(--muted); }
.error { color: var(--accent); min-height: 1em; margin: 0; }
h2 { margin: 0 0 8px; font-size: 16px; } h3 { margin: 0; font-size: 14px; }
label { display: flex; flex-direction: column; gap: 4px; color: var(--muted); font-size: 12px; flex: 1; }
input { background: var(--panel2); border: 1px solid var(--line); color: var(--text); border-radius: 6px; padding: 9px 10px; font-size: 14px; outline: none; }
input:focus { border-color: var(--accent2); }
button { border: 0; border-radius: 6px; padding: 8px 14px; font-size: 13px; cursor: pointer; color: var(--text); background: var(--panel2); }
button:disabled { opacity: .5; cursor: default; }
.primary { background: var(--accent); color: #fff; font-weight: 600; padding: 10px 16px; }
.danger { background: var(--accent); color: #fff; }
.ghost { background: transparent; border: 1px solid var(--line); }
.ghost:hover { background: var(--panel2); }
.small { padding: 4px 8px; font-size: 12px; }
.row { display: flex; gap: 10px; align-items: center; }
.row.between { justify-content: space-between; }
.spacer { flex: 1; }
.topbar { display: flex; align-items: center; gap: 10px; padding: 10px 16px; background: var(--panel); border-bottom: 1px solid var(--line); }
.dash { display: grid; grid-template-columns: minmax(320px, 440px) 1fr; gap: 16px; padding: 16px; overflow: auto; }
@media (max-width: 860px) { .dash { grid-template-columns: 1fr; } }
#connect-form { display: flex; flex-direction: column; gap: 14px; align-self: start; }
#filter { width: 100%; margin: 8px 0; }
table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 8px 6px; border-bottom: 1px solid var(--line); }
th { color: var(--muted); font-weight: 500; font-size: 12px; }
tbody tr { cursor: pointer; } tbody tr:hover { background: var(--panel2); }
.dot { width: 9px; height: 9px; border-radius: 50%; display: inline-block; background: #555; }
.dot.on { background: var(--ok); } .dot.live { background: var(--accent); animation: pulse 1.5s infinite; }
@keyframes pulse { 50% { opacity: .35; } }
.tag { font-size: 11px; padding: 2px 6px; border-radius: 4px; background: var(--panel2); color: var(--muted); }

.session-bar { padding: 6px 12px; }
.toggle { flex-direction: row; align-items: center; color: var(--text); font-size: 13px; flex: 0; white-space: nowrap; }
.session-body { flex: 1; display: flex; min-height: 0; }
.stage { flex: 1; position: relative; background: #000; overflow: auto; display: flex; }
.stage video { outline: none; display: block; margin: auto; cursor: default; }
.stage.fit video { width: 100%; height: 100%; object-fit: contain; }
.stage-msg { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; color: var(--muted); pointer-events: none; }
.menu { position: absolute; top: 46px; right: 260px; z-index: 5; background: var(--panel); border: 1px solid var(--line); border-radius: 8px; padding: 6px; display: flex; flex-direction: column; gap: 2px; width: 240px; }
.menu button { text-align: left; background: transparent; } .menu button:hover { background: var(--panel2); }
.menu small { padding: 4px 8px; }

.files { width: 340px; background: var(--panel); border-left: 1px solid var(--line); padding: 12px; display: flex; flex-direction: column; gap: 8px; min-height: 0; }
#f-path { flex: 1; }
#f-list { list-style: none; margin: 0; padding: 0; overflow: auto; flex: 1; border: 1px solid var(--line); border-radius: 6px; }
#f-list li { padding: 6px 8px; display: flex; gap: 8px; cursor: pointer; border-bottom: 1px solid var(--panel2); white-space: nowrap; }
#f-list li:hover { background: var(--panel2); }
#f-list .name { flex: 1; overflow: hidden; text-overflow: ellipsis; }
#f-list .size { color: var(--muted); font-size: 12px; }
.drop { border: 1px dashed var(--line); border-radius: 6px; padding: 12px; text-align: center; color: var(--muted); }
.drop.over { border-color: var(--accent2); color: var(--text); }
.link { display: inline; color: var(--accent2); cursor: pointer; font-size: 14px; }
.transfers { list-style: none; margin: 0; padding: 0; max-height: 140px; overflow: auto; font-size: 12px; }
.transfers li { padding: 4px 0; display: flex; justify-content: space-between; gap: 8px; }
.toast { position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%); background: var(--panel2); border: 1px solid var(--line); padding: 10px 16px; border-radius: 8px; z-index: 10; }
label > input { width: 100%; min-width: 0; }
.row > label { min-width: 0; }
#connect-form p { margin: 0; }
