:root {
  --bg: #f7f7f5;
  --text: #1f1d1a;
  --muted: #5f5a52;
  --card: #ffffff;
  --line: #cfd3dc;
  --accent: #2f46c8;
  --warn: #9a5b00;
  --limit: #b42318;
  color-scheme: light dark;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0f1218;
    --text: #e9ecf2;
    --muted: #9aa3b5;
    --card: #171b24;
    --line: #333b4d;
    --accent: #8fa2ff;
    --warn: #f2b880;
    --limit: #ff8a80;
  }
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: system-ui, -apple-system, "Segoe UI", sans-serif;
  color: var(--text);
  background: var(--bg);
}

.page {
  max-width: 460px;
  margin: 0 auto;
  padding: 2rem 1.25rem;
}

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

.form {
  padding: 1.25rem;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 12px;
}

.label {
  display: block;
  margin-bottom: 0.4rem;
  font-weight: 600;
}

.textarea {
  display: block;
  width: 100%;
  padding: 0.65rem 0.75rem;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--bg);
  color: var(--text);
  font: inherit;
  line-height: 1.5;
  resize: vertical;
}

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

.row {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  margin-top: 0.4rem;
  font-size: 0.88rem;
}

.hint,
.counter {
  margin: 0;
  color: var(--muted);
}

.counter {
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.counter.is-warning {
  color: var(--warn);
  font-weight: 600;
}

.counter.is-limit {
  color: var(--limit);
  font-weight: 700;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}
