.dialog-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);
}

.dialog-main {
  display: contents;
}

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

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

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

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

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

.dialog-demo button {
  background: var(--accent);
  border: none;
  color: white;
  padding: 12px 24px;
  border-radius: var(--radius-sm);
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s;
}

.dialog-demo button:hover {
  background: var(--accent-hover);
}

dialog {
  border: none;
  border-radius: var(--radius-lg);
  padding: 24px;
  background: var(--surface);
  color: var(--text);
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
  max-width: 400px;
  width: 90%;
}

dialog::backdrop {
  background: rgba(0, 0, 0, 0.7);
}

dialog h2 {
  color: var(--info);
  margin-bottom: 15px;
}

dialog .dialog-content {
  color: var(--text);
  line-height: 1.6;
  margin-bottom: 20px;
}

dialog .dialog-actions {
  display: flex;
  justify-content: flex-end;
}

dialog .close-btn {
  background: var(--surface-strong);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 8px 16px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: background 0.2s;
}

dialog .close-btn:hover {
  background: var(--surface-hover);
}

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