:root {
  color-scheme: light;
  --ink: #15171a;
  --muted: #606872;
  --line: #d9dee4;
  --panel: #ffffff;
  --soft: #f2f5f7;
  --accent: #0b6b63;
  --accent-strong: #084f49;
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: #f8f8f4;
  color: var(--ink);
}

button,
textarea,
input {
  font: inherit;
}

a {
  color: var(--accent);
  text-underline-offset: 3px;
}

a:hover {
  color: var(--accent-strong);
}

.shell {
  width: min(880px, calc(100% - 32px));
  margin: 0 auto;
  padding: 46px 0 34px;
}

.intro {
  margin-bottom: 26px;
}

h1,
h2,
h3,
h4,
p {
  margin-top: 0;
}

h1 {
  max-width: 740px;
  margin-bottom: 16px;
  font-size: clamp(3rem, 8vw, 5.7rem);
  line-height: 0.95;
  letter-spacing: 0;
}

.lede {
  max-width: 720px;
  color: #343a40;
  font-size: 1.08rem;
  line-height: 1.55;
}

.tool {
  margin-top: 18px;
}

.input-panel,
.result {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.input-panel {
  padding: 18px;
}

label {
  display: block;
  font-weight: 760;
  margin-bottom: 8px;
}

textarea {
  width: 100%;
  min-height: 190px;
  resize: vertical;
  border: 1px solid #b8c1ca;
  border-radius: 6px;
  padding: 14px;
  color: #0e161b;
  background: #fbfcfd;
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  line-height: 1.55;
}

textarea:focus {
  outline: 3px solid rgba(11, 107, 99, 0.18);
  border-color: var(--accent);
}

.controls {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
  margin-top: 14px;
}

.controls button {
  border: 0;
  background: var(--accent);
  color: #fff;
  border-radius: 6px;
  padding: 10px 14px;
  cursor: pointer;
  font-weight: 720;
}

.controls button:hover {
  background: var(--accent-strong);
}

.collect {
  display: flex;
  gap: 8px;
  align-items: center;
  margin: 0;
  color: #384047;
  font-weight: 620;
}

.results-header {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: end;
  margin-top: 30px;
  border-bottom: 1px solid var(--line);
  padding-bottom: 10px;
}

.results-header h2 {
  margin-bottom: 0;
  font-size: 1.2rem;
}

.results-header p {
  margin-bottom: 0;
  color: var(--muted);
}

.results {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 18px;
  margin-top: 18px;
}

.result {
  padding: 22px;
}

.algorithm {
  margin-bottom: 8px;
  color: var(--accent);
  font-weight: 820;
}

.result h3 {
  margin-bottom: 16px;
  overflow-wrap: anywhere;
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  font-size: 1.08rem;
  line-height: 1.45;
}

.uniform {
  margin-bottom: 12px;
  color: #30373d;
  font-size: 1.06rem;
  line-height: 1.58;
  overflow-wrap: anywhere;
}

.best {
  margin-bottom: 20px;
  padding: 12px 14px;
  border-left: 4px solid var(--accent);
  background: var(--soft);
  color: #24292f;
  font-weight: 700;
  line-height: 1.45;
}

.result h4 {
  margin-bottom: 10px;
  font-size: 0.98rem;
}

.axes {
  display: grid;
  gap: 0;
  margin: 0;
  padding-left: 1.4rem;
}

.axes li {
  padding: 12px 0;
  border-top: 1px solid #e4e8ec;
}

.axes li:first-child {
  border-top: 0;
}

.axis-label {
  display: block;
  color: #24292e;
  line-height: 1.4;
}

.axis-label code {
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  overflow-wrap: anywhere;
}

.axis-probability {
  display: block;
  margin-top: 5px;
  color: var(--muted);
  font-size: 0.93rem;
  line-height: 1.45;
}

.closing {
  margin-top: 30px;
  max-width: 760px;
}

.closing p {
  color: var(--muted);
  line-height: 1.6;
}

footer {
  margin-top: 30px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.94rem;
}

.error {
  border-color: #e4b8c0;
  background: #fff7f8;
}

@media (max-width: 700px) {
  .shell {
    width: min(100% - 24px, 880px);
    padding-top: 30px;
  }

  .results-header {
    display: block;
  }

  .results-header h2 {
    margin-bottom: 6px;
  }

  .controls {
    align-items: stretch;
  }
}
