:root {
  --bg: #001100;
  --bg-panel: #031a03;
  --fg: #8aff8a;
  --muted: #62af81;
  --accent: #00ff66;
  --danger: #ff5577;
  --border: #0c350c;
  --mono-size: 14px;
  --mono-line: 20px;
  --info: #5dc2ff;
  --warn: #ffd166;
  --success: #4affb8;
  --note: #c792ea;
  --ai: #66eeff;
  --google: #9ae66e;
  --final: #ff9bd2;
  --start: #8eecf5;
  --retry: #ff9f1c;
  --stop: #ffa3a3;
  --white: #ffffff;
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
}

.container {
  max-width: 1400px;
  margin: 0 auto;
  padding: 24px 16px 48px;
}

h1 {
  font-size: 20px;
  font-weight: 600;
  color: var(--accent);
  margin: 0 0 12px 0;
}

.status {
  background: linear-gradient(180deg, #001600 0%, #001b00 100%);
  border: 1px solid var(--border);
  padding: 0px 12px 12px 12px;
  min-height: 300px;
  max-height: 300px;
  overflow: auto;
  white-space: pre-wrap;
  margin-bottom: 12px;
  color: var(--white);
}

.status .status-line {
  font-size: 14px;
  border-left: 3px solid transparent;
  margin-top: 6px;
  color: var(--white);
}
.status .status-line .timestamp { color: var(--muted); }
.status .status-line .msg { color: var(--white); }
.status .status-line.warn .msg { color: var(--warn); }
.status .status-line.error .msg { color: var(--danger); }
.status .status-line.info { border-left-color: var(--info); }
.status .status-line.warn { border-left-color: var(--warn); }
.status .status-line.error { border-left-color: var(--danger); }
.status .status-line.note { border-left-color: var(--note); }
.status .status-line.success { border-left-color: var(--success); }
.status .status-line.ai { border-left-color: var(--ai); }
.status .status-line.google { border-left-color: var(--google); }
.status .status-line.final { border-left-color: var(--final); }
.status .status-line.start { border-left-color: var(--start); }
.status .status-line.retry { border-left-color: var(--retry); }
.status .status-line.stop { border-left-color: var(--stop); }

.columns {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.column label {
  display: block;
  margin-bottom: 8px;
  color: var(--accent);
}

textarea {
  width: 100%;
  min-height: 340px;
  background: #001600;
  color: var(--white);
  border: 1px solid var(--border);
  outline: none;
  padding: 10px;
  resize: vertical;
  font-family: inherit;
  font-size: var(--mono-size);
  line-height: var(--mono-line);
}

.ta-wrap {
  position: relative;
  display: grid;
  grid-template-columns: auto 1fr;
  min-height: 420px;
  max-height: 420px;
}
.gutter {
  width: auto;
  min-width: 44px;
  background: linear-gradient(180deg, #001400 0%, #001700 100%);
  border: 1px solid var(--border);
  border-right: none;
  color: var(--muted);
  padding: 10px 8px;
  text-align: right;
  user-select: none;
  overflow: auto;
  white-space: pre;
  font-family: inherit;
  font-size: var(--mono-size);
  line-height: var(--mono-line);
  max-height: 420px;
}
.ta-wrap textarea {
  border-left: none;
  max-height: 420px;
  overflow: auto;
  resize: none;
  background: linear-gradient(180deg, #001600 0%, #001b00 100%);
  box-shadow: inset 0 0 0 1px rgba(0,0,0,0.35);
}

/* Contenteditable output styles */
.ta-wrap .editable {
  border: 1px solid var(--border);
  border-left: none;
  max-height: 420px;
  overflow: auto;
  background: linear-gradient(180deg, #001600 0%, #001b00 100%);
  box-shadow: inset 0 0 0 1px rgba(0,0,0,0.35);
  padding: 10px;
  color: var(--white);
  font-family: inherit;
  font-size: var(--mono-size);
  line-height: var(--mono-line);
  white-space: pre;
  outline: none !important;
}
.ta-wrap .editable .line { color: var(--white); }
.ta-wrap .editable .line.error { color: var(--danger); }

.editable .error-text { color: var(--danger) !important; }

.error-line {
  color: #ff5566;
}

/* Hide gutter scrollbar while allowing programmatic scrolling */
.gutter::-webkit-scrollbar { width: 0; height: 0; }
.gutter { scrollbar-width: none; }

.controls {
  display: flex;
  gap: 8px;
  margin-top: 8px;
}

.btn {
  background: transparent;
  color: var(--fg);
  border: 1px solid var(--border);
  padding: 8px 12px;
  cursor: pointer;
  transition: border-color 0.15s ease, color 0.15s ease, box-shadow 0.15s ease;
}
.btn:hover {
  border-color: var(--accent);
  box-shadow: 0 0 12px rgba(0,255,102,0.12);
}
.btn.primary {
  border-color: var(--accent);
  color: var(--accent);
}
.btn.danger {
  border-color: var(--danger);
  color: var(--danger);
}

.controls.right .btn:first-child { border-color: var(--info); color: var(--info); }
.controls.right .btn:first-child:hover { box-shadow: 0 0 12px rgba(93,194,255,0.12); }
.controls.right .btn:last-child { border-color: var(--warn); color: var(--warn); }
.controls.right .btn:last-child:hover { box-shadow: 0 0 12px rgba(255,209,102,0.14); }

@media (max-width: 900px) {
  .columns { grid-template-columns: 1fr; }
}


