:root {
  color-scheme: dark;
  --bg: #000;
  --panel: #12151a;
  --line: #2a3140;
  --text: #f2f4f7;
  --muted: #9aa3b2;
  --accent: #3d8bfd;
}
* { box-sizing: border-box; }
html, body {
  margin: 0;
  height: 100%;
  background: #000;
  color: var(--text);
  font-family: system-ui, sans-serif;
  overflow: hidden;
  overscroll-behavior: none;
}
.hidden { display: none !important; }
.gate { padding: 48px 20px; max-width: 420px; margin: 0 auto; }
.gate h1 { margin: 0 0 12px; font-size: 28px; }
.gate p { color: var(--muted); line-height: 1.45; }
.gate a { color: var(--accent); }
.gate form, .chrome form { display: flex; gap: 8px; }
input, button { font: inherit; }
input {
  flex: 1;
  background: #1c2128;
  color: var(--text);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 12px 14px;
}
button {
  background: var(--accent);
  color: #fff;
  border: 0;
  border-radius: 10px;
  padding: 12px 16px;
  font-weight: 600;
}
.app { display: flex; flex-direction: column; height: 100%; background: #000; }
.chrome {
  display: flex;
  gap: 8px;
  padding: 8px 8px calc(8px + env(safe-area-inset-top));
  background: var(--panel);
  z-index: 3;
}
.chrome form { flex: 1; }
.chrome #back { background: #2a3140; }
.view {
  flex: 1;
  position: relative;
  background: #000;
  overflow: hidden;
  touch-action: none;
  cursor: none;
}
#frame { width: 100%; height: 100%; object-fit: contain; display: block; user-select: none; }
.cursor {
  position: absolute;
  width: 18px;
  height: 18px;
  margin: -9px 0 0 -9px;
  border: 2px solid #fff;
  border-radius: 50%;
  pointer-events: none;
  display: none;
  box-shadow: 0 0 0 1px #000;
}
.hint {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--muted);
  pointer-events: none;
}
.typebar {
  display: flex;
  gap: 8px;
  padding: 8px 8px 4px;
  background: var(--panel);
}
.typebar.hot input { border-color: var(--accent); }
.status {
  min-height: 1.2em;
  padding: 2px 12px 6px;
  font-size: 12px;
  color: var(--muted);
}
.dock {
  display: flex;
  gap: 10px;
  align-items: center;
  justify-content: space-between;
  padding: 8px 10px calc(10px + env(safe-area-inset-bottom));
  background: var(--panel);
}
.now { font-size: 13px; color: var(--muted); }
.dock-actions { display: flex; gap: 8px; }
#send { white-space: nowrap; }
#send:disabled { opacity: 0.5; }
button.ghost { background: #2a3140; }
