:root {
  --bg: #0f1115; --panel: #171a21; --line: #2a2f3a; --text: #e6e8ee; --muted: #9aa1b2;
  --accent: #4c8dff; --ok: #39c07a; --warn: #f2b84b; --bad: #ef5b5b;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; color-scheme: dark;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; background: var(--bg); color: var(--text); }
button, input, select { font: inherit; color: inherit; }
button { background: #232834; border: 1px solid var(--line); border-radius: 8px; padding: 6px 12px; cursor: pointer; }
button:hover { background: #2b3140; }
button:disabled { opacity: .6; cursor: default; }
input, select { background: #0c0e12; border: 1px solid var(--line); border-radius: 8px; padding: 7px 10px; }
input:focus, select:focus, button:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.err { color: var(--bad); min-height: 1.2em; margin: 6px 0 0; }

/* login */
.login { display: grid; place-items: center; }
.card { width: min(360px, 92vw); background: var(--panel); border: 1px solid var(--line); border-radius: 14px; padding: 28px; }
.card h1 { margin: 0 0 4px; font-size: 22px; }
.card p { margin: 0 0 20px; }
.card label { display: block; font-size: 14px; margin-bottom: 6px; }
.card input { width: 100%; margin-bottom: 14px; }
.card button[type=submit] { width: 100%; background: var(--accent); border-color: var(--accent); color: #fff; padding: 9px; }

/* app */
.app { overflow: hidden; user-select: none; -webkit-user-select: none; }
#screen { position: fixed; inset: 0; width: 100vw; height: 100vh; object-fit: contain; background: #000; outline: none; touch-action: none; }
#sink { position: fixed; left: -1000px; top: 0; width: 10px; height: 10px; opacity: 0; }
.overlay { position: fixed; inset: 0; display: grid; place-items: center; background: rgba(8,9,12,.72); z-index: 20; }
.overlay[hidden] { display: none; }
.overlay .msg { background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 18px 22px; display: flex; gap: 14px; align-items: center; }
.pill { position: fixed; left: 50%; bottom: 18px; transform: translateX(-50%); z-index: 15; background: var(--panel); border-radius: 999px; }

.bar { position: fixed; top: 0; left: 50%; transform: translate(-50%, -110%); z-index: 10; display: flex; gap: 10px; align-items: center;
  background: rgba(23,26,33,.96); border: 1px solid var(--line); border-top: 0; border-radius: 0 0 12px 12px; padding: 8px 12px; font-size: 13px;
  transition: transform .18s ease; }
.bar.show { transform: translate(-50%, 0); }
.bar label { display: flex; gap: 6px; align-items: center; color: var(--muted); }
.bar select { padding: 4px 6px; }
.bar button { padding: 4px 10px; }
.stat { display: flex; align-items: center; gap: 6px; min-width: 64px; font-variant-numeric: tabular-nums; }
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--muted); display: inline-block; }
.dot.ok { background: var(--ok); } .dot.warn { background: var(--warn); } .dot.bad { background: var(--bad); }
.handle { position: fixed; top: 0; left: 50%; transform: translateX(-50%); width: 64px; height: 6px; padding: 0; border-radius: 0 0 6px 6px;
  background: rgba(154,161,178,.45); border: 0; z-index: 9; }
.menu { position: absolute; right: 8px; top: 100%; margin-top: 4px; background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: 6px; display: grid; gap: 4px; }
.menu[hidden] { display: none; }
.menu button { text-align: left; border: 0; background: transparent; }
.menu button:hover { background: #232834; }

.panel { position: fixed; top: 0; right: 0; bottom: 0; width: min(440px, 100vw); z-index: 12; background: var(--panel); border-left: 1px solid var(--line);
  padding: 16px; overflow: auto; user-select: text; -webkit-user-select: text; }
.panel[hidden] { display: none; }
.panel header { display: flex; justify-content: space-between; align-items: center; }
.panel h2 { margin: 0; font-size: 17px; }
.panel header button { border: 0; background: transparent; font-size: 22px; line-height: 1; }
#fetch { display: flex; gap: 8px; margin-top: 10px; }
#fetch input { flex: 1; min-width: 0; }
.list { list-style: none; margin: 10px 0 0; padding: 0; display: grid; gap: 8px; }
.list li { border: 1px solid var(--line); border-radius: 10px; padding: 10px; display: grid; gap: 6px; }
.list .name { word-break: break-all; }
.list .row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; font-size: 13px; color: var(--muted); }
.list .row a, .list .row button { font-size: 13px; padding: 3px 9px; border-radius: 7px; border: 1px solid var(--line); background: #232834; color: var(--text); text-decoration: none; }
.prog { height: 4px; background: #0c0e12; border-radius: 4px; overflow: hidden; }
.prog i { display: block; height: 100%; background: var(--accent); width: 0; }
.empty { color: var(--muted); font-size: 14px; border: 0 !important; }
