* { box-sizing: border-box; }

html, body {
  margin: 0;
  min-height: 100%;
  background: var(--color-bg);
  color: var(--color-text);
  font-family: var(--font-body);
  -webkit-tap-highlight-color: transparent;
}

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

section {
  display: flex;
  flex-direction: column;
  gap: 16px;
  min-height: calc(100dvh - 40px);
}
section[hidden], [hidden] { display: none !important; }

button { font: inherit; color: inherit; cursor: pointer; }
button:disabled { opacity: 0.35; cursor: not-allowed; }
:focus-visible { outline: 2px solid var(--color-lime); outline-offset: 2px; }
/* headings only take focus programmatically, to announce a new screen */
[tabindex='-1']:focus { outline: none; }

fieldset { border: none; margin: 0; padding: 0; }
legend { padding: 0; margin-bottom: 8px; text-transform: uppercase; }
legend,
.label { font-size: 12px; font-weight: 700; letter-spacing: 3px; color: var(--color-text-muted); }

input {
  flex: 1;
  min-width: 0;
  height: 48px;
  padding: 0 14px;
  border-radius: var(--radius-sm);
  border: 1.5px solid var(--color-border);
  background: var(--color-panel);
  color: var(--color-text);
  font: inherit;
  font-size: 16px; /* 16px stops iOS from zooming in on focus */
}
input::placeholder { color: var(--color-text-muted); }

/* utilities */
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
.row { display: flex; align-items: center; gap: 8px; }
.row-between { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.centered { text-align: center; }
.pink { color: var(--color-pink); }
.lime { color: var(--color-lime); }
.hint { margin: 0; text-align: center; font-size: 14px; color: var(--color-text-muted); }
.load-error { margin-top: 40vh; text-align: center; color: var(--color-pink); }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
