/* ── COMPACT EDITOR LAYOUT ───────────────────────────────────── */
#panel-editor { padding: 0; overflow: hidden; }
.EditorCompact-Cx { position: relative; height: 100%; display: grid; grid-template-columns: 42px minmax(0, 1fr); background: var(--bg); overflow: hidden; }
.EditorIconbar-Dx { display: flex; flex-direction: column; align-items: center; gap: 7px; padding: 10px 5px; border-right: 1px solid var(--border2); background: #08090d; z-index: 5; }
.EditorIcon-Eo { width: 30px; height: 30px; display: grid; place-items: center; border: 1px solid var(--border2); border-radius: 6px; background: var(--bg2); color: var(--text2); font-size: 16px; line-height: 1; }
.EditorIcon-Eo:hover { border-color: var(--accent); color: var(--accent); }
.EditorIcon-Eo.primary { margin-top: auto; color: var(--accent); border-color: var(--accent); }
.EditorTreeDrawer-Dx { position: absolute; top: 0; bottom: 0; left: 42px; width: min(340px, 42vw); transform: translateX(-105%); transition: transform .18s ease; z-index: 4; background: rgba(11,13,19,.98); border-right: 1px solid var(--border2); box-shadow: 16px 0 34px rgba(0,0,0,.38); }
#panel-editor.tree-open .EditorTreeDrawer-Dx { transform: translateX(0); }

#panel-editor .EditorTreeDrawer-Dx {
  background: rgba(11,13,19,.84);
  backdrop-filter: blur(8px);
}
#editor-sidebar { height: 100%; display: grid; grid-template-rows: auto minmax(0, 1fr); padding: 9px; gap: 8px; }
#editor-sidebar-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; color: var(--text3); letter-spacing: 3px; text-transform: uppercase; font-size: 12px; }
.EditorTreeTools-Eo { display: flex; gap: 4px; }
#editor-tree { min-height: 0; overflow: auto; padding: 7px; border: 1px solid var(--border2); border-radius: 8px; background: linear-gradient(180deg, #11141d, #0d1017); }

.editor-find-file-break {
  margin: 8px 0 5px;
  padding: 4px 6px;
  border-radius: 6px;
  color: #9fd3ff;
  background: rgba(80,150,220,.16);
  border: 1px solid rgba(120,190,255,.28);
  font-size: 10px;
  letter-spacing: .04em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.editor-find-gap-break {
  margin: 6px 0;
  color: rgba(255,255,255,.72);
  font-size: 10px;
  letter-spacing: .08em;
  text-align: center;
}

.EditorFindPopover-Dx {
  min-height: 0;
  height: 100%;
  display: grid;
  grid-template-rows: auto auto auto minmax(0, auto) auto minmax(0, 1fr);
  gap: 8px;
  padding: 9px;
  border: 1px solid rgba(120,170,220,.26);
  border-radius: 9px;
  background: linear-gradient(180deg, rgba(20,24,35,.96), rgba(10,12,18,.96));
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.035);
  overflow: hidden;
}

.EditorFindPopover-Dx[hidden] {
  display: none;
}

.EditorFindTitle-Dx {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  color: var(--text);
  font-size: 12px;
  letter-spacing: .09em;
  text-transform: uppercase;
}

.EditorFindTitle-Dx .inp-btn {
  padding: 3px 8px;
  font-size: 10px;
}

.EditorFindFields-Dx {
  display: grid;
  grid-template-columns: 1fr;
  gap: 6px;
}

.EditorFindBase-Dx {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px;
  padding: 7px;
  border: 1px solid rgba(255,255,255,.09);
  border-radius: 8px;
  background: rgba(255,255,255,.035);
  color: var(--text2);
  font-size: 11px;
}

.EditorFindBase-Dx label {
  display: flex;
  align-items: center;
  gap: 5px;
  min-width: 0;
  white-space: nowrap;
}

.EditorFindOptions-Dx {
  min-height: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
  overflow: auto;
  padding-right: 2px;
}

.EditorFindFilterRow-Dx {
  display: grid;
  grid-template-columns: 88px 76px minmax(0, 1fr);
  gap: 6px;
  align-items: start;
  min-width: 0;
  padding: 6px;
  border: 1px solid rgba(255,255,255,.085);
  border-radius: 8px;
  background: rgba(0,0,0,.16);
}

.EditorFindFilterRow-Dx select.field-input {
  width: 100%;
  min-width: 0;
  height: 26px;
  padding: 2px 5px;
  font-size: 11px;
}

.EditorFindFilterKind-Eo {
  min-width: 0;
  height: 26px;
  display: flex;
  align-items: center;
  padding: 0 6px;
  border: 1px solid rgba(255,255,255,.08);
  border-radius: 6px;
  color: var(--text3);
  font-size: 10px;
  letter-spacing: .06em;
  text-transform: uppercase;
  overflow: hidden;
}

.EditorFindDrop-Dx {
  min-width: 0;
  border: 1px solid rgba(255,255,255,.10);
  border-radius: 6px;
  padding: 4px 6px;
  background: rgba(255,255,255,.025);
  overflow: hidden;
}

.EditorFindDrop-Dx summary {
  cursor: pointer;
  color: var(--text2);
  font-size: 10px;
  list-style-position: inside;
}

.EditorFindDrop-Dx > div {
  max-height: 132px;
  overflow: auto;
  margin-top: 5px;
  padding-top: 4px;
  border-top: 1px solid rgba(255,255,255,.07);
}

.editor-find-check-row {
  display: flex;
  gap: 4px;
  align-items: flex-start;
  min-width: 0;
  margin: 4px 0;
  font-size: 10px;
  line-height: 1.25;
  color: var(--text2);
  word-break: break-word;
}

.editor-find-filter-empty {
  padding: 4px 0;
  color: var(--text3);
  font-size: 10px;
  font-style: italic;
}

.EditorFindButtons-Dx {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px;
}

.EditorFindButtons-Dx .inp-btn,
#editor-find-add-filter-btn {
  min-width: 0;
  padding: 5px 6px;
  font-size: 10px;
}

#editor-find-results {
  min-height: 0;
  overflow: auto;
  border: 1px solid rgba(255,255,255,.085);
  border-radius: 8px;
  background: rgba(0,0,0,.18);
}

#editor-find-results[hidden] {
  display: none;
}

.editor-find-results-head {
  position: sticky;
  top: 0;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  padding: 6px;
  border-bottom: 1px solid rgba(255,255,255,.08);
  background: rgba(12,15,23,.96);
  color: var(--text2);
  font-size: 11px;
}

.editor-find-results-list {
  padding: 6px;
}

.editor-find-result-row {
  width: 100%;
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr);
  gap: 6px;
  padding: 4px 5px;
  border: 0;
  border-radius: 5px;
  background: transparent;
  color: var(--text2);
  text-align: left;
}

.editor-find-result-row:hover {
  background: rgba(224,92,53,.12);
  color: var(--text);
}

.editor-find-result-line {
  color: var(--text3);
  font-size: 10px;
  text-align: right;
}

.editor-find-result-quote {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 10px;
}

.editor-tree-row { display: grid; grid-template-columns: 12px 14px minmax(0, 1fr); gap: 4px; align-items: center; min-width: 0; padding: 3px 6px; border-radius: 6px; color: var(--text2); letter-spacing: 1px; }
.editor-tree-row:hover, .editor-tree-row.active { background: rgba(224,92,53,.12); color: var(--text); }
.editor-tree-name { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.editor-tree-children { margin-left: 12px; padding-left: 8px; border-left: 1px solid rgba(255,255,255,.06); }
.EditorMain-Dx { position: relative; min-width: 0; height: 100%; display: grid; grid-template-rows: auto minmax(0, 1fr); padding: 10px 12px 12px; gap: 10px; }
.EditorHead-Dx { display: grid; grid-template-columns: minmax(0, 1fr) 170px auto auto; gap: 8px; align-items: center; min-height: 34px; }
#editor-file-path { color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
#editor-file-status { display: inline-block; color: var(--text3); font-size: 13px; }

#editor-section-select { min-width: 0; background: var(--bg2); border: 1px solid var(--border2); color: var(--text2); border-radius: var(--radius); padding: 4px 6px; font-family: var(--font-ui); }
#panel-editor {
  --editor-code-font: var(--font-mono, "Courier New", ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace);
  --editor-code-size: 15px;
  --editor-code-line: 1.62;
  --editor-code-pad: 14px;
  --editor-code-tab: 2;
}

#editor-stage { position: relative; min-height: 0; overflow: hidden; border: 1px solid var(--border2); border-radius: 8px; background: #111116; }
#editor-highlight, #editor-textarea, #editor-collapsed-view { position: absolute; inset: 0; box-sizing: border-box; width: 100%; height: 100%; margin: 0; padding: var(--editor-code-pad); border: 0; background: transparent; color: var(--text2); font-family: var(--editor-code-font); font-size: var(--editor-code-size); line-height: var(--editor-code-line); letter-spacing: 0; tab-size: var(--editor-code-tab); overflow: auto; white-space: pre; }
#editor-highlight-code { display: block; margin: 0; padding: 0; border: 0; background: transparent; color: inherit; font: inherit; line-height: inherit; letter-spacing: inherit; tab-size: inherit; white-space: inherit; }
#editor-textarea { resize: none; caret-color: var(--accent2); color: transparent; -webkit-text-fill-color: transparent; z-index: 2; }
#editor-highlight { z-index: 1; pointer-events: none; }
#editor-textarea:focus { outline: none; }
#editor-stage.collapsed-mode #editor-textarea, #editor-stage.collapsed-mode #editor-highlight { display: none; }
#editor-collapsed-view { position: absolute; z-index: 3; background: #111116; }
.editor-collapsed-item { display: grid; grid-template-columns: 52px 18px minmax(0, 1fr); gap: 8px; padding: 5px 8px; border-bottom: 1px solid rgba(255,255,255,.04); cursor: pointer; }
.editor-collapsed-item:hover, .editor-collapsed-item.selected { background: rgba(224,92,53,.12); }
#panel-editor #editor-collapsed-view {
  padding: 14px;
  background:
    radial-gradient(circle at 12% 0%, rgba(224,92,53,.09), transparent 34%),
    #0b0d12;
  white-space: normal;
}

#panel-editor .editor-collapsed-item {
  display: block;
  margin: 0 0 10px;
  padding: 0;
  border: 1px solid rgba(255,255,255,.08);
  border-left: 3px solid rgba(224,92,53,.35);
  border-radius: 8px;
  background: linear-gradient(180deg, rgba(255,255,255,.035), rgba(255,255,255,.012)), #10131a;
  overflow: hidden;
}

#panel-editor .editor-collapsed-item:hover,
#panel-editor .editor-collapsed-item.selected {
  background: linear-gradient(180deg, rgba(224,92,53,.13), rgba(255,255,255,.018)), #11141d;
  border-left-color: var(--accent);
}

#panel-editor .editor-collapsed-header {
  display: grid;
  grid-template-columns: 64px minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  padding: 8px 10px;
  border-bottom: 1px solid rgba(255,255,255,.06);
}

#panel-editor .editor-collapsed-line {
  color: var(--text3);
  font-family: var(--font-mono);
  font-size: 12px;
  text-align: right;
}

#panel-editor .editor-collapsed-signature {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--text);
  text-align: left;
  font-family: var(--font-ui);
  font-size: 14px;
  letter-spacing: .02em;
}

#panel-editor .editor-collapsed-copy {
  padding: 3px 8px;
  border: 1px solid rgba(255,255,255,.12);
  border-radius: 4px;
  color: var(--text2);
  font-size: 12px;
}

#panel-editor .editor-collapsed-source.editor-collapsed-editor {
  display: block;
  width: calc(100% - 20px);
  min-height: 42px;
  max-height: 30vh;
  margin: 10px;
  padding: 10px 12px;
  resize: vertical;
  overflow: auto;
  border: 1px solid rgba(255,255,255,.09);
  border-radius: 6px;
  background: #090b10;
  color: var(--text2);
  font-family: var(--font-ui);
  font-size: 14px;
  line-height: 1.55;
  white-space: pre;
}

#panel-editor .editor-collapsed-source.editor-collapsed-editor:focus {
  outline: none;
  border-color: var(--accent);
  color: var(--text);
  box-shadow: 0 0 0 1px rgba(224,92,53,.18);
}

#panel-editor .editor-collapsed-item:not(.selected) .editor-collapsed-source.editor-collapsed-editor {
  display: none;
}

#panel-editor .editor-collapsed-item.selected .editor-collapsed-source.editor-collapsed-editor {
  display: block;
}

#panel-editor #editor-highlight { display: block; }
#panel-editor #editor-textarea { color: transparent; -webkit-text-fill-color: transparent; }

#editor-exit-prompt {
  position: fixed;
  inset: 0;
  z-index: 12000;
  display: grid;
  place-items: center;
  background: rgba(0,0,0,.62);
}

#editor-exit-prompt[hidden] {
  display: none;
}

.editor-exit-card {
  width: min(520px, 92vw);
  padding: 16px;
  border: 1px solid rgba(224,92,53,.42);
  border-radius: 10px;
  background: linear-gradient(180deg, rgba(255,255,255,.045), rgba(255,255,255,.012)), #11141d;
  box-shadow: 0 18px 46px rgba(0,0,0,.52), 0 0 24px rgba(224,92,53,.14);
}

.editor-exit-title {
  margin-bottom: 8px;
  color: var(--text);
  font-size: 16px;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.editor-exit-message {
  margin-bottom: 14px;
  color: var(--text2);
  font-size: 13px;
  line-height: 1.45;
}

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

.tok-comment { color: #ff6fb7; }.tok-string { color: #8fdc8f; }.tok-keyword { color: #c58cff; }.tok-type { color: #6abdf5; }.tok-number { color: #69d2c4; }.tok-punct { color: #cdcdcf; }.tok-prop, .tok-tag { color: #7ab7ff; }.tok-attr { color: #74d4e8; }.tok-glyph { color: #f2d86b; font-weight: 700; text-shadow: 0 0 8px rgba(242,216,107,.24); }

