* { box-sizing: border-box; }
:root {
  color-scheme: light;
  --paper: #f0f5fd;
  --panel: #ffffff;
  --ink: #18263b;
  --muted: #4a5b74;
  --line: #97abc6;
  --accent: #2049ae;
  --result: #edf3ff;
  font: 16px/1.5 "Segoe UI", system-ui, sans-serif;
  color: var(--ink);
  background: var(--paper);
}
body { margin: 0; }
main { max-width: 66rem; margin: 0 auto; padding: clamp(2rem, 6vw, 5rem) 1.1rem 3rem; }
.intro { margin-bottom: 1.9rem; }
h1 { margin: 0; font-size: clamp(2.45rem, 7vw, 4.65rem); line-height: 1.06; letter-spacing: -.06em; }
.intro p { margin: .8rem 0 0; color: var(--muted); max-width: 32rem; }
.bench { overflow: hidden; background: var(--panel); border: 1px solid var(--line); border-radius: .85rem; }
.controls, .actions { display: flex; flex-wrap: wrap; gap: .8rem 1rem; padding: 1rem; align-items: end; }
.controls label { display: grid; gap: .3rem; }
label, button { font-weight: 600; font-size: .9rem; }
button, select {
  min-height: 2.75rem;
  padding: .4rem .75rem;
  border: 1px solid var(--line);
  border-radius: .4rem;
  background: var(--panel);
  color: var(--ink);
  font-family: inherit;
}
button { cursor: pointer; }
button:hover:not(:disabled) { border-color: var(--accent); }
button:disabled { opacity: .55; cursor: default; }
.primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.primary:hover { background: #15378d; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
.editors { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); border-block: 1px solid var(--line); }
.editor { min-width: 0; padding: .8rem 1rem; }
.editor label { display: flex; justify-content: space-between; gap: .5rem; align-items: baseline; }
.result { background: var(--result); border-left: 1px solid var(--line); }
.count { color: var(--muted); font-weight: 400; font-size: .8rem; }
textarea {
  display: block;
  width: 100%;
  min-height: 10rem;
  margin-top: .5rem;
  padding: .5rem;
  resize: vertical;
  border: 1px solid transparent;
  border-radius: .25rem;
  background: transparent;
  color: var(--ink);
  font: .95rem/1.65 "Cascadia Mono", Consolas, monospace;
}
textarea:hover { border-color: var(--line); }
.actions { align-items: center; }
#status { margin: 0; color: var(--muted); font-size: .9rem; }
#status.error { color: #a12f36; }
.reference { margin-top: 1.75rem; }
h2 { font-size: 1.2rem; margin: 0 0 .5rem; }
dl { margin: 0; }
dl div { display: grid; grid-template-columns: 9.5rem 1fr; gap: 1rem; padding: .65rem 0; border-top: 1px solid var(--line); }
dt { font-weight: 650; }
dd { margin: 0; color: var(--muted); max-width: 52ch; }
@media (max-width: 38rem) {
  .editors { grid-template-columns: 1fr; }
  .result { border-left: 0; border-top: 1px solid var(--line); }
  textarea { min-height: 7rem; }
  dl div { grid-template-columns: 1fr; gap: .2rem; }
}
