@font-face {
  font-family: 'IBM Plex Sans';
  font-style: normal;
  font-display: swap;
  font-weight: 400;
  src: url(fonts/ibm-plex-sans-cyrillic-400-normal.woff2) format('woff2');
  unicode-range: U+0301,U+0400-045F,U+0490-0491,U+04B0-04B1,U+2116;
}
@font-face {
  font-family: 'IBM Plex Sans';
  font-style: normal;
  font-display: swap;
  font-weight: 400;
  src: url(fonts/ibm-plex-sans-latin-400-normal.woff2) format('woff2');
  unicode-range: U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD;
}
@font-face {
  font-family: 'IBM Plex Sans';
  font-style: normal;
  font-display: swap;
  font-weight: 500;
  src: url(fonts/ibm-plex-sans-cyrillic-500-normal.woff2) format('woff2');
  unicode-range: U+0301,U+0400-045F,U+0490-0491,U+04B0-04B1,U+2116;
}
@font-face {
  font-family: 'IBM Plex Sans';
  font-style: normal;
  font-display: swap;
  font-weight: 500;
  src: url(fonts/ibm-plex-sans-latin-500-normal.woff2) format('woff2');
  unicode-range: U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD;
}
@font-face {
  font-family: 'IBM Plex Mono';
  font-style: normal;
  font-display: swap;
  font-weight: 400;
  src: url(fonts/ibm-plex-mono-cyrillic-400-normal.woff2) format('woff2');
  unicode-range: U+0301,U+0400-045F,U+0490-0491,U+04B0-04B1,U+2116;
}
@font-face {
  font-family: 'IBM Plex Mono';
  font-style: normal;
  font-display: swap;
  font-weight: 400;
  src: url(fonts/ibm-plex-mono-latin-400-normal.woff2) format('woff2');
  unicode-range: U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD;
}
@font-face {
  font-family: 'IBM Plex Mono';
  font-style: normal;
  font-display: swap;
  font-weight: 500;
  src: url(fonts/ibm-plex-mono-cyrillic-500-normal.woff2) format('woff2');
  unicode-range: U+0301,U+0400-045F,U+0490-0491,U+04B0-04B1,U+2116;
}
@font-face {
  font-family: 'IBM Plex Mono';
  font-style: normal;
  font-display: swap;
  font-weight: 500;
  src: url(fonts/ibm-plex-mono-latin-500-normal.woff2) format('woff2');
  unicode-range: U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD;
}
:root {
  --ground: #f5f4f0;
  --face: #e9e6e0;
  --ink: #191919;
  --quiet: #5c5c5c;
  --faint: #a8a8a8;
  --line: #cfcbc3;
  --signal: #e96a26;
  --wash: #f3e2d6;
  --sans: 'IBM Plex Sans', 'Helvetica Neue', Helvetica, Arial, sans-serif;
  --mono: 'IBM Plex Mono', ui-monospace, 'SF Mono', Menlo, Consolas, monospace;
  --bar: 48px;
  --head: 40px;
  color-scheme: light dark;
}

@media (prefers-color-scheme: dark) {
  :root {
    --ground: #171716;
    --face: #1f1e1d;
    --ink: #eceae4;
    --quiet: #a8a8a8;
    --faint: #6b6a67;
    --line: #353431;
    --signal: #f0783a;
    --wash: #3a271c;
  }
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  margin: 0;
  min-height: 100vh;
  min-height: 100dvh;
  background: var(--ground);
  color: var(--ink);
  font: 400 15px/1.5 var(--sans);
  -webkit-font-smoothing: antialiased;
}

h1,
h2,
p,
dl,
dd,
ul,
pre,
fieldset,
legend {
  margin: 0;
  padding: 0;
}

fieldset {
  min-inline-size: 0;
  border: 0;
}

ul {
  list-style: none;
}

a {
  color: inherit;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}

a:hover {
  text-decoration-color: var(--signal);
}

button,
input,
select,
textarea {
  color: inherit;
  font: inherit;
}

button,
select {
  cursor: pointer;
}

:focus-visible {
  outline: 2px solid var(--signal);
  outline-offset: 2px;
}

[hidden] {
  display: none !important;
}

.offscreen {
  position: fixed;
  top: 0;
  left: -9999px;
}

.label,
.tag,
.readout dt {
  color: var(--quiet);
  font: 500 11px/1.2 var(--sans);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px 16px;
  height: var(--bar);
  padding: 0 16px;
  border-bottom: 1px solid var(--line);
}

.name {
  display: flex;
  align-items: baseline;
  gap: 10px;
  min-width: 0;
  font: 500 13px/1.2 var(--mono);
  white-space: nowrap;
}

.links {
  display: flex;
  align-items: center;
  gap: 16px;
  font-size: 13px;
}

.bench {
  display: grid;
  grid-template-columns: 296px minmax(0, 1fr) minmax(0, 1fr);
  height: calc(100vh - var(--bar));
  min-height: 560px;
  border-bottom: 1px solid var(--line);
}
@supports (height: 1dvh) {
  .bench {
    height: calc(100dvh - var(--bar));
  }
}

.panel {
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 0;
}

.panel + .panel {
  border-left: 1px solid var(--line);
}

.controls {
  overflow-y: auto;
  background: var(--face);
}

.panel-head {
  display: flex;
  flex: none;
  align-items: center;
  gap: 12px;
  height: var(--head);
  padding: 0 16px;
  border-bottom: 1px solid var(--line);
}

.panel-head > .label {
  margin-right: auto;
}

.fields + .panel-head {
  border-top: 1px solid var(--line);
}

.fields {
  padding: 0 16px;
}

.field {
  display: block;
  padding: 12px 0;
  border-bottom: 1px solid var(--line);
}

.field:last-child {
  border-bottom: 0;
}

.field-head {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 20px;
}

.field legend {
  float: left;
  width: 100%;
}

.field legend + * {
  clear: both;
}

.option {
  font: 500 12.5px/1.2 var(--mono);
}

.hint {
  display: block;
  margin-top: 4px;
  color: var(--quiet);
  font-size: 12.5px;
  line-height: 1.4;
  text-wrap: pretty;
}

.field[data-off],
.field[data-off] .hint {
  color: var(--faint);
}

.segment {
  display: inline-flex;
  border: 1px solid var(--ink);
  border-radius: 2px;
}

.field .segment {
  display: flex;
  margin-top: 8px;
}

.segment > * {
  position: relative;
  flex: 1;
}

.segment > * + * {
  border-left: 1px solid var(--ink);
}

.segment input {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  margin: 0;
  opacity: 0;
  cursor: pointer;
}

.segment span,
.segment button {
  display: block;
  width: 100%;
  height: 28px;
  padding: 0 12px;
  border: 0;
  background: transparent;
  font: 400 12.5px/28px var(--mono);
  text-align: center;
  transition:
    background-color 0.1s,
    color 0.1s;
}

.segment label:hover span,
.segment button:hover {
  background: var(--line);
}

.segment input:checked + span,
.segment button[aria-pressed='true'] {
  background: var(--ink);
  color: var(--ground);
}

.segment input:focus-visible + span {
  outline: 2px solid var(--signal);
  outline-offset: 2px;
}

.field-head input {
  position: absolute;
  top: 0;
  right: 0;
  width: 36px;
  height: 20px;
  margin: 0;
  opacity: 0;
  cursor: pointer;
}

.switch {
  position: relative;
  flex: none;
  width: 36px;
  height: 20px;
  border: 1px solid var(--ink);
  border-radius: 2px;
}

.switch::before {
  position: absolute;
  top: 50%;
  right: calc(100% + 8px);
  color: var(--quiet);
  content: 'OFF';
  font: 500 10px/1 var(--mono);
  letter-spacing: 0.06em;
  transform: translateY(-50%);
}

.switch::after {
  position: absolute;
  top: 3px;
  left: 3px;
  width: 12px;
  height: 12px;
  border-radius: 1px;
  background: var(--faint);
  content: '';
  transition:
    transform 0.1s,
    background-color 0.1s;
}

input:checked + .switch::before {
  color: var(--ink);
  content: 'ON';
}

input:checked + .switch::after {
  background: var(--signal);
  transform: translateX(16px);
}

input:focus-visible + .switch {
  outline: 2px solid var(--signal);
  outline-offset: 2px;
}

input:disabled + .switch {
  border-color: var(--faint);
}

input:disabled + .switch::before {
  color: var(--faint);
}

input:disabled + .switch::after {
  background: var(--line);
}

.entry,
select,
.button {
  height: 28px;
  border: 1px solid var(--ink);
  border-radius: 2px;
  background-color: transparent;
  font-size: 12.5px;
}

.entry {
  display: block;
  width: 100%;
  height: 32px;
  margin-top: 8px;
  padding: 0 8px;
  background-color: var(--ground);
  font-family: var(--mono);
}

.entry::placeholder {
  color: var(--quiet);
  opacity: 1;
}

.pick {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

select {
  min-width: 0;
  max-width: 100%;
  padding: 0 28px 0 8px;
  appearance: none;
  background-image:
    linear-gradient(45deg, transparent 50%, currentColor 50%),
    linear-gradient(135deg, currentColor 50%, transparent 50%);
  background-position:
    calc(100% - 14px) 50%,
    calc(100% - 9px) 50%;
  background-repeat: no-repeat;
  background-size: 5px 5px;
  text-overflow: ellipsis;
}

.actions {
  display: flex;
  flex: none;
  gap: 8px;
  padding: 12px 16px 16px;
}

.button {
  flex: none;
  padding: 0 12px;
  white-space: nowrap;
  transition:
    background-color 0.1s,
    color 0.1s;
}

.actions .button {
  flex: 1;
}

.button:hover,
.button[data-done] {
  background-color: var(--ink);
  color: var(--ground);
}

.code {
  font: 400 13px/1.6 var(--mono);
  tab-size: 2;
}

textarea.code {
  flex: 1;
  width: 100%;
  min-height: 0;
  padding: 16px;
  overflow: auto;
  border: 0;
  border-radius: 0;
  background: transparent;
  outline-offset: -2px;
  resize: none;
  white-space: pre;
}

#result {
  flex: 1;
  min-height: 0;
  padding: 16px 0;
  overflow: auto;
  outline-offset: -2px;
}

.line {
  position: relative;
  display: block;
  width: max-content;
  min-width: 100%;
  padding: 0 16px 0 36px;
}

.line[data-written] {
  background: var(--wash);
}

.line[data-written]::before {
  position: absolute;
  left: 16px;
  color: var(--signal);
  content: '+';
  font-weight: 500;
}

.snippet {
  flex: none;
  padding: 12px 16px;
  font-size: 12px;
  line-height: 1.55;
  overflow-wrap: anywhere;
  white-space: pre-wrap;
}

.legend {
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--quiet);
  font-size: 12.5px;
  white-space: nowrap;
}

.mark {
  color: var(--signal);
  font: 500 13px/1 var(--mono);
}

.failure {
  flex: 1;
  min-height: 0;
  padding: 16px;
  overflow: auto;
}

.failure .label {
  color: var(--ink);
}

.failure .label::before {
  display: inline-block;
  width: 8px;
  height: 8px;
  margin-right: 8px;
  border-radius: 50%;
  background: var(--signal);
  content: '';
}

.failure-text {
  margin-top: 12px;
  font: 400 13px/1.6 var(--mono);
  overflow-wrap: anywhere;
  white-space: pre-wrap;
}

.notes {
  flex: none;
  max-height: 32%;
  padding: 12px 16px;
  overflow: auto;
  border-top: 1px solid var(--line);
  font-size: 12.5px;
  line-height: 1.5;
}

.notes ul {
  display: grid;
  gap: 4px;
  margin-top: 8px;
}

.notes code {
  font: 500 12px/1 var(--mono);
}

.readout {
  display: flex;
  flex: none;
  flex-wrap: wrap;
  gap: 8px 28px;
  padding: 12px 16px;
  border-top: 1px solid var(--line);
}

.readout div {
  display: grid;
  gap: 6px;
}

.readout dd {
  font: 500 14px/1 var(--mono);
  font-variant-numeric: tabular-nums;
}

.about {
  max-width: 72ch;
  margin: 0 auto;
  padding: 64px 16px 96px;
}

.about h2 {
  margin: 40px 0 8px;
  font: 500 20px/1.3 var(--sans);
}

.about h2:first-child {
  margin-top: 0;
}

.about p {
  font-size: 16px;
  line-height: 1.6;
  text-wrap: pretty;
}

.about .snippet {
  margin-top: 12px;
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: 2px;
  font-size: 13px;
  white-space: pre;
}

.more {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 24px;
  margin-top: 24px;
}

@media (max-width: 1100px) {
  .bench {
    grid-template-columns: 264px minmax(0, 1fr) minmax(0, 1fr);
  }

  .legend {
    display: none;
  }
}

@media (max-width: 860px) {
  .bar {
    flex-wrap: wrap;
    height: auto;
    min-height: var(--bar);
    padding-block: 10px;
  }

  .bench {
    display: flex;
    flex-direction: column;
    height: auto;
    min-height: 0;
  }

  .panel + .panel {
    border-top: 1px solid var(--line);
    border-left: 0;
  }

  .source {
    order: 1;
  }

  .result {
    order: 2;
  }

  .controls {
    order: 3;
    overflow: visible;
  }

  textarea.code {
    flex: none;
    height: 36vh;
    height: 36svh;
    min-height: 220px;
  }

  #result,
  .failure {
    flex: none;
    max-height: 70vh;
    max-height: 70svh;
  }

  .legend {
    display: flex;
  }

  .about {
    padding-top: 48px;
  }
}

@media (pointer: coarse) {
  .segment span,
  .segment button {
    height: 44px;
    line-height: 44px;
  }

  .entry,
  select,
  .button {
    height: 44px;
  }

  .entry,
  select,
  textarea.code {
    font-size: 16px;
  }

  .field {
    padding: 14px 0;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    transition: none !important;
  }
}
