:root {
  --ink: #003230;
  --paper: #f7f5f3;
  --field: #ffffff;
  --line: #d7e0dc;
  --accent: #78ffaf;
  --accent-ink: #003230;
  --error: #a0001b;
  --focus: #0a6cff;
  color-scheme: light dark;
  color: var(--ink);
  background: var(--paper);
  font-family: "Segoe UI", system-ui, sans-serif;
  font-size: 14px;
}

body {
  margin: 0;
  padding: 16px;
  background: var(--paper);
}

header {
  margin-bottom: 14px;
}

header h1 {
  margin: 0;
  font-size: 22px;
  font-weight: 650;
}

.mark {
  margin: 0;
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.note {
  margin: 4px 0 0;
  font-size: 12px;
  opacity: 0.8;
}

.review {
  margin-top: 16px;
}

.review h2 {
  margin: 0 0 6px;
  font-size: 16px;
}

.check input {
  width: auto;
}

.check {
  flex-direction: row;
  align-items: center;
  gap: 8px;
  margin: 8px 0;
}

form,
label {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

form {
  gap: 10px;
}

.row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 8px;
}

input,
select,
textarea,
button {
  font: inherit;
  color: inherit;
}

input,
select,
textarea {
  box-sizing: border-box;
  width: 100%;
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 8px;
  background: var(--field);
}

textarea {
  width: 100%;
  box-sizing: border-box;
  resize: vertical;
}

.browser-only {
  margin-top: 10px;
}

.row .browser-only {
  margin-top: 0;
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}

button {
  border: 0;
  border-radius: 999px;
  padding: 8px 12px;
  background: var(--accent);
  color: var(--accent-ink);
  cursor: pointer;
}

button.secondary {
  background: transparent;
  color: inherit;
  border: 1px solid currentColor;
}

#result {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  background: var(--field);
  border-radius: 8px;
  min-height: 4em;
  padding: 10px;
  margin-top: 12px;
}

#status {
  min-height: 1.2em;
}

body[data-host="word"] .browser-only {
  display: none;
}

.word-only {
  display: none;
}

body[data-host="word"] .word-only {
  display: inline-block;
}

button {
  white-space: nowrap;
}

.word-only-block {
  display: none;
}

body[data-host="word"] .word-only-block {
  display: block;
}

body[data-host="word"] label.check.word-only-block {
  display: flex;
}

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

button:disabled {
  opacity: 0.55;
  cursor: progress;
}

body[data-busy="true"] #result {
  opacity: 0.6;
}

@media (prefers-color-scheme: dark) {
  :root {
    --ink: #e6f4ee;
    --paper: #0f2524;
    --field: #163432;
    --line: #2e4e4b;
    --error: #ff9aa8;
    --focus: #7fb4ff;
  }
}

:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 2px;
}
