:root {
  --bg: #0f172a; --panel: #1e293b; --line: #334155; --text: #f1f5f9; --muted: #94a3b8;
  --accent: #38bdf8; --ok: #4ade80; --err: #f87171;
  --sat: env(safe-area-inset-top, 0px); --sab: env(safe-area-inset-bottom, 0px);
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; height: 100%; background: var(--bg); color: var(--text);
  font: 17px/1.4 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  overscroll-behavior: none; -webkit-user-select: none; user-select: none; }
[hidden] { display: none !important; }
h1 { font-size: 22px; font-weight: 650; margin: 0 0 18px; }

.screen { min-height: 100dvh; padding: calc(var(--sat) + 28px) 20px calc(var(--sab) + 20px); display: flex; flex-direction: column; }
.hint { color: var(--muted); margin: 0 0 14px; }
.error { color: var(--err); }

button { font: inherit; color: inherit; border: 0; border-radius: 14px; cursor: pointer; }
button:disabled { opacity: .5; }
.primary { background: var(--accent); color: #04263a; font-weight: 650; padding: 16px 26px; min-height: 56px; }
.secondary { background: var(--panel); color: var(--text); padding: 16px 22px; min-height: 56px; border: 1px solid var(--line); }
.link { background: none; color: var(--accent); padding: 14px; }

#login-form { display: flex; flex-direction: column; gap: 14px; }
input[type=password] { font: inherit; padding: 16px; border-radius: 14px; border: 1px solid var(--line); background: var(--panel); color: var(--text); -webkit-user-select: text; user-select: text; }

.company-list { display: flex; flex-direction: column; gap: 12px; }
.company-list button { background: var(--panel); border: 1px solid var(--line); text-align: left; padding: 0 20px; min-height: 68px; font-size: 18px; font-weight: 550; }
.company-list button.active { border-color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent); }
.company-list button:active { background: #263449; }

.camera { position: fixed; inset: 0; background: #000; }
video, #frozen { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; background: #000; }
.topbar { position: absolute; top: 0; left: 0; right: 0; z-index: 3; display: flex; justify-content: space-between; align-items: center;
  padding: calc(var(--sat) + 10px) 14px 14px; background: linear-gradient(#000a, #0000); }
.company-btn { background: #0f172acc; padding: 10px 14px; font-weight: 600; max-width: 75%; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.chev { color: var(--muted); }
.counter { background: #0f172acc; border-radius: 12px; padding: 10px 14px; font-weight: 650; color: var(--ok); }

.status { position: absolute; left: 14px; right: 14px; bottom: calc(var(--sab) + 140px); z-index: 3; text-align: center; pointer-events: none; }
.status span { display: inline-block; padding: 9px 16px; border-radius: 999px; background: #0f172ae6; font-size: 15px; pointer-events: auto; }
.status .ok { color: var(--ok); } .status .err { color: var(--err); } .status button { background: none; color: var(--accent); padding: 0 0 0 8px; text-decoration: underline; }

.controls { position: absolute; left: 0; right: 0; bottom: 0; z-index: 3; padding: 20px 22px calc(var(--sab) + 22px); background: linear-gradient(#0000, #000b); }
.row { display: flex; align-items: center; justify-content: space-between; gap: 14px; }
.row .primary, .row .secondary { flex: 1; }
.shutter { width: 78px; height: 78px; border-radius: 50%; background: #fff; border: 5px solid #ffffff55; background-clip: padding-box; padding: 0; }
.shutter:active { transform: scale(.94); }
.side { width: 56px; height: 56px; background: #0f172acc; font-size: 22px; display: inline-flex; align-items: center; justify-content: center; }
span.side { background: none; }

.cam-overlay { position: absolute; inset: 0; z-index: 2; background: #0f172a; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 16px; padding: 30px; text-align: center; }
