@use '../../styles/component/panel';

:host {
  --batch-code-editor-min-height: 3.175rem;

  display: block;
}

.editor {
  color: var(--calc-text, var(--color-text, #1f2937));
  display: grid;
  grid-template-columns: max-content minmax(0, 1fr);
  min-height: var(--batch-code-editor-min-height);
  overflow: hidden;
}

.gutter {
  background: var(--color-background-mute, #edf1f6);
  border-right: 1px solid var(--color-border, #d8dee8);
  color: var(--color-text-hover, #667085);
  font:
    0.95rem/1.5 Consolas,
    'SFMono-Regular',
    'Liberation Mono',
    Menlo,
    monospace;
  font-variant-numeric: tabular-nums;
  min-width: 2ch;
  padding: 0.875rem 0.35rem;
  text-align: right;
  user-select: none;
  white-space: pre;
}

.stack {
  background: var(--calc-app-background, var(--color-background, Canvas));
  min-width: 0;
  overflow: auto;
  position: relative;
}

.stack:focus-within {
  background: var(--calc-app-background, var(--color-background, Canvas));
}

.highlight,
.input {
  border: 0;
  box-sizing: border-box;
  font:
    0.95rem/1.5 Consolas,
    'SFMono-Regular',
    'Liberation Mono',
    Menlo,
    monospace;
  inset: 0;
  letter-spacing: 0;
  margin: 0;
  min-height: 100%;
  min-width: 100%;
  outline: 0;
  overflow: hidden;
  padding: 0.875rem;
  tab-size: 4;
  white-space: pre;
}

.highlight {
  color: var(--calc-text, var(--color-text, #1f2937));
  pointer-events: none;
  position: absolute;
}

.input {
  background: transparent;
  caret-color: var(--color-input-text-focus, var(--calc-text, #0f172a));
  color: transparent;
  min-height: var(--batch-code-editor-min-height);
  position: relative;
  resize: vertical;
}

.input::selection {
  background: color-mix(in srgb, var(--blue-background, Highlight) 52%, transparent);
  color: transparent;
}

.hljs-keyword,
.hljs-built_in,
.hljs-name {
  color: var(--blue-text, #0550ae);
  font-weight: 650;
}

.hljs-string {
  color: var(--green-text, #0a7c46);
}

.hljs-number {
  color: var(--red-text, #9a3412);
}

.hljs-comment {
  color: var(--color-text-hover, #6b7280);
  font-style: italic;
}

.hljs-title,
.hljs-function {
  color: var(--blue-text-hover, #7c3aed);
}
