:root {
  color-scheme: light dark;
  --bg: #eef3f7;
  --card: #fff;
  --text: #192a37;
  --muted: #566b7c;
  --field: #edf4f9;
  --border: #cedbe5;
  --blue: #0864b6;
  --active: #fff;
  font: 16px/1.5 system-ui, sans-serif;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #101b25;
    --card: #1a2936;
    --text: #f3f7fc;
    --muted: #b2c2d1;
    --field: #243849;
    --border: #3c5264;
    --blue: #80c4ff;
    --active: #102336;
  }
}
* {
  box-sizing: border-box;
}
body {
  background: var(--bg);
  color: var(--text);
  margin: 0;
  padding: 1.5rem 1rem;
}
main {
  max-width: 35rem;
  margin: auto;
  padding: 1.25rem;
  border-radius: 1.3rem;
  background: var(--card);
}
header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--border);
}
header div, label {
  display: grid;
}
header strong {
  font-size: 1.2rem;
}
header small, header span, .muted, .status {
  color: var(--muted);
}
h1 {
  font-size: 1.55rem;
  line-height: 1.2;
  margin: 0;
}
p {
  margin: 0;
}
#screen {
  padding-top: 1.25rem;
  display: grid;
  gap: 1rem;
}
form, .rows {
  display: grid;
  gap: 0.75rem;
}
label {
  gap: 0.3rem;
}
input, select, textarea, button {
  font: inherit;
}
input, select, textarea {
  width: 100%;
  min-height: 44px;
  background: var(--field);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 0.7rem;
  padding: 0.55rem 0.75rem;
}
button, a {
  color: var(--blue);
}
button {
  min-height: 44px;
  padding: 0.55rem 0.9rem;
  border-radius: 0.8rem;
  background: var(--field);
  border: 0;
  cursor: pointer;
  touch-action: manipulation;
}
button.primary {
  background: var(--blue);
  color: var(--active);
  font-weight: 650;
}
button:disabled {
  opacity: 0.5;
  cursor: wait;
}
.actions {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}
.actions > * {
  flex: 1;
}
button:focus-visible, input:focus-visible, textarea:focus-visible, select:focus-visible, a:focus-visible {
  outline: 3px solid var(--blue);
  outline-offset: 2px;
}
button:active {
  opacity: 0.78;
}
code, output, .break {
  overflow-wrap: anywhere;
}
output {
  font-size: 1.15rem;
}
code {
  display: block;
  background: var(--field);
  border-radius: 0.7rem;
  padding: 0.7rem;
}
.status:not(:empty) {
  margin-top: 1rem;
}
.phrase {
  padding: 1rem;
  background: var(--field);
  line-height: 1.9;
  border-radius: 0.9rem;
}
.record {
  display: grid;
  gap: 0.4rem;
  padding: 0.8rem;
  background: var(--field);
  border-radius: 0.8rem;
}
@media (prefers-reduced-motion: no-preference) {
  button {
    transition: transform 0.12s ease, background-color 0.15s ease;
  }
  button:active {
    transform: scale(0.98);
  }
}
@media (max-width: 480px) {
  body {
    padding: 0;
  }
  main {
    min-height: 100dvh;
    border-radius: 0;
  }
}
#screen canvas {
  justify-self: center;
  width: min(100%, 17rem);
  height: auto;
  image-rendering: pixelated;
}
