html, body {
  margin: 0;
  height: 100%;
  font-family: Verdana, sans-serif;
  display: flex;
  flex-direction: column;
  background: #f9f9f9;
}

/* Top bar */
.topbar {
  background: #282A35;
  color: white;
  padding: 10px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-weight: bold;
}

.topbar button {
  background: #04AA6D;
  border: none;
  color: white;
  padding: 8px 16px;
  cursor: pointer;
  font-size: 14px;
}

/* Top Ad */
.ad-top {
  width: 100%;
  height: 150px; /* fixed height */
  background: #f1f1f1;
  display: flex;
  justify-content: center;
  align-items: center;
  overflow: hidden; /* important! */
  flex-shrink: 0;
}

.ad-top img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}

/* Container for editor + output */
.container {
  display: flex;
  flex: 1; /* fill remaining height */
  min-height: 0;
}

/* Editor panel */
.editor {
  width: 50%;
  border-right: 1px solid #ccc;
  display: flex;
  flex-direction: column;
}

.editor-header {
  background: #f1f1f1;
  padding: 8px;
  font-weight: bold;
}

textarea {
  flex: 1;
  border: none;
  outline: none;
  padding: 10px;
  font-family: Consolas, monospace;
  font-size: 14px;
  background: #1e1e1e;
  color: #00ff9c;
  resize: none;
}

/* Output panel */
.preview {
  width: 50%;
  display: flex;
  flex-direction: column;
}

.preview-header {
  background: #f1f1f1;
  padding: 8px;
  font-weight: bold;
}

iframe {
  flex: 1;
  border: none;
}

/* Mobile responsiveness */
@media (max-width: 768px) {
  .container {
    flex-direction: column;
  }
  .editor, .preview {
    width: 100%;
    height: 50%;
  }
  .ad-top {
    height: 150px;
  }
}
