body {
  background:
    radial-gradient(
      circle at 24% 18%,
      rgb(255 255 255 / 16%),
      transparent 23rem
    ),
    linear-gradient(120deg, #47a9ed 0%, #8f95d8 52%, #ee83c7 100%);
}

button,
input {
  font: inherit;
}

button {
  cursor: pointer;
}

.page {
  width: min(100%, 1180px);
  min-height: 100vh;
  margin: 0 auto;
  padding: 28px 18px 34px;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  margin-bottom: 14px;
}

.home-link,
.nav-link,
.control-button {
  border: 0;
  border-radius: 8px;
  background: rgb(138 178 255 / 62%);
  color: #123760;
  font-weight: 850;
  text-decoration: none;
  box-shadow: 0 8px 24px rgb(24 52 92 / 16%);
}

.home-link {
  padding: 0.36rem 0.62rem;
  font-size: 0.82rem;
}

.brand {
  border-radius: 8px;
  padding: 0.34rem 0.7rem;
  background: rgb(138 178 255 / 62%);
  color: #123760;
  font-size: clamp(1.1rem, 3vw, 1.65rem);
  font-weight: 900;
}

.model-nav {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
  margin-bottom: 18px;
}

.nav-link {
  padding: 0.42rem 0.62rem;
  font-size: 0.84rem;
}

.nav-link[aria-current="page"] {
  background: rgb(255 255 255 / 80%);
}

.workspace {
  display: grid;
  grid-template-columns: minmax(290px, 0.9fr) minmax(320px, 1.4fr);
  gap: 14px;
}

.panel {
  border-radius: 8px;
  background: rgb(41 44 45 / 92%);
  box-shadow: 0 16px 50px rgb(18 31 44 / 22%);
}

.draw-panel,
.generate-panel {
  padding: 14px;
}

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

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

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

.control-button {
  min-height: 36px;
  padding: 0 0.74rem;
}

.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 / 12%);
  color: #fff;
  font-size: 3.1rem;
  font-weight: 900;
}

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

.bar {
  display: grid;
  grid-template-columns: 1.3rem 1fr 3.2rem;
  gap: 7px;
  align-items: center;
  color: #dfe9e4;
  font-size: 0.78rem;
  font-weight: 800;
}

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

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

.viz-panel {
  min-height: 520px;
  padding: 12px;
}

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

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

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

.map,
.dense-cell {
  border: 1px solid rgb(255 255 255 / 12%);
  border-radius: 6px;
  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;
}

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

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

.latent-grid label {
  display: grid;
  grid-template-columns: 2.4rem 1fr 3.1rem;
  gap: 7px;
  align-items: center;
  color: #dce7e1;
  font-size: 0.76rem;
  font-weight: 800;
}

.latent-grid input {
  width: 100%;
  accent-color: #23d45d;
}

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

@media (width <= 760px) {
  .page {
    padding: 16px 12px 24px;
  }

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

  .brand {
    font-size: 1.14rem;
  }

  .topbar {
    justify-content: flex-start;
  }

  .model-nav {
    justify-content: flex-start;
  }
}
