:root {
  color: #17211a;
  background: #f3f5f0;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-synthesis: none;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-width: 320px;
}

button,
input,
select {
  font: inherit;
}

.topbar,
main,
footer {
  width: min(1180px, calc(100% - 32px));
  margin-inline: auto;
}

.topbar {
  min-height: 126px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid #cbd2c8;
}

.eyebrow {
  margin: 0 0 5px;
  color: #607067;
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
}

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

h1 {
  margin-bottom: 0;
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  font-size: 42px;
  line-height: 1;
  letter-spacing: 0;
}

h1 span {
  color: #b03a2e;
  font-size: 18px;
}

h2 {
  margin-bottom: 0;
  font-size: 20px;
  letter-spacing: 0;
}

.warning {
  margin: 0;
  padding: 7px 10px;
  color: #8b251d;
  border: 1px solid #d9a49f;
  background: #fff7f5;
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

main {
  padding-block: 26px 36px;
}

.controls {
  display: grid;
  grid-template-columns: minmax(180px, 0.8fr) minmax(240px, 1.4fr) minmax(150px, 0.6fr) auto;
  gap: 12px;
  align-items: end;
  margin-bottom: 22px;
}

label {
  display: grid;
  gap: 6px;
  color: #526158;
  font-size: 12px;
  font-weight: 700;
}

input,
select,
button {
  min-height: 42px;
  border: 1px solid #aeb9b0;
  border-radius: 4px;
  background: #ffffff;
  color: #17211a;
}

input,
select {
  width: 100%;
  padding: 9px 11px;
}

button {
  padding: 9px 16px;
  border-color: #234d37;
  background: #234d37;
  color: white;
  cursor: pointer;
  font-weight: 800;
}

button:hover,
button:focus-visible {
  background: #173927;
}

input:focus,
select:focus,
button:focus-visible {
  outline: 3px solid #f4b942;
  outline-offset: 2px;
}

.workspace {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 340px;
  gap: 28px;
  align-items: start;
}

.field-panel {
  min-width: 0;
}

.section-heading,
.snippet-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 12px;
}

#selected {
  color: #526158;
  font-family: "SFMono-Regular", Consolas, monospace;
  font-size: 12px;
  text-align: right;
}

.grid {
  display: grid;
  grid-template-columns: repeat(9, minmax(42px, 1fr));
  gap: 3px;
  aspect-ratio: 1;
  width: 100%;
  padding: 3px;
  background: #26312b;
  border: 1px solid #26312b;
}

.cell {
  position: relative;
  min-height: 0;
  min-width: 0;
  border: 0;
  border-radius: 0;
  padding: 4px;
  color: #102016;
  background: var(--cell-color);
  font-family: "SFMono-Regular", Consolas, monospace;
  font-size: 10px;
  font-weight: 800;
  line-height: 1.15;
  text-align: left;
  overflow: hidden;
}

.cell:hover,
.cell:focus-visible,
.cell[aria-pressed="true"] {
  z-index: 1;
  box-shadow: inset 0 0 0 3px #fff, inset 0 0 0 5px #17211a;
  outline: 0;
}

aside {
  display: grid;
  gap: 30px;
  border-left: 1px solid #cbd2c8;
  padding-left: 26px;
}

.result-block {
  min-height: 132px;
  border-top: 5px solid #b03a2e;
  padding-top: 14px;
}

.result-block h2 {
  margin-bottom: 8px;
  font-size: 28px;
}

.result-block p:last-child {
  color: #607067;
  line-height: 1.5;
}

.snippet-heading {
  align-items: center;
}

.snippet-heading select {
  width: 130px;
  min-height: 34px;
  padding-block: 5px;
}

pre {
  min-height: 224px;
  margin: 0;
  padding: 16px;
  overflow: auto;
  border: 1px solid #313934;
  border-radius: 4px;
  background: #17211a;
  color: #eaf2eb;
  font: 12px/1.6 "SFMono-Regular", Consolas, monospace;
  white-space: pre-wrap;
}

footer {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  padding-block: 18px 28px;
  border-top: 1px solid #cbd2c8;
  color: #607067;
  font: 12px "SFMono-Regular", Consolas, monospace;
}

footer a {
  color: #234d37;
  font-weight: 800;
}

@media (max-width: 850px) {
  .controls {
    grid-template-columns: 1fr 1fr;
  }

  .workspace {
    grid-template-columns: 1fr;
  }

  aside {
    grid-template-columns: 1fr 1fr;
    border-left: 0;
    border-top: 1px solid #cbd2c8;
    padding: 24px 0 0;
  }
}

@media (max-width: 560px) {
  .topbar,
  main,
  footer {
    width: min(100% - 20px, 1180px);
  }

  .topbar {
    min-height: 102px;
  }

  h1 {
    font-size: 32px;
  }

  .controls,
  aside {
    grid-template-columns: 1fr;
  }

  .grid {
    grid-template-columns: repeat(9, minmax(30px, 1fr));
  }

  .cell {
    padding: 2px;
    font-size: 8px;
  }

  footer {
    flex-direction: column;
  }
}

@media (max-width: 360px) {
  .topbar {
    gap: 8px;
  }

  .topbar .eyebrow {
    font-size: 10px;
  }

  .warning {
    width: 112px;
    padding: 6px;
    font-size: 9px;
    text-align: center;
  }
}
