html {
  background: #101314;
}

body {
  background: #101314;
  color: #eef5f1;
  overflow-x: hidden;
}

button,
input {
  font: inherit;
}

button {
  cursor: pointer;
}

.page {
  min-height: 100vh;
  padding: 38px 18px 18px;
}

.control-button {
  border: 0;
  border-radius: 8px;
  min-height: 36px;
  padding: 0 0.74rem;
  background: #d7e5de;
  color: #13201b;
  font-weight: 800;
  text-decoration: none;
  box-shadow: 0 8px 24px rgb(0 0 0 / 20%);
}

.workspace {
  width: min(100%, 1220px);
  min-height: calc(100vh - 56px);
  margin: 0 auto;
  display: grid;
  gap: 16px;
  align-items: stretch;
}

.model-convolution .workspace {
  grid-template-columns: minmax(296px, 420px) minmax(420px, 1fr);
}

.model-dense-pixels .workspace {
  grid-template-columns: minmax(296px, 390px) minmax(460px, 1fr);
  align-items: start;
}

.model-latent-sampler .workspace {
  grid-template-columns: minmax(300px, 430px) minmax(460px, 1fr);
}

.draw-board {
  display: grid;
  gap: 9px;
}

.drawing-canvas,
.generated-canvas {
  width: 100%;
  aspect-ratio: 1;
  border: 1px solid rgb(255 255 255 / 16%);
  border-radius: 8px;
  background: #050607;
  touch-action: none;
  image-rendering: pixelated;
}

.model-convolution .drawing-canvas {
  box-shadow: 0 0 0 8px #1d292d;
}

.model-dense-pixels .drawing-canvas {
  border-style: dashed;
  box-shadow: 0 0 0 8px #182322;
}

.model-latent-sampler .generated-canvas {
  box-shadow: 0 0 0 8px #222322;
}

.draw-panel,
.generate-panel,
.viz-panel {
  border-radius: 8px;
}

.draw-panel,
.generate-panel {
  padding: 12px;
  background: #161d1f;
}

.model-dense-pixels .draw-panel {
  background: #141f1d;
}

.model-latent-sampler .generate-panel {
  background: #1b1d1a;
}

.control-row {
  display: flex;
  gap: 8px;
}

.prediction {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 12px;
  align-items: center;
  margin-top: 12px;
}

.digit {
  width: 72px;
  height: 72px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  background: rgb(255 255 255 / 10%);
  color: #fff;
  font-size: 3.1rem;
  font-weight: 900;
}

.bars {
  display: grid;
  gap: 5px;
}

.bar,
.latent-grid label {
  display: grid;
  gap: 7px;
  align-items: center;
  font-weight: 800;
}

.bar {
  grid-template-columns: 1.3rem 1fr 3.2rem;
  color: #dfe9e4;
  font-size: 0.78rem;
}

.bar-track {
  height: 8px;
  overflow: hidden;
  border-radius: 999px;
  background: rgb(255 255 255 / 13%);
}

.bar-fill {
  height: 100%;
  border-radius: inherit;
  background: #24d366;
}

.viz-panel {
  min-height: 520px;
  padding: 10px;
  overflow: auto;
  background: #1b2023;
}

.model-convolution .viz-panel {
  background: #171e22;
}

.model-dense-pixels .viz-panel {
  background: #111a19;
}

.model-latent-sampler .viz-panel {
  background: #181a18;
}

.activation-title {
  margin: 0 0 10px;
  color: #dbe8e2;
  font-size: 0.82rem;
  font-weight: 850;
}

.activation-section {
  gap: 8px;
}

.activation-section + .activation-section {
  margin-top: 15px;
}

.maps {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(52px, 1fr));
  gap: 7px;
}

.map,
.dense-cell {
  border: 1px solid rgb(255 255 255 / 12%);
  border-radius: 5px;
  background: #111719;
}

.map {
  width: 100%;
  aspect-ratio: 1;
  image-rendering: pixelated;
}

.dense-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(14px, 1fr));
  gap: 4px;
}

.model-dense-pixels .dense-grid {
  grid-template-columns: repeat(auto-fill, minmax(11px, 1fr));
  gap: 5px 7px;
}

.dense-cell {
  aspect-ratio: 1;
}

.model-dense-pixels .dense-cell {
  border-radius: 999px;
}

.latent-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px 12px;
  margin-top: 12px;
}

.latent-grid label {
  grid-template-columns: 2.4rem 1fr 3.1rem;
  color: #dce7e1;
  font-size: 0.76rem;
}

.latent-grid input {
  width: 100%;
  accent-color: #24d366;
}

.status {
  min-height: 1.2em;
  margin-top: 10px;
  color: #dbe8e2;
  font-size: 0.82rem;
  font-weight: 700;
}

@media (width <= 760px) {
  .page {
    padding: 46px 10px 14px;
  }

  .workspace {
    grid-template-columns: minmax(0, 1fr);
  }

  .latent-grid {
    grid-template-columns: minmax(0, 1fr);
  }
}
