:root {
  color-scheme: light dark;
  --bg: #ffffff;
  --fg: #111111;
  --border: #d0d0d0;
  --accent: #2b6cb0;
  --danger: #b02a2a;
  --success: #2a7a2a;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #121212;
    --fg: #f0f0f0;
    --border: #3a3a3a;
    --accent: #6ea8e0;
    --danger: #e08080;
    --success: #7fd17f;
  }
}

* {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  min-height: 100vh;
  min-height: 100dvh;
  background: var(--bg);
  color: var(--fg);
  font: 1rem/1.5 -apple-system, system-ui, sans-serif;
  display: flex;
  flex-direction: column;
}

main {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 1rem;
  max-width: 32rem;
  width: 100%;
  margin: 0 auto;
  padding: 1.5rem;
}

h1 {
  font-size: 1.25rem;
  margin: 0 0 0.5rem;
}

p {
  margin: 0;
}

/* Visible only to screen readers -- the textarea's placeholder is not a
   substitute for a real label. */
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

textarea {
  width: 100%;
  min-height: 40vh;
  padding: 1rem;
  font: inherit;
  color: inherit;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 0.5rem;
  resize: vertical;
}

textarea:focus,
button:focus {
  outline: 3px solid var(--accent);
  outline-offset: 2px;
}

button {
  font: inherit;
  padding: 0.875rem 1.25rem;
  border: none;
  border-radius: 0.5rem;
  background: var(--accent);
  color: white;
  cursor: pointer;
}

button:disabled {
  opacity: 0.6;
  cursor: default;
}

#status[data-kind="error"],
#pair-status[data-kind="error"] {
  color: var(--danger);
}

#status[data-kind="success"],
#pair-status[data-kind="success"] {
  color: var(--success);
}

code {
  background: var(--border);
  padding: 0.1rem 0.35rem;
  border-radius: 0.25rem;
}

#queue-count {
  font-size: 0.875rem;
  opacity: 0.75;
}

#retry-button {
  background: transparent;
  color: var(--accent);
  border: 1px solid var(--accent);
  padding: 0.5rem 1rem;
}
