* {
  box-sizing: border-box;
}

body {
  margin: 0;
  padding: 24px;
  font-family: Arial, sans-serif;
}

main {
  max-width: 900px;
}

h1 {
  margin: 0 0 8px;
  font-size: 24px;
  line-height: 1.2;
}

h2 {
  margin: 0;
  font-size: 18px;
}

p {
  margin-top: 0;
}

form {
  display: grid;
  gap: 8px;
  margin-top: 16px;
}

label {
  font-weight: bold;
}

textarea {
  width: 100%;
  min-height: 220px;
  resize: vertical;
  padding: 8px;
  font: inherit;
  line-height: 1.4;
}

button {
  padding: 4px 10px;
  font: inherit;
  cursor: pointer;
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.52;
}

.controls,
.output-heading {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
}

.error {
  color: red;
}

section {
  margin-top: 24px;
}

footer {
  margin-top: 24px;
}

.output {
  min-height: 160px;
  margin-top: 8px;
  border: 1px solid #ccc;
  padding: 8px;
  line-height: 1.5;
  white-space: pre-wrap;
}

mark {
  position: relative;
}

mark:hover::after,
mark:focus::after {
  content: attr(data-label);
  position: absolute;
  left: 0;
  bottom: 100%;
  z-index: 5;
  width: max-content;
  max-width: 220px;
  padding: 2px 4px;
  background: #000;
  color: white;
  font-size: 12px;
  white-space: nowrap;
}

.em-dash {
  background: yellow;
}

.negative-parallelisms {
  background: lightblue;
}

.tricolon {
  background: lightgreen;
}

.generic-transition {
  background: plum;
}

.abstract-language {
  background: lightsalmon;
}

.over-symmetry {
  background: paleturquoise;
}

.superficial-emphasis-connectors {
  background: khaki;
}

.avoidance-of-basic-copulatives {
  background: lightskyblue;
}

.extreme-figurative-language {
  background: orange;
}

.ai-cliche {
  background: pink;
}

@media (max-width: 720px) {
  .controls,
  .output-heading {
    align-items: stretch;
    flex-direction: column;
  }
}
