:root {
  --ground: #0f1418;
  --panel: #182028;
  --line: #2b3742;
  --ink: #f1ece2;
  --soft: #a9b4bd;
  --cream: #ecdfc4;
  --red: #d2553f;
  --green: #5fb48a;
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  min-height: 100vh;
  background: var(--ground);
  color: var(--ink);
  font: 16px/1.45 -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
}
[hidden] { display: none !important; }

.top {
  display: flex; align-items: end; justify-content: space-between; gap: 16px; flex-wrap: wrap;
  padding: 18px 24px; border-bottom: 1px solid var(--line);
}
.firm { margin: 0; color: var(--soft); font-size: 13px; letter-spacing: .08em; text-transform: uppercase; }
h1 { margin: 2px 0 0; font: 400 26px/1.2 Georgia, "Times New Roman", serif; }
.status { margin: 0; color: var(--soft); font-size: 14px; }
.status.live { color: var(--green); }

.alert { margin: 0; padding: 12px 24px; background: #4a1f18; color: #ffd9d0; }

.layout { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 20px; padding: 20px 24px 28px; }
@media (max-width: 900px) { .layout { grid-template-columns: minmax(0, 1fr); } }

.tiles {
  display: grid; gap: 10px; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  min-height: 420px; padding: 10px; background: #000; border: 1px solid var(--line); border-radius: 10px;
}
.empty { margin: auto; color: var(--soft); grid-column: 1 / -1; }
.tile { position: relative; min-height: 200px; background: #0a0d10; border-radius: 8px; overflow: hidden; }
.tile video { display: block; width: 100%; height: 100%; object-fit: cover; }
.tile.me video { transform: scaleX(-1); }
.tile .who {
  position: absolute; left: 8px; bottom: 8px; max-width: calc(100% - 16px);
  padding: 3px 9px; border-radius: 6px; background: rgba(0, 0, 0, .62); font-size: 14px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.tile.off::after {
  content: "Camera off"; position: absolute; inset: 0; display: grid; place-items: center; color: var(--soft); background: #0a0d10;
}
.tile.off .who { z-index: 1; }

.bar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-top: 14px; }
button {
  appearance: none; padding: 10px 16px; border: 1px solid var(--line); border-radius: 8px;
  background: var(--panel); color: var(--ink); font: inherit; cursor: pointer;
}
button:hover { border-color: var(--soft); }
button:disabled { opacity: .5; cursor: default; }
button.main { background: var(--cream); border-color: var(--cream); color: #1b1710; font-weight: 600; }
button.danger { margin-left: auto; border-color: var(--red); color: #ffb9ab; }
button.danger.sure { background: var(--red); color: #fff; }
button.small { padding: 6px 12px; font-size: 14px; }

.rec { display: inline-flex; align-items: center; gap: 8px; color: var(--soft); font-size: 14px; }
.rec i { width: 10px; height: 10px; border-radius: 50%; background: var(--red); }
.rec b { font-weight: 400; font-variant-numeric: tabular-nums; }

.side section { padding: 16px; margin-bottom: 16px; background: var(--panel); border: 1px solid var(--line); border-radius: 10px; }
h2 { margin: 0 0 10px; font: 400 19px/1.2 Georgia, "Times New Roman", serif; }
.hint { margin: 0; color: var(--soft); font-size: 14px; }
.people { list-style: none; margin: 0; padding: 0; }
.people li { padding: 12px 0; border-top: 1px solid var(--line); }
.people li:first-child { border-top: 0; padding-top: 0; }
.people .name { margin: 0 0 2px; font-size: 17px; overflow-wrap: anywhere; }
.people .since { margin: 0 0 8px; color: var(--soft); font-size: 13px; }
.people .row { display: flex; gap: 8px; }
.note { margin: 0; color: var(--soft); font-size: 13px; }

/* the sign-in screen */
.signin { display: grid; place-items: center; padding: 24px; }
.door { width: min(380px, 100%); padding: 28px; background: var(--panel); border: 1px solid var(--line); border-radius: 12px; }
.door h1 { margin-bottom: 22px; }
.door label { display: block; margin-bottom: 6px; color: var(--soft); font-size: 14px; }
.door input[type="password"], .door input[type="text"] {
  width: 100%; padding: 12px 14px; margin-bottom: 14px; border: 1px solid var(--line); border-radius: 8px;
  background: var(--ground); color: var(--ink); font: inherit;
}
.door input:focus { outline: 2px solid var(--cream); outline-offset: 1px; }
.door button { width: 100%; }
.door .hint { min-height: 1.5em; margin-top: 12px; color: #ffb9ab; }
.door .fine { margin: 14px 0 0; color: var(--soft); font-size: 13px; }
