.hl-code-editor,
.hl-code-file-viewer {
  --hl-code-editor-bg: #ffffff;
  --hl-code-editor-fg: #172033;
  --hl-code-editor-muted: #6b7280;
  --hl-code-editor-border: #d9dee8;
  --hl-code-editor-gutter-bg: #f7f8fb;
  --hl-code-editor-active-line: #f3f6fb;
  --hl-code-editor-selection: rgba(46, 125, 246, 0.24);
  --hl-code-editor-panel-bg: #ffffff;
}

.hl-code-editor[data-theme='dark'],
.hl-code-file-viewer[data-theme='dark'] {
  --hl-code-editor-bg: #151922;
  --hl-code-editor-fg: #e8ecf5;
  --hl-code-editor-muted: #9aa4b2;
  --hl-code-editor-border: #2f3747;
  --hl-code-editor-gutter-bg: #111620;
  --hl-code-editor-active-line: rgba(255, 255, 255, 0.06);
  --hl-code-editor-selection: rgba(81, 144, 255, 0.34);
  --hl-code-editor-panel-bg: #171d28;
}

.hl-code-editor {
  height: 100%;
  min-height: 220px;
  overflow: hidden;
  background: var(--hl-code-editor-bg);
  color: var(--hl-code-editor-fg);
}

.hl-code-editor__mount {
  height: 100%;
}

.hl-code-editor--empty {
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--hl-code-editor-border);
  color: var(--hl-code-editor-muted);
  font: 13px/1.4 ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

.hl-code-file-viewer {
  display: grid;
  grid-template-columns: minmax(180px, 260px) minmax(0, 1fr);
  height: 100%;
  min-height: 420px;
  overflow: hidden;
  border: 1px solid var(--hl-code-editor-border);
  background: var(--hl-code-editor-bg);
  color: var(--hl-code-editor-fg);
}

.hl-code-file-viewer__tree {
  overflow: auto;
  border-right: 1px solid var(--hl-code-editor-border);
  background: var(--hl-code-editor-gutter-bg);
  padding: 8px 0;
}

.hl-code-file-viewer__tree-item {
  display: flex;
  align-items: center;
  gap: 6px;
  width: 100%;
  min-height: 28px;
  border: 0;
  background: transparent;
  color: var(--hl-code-editor-muted);
  cursor: pointer;
  font: 12px/1.35 ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  text-align: left;
}

.hl-code-file-viewer__tree-item:hover {
  background: var(--hl-code-editor-active-line);
  color: var(--hl-code-editor-fg);
}

.hl-code-file-viewer__tree-item--selected {
  background: rgba(46, 125, 246, 0.14);
  color: var(--hl-code-editor-fg);
}

.hl-code-file-viewer__tree-item--dir {
  font-weight: 600;
}

.hl-code-file-viewer__editor {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  min-width: 0;
  min-height: 0;
}

.hl-code-file-viewer__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  height: 38px;
  padding: 0 12px;
  border-bottom: 1px solid var(--hl-code-editor-border);
  color: var(--hl-code-editor-muted);
  font: 12px/1.4 ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
}

.hl-code-file-viewer__header span:first-child {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--hl-code-editor-fg);
}

@media (max-width: 760px) {
  .hl-code-file-viewer {
    grid-template-columns: 1fr;
    grid-template-rows: 160px minmax(0, 1fr);
  }

  .hl-code-file-viewer__tree {
    border-right: 0;
    border-bottom: 1px solid var(--hl-code-editor-border);
  }
}

