:root {
  --bg: #0f172a;
  --panel: #111827;
  --text: #e5e7eb;
  --muted: #9ca3af;
  --accent: #38bdf8;
  --danger: #f87171;
  --border: #1f2937;
  --radius: 14px;
  --shadow: 0 20px 50px rgba(0, 0, 0, 0.35);
  font-family: 'JetBrains Mono', 'Fira Code', 'SFMono-Regular', ui-monospace, 'Menlo',
    'Consolas', 'Liberation Mono', 'Courier New', monospace;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background: radial-gradient(circle at 20% 20%, rgba(56, 189, 248, 0.15), transparent 30%),
    radial-gradient(circle at 80% 0%, rgba(129, 140, 248, 0.18), transparent 25%),
    var(--bg);
  color: var(--text);
}

main.page {
  max-width: 2000px;
  margin: 0 auto;
  padding: 32px 20px 48px;
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.hero {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  flex-wrap: wrap;
}

.eyebrow {
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent);
  font-weight: 700;
  margin: 0 0 6px;
  font-size: 12px;
}

.hero h1 {
  margin: 0;
  font-size: 32px;
}

.lede {
  margin: 8px 0 0;
  max-width: 700px;
  color: var(--muted);
  line-height: 1.6;
}

.status {
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: rgba(56, 189, 248, 0.1);
  color: var(--accent);
  font-weight: 600;
  min-width: 220px;
  text-align: center;
}

.status.error {
  background: rgba(248, 113, 113, 0.15);
  color: var(--danger);
}

.workbench {
  display: flex;
  gap: 0;
  /* height: 600px;  Let content dictate height or use min-height */
  min-height: 600px;
}

.panel {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  flex: 1;
  min-width: 200px;
}

.resizer {
  width: 12px;
  cursor: col-resize;
  background: transparent;
  display: flex;
  justify-content: center;
  align-items: center;
  transition: background 0.2s;
  flex-shrink: 0;
  z-index: 10;
  /* Ensure it's above */
}

.resizer:hover,
.resizer.dragging {
  background: rgba(56, 189, 248, 0.1);
}

.resizer::after {
  content: "";
  width: 2px;
  height: 40px;
  background: var(--border);
  border-radius: 1px;
}

.panel-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 18px;
  border-bottom: 1px solid var(--border);
}

.panel-header h2 {
  margin: 0;
  font-size: 18px;
}

button {
  background: var(--accent);
  color: #04101d;
  border: none;
  border-radius: 999px;
  padding: 10px 16px;
  font-weight: 700;
  cursor: pointer;
  transition: transform 120ms ease, opacity 120ms ease;
}

button[disabled] {
  opacity: 0.55;
  cursor: not-allowed;
}

button:hover:not([disabled]) {
  transform: translateY(-1px);
}

.input-wrapper {
  display: flex;
  position: relative;
  flex: 1;
  overflow: hidden;
}

.line-numbers {
  padding: 16px 8px;
  text-align: right;
  background: rgba(0, 0, 0, 0.2);
  color: var(--muted);
  font-size: 15px;
  line-height: 1.5;
  font-family: inherit;
  user-select: none;
  min-width: 3em;
  border-right: 1px solid var(--border);
}

textarea {
  width: 100%;
  min-height: 100%;
  /* Fill the panel */
  padding: 16px;
  background: transparent;
  color: var(--text);
  border: none;
  resize: none;
  font-size: 15px;
  line-height: 1.5;
  font-family: inherit;
  flex: 1;
}

textarea:focus {
  outline: none;
}

.input-wrapper:focus-within {
  outline: 2px solid var(--accent);
  outline-offset: -2px;
}

pre#output {
  margin: 0;
  padding: 16px;
  min-height: 100%;
  /* Fill the panel */
  font-size: 15px;
  line-height: 1.35;
  color: var(--text);
  white-space: normal;
  word-break: break-word;
  font-family: inherit;
  counter-reset: line;
  overflow: auto;
  /* Allow scrolling */
  flex: 1;
}

.code-line {
  display: flex;
  padding: 0;
  margin: 0;
  border-radius: 0;
  cursor: pointer;
  transition: background-color 120ms ease;
  white-space: pre-wrap;
}

.code-line::before {
  counter-increment: line;
  content: counter(line);
  display: inline-block;
  width: 3em;
  min-width: 3em;
  margin-right: 1em;
  text-align: right;
  color: var(--muted);
  user-select: none;
  border-right: 1px solid var(--border);
  padding-right: 8px;
}

.code-line.highlight {
  background: rgba(56, 189, 248, 0.16);
}

.text-highlight {
  background: rgba(255, 255, 0, 0.25);
  color: #fff;
  border-radius: 2px;
}

.site-footer {
  text-align: center;
  color: var(--muted);
  font-size: 14px;
  margin-top: auto;
  padding-top: 24px;
  width: 100%;
}

@media (max-width: 720px) {
  .hero h1 {
    font-size: 26px;
  }

  .workbench {
    flex-direction: column;
    height: auto;
  }

  .resizer {
    display: none;
    /* Disable resizing on mobile */
  }

  .panel {
    min-width: auto;
    width: 100%;
  }
}