:root {
  --bg: #f2f2f7;
  --text: #1c1c1e;
  --card: #ffffff;
  --accent: #34c759;
  --muted: #6c6c70;
  --btn: #e5e5ea;
  --danger: #ff453a;
  color-scheme: light dark;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #000000;
    --card: #1c1c1e;
    --text: #ffffff;
    --muted: #98989d;
    --btn: #2c2c2e;
  }
}
* { box-sizing: border-box; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 18px/1.4 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  -webkit-tap-highlight-color: transparent;
}
#app {
  max-width: 560px;
  margin: 0 auto;
  padding: calc(16px + env(safe-area-inset-top)) 16px calc(16px + env(safe-area-inset-bottom));
  min-height: 100vh;
}
h1 { margin: 8px 0 20px; font-size: 1.6rem; }
.tiles { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.tile {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 8px; min-height: 150px; padding: 12px;
  background: var(--card); color: var(--text);
  border-radius: 18px; text-decoration: none; text-align: center;
  box-shadow: 0 1px 4px rgba(0,0,0,.12);
}
.tile .icon { font-size: 2.6rem; }
.tile:active { transform: scale(.97); }
form.code { display: flex; flex-direction: column; gap: 12px; }
input, button {
  font: inherit; padding: 14px; border-radius: 12px;
  border: 1px solid transparent; background: var(--btn); color: var(--text);
}
button.primary { background: var(--accent); color: #fff; border: 0; font-weight: 600; }
.error { color: var(--danger); min-height: 1.4em; margin: 0; }
footer { margin-top: 32px; text-align: center; }
footer button { background: none; border: 0; color: var(--muted); font-size: .9rem; text-decoration: underline; }
