/* textcleanups.com */
@font-face { font-family: "Atkinson Hyperlegible"; font-weight: 400; font-style: normal; font-display: swap; src: url(/assets/fonts/atkinson-400.woff2) format("woff2"); }
@font-face { font-family: "Atkinson Hyperlegible"; font-weight: 700; font-style: normal; font-display: swap; src: url(/assets/fonts/atkinson-700.woff2) format("woff2"); }
@font-face { font-family: "Atkinson Hyperlegible"; font-weight: 400; font-style: italic; font-display: swap; src: url(/assets/fonts/atkinson-400-italic.woff2) format("woff2"); }
@font-face { font-family: "IBM Plex Mono"; font-weight: 400; font-style: normal; font-display: swap; src: url(/assets/fonts/plex-mono-400.woff2) format("woff2"); }

:root {
  --paper: #F7F9FB;
  --sheet: #FFFFFF;
  --ink: #18222F;
  --ink-soft: #4A5868;
  --pencil: #2266A3;
  --pencil-deep: #174E80;
  --wash: #E3EEF8;
  --rule: #CCD8E4;
  --rule-faint: #E4ECF3;
  --error: #A3342A;
  --sans: "Atkinson Hyperlegible", system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, "SFMono-Regular", Consolas, monospace;
  --measure: 68ch;
  --radius: 6px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --paper: #131C27;
    --sheet: #18232F;
    --ink: #E6EDF4;
    --ink-soft: #A9B7C6;
    --pencil: #7DB6EC;
    --pencil-deep: #A8CFF4;
    --wash: #1D2E40;
    --rule: #33465A;
    --rule-faint: #223243;
    --error: #F0948A;
    color-scheme: dark;
  }
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font: 400 1.0625rem/1.6 var(--sans);
  text-rendering: optimizeLegibility;
}
a { color: var(--pencil); text-underline-offset: 0.18em; text-decoration-thickness: 1px; }
a:hover { color: var(--pencil-deep); text-decoration-thickness: 2px; }
:focus-visible { outline: 3px solid var(--pencil); outline-offset: 2px; border-radius: 2px; }
.skip { position: absolute; left: -999px; top: 0; background: var(--ink); color: var(--paper); padding: .5rem 1rem; z-index: 10; }
.skip:focus { left: 1rem; top: 1rem; }

.wrap { width: min(1120px, 100% - 32px); margin-inline: auto; }

/* header */
.site-head { border-bottom: 1px solid var(--rule); background: var(--sheet); }
.site-head .wrap { display: flex; align-items: center; justify-content: space-between; gap: 1rem; min-height: 60px; }
.brand { display: inline-flex; align-items: center; gap: .55rem; color: var(--ink); text-decoration: none; font-weight: 700; font-size: 1.15rem; letter-spacing: -0.01em; }
.brand:hover { color: var(--ink); }
.brand svg { width: 28px; height: 28px; flex: none; }
.site-head nav a { font-weight: 700; text-decoration: none; }
.site-head nav a:hover { text-decoration: underline; }

/* page head */
main { padding-block: 2rem 4rem; }
.crumbs { font-size: .9rem; color: var(--ink-soft); margin-bottom: .75rem; }
.crumbs a { color: var(--ink-soft); }
h1 { font-size: clamp(1.9rem, 1.4rem + 2vw, 2.75rem); line-height: 1.12; letter-spacing: -0.02em; margin: 0 0 .5rem; max-width: 22ch; }
.home h1 { max-width: 18ch; }
.lede { font-size: 1.15rem; color: var(--ink-soft); margin: 0 0 1.75rem; max-width: 60ch; }

/* tool */
.tool { margin-bottom: 1rem; }
.panes { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.pane { display: flex; flex-direction: column; min-width: 0; }
.pane-label { font-weight: 700; font-size: .95rem; margin-bottom: .35rem; }
textarea {
  width: 100%;
  min-height: 300px;
  resize: vertical;
  padding: 12px 14px;
  font: 400 .95rem/24px var(--mono);
  color: var(--ink);
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  tab-size: 4;
}
textarea.input {
  background-color: var(--sheet);
  background-image: repeating-linear-gradient(to bottom, transparent 0 23px, var(--rule-faint) 23px 24px);
  background-position: 0 12px;
  background-attachment: local;
}
textarea.output { background: var(--wash); border-color: transparent; }
textarea:focus { border-color: var(--pencil); outline: none; box-shadow: 0 0 0 2px var(--pencil); }
textarea::placeholder { color: var(--ink-soft); opacity: .8; }

.stats { margin: 0; display: grid; grid-template-columns: repeat(2, 1fr); align-content: start; gap: 1px; background: var(--rule); border-radius: var(--radius); overflow: hidden; min-height: 300px; }
.stats div { background: var(--wash); padding: .9rem 1rem; display: flex; flex-direction: column-reverse; justify-content: flex-end; }
.stats dd { margin: 0; font-size: 1.75rem; font-weight: 700; line-height: 1.1; font-variant-numeric: tabular-nums; }
.stats dt { color: var(--ink-soft); font-size: .9rem; }
.stats div:first-child { grid-column: 1 / -1; }
.stats div:first-child dd { font-size: 2.75rem; color: var(--pencil); }

/* options */
.opts { border: 0; margin: 1rem 0 0; padding: 0; display: flex; flex-wrap: wrap; gap: .6rem 1.5rem; align-items: center; }
.opts legend { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.check { display: inline-flex; align-items: center; gap: .45rem; cursor: pointer; }
.check input { width: 1.1rem; height: 1.1rem; accent-color: var(--pencil); margin: 0; }
.field { display: inline-flex; flex-direction: column; gap: .2rem; font-weight: 700; font-size: .95rem; }
.field input, .field select {
  font: 400 1rem var(--sans); color: var(--ink); background: var(--sheet);
  border: 1px solid var(--rule); border-radius: var(--radius); padding: .5rem .65rem; min-width: 14rem;
}
.field input:focus, .field select:focus { border-color: var(--pencil); outline: none; box-shadow: 0 0 0 2px var(--pencil); }
.fields { display: flex; flex-wrap: wrap; gap: .75rem 1rem; width: 100%; }
.seg { display: inline-flex; flex-wrap: wrap; gap: 0; border: 1px solid var(--rule); border-radius: var(--radius); overflow: hidden; background: var(--sheet); }
.seg label { position: relative; cursor: pointer; }
.seg input { position: absolute; opacity: 0; width: 1px; height: 1px; margin: 0; }
.seg span { display: block; padding: .5rem .8rem; border-right: 1px solid var(--rule); font-size: .95rem; white-space: nowrap; }
.seg label:last-child span { border-right: 0; }
.seg input:checked + span { background: var(--pencil); color: var(--sheet); font-weight: 700; }
.seg input:focus-visible + span { outline: 3px solid var(--pencil); outline-offset: -3px; }
.seg-wrap { display: flex; flex-direction: column; align-items: flex-start; gap: .3rem; width: 100%; }
.seg-wrap > span { font-weight: 700; font-size: .95rem; }

/* action bar */
.bar { display: flex; flex-wrap: wrap; align-items: center; gap: .6rem; margin-top: 1rem; padding-top: 1rem; border-top: 1px solid var(--rule); }
.note { margin: 0 auto 0 0; font-weight: 700; color: var(--pencil); min-height: 1.6em; display: flex; align-items: center; gap: .4rem; }
.note:not(:empty)::before {
  content: ""; width: 14px; height: 10px; flex: none;
  border-left: 2px solid currentColor; border-bottom: 2px solid currentColor;
  transform: rotate(-45deg) translate(1px, -2px);
}
.note.error { color: var(--error); }
.note.error::before { border: 0; width: 6px; height: 6px; border-radius: 50%; background: currentColor; transform: none; }
button {
  font: 700 .95rem var(--sans); cursor: pointer; border-radius: var(--radius);
  padding: .6rem 1rem; border: 1px solid var(--rule); background: var(--sheet); color: var(--ink);
}
button:hover { border-color: var(--ink-soft); }
button.primary { background: var(--pencil); border-color: var(--pencil); color: var(--sheet); min-width: 8.5rem; }
button.primary:hover { background: var(--pencil-deep); border-color: var(--pencil-deep); }
.private { font-size: .9rem; color: var(--ink-soft); margin: .75rem 0 0; }

/* ads: hidden until an ad network fills it */
.ad-slot:empty { display: none; }
.ad-slot { margin: 2.5rem 0; min-height: 100px; }

/* content */
.content { margin-top: 3.5rem; display: grid; grid-template-columns: minmax(0, var(--measure)) minmax(220px, 1fr); gap: 3rem; align-items: start; }
.guide h2, .faq h2 { font-size: 1.5rem; line-height: 1.2; letter-spacing: -0.01em; margin: 2.25rem 0 .6rem; }
.guide > :first-child { margin-top: 0; }
.guide h3 { font-size: 1.15rem; margin: 1.5rem 0 .4rem; }
.guide p, .guide li { max-width: var(--measure); }
.guide ol, .guide ul { padding-left: 1.3rem; }
.guide li { margin-bottom: .35rem; }
.guide code { font: .92em var(--mono); background: var(--wash); padding: .1em .35em; border-radius: 4px; }
.guide table { border-collapse: collapse; width: 100%; font-size: .95rem; margin: 1rem 0; }
.guide th, .guide td { text-align: left; padding: .5rem .6rem; border-bottom: 1px solid var(--rule); vertical-align: top; }
.guide th { font-weight: 700; }
.faq details { border-bottom: 1px solid var(--rule); }
.faq summary { cursor: pointer; font-weight: 700; padding: .85rem 0; list-style-position: outside; }
.faq details[open] summary { color: var(--pencil); }
.faq details p { margin: 0 0 1rem; max-width: var(--measure); }

.aside { position: sticky; top: 1.5rem; border-left: 2px solid var(--pencil); padding-left: 1.25rem; }
.aside h2 { font-size: 1rem; margin: 0 0 .6rem; }
.aside ul { list-style: none; margin: 0 0 1.5rem; padding: 0; }
.aside li { margin-bottom: .45rem; }
.aside a { text-decoration: none; }
.aside a:hover { text-decoration: underline; }

/* home directory */
.directory { margin-top: 4rem; }
.directory > h2 { font-size: 1.75rem; letter-spacing: -0.015em; margin: 0 0 1.5rem; }
.groups { display: grid; grid-template-columns: repeat(3, 1fr); gap: 2rem 2.5rem; }
.group h3 { font-size: 1.05rem; margin: 0 0 .75rem; padding-bottom: .5rem; border-bottom: 2px solid var(--ink); }
.group dl { margin: 0; }
.group dt { margin-top: .9rem; }
.group dt a { font-weight: 700; font-size: 1.05rem; }
.group dd { margin: .15rem 0 0; color: var(--ink-soft); font-size: .95rem; }

.prose { max-width: var(--measure); }
.prose h2 { font-size: 1.5rem; margin: 2.25rem 0 .6rem; }

/* footer */
.site-foot { border-top: 1px solid var(--rule); background: var(--sheet); padding-block: 2rem; font-size: .95rem; color: var(--ink-soft); }
.site-foot .wrap { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 1rem; }
.site-foot nav { display: flex; flex-wrap: wrap; gap: 1.25rem; }
.site-foot a { color: var(--ink-soft); }
.site-foot p { margin: 0; }

@media (max-width: 900px) {
  .content { grid-template-columns: 1fr; gap: 2rem; }
  .aside { position: static; }
  .groups { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 700px) {
  main { padding-top: 1.25rem; }
  .panes { grid-template-columns: 1fr; }
  textarea { min-height: 200px; }
  .stats { min-height: 0; }
  .groups { grid-template-columns: 1fr; }
  .bar .note { flex-basis: 100%; }
  .field input, .field select { min-width: 0; width: 100%; }
  .field { flex: 1 1 100%; }
}
@media (prefers-reduced-motion: reduce) { * { scroll-behavior: auto !important; transition: none !important; } }
