:root {
  --bg: #f8fafc;
  --fg: #1f2937;
  --primary: #2563eb;
  --primary-fg: #ffffff;
  --secondary: #e5e7eb;
  --danger: #b91c1c;
  --muted: #6b7280;
  --warn-bg: #fef3c7;
  --warn-fg: #92400e;
}

* { box-sizing: border-box; }

html, body { margin: 0; padding: 0; background: var(--bg); color: var(--fg); font-family: -apple-system, system-ui, sans-serif; }

main {
  max-width: 480px;
  margin: 0 auto;
  padding: 1rem;
  padding-top: max(env(safe-area-inset-top), 1rem);
}

header h1 { margin: 0; font-size: 1.4rem; }
header .sub { margin: 0.25rem 0 1.5rem; color: var(--muted); font-size: 0.95rem; }

.screen { display: none; }
body[data-screen="idle"]    .screen-idle,
body[data-screen="loading"] .screen-loading,
body[data-screen="review"]  .screen-review,
body[data-screen="done"]    .screen-done { display: block; }

.big-button {
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.4rem;
  padding: 2rem;
  background: var(--primary);
  color: var(--primary-fg);
  border-radius: 1rem;
  cursor: pointer;
  margin-bottom: 1rem;
  user-select: none;
}
.privacy { font-size: 0.85rem; color: var(--muted); }

.spinner {
  width: 48px; height: 48px; margin: 2rem auto;
  border: 4px solid var(--secondary);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 1s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

form label { display: block; margin-bottom: 0.75rem; font-size: 0.9rem; }
form input, form textarea {
  display: block;
  width: 100%;
  padding: 0.6rem;
  font-size: 1rem;
  border: 1px solid var(--secondary);
  border-radius: 0.4rem;
  background: white;
  margin-top: 0.25rem;
}
.row { display: grid; grid-template-columns: 1fr 1fr; gap: 0.75rem; }

.banner {
  padding: 0.6rem;
  background: var(--warn-bg);
  color: var(--warn-fg);
  border-radius: 0.4rem;
  font-size: 0.9rem;
  margin: 0.5rem 0;
}

.actions { display: flex; gap: 0.75rem; margin-top: 1rem; }
.actions button {
  flex: 1;
  padding: 0.8rem;
  font-size: 1rem;
  border: 0;
  border-radius: 0.5rem;
  background: var(--primary);
  color: var(--primary-fg);
  cursor: pointer;
}
.actions .secondary { background: var(--secondary); color: var(--fg); }

.toast {
  position: fixed;
  bottom: 1rem; left: 1rem; right: 1rem;
  padding: 0.8rem;
  background: var(--danger);
  color: white;
  border-radius: 0.5rem;
  text-align: center;
}
