:root {
  --compiler-bg: #f6f7fb;
  --compiler-panel: #ffffff;
  --compiler-ink: #1f2937;
  --compiler-muted: #6b7280;
  --compiler-border: #e2e8f0;
  --compiler-accent: #18a566;
  --compiler-accent-strong: #0f7a3c;
  --compiler-shadow: 0 18px 40px rgba(15, 23, 42, 0.08);
}

.compiler-page {
  font-family: "Space Grotesk", "Trebuchet MS", "Gill Sans", sans-serif;
}

.compiler-hero {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  background: #ffffff;
  border: none;
  border-radius: 6px;
  padding: 12px 16px;
  box-shadow: 0 10px 18px rgba(15, 23, 42, 0.06);
  margin-bottom: 18px;
}

.compiler-hero-copy h2 {
  margin: 4px 0 6px;
  color: var(--compiler-ink);
  font-size: 1.4rem;
}

.compiler-hero-kicker {
  text-transform: uppercase;
  letter-spacing: 0.1em;
  font-size: 0.65rem;
  color: var(--compiler-muted);
  margin: 0;
  font-weight: 700;
}

.compiler-lead {
  color: var(--compiler-muted);
  margin-bottom: 0;
  font-size: 0.95rem;
}

.compiler-hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
}

.hero-pill {
  border-radius: 6px;
  background: #f1f5f9;
  border: none;
  color: #475569;
  font-size: 0.72rem;
  padding: 4px 10px;
  font-weight: 600;
}

.compiler-layout {
  margin-top: 6px;
}

@media (min-width: 992px) {
  .compiler-layout {
    display: grid;
    grid-template-columns: minmax(0, 1.35fr) minmax(0, 0.9fr);
    gap: 24px;
    align-items: start;
  }

  .compiler-layout > [class*="col-"] {
    width: auto;
    max-width: none;
  }

  .compiler-right {
    margin-top: 0 !important;
  }
}

.compiler-form {
  background: var(--compiler-panel);
  border: none;
  border-radius: 8px;
  padding: 12px;
  box-shadow: var(--compiler-shadow);
}

.compiler-form .editor-section {
  margin-top: 12px;
  border: none;
  border-radius: 8px;
  overflow: hidden;
  background: #fff;
  box-shadow: 0 8px 18px rgba(15, 23, 42, 0.06);
}

.compiler-panel-title {
  margin-top: 12px;
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--compiler-muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.compiler-form #file-tabs {
  background: #eef2f6;
  border-bottom: 1px solid var(--compiler-border);
}

.compiler-form .file-name.active {
  border-color: var(--compiler-accent);
}

.compiler-form .ace_editor {
  border: none;
  border-radius: 0 0 12px 12px;
  min-height: 360px;
}

.compiler-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  flex-wrap: wrap;
  background: #f1f5f9;
  border: none;
  border-radius: 8px;
  padding: 8px 10px;
}

.compiler-toolbar .toolbar-left,
.compiler-toolbar .toolbar-right {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.compiler-usage-meter {
  font-size: 0.76rem;
  color: #4f6988;
  border: 1px solid #d0dbe8;
  border-radius: 999px;
  background: #f8fbff;
  padding: 3px 9px;
}

.compiler-toolbar .btn {
  border: 1px solid #d1d9e6;
  background: #ffffff;
  color: #2c3e50;
  border-radius: 8px;
  font-size: 12px;
  padding: 4px 10px;
}

.compiler-toolbar .btn:hover {
  background: #f5f7fb;
}

.compiler-run {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: #ffffff;
  background: linear-gradient(135deg, var(--compiler-accent) 0%, var(--compiler-accent-strong) 100%);
  border: 1px solid rgba(15, 122, 60, 0.6);
  box-shadow: 0 8px 16px rgba(15, 122, 60, 0.2);
}

.compiler-run .label {
  font-weight: 600;
}

.compiler-run .spinner {
  width: 12px;
  height: 12px;
  border: 2px solid rgba(255, 255, 255, 0.5);
  border-top-color: #fff;
  border-radius: 50%;
  animation: compiler-spin 0.8s linear infinite;
  display: none;
}

.compiler-run.is-running {
  opacity: 0.75;
  cursor: not-allowed;
}

.compiler-run.is-running .spinner {
  display: inline-block;
}

.compiler-output-wrap {
  position: sticky;
  top: 16px;
}

.compiler-page .output-section {
  border: none;
  border-radius: 8px;
  box-shadow: 0 10px 18px rgba(15, 23, 42, 0.06);
}

.compiler-page .stdout {
  border-radius: 6px;
}

#compiler-stdout {
  min-height: 280px;
}

.output-input-line {
  display: flex;
  align-items: center;
  gap: 6px;
  margin: 4px 0;
}

.output-prompt {
  color: #94a3b8;
}

.output-input {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(148, 163, 184, 0.4);
  border-radius: 4px;
  padding: 2px 6px;
  color: #e2e8f0;
  font-family: inherit;
  font-size: 13px;
}

.output-input:focus {
  outline: none;
  border-color: #93c5fd;
  box-shadow: 0 0 0 2px rgba(147, 197, 253, 0.2);
}

.output-input-value {
  color: #e2e8f0;
}

@keyframes compiler-spin {
  to {
    transform: rotate(360deg);
  }
}

@media (max-width: 992px) {
  .compiler-hero {
    flex-direction: column;
    align-items: flex-start;
  }

  .compiler-hero-actions {
    justify-content: flex-start;
  }

  .compiler-output-wrap {
    position: static;
  }
}
