/**
 * Copyright 2025 Google LLC
 * SPDX-License-Identifier: Apache-2.0
 */

:root {
  color-scheme: dark light;
}

html {
  box-sizing: border-box;
}

*,
*:before,
*:after {
  box-sizing: inherit;
}

body {
  font-family: system-ui, sans-serif;
  max-width: clamp(320px, 90%, 1000px);
  margin: auto;
}

body,
form {
  display: flex;
  flex-direction: column;
}

label {
  font-weight: bold;
}

[contenteditable],
output {
  display: block;
  width: 30em;
  height: 15ex;
  min-height: fit-content;
  border: solid 1px CanvasText;
}

button {
  display: block;
  margin-block: 1ex;
  width: max-content;
}

.error {
  background-color: red;
  color: white;
  padding: 1rem;
  width: fit-content;
}

.error a {
  color: white;
}

:popover-open {
  inset: unset;
  position: absolute;
}

:popover-open h1 {
  margin-block-end: 0.5rem;
  font-size: 1.1rem;
}

:popover-open button {
  display: unset;
  appearance: none;
  font-size: inherit;
  border: none;
  background-color: transparent;
}

:popover-open button:hover {
  outline-color: rgb(153, 200, 255);
  outline-style: auto;
  outline-width: 1px;
}

::highlight(spelling) {
  text-decoration-color: light-dark(purple, yellow) ;
  text-decoration-line: underline;
  text-decoration-style: wavy;
}

::highlight(punctuation) {
  text-decoration-color: red;
  text-decoration-line: underline;
  text-decoration-style: wavy;
}

::highlight(capitalization) {
  text-decoration-color: lime;
  text-decoration-line: underline;
  text-decoration-style: wavy;
}

::highlight(preposition) {
  text-decoration-color: orange;
  text-decoration-line: underline;
  text-decoration-style: wavy;
}

::highlight(missing-words) {
  text-decoration-color: deeppink;
  text-decoration-line: underline;
  text-decoration-style: wavy;
}

::highlight(grammar) {
  text-decoration-color: light-dark(blue, lightblue);
  text-decoration-line: underline;
  text-decoration-style: wavy;
}

footer {
  margin-block: 1rem;
}
