.template-app {
  display: grid;
  grid-template-areas:
    "header header"
    "side center"
    "side code";
  grid-template-columns: 280px 1fr 320px;
  grid-template-rows: auto 1fr;
  gap: 20px;
  min-height: calc(100vh - 120px);
}

.template-main {
  display: contents;
}

.template-side {
  grid-area: side;
  height: fit-content;
  position: sticky;
  top: 20px;
}

.template-center {
  grid-area: center;
}

.template-code {
  grid-area: code;
  height: fit-content;
  position: sticky;
  top: 20px;
}

.template-viz {
  min-height: 200px;
}

.template-demo {
  background: var(--surface-solid);
  padding: 20px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-strong);
}

.template-demo .notice {
  color: var(--info);
  margin-bottom: 15px;
  font-size: 14px;
}

.template-demo .card {
  background: var(--surface);
  border-radius: var(--radius-sm);
  padding: 16px;
  border: 1px solid var(--border);
}

.template-demo .card h3 {
  margin: 0 0 10px 0;
  color: var(--accent);
}

.template-demo .card p {
  margin: 0;
  color: var(--text);
}

@media (max-width: 1024px) {
  .template-app {
    grid-template-areas:
      "header"
      "side"
      "center"
      "code";
    grid-template-columns: 1fr;
    grid-template-rows: auto auto auto auto;
  }
  
  .template-side,
  .template-center,
  .template-code {
    position: static;
  }
}