.headercode {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 15px 19px;
  margin-top: 100px;
  background-color: var(--oxford-blue-2);
}
.title {
  font-weight: 600;
  letter-spacing: 0.2px;
  margin-right: 6px;
}
.subcode {
  color: #a4acc7;
  font-size: 12px;
}
.spacer {
  flex: 1;
}
.btncode {
  appearance: none;
  background: var(--oxford-blue-2);
  color: var(--white);
  border: 1px solid #2a3354;
  padding: 8px 10px;
  border-radius: 8px;
  cursor: pointer;
  font-weight: 500;
}
.btncode:hover {
  border-color: #6ea8fe;
}
/* .btncode.primary {
  background: #6ea8fe;
  color: #0b0f1a;
  font-weight: 500;
  border-color: #6ea8fe;
  box-shadow: 0 2px 10px rgba(110, 168, 254, 0.35);
} */
/* .btncode.warn {
  background: #fb923c;
  color: #0b0f1a;
  border-color: #fb923c;
} */
/* .btncode.success {
  background: #4ade80;
  color: #0b0f1a;
  font-weight: 500;
  border-color: #4ade80;
} */
/* .btncode.danger {
  background: #f87171;
  color: #0b0f1a;
  border-color: #f87171;
} */
.toolbar-group {
  display: flex;
  gap: 8px;
  align-items: center;
}
.toolbar-divider {
  width: 1px;
  height: 24px;
  background: #2a3354;
  margin: 0 4px;
}

/* Hide native file inputs in toolbar */
.headercode .toolbar-group input[type="file"] {
  display: none !important;
}

.wrap {
  display: grid;
  grid-template-rows: auto auto;
}
.editors {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 8px;
  padding: 8px;
}
.editor-tabs {
  display: none;
  gap: 8px;
  padding: 0 8px 8px;
}
.editor-tabs .tab-btn {
  padding: 6px 10px;
}
.panel {
  background: #151a2c;
  border: 1px solid var(--light-text-primary);
  border-radius: 10px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  min-height: 500px;
}
.panel > .head {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  border-bottom: 1px solid #2a3354;
  background: var(--oxford-blue-2);
}
.panel > .head .label {
  font-weight: 600;
  color: var(--white);
}
.panel > .head .muted {
  color: var(--white);
  font-size: 12px;
}
.panel > .body {
  position: relative;
  flex: 1;
}

.code-wrap {
  position: absolute;
  inset: 0;
}
.code {
  position: absolute;
  inset: 0;
  margin: 0;
  padding: 12px 12px 24px 12px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas,
    "Liberation Mono", "Courier New", monospace;
  font-size: 13px;
  line-height: 1.6;
  overflow: auto;
  background: var(--oxford-blue-2);
  color: #e7eaf6;
  white-space: pre;
  tab-size: 2;
}
.textarea {
  position: absolute;
  inset: 0;
  resize: none;
  border: none;
  outline: none;
  background: var(--oxford-blue-2);
  color: var(--white);
  caret-color: var(--white);
  font: inherit;
  padding: 12px 12px 24px 12px;
  line-height: inherit;
  overflow: auto;
  white-space: pre;
  tab-size: inherit;
}
.code::-webkit-scrollbar,
.textarea::-webkit-scrollbar,
.preview iframe::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}
.code::-webkit-scrollbar-thumb,
.textarea::-webkit-scrollbar-thumb,
.preview iframe::-webkit-scrollbar-thumb {
  background: #253157;
  border-radius: 8px;
  border: 2px solid #0b0f1a;
}
.code::-webkit-scrollbar-track,
.textarea::-webkit-scrollbar-track,
.preview iframe::-webkit-scrollbar-track {
  background: #0b0f1a;
}

/* Syntax highlighting */
.tok-comment {
  color: #6b7280;
  font-style: italic;
}
.tok-string {
  color: #a7f3d0;
}
.tok-number {
  color: #fdba74;
}
.tok-keyword {
  color: #93c5fd;
  font-weight: 600;
}
.tok-tag {
  color: #fca5a5;
}
.tok-attr {
  color: #fde68a;
}
.tok-punct {
  color: #cbd5e1;
}

.preview {
  padding: 8px;
}
.preview .panel {
  height: 100%;
}
.preview iframe {
  width: 100%;
  height: 100%;
  border: none;
  background: white;
}

.status {
  font-size: 12px;
  color: #a4acc7;
  padding: 4px 8px;
}

.list {
  display: grid;
  gap: 8px;
  max-height: 200px;
  overflow: auto;
}
.list .item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 6px 8px;
  border: 1px solid #2a3354;
  border-radius: 8px;
  background: #101426;
}
.item .name {
  font-weight: 600;
}
.item .actions {
  display: flex;
  gap: 6px;
}

@media (max-width: 1100px) {
  .wrap {
    grid-template-rows: auto auto;
  }
  .editors {
    grid-template-columns: 1fr;
  }
}
@media (max-width: 900px) {
  .headercode {
    flex-wrap: wrap;
    padding: 10px;
  }
  .toolbar-group {
    flex-wrap: wrap;
  }
  .editor-tabs {
    display: flex;
    margin-top: 20px;
  }
  .editors .panel {
    display: none;
  }
  .editors .panel.active {
    display: flex;
  }
  .preview .panel {
    min-height: 45vh;
  }
}
@media (max-width: 600px) {
  .btncode {
    padding: 6px 8px;
  }
  .title {
    font-size: 15px;
  }
  .subcode {
    display: none;
  }
}
