/* haunt remote — our operator page. black / grey / white, lowercase, inter. */
:root {
  --bg: #0a0a0a;
  --panel: #131313;
  --raised: #1a1a1a;
  --edge: #262626;
  --edge-strong: #3a3a3a;
  --ink: #e8e8e8;
  --ink-strong: #ffffff;
  --muted: #8c8c8c;
  --idle: #5a5a5a;
  --radius: 12px;
  color-scheme: dark;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  background: var(--bg);
  color: var(--ink);
  font: 14px/1.45 Inter, "Inter Variable", -apple-system, BlinkMacSystemFont, "Helvetica Neue", Arial, sans-serif;
  text-transform: lowercase;
  -webkit-font-smoothing: antialiased;
}
input, select, textarea { text-transform: none; font: inherit; }
h1 { font-size: 22px; font-weight: 600; letter-spacing: -0.01em; margin: 0; color: var(--ink-strong); }
h2 { font-size: 12px; font-weight: 600; letter-spacing: 0.06em; margin: 0 0 8px; color: var(--muted); }
p { margin: 0; }
.muted { color: var(--muted); }
.small { font-size: 12px; }
.grow { flex: 1; }
[hidden] { display: none !important; }

.mark { font-weight: 700; letter-spacing: 0.02em; color: var(--ink-strong); font-size: 15px; }
.mark span { font-weight: 400; color: var(--muted); }

.bar {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 20px; border-bottom: 1px solid var(--edge); background: #050505;
  position: sticky; top: 0; z-index: 2;
}
.bar form { margin: 0; }
.pill {
  font-size: 12px; padding: 2px 10px; border-radius: 999px; border: 1px solid var(--edge-strong); color: var(--muted);
}
.pill.ok { color: var(--ink-strong); border-color: #8c8c8c; }

button {
  font: inherit; text-transform: lowercase; cursor: pointer; border-radius: 999px; padding: 6px 14px;
  border: 1px solid var(--edge-strong); background: transparent; color: var(--ink);
}
button:hover:not(:disabled) { border-color: var(--muted); color: var(--ink-strong); }
button:disabled { opacity: 0.4; cursor: default; }
button.primary { background: var(--ink-strong); color: #000; border-color: var(--ink-strong); font-weight: 600; }
button.primary:hover:not(:disabled) { background: #d0d0d0; color: #000; }
button.primary.holding { background: transparent; color: var(--ink-strong); border-color: var(--ink-strong); }

input {
  background: var(--raised); color: var(--ink); border: 1px solid var(--edge-strong); border-radius: 8px;
  padding: 7px 10px; min-width: 0; flex: 1;
}
input:focus, select:focus, canvas:focus { outline: 1px solid var(--muted); outline-offset: 1px; }
select {
  background: var(--raised); color: var(--ink); border: 1px solid var(--edge-strong); border-radius: 8px; padding: 5px 8px;
}
label.select { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: 12px; }

main { padding: 20px; }
.section-head { display: flex; align-items: baseline; gap: 12px; margin-bottom: 16px; }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 14px; }
.card {
  background: var(--panel); border: 1px solid var(--edge); border-radius: var(--radius); padding: 14px;
}
.device { cursor: pointer; padding: 10px; display: flex; flex-direction: column; gap: 8px; transition: border-color 0.12s; }
.device:hover { border-color: var(--edge-strong); }
.device.off { cursor: default; opacity: 0.55; }
.thumb {
  aspect-ratio: 9 / 19.5; background: #000; border-radius: 9px; border: 1px solid var(--edge);
  display: flex; align-items: center; justify-content: center; overflow: hidden; color: var(--idle); font-size: 12px;
}
.thumb img { width: 100%; height: 100%; object-fit: contain; display: block; }
.device .name { font-weight: 600; color: var(--ink-strong); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.device .meta { font-size: 12px; color: var(--muted); }
.device .cause { font-size: 12px; color: var(--ink); }
.empty { color: var(--muted); margin-top: 40px; text-align: center; }

.viewer-head { display: flex; align-items: center; gap: 14px; margin-bottom: 16px; flex-wrap: wrap; }
.stage { display: flex; gap: 20px; align-items: flex-start; flex-wrap: wrap; }
.screen-wrap { position: relative; flex: 0 1 auto; }
#screen {
  display: block; background: #000; border: 1px solid var(--edge-strong); border-radius: 14px;
  max-height: calc(100vh - 170px); max-width: min(100%, 720px); width: auto; height: auto;
  touch-action: none; cursor: default;
}
#screen.controlling { cursor: crosshair; border-color: var(--ink-strong); }
.waiting {
  position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; color: var(--muted);
  pointer-events: none;
}
.side { display: flex; flex-direction: column; gap: 14px; width: 320px; max-width: 100%; }
.row { display: flex; gap: 8px; margin-top: 10px; }
.check { display: flex; gap: 6px; align-items: center; font-size: 12px; color: var(--muted); margin-top: 8px; }
.check input { flex: none; }
.facts { display: grid; grid-template-columns: auto 1fr; gap: 4px 12px; margin: 0; font-size: 12px; }
.facts dt { color: var(--muted); }
.facts dd { margin: 0; font-variant-numeric: tabular-nums; }
.log { list-style: none; margin: 0; padding: 0; font-size: 12px; max-height: 220px; overflow: auto; }
.log li { padding: 3px 0; border-bottom: 1px solid var(--edge); color: var(--ink); }
.log li time { color: var(--idle); margin-right: 6px; font-variant-numeric: tabular-nums; }

body.login { display: flex; align-items: center; justify-content: center; min-height: 100vh; padding: 16px; }
.login-box {
  width: 340px; max-width: 100%; background: var(--panel); border: 1px solid var(--edge); border-radius: var(--radius);
  padding: 24px; display: flex; flex-direction: column; gap: 10px;
}
.stack { display: flex; flex-direction: column; gap: 12px; margin-top: 8px; }
.stack label { display: flex; flex-direction: column; gap: 6px; font-size: 12px; color: var(--muted); }
.problem { color: var(--ink-strong); min-height: 1em; font-size: 12px; }

@media (max-width: 700px) {
  main { padding: 16px; }
  .side { width: 100%; }
  #screen { max-height: 70vh; }
}
