/* Light theme. Text #1a1a1a on #ffffff is about 17:1; button text #ffffff on
   #8a1c1c is about 9:1 and #ffffff on #0b4a8f about 9:1 (both above 7:1). */
:root {
  --bg: #ffffff;
  --fg: #1a1a1a;
  --muted: #3d3d3d;
  --accent: #0b4a8f;
  --record: #8a1c1c;
  --on-color: #ffffff;
  --line: #1a1a1a;
}

* { box-sizing: border-box; }

html { font-size: 22px; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  font-size: 1rem;
  line-height: 1.4;
}

#app { min-height: 100vh; min-height: 100dvh; display: flex; flex-direction: column; }

button {
  font: inherit;
  font-weight: 700;
  min-height: 3rem;
  padding: 0.5rem 1.25rem;
  border: 3px solid var(--line);
  border-radius: 0.75rem;
  background: var(--bg);
  color: var(--fg);
}

button:focus-visible { outline: 4px solid var(--accent); outline-offset: 3px; }


main { flex: 1; display: flex; flex-direction: column; padding: 1rem 1rem 2rem; }

.nav-link { min-height: 3.5rem; margin: 1rem 0; align-self: center; border-color: var(--accent); color: var(--accent); }

.home { display: flex; flex-direction: column; align-items: center; gap: 1rem; text-align: center; }

.record {
  /* 60% of the shorter screen side: fits portrait and landscape. */
  width: min(60vw, 60vh);
  height: min(60vw, 60vh);
  border-radius: 50%;
  border-color: var(--record);
  background: var(--record);
  color: var(--on-color);
  font-size: 2rem;
  line-height: 1.2;
}

.record.recording { animation: pulse 2s ease-in-out infinite; }
.record.busy { border-color: var(--fg); animation: breathe 1.6s ease-in-out infinite; }
.record:disabled { cursor: default; }

@keyframes pulse { 50% { transform: scale(1.04); } }
@keyframes breathe { 50% { transform: scale(0.96); } }

@media (prefers-reduced-motion: reduce) {
  .record.recording, .record.busy { animation: none; }
}

.timer { margin: 0; font-size: 3rem; font-weight: 700; font-variant-numeric: tabular-nums; }
.status, .saved { margin: 0; font-size: 1.25rem; font-weight: 700; color: var(--muted); min-height: 1.5em; }
.saved { color: var(--accent); }

.recordings h1 { font-size: 1.6rem; margin: 0 0 1rem; }
.rows { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 1.25rem; }
.row { border: 3px solid var(--line); border-radius: 0.75rem; padding: 1rem; }
.row p { margin: 0 0 0.35rem; }
.row .when { font-weight: 700; }
.row .where { color: var(--muted); }
.play { width: 100%; min-height: 4rem; margin-top: 0.5rem; background: var(--accent); border-color: var(--accent); color: var(--on-color); font-size: 1.5rem; }
.play:disabled { background: var(--bg); color: var(--fg); border-color: var(--line); border-style: dashed; }

/* Last, with !important, so no display rule above can show a hidden view. */
[hidden] { display: none !important; }

/* Pairing page: one message, one huge button. */
.pair { justify-content: center; gap: 1.5rem; padding: 1.5rem; text-align: center; }
.pair-message { margin: 0; font-size: 1.5rem; font-weight: 700; }
.pair-big { min-height: 6rem; font-size: 2rem; background: var(--accent); border-color: var(--accent); color: var(--on-color); }
.pair-small { margin: 0; font-size: 1.25rem; color: var(--muted); }
