:root { --bg: #0f1115; --panel: #1b1f27; --fg: #e8eaf0; --muted: #9aa3b2; --accent: #4f8cff; --err: #ff6b6b; }
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; background: var(--bg); color: var(--fg); font: 15px/1.4 system-ui, "Segoe UI", Arial, sans-serif; }
button, select, input, textarea { font: inherit; color: inherit; }
button, select { background: #2a303c; border: 1px solid #3a4252; border-radius: 8px; padding: 6px 10px; cursor: pointer; }
button:hover { border-color: var(--accent); }

/* login */
body.login { display: grid; place-items: center; padding: 16px; }
.card { width: min(360px, 100%); background: var(--panel); padding: 24px; border-radius: 14px; display: grid; gap: 14px; }
.card h1 { margin: 0 0 4px; font-size: 20px; }
.card label { display: grid; gap: 6px; color: var(--muted); }
.card input { background: #0f1115; border: 1px solid #3a4252; border-radius: 8px; padding: 10px; direction: ltr; }
.card button { background: var(--accent); border: 0; padding: 10px; font-weight: 600; }
#err { color: var(--err); min-height: 1.2em; margin: 0; }

/* app */
body.app { overflow: hidden; touch-action: none; overscroll-behavior: none; }
#bar { position: fixed; inset: 0 0 auto 0; height: 44px; display: flex; gap: 6px; align-items: center; padding: 4px 8px;
  background: rgba(15,17,21,.92); z-index: 10; padding-top: max(4px, env(safe-area-inset-top)); }
#status { color: var(--muted); font-size: 13px; margin-inline-start: auto; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
#stage { position: fixed; inset: 44px 0 0 0; display: grid; place-items: center; overflow: hidden; }
#screen { max-width: 100%; max-height: 100%; outline: none; cursor: default; background: #000; touch-action: none; transform-origin: 0 0; }
#kbd { position: fixed; left: -1000px; top: 50px; width: 10px; height: 10px; opacity: 0; }
.panel { position: fixed; top: 52px; inset-inline-start: 8px; width: min(420px, calc(100% - 16px)); max-height: calc(100% - 64px); overflow: auto;
  background: var(--panel); border-radius: 12px; padding: 12px; z-index: 11; box-shadow: 0 8px 30px rgba(0,0,0,.5); }
.panel h3 { margin: 0 0 10px; font-size: 16px; }
.panel small { color: var(--muted); font-weight: 400; direction: ltr; }
.panel textarea { width: 100%; background: #0f1115; border: 1px solid #3a4252; border-radius: 8px; padding: 8px; }
.row { display: flex; gap: 8px; margin-top: 8px; }
.row.wrap { flex-wrap: wrap; }
.drop { display: block; border: 1px dashed #4a5366; border-radius: 10px; padding: 14px; text-align: center; cursor: pointer; }
.drop input { display: none; }
#files { list-style: none; padding: 0; margin: 10px 0 0; }
#files li { display: flex; justify-content: space-between; gap: 8px; padding: 6px 0; border-bottom: 1px solid #2a303c; }
#files a { color: var(--accent); word-break: break-all; }
#files span { color: var(--muted); white-space: nowrap; font-size: 13px; }
progress { width: 100%; margin-top: 8px; }
.check { display: flex; gap: 8px; align-items: center; margin-top: 10px; color: var(--muted); }
