:root {
  --bg: #f1f5f2;
  --ink: #18332b;
  --muted: #465c53;
  --green: #146144;
  --line: #afc3b7;
  --soft: #e6eee8;
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font:
    16px/1.65 system-ui,
    -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    sans-serif;
}
header {
  background: #173b2e;
  color: white;
  padding: 18px max(24px, calc((100vw - 1160px) / 2));
  display: flex;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  font-size: 14px;
  font-weight: 650;
}
header span:last-child,
.eyebrow {
  font:
    700 12px/1.6 ui-monospace,
    monospace;
  letter-spacing: 0.1em;
}
main {
  max-width: 1160px;
  padding: 34px 24px;
  margin: auto;
}
.intro {
  max-width: 900px;
  padding: 12px 0 20px;
}
.eyebrow {
  color: var(--muted);
}
h1 {
  font-size: clamp(38px, 5.2vw, 60px);
  letter-spacing: -0.045em;
  line-height: 1.1;
  margin: 12px 0 20px;
}
h2 {
  font-size: 23px;
  line-height: 1.3;
  margin: 0 0 15px;
}
.lead {
  font-size: 22px;
  line-height: 1.5;
}
p {
  margin: 12px 0 20px;
}
.callout {
  padding: 18px;
  background: var(--soft);
  border-left: 4px solid var(--green);
}
.metrics {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
  margin: 22px 0;
}
.metrics > div {
  padding: 18px;
  background: white;
  border: 1px solid var(--line);
  border-radius: 8px;
  min-width: 0;
}
.metrics strong {
  display: block;
  font-size: 30px;
  line-height: 1.2;
  margin-bottom: 12px;
}
.metrics span {
  color: var(--muted);
  font-size: 14px;
}
.layout {
  display: grid;
  grid-template-columns: minmax(0, 1.55fr) minmax(0, 1fr);
  gap: 22px;
}
.panel {
  min-width: 0;
  background: white;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 26px;
  margin: 0 0 22px;
}
.section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
}
.section-head h2 {
  margin-bottom: 0;
}
label {
  display: block;
  font-weight: 700;
  margin: 20px 0 8px;
}
textarea {
  display: block;
  width: 100%;
  resize: vertical;
  min-height: 280px;
  font:
    14px/1.6 ui-monospace,
    monospace;
  padding: 15px;
  border: 1px solid #668173;
  border-radius: 6px;
  color: var(--ink);
  background: #f8faf9;
}
button,
#download {
  min-height: 46px;
  padding: 11px 16px;
  font:
    600 16px/1.4 system-ui,
    sans-serif;
  border: 1px solid var(--green);
  background: var(--green);
  color: white;
  border-radius: 6px;
  cursor: pointer;
  margin: 12px 8px 8px 0;
  display: inline-flex;
  align-items: center;
  text-decoration: none;
}
#example {
  background: white;
  color: var(--green);
}
button:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}
button:focus-visible,
textarea:focus-visible,
a:focus-visible,
summary:focus-visible {
  outline: 3px solid #116da0;
  outline-offset: 3px;
}
a {
  color: #10593d;
}
pre {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  background: var(--soft);
  border-radius: 6px;
  padding: 16px;
  font-size: 13px;
}
code {
  overflow-wrap: anywhere;
}
summary {
  min-height: 44px;
  line-height: 1.6;
  padding: 12px 0;
  cursor: pointer;
  font-weight: 650;
}
img {
  display: block;
  width: 100%;
  height: auto;
}
footer {
  font-size: 14px;
  color: var(--muted);
  padding: 14px 0 24px;
}
.error {
  color: #a52317;
}
.small {
  font-size: 14px;
  color: var(--muted);
}
#result .metrics {
  grid-template-columns: repeat(3, 1fr);
}
#target {
  overflow-wrap: anywhere;
}
[hidden] {
  display: none !important;
}
@media (max-width: 750px) {
  main {
    padding: 24px 16px;
  }
  .layout {
    grid-template-columns: 1fr;
    gap: 0;
  }
  .panel {
    padding: 20px;
  }
  .metrics {
    grid-template-columns: 1fr 1fr;
  }
  .metrics strong {
    font-size: 28px;
  }
  #result .metrics {
    grid-template-columns: 1fr;
  }
  .lead {
    font-size: 20px;
  }
  header {
    padding: 16px;
  }
  h2 {
    font-size: 21px;
  }
  textarea {
    font-size: 13px;
  }
}
@media (prefers-reduced-motion: no-preference) {
  button {
    transition: filter 0.15s;
  }
  button:hover {
    filter: brightness(0.94);
  }
}
