:root {
  --bg: #0b0d10;
  --panel: #14181d;
  --line: #232a31;
  --fg: #e6e6e6;
  --muted: #8b97a3;
  --accent: #d97757; /* claude terracotta */
  --ok: #4caf50;
  --bad: #e0564b;
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body {
  margin: 0; height: 100%; background: var(--bg); color: var(--fg);
  font-family: -apple-system, "Segoe UI", Roboto, system-ui, sans-serif;
  overscroll-behavior: none;
}
.screen { position: fixed; inset: 0; display: flex; flex-direction: column; }
[hidden] { display: none !important; }

/* --- pairing --- */
#pair-screen { align-items: center; justify-content: center; padding: env(safe-area-inset-top) 20px; }
.card {
  width: 100%; max-width: 360px; background: var(--panel);
  border: 1px solid var(--line); border-radius: 16px; padding: 24px;
}
.card h1 { margin: 0 0 4px; font-size: 22px; letter-spacing: .3px; }
.card .sub { margin: 0 0 20px; color: var(--muted); font-size: 14px; line-height: 1.4; }
label { display: block; font-size: 12px; color: var(--muted); margin-bottom: 6px; text-transform: uppercase; letter-spacing: .08em; }
#code {
  width: 100%; font-size: 28px; letter-spacing: .35em; text-align: center;
  font-family: "Cascadia Mono", ui-monospace, Consolas, monospace;
  padding: 14px 10px; background: #0b0e12; color: var(--fg);
  border: 1px solid var(--line); border-radius: 12px; text-transform: uppercase;
}
#code:focus { outline: none; border-color: var(--accent); }
button.primary {
  width: 100%; margin-top: 16px; padding: 14px; font-size: 16px; font-weight: 600;
  color: #1a1207; background: var(--accent); border: none; border-radius: 12px;
}
button.primary:active { filter: brightness(.92); }
.status { min-height: 18px; margin: 12px 0 0; font-size: 13px; text-align: center; }
.status.err { color: var(--bad); }
.status.ok { color: var(--ok); }
.hint { margin: 18px 0 0; color: var(--muted); font-size: 12px; line-height: 1.5; text-align: center; }
.hint code { background: #0b0e12; padding: 2px 6px; border-radius: 6px; font-size: 11px; }

/* --- terminal --- */
#bar {
  display: flex; align-items: center; gap: 8px; padding: calc(env(safe-area-inset-top) + 8px) 12px 8px;
  background: var(--panel); border-bottom: 1px solid var(--line); font-size: 13px; color: var(--muted);
}
.dot { width: 9px; height: 9px; border-radius: 50%; background: var(--muted); flex: none; }
.dot.ok { background: var(--ok); }
.dot.bad { background: var(--bad); }
#conn-label { flex: 1; }
button.ghost { background: transparent; color: var(--muted); border: 1px solid var(--line); border-radius: 8px; padding: 5px 10px; font-size: 12px; }
#terminal { flex: 1; min-height: 0; padding: 4px 6px 0; }

/* --- touch toolbar --- */
#toolbar {
  display: flex; gap: 6px; padding: 8px 8px calc(env(safe-area-inset-bottom) + 8px);
  background: var(--panel); border-top: 1px solid var(--line);
  overflow-x: auto; -webkit-overflow-scrolling: touch;
}
#toolbar button {
  flex: 0 0 auto; min-width: 44px; height: 40px; padding: 0 12px;
  background: #1b2127; color: var(--fg); border: 1px solid var(--line);
  border-radius: 10px; font-size: 15px; font-family: "Cascadia Mono", ui-monospace, monospace;
}
#toolbar button:active { background: #262e36; }
#toolbar button.on { background: var(--accent); color: #1a1207; border-color: var(--accent); }
