html, body { margin: 0; height: 100%; background: #111318; color: #f2f2f2; overflow: hidden;
  font-family: system-ui, -apple-system, sans-serif; -webkit-user-select: none; user-select: none; touch-action: none; }
#view { position: fixed; inset: 0; width: 100%; height: 100%; display: block; }
.screen { position: fixed; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 24px;
  /* keep bottom UI clear of floating mobile browser toolbars (Arc, Safari) */
  padding: env(safe-area-inset-top) 16px calc(env(safe-area-inset-bottom) + 72px); }
.screen[hidden] { display: none; }
h1 { margin: 0; font-size: clamp(32px, 8vw, 72px); letter-spacing: 0.02em; }
button.big { font: inherit; font-size: 20px; padding: 14px 40px; border: 0; border-radius: 99px; background: #f2f2f2; color: #111318; cursor: pointer; }
#errline { position: fixed; left: 0; right: 0; top: 0; z-index: 99999; background: #a00; color: #fff;
  font: 12px/1.3 monospace; padding: 4px 8px; white-space: pre-wrap; pointer-events: none; }
#ui { position: fixed; inset: 0; width: 100%; height: 100%; display: block; }
.lead { margin: 0; max-width: 28em; text-align: center; line-height: 1.4; opacity: .85; }
.msg { margin: 0; max-width: 28em; text-align: center; color: #ffb4a8; min-height: 1.4em; }
.pill { position: fixed; top: calc(env(safe-area-inset-top) + 12px); left: 50%; transform: translateX(-50%);
  padding: 8px 14px; border-radius: 99px; background: rgba(17,19,24,.72); font-size: 14px; white-space: nowrap; pointer-events: none; }
.pill::before { content: ''; display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 8px; background: #888; vertical-align: 1px; }
.pill[data-k="ok"]::before { background: #5adc8c; }
.pill[data-k="manual"]::before { background: #ffc828; }
.pill[hidden], #bar[hidden], .sl[hidden], .btn[hidden] { display: none; }
#bar { position: fixed; left: 0; right: 0; bottom: 0; display: flex; flex-direction: column; gap: 10px;
  padding: 12px 12px calc(env(safe-area-inset-bottom) + 64px); background: linear-gradient(transparent, rgba(17,19,24,.85) 30%); }
#bar .row { display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; }
.btn { font: inherit; font-size: 15px; padding: 10px 16px; border: 0; border-radius: 99px; background: rgba(242,242,242,.14); color: #f2f2f2; cursor: pointer; }
.btn[aria-pressed="true"] { background: #f2f2f2; color: #111318; }
.sl { display: flex; align-items: center; gap: 8px; font-size: 14px; flex: 1 1 150px; max-width: 280px; }
.sl input { flex: 1; min-width: 0; }
