/* Text editor styles: tabs, the editor, search results and the status bar (centre); the find panel (right). */
#main { display: flex; flex-direction: row; flex: 1; min-width: 0; min-height: 0; background: var(--panel); }
#te-center { flex: 1; min-width: 0; display: flex; flex-direction: column; }

/* the open files (a section of the left panel) */
.te-files { display: flex; flex-direction: column; min-height: 0; }
.te-files-list { flex: 1; min-height: 0; overflow-y: auto; padding: 6px; display: flex; flex-direction: column; gap: 1px; }
.te-file { position: relative; flex: none; display: flex; align-items: center; gap: 7px; height: 30px; padding: 0 4px 0 8px; border-radius: var(--radius-s); cursor: pointer; color: var(--text-2); font-size: 13px; outline: none; }
.te-file:hover { background: var(--line-soft); }
.te-file.on { background: var(--prog-soft); color: var(--prog-strong); font-weight: 500; }
.te-file:focus-visible { box-shadow: 0 0 0 2px var(--prog); }
.te-file-ic { font-size: 17px; color: var(--faint); }
.te-file.on .te-file-ic { color: var(--prog-strong); }
.te-file-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.te-file.untitled .te-file-name { font-style: italic; }
.te-file-side { flex: none; font-size: 11px; font-weight: 400; color: var(--muted); padding: 1px 6px; border-radius: 8px; background: var(--sunk); box-shadow: inset 0 0 0 1px var(--line); }
.te-file-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--danger); flex: none; display: none; }
.te-file.dirty .te-file-dot, .te-file-dot.on { display: block; }
.te-file-x, .te-pane-x { flex: none; width: 22px; height: 22px; border: 0; border-radius: 4px; background: none; display: inline-flex; align-items: center; justify-content: center; padding: 0; cursor: pointer; color: var(--muted); opacity: 0; }
.te-file-x .material-symbols-outlined, .te-pane-x .material-symbols-outlined { font-size: 16px; }
.te-file:hover .te-file-x, .te-file.on .te-file-x, .te-pane-head:hover .te-pane-x, .te-pane.on .te-pane-x { opacity: 1; }
.te-file-x:hover, .te-pane-x:hover { background: var(--line-strong); color: var(--text); }
.te-file.drop-before::before, .te-file.drop-after::after { content: ''; position: absolute; left: 4px; right: 4px; height: 2px; border-radius: 1px; background: var(--prog); }
.te-file.drop-before::before { top: -1px; }
.te-file.drop-after::after { bottom: -1px; }
.te-files-add { flex: none; display: flex; align-items: center; justify-content: center; gap: 6px; margin: 2px 8px 10px; height: 32px; border: 1.5px dashed var(--line-strong); border-radius: 8px; background: none; color: var(--muted); font: inherit; font-size: 13px; cursor: pointer; }
.te-files-add:hover { border-color: var(--prog); color: var(--prog-strong); background: var(--prog-soft); }
.te-files-add .material-symbols-outlined { font-size: 18px; }

/* the sides of the editor (two with View › Side by side) */
#te-editor { display: flex; flex-direction: row; }
.te-pane { flex: 1 1 0; min-width: 0; display: flex; flex-direction: column; }
.te-pane + .te-pane { border-left: 1px solid var(--line-strong); }
.te-host { flex: 1; min-height: 0; position: relative; }
.te-pane-head { display: none; }
#te-editor.split .te-pane-head { flex: none; display: flex; align-items: center; gap: 7px; height: 32px; padding: 0 6px 0 10px; border-bottom: 1px solid var(--line); background: var(--panel); color: var(--muted); font-size: 12.5px; cursor: default; }
#te-editor.split .te-pane.on .te-pane-head { color: var(--text); font-weight: 600; box-shadow: inset 0 -2px 0 var(--prog); }
.te-pane-ic { font-size: 16px; color: var(--faint); }
.te-pane.on .te-pane-ic { color: var(--prog-strong); }
.te-pane-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* editor */
#te-editor { flex: 1; min-height: 120px; position: relative; background: #fff; }
.te-bm-glyph { background: radial-gradient(circle at 50% 50%, #2e7bd6 0 4.5px, transparent 5px); cursor: pointer; }
.te-bm-line { background: rgba(46, 123, 214, 0.07); }
.te-mark { background: rgba(255, 82, 82, 0.32); border-radius: 2px; }
.te-findhl { background: rgba(255, 214, 0, 0.42); border-radius: 2px; }
body[data-theme="dark"] #te-editor { background: #1e1e1e; }
body[data-theme="dark"] .te-findhl { background: rgba(255, 214, 0, 0.3); }

/* search results */

/* status bar */

/* find panel */

/* compare */
.te-compare { position: fixed; inset: 0; z-index: 900; display: flex; flex-direction: column; background: var(--surface); }
.tc-bar { flex: none; display: flex; align-items: center; gap: 8px; height: 46px; padding: 0 12px; border-bottom: 1px solid var(--line-strong); background: var(--sunk); }
.tc-title { font-weight: 600; font-size: 13px; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tc-stats { flex: 1; font-size: 12.5px; }
.tc-host { flex: 1; min-height: 0; }

/* dialogs */
.te-coldlg { display: flex; flex-direction: column; gap: 8px; font-size: 13px; }
.col-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; padding-left: 20px; }
.col-grid label { display: flex; flex-direction: column; gap: 3px; font-size: 12px; color: var(--muted); }
.te-prefs { display: flex; flex-direction: column; gap: 8px; }
.te-pref { display: grid; grid-template-columns: 1fr 180px; align-items: center; gap: 10px; font-size: 13px; }
.te-pref input[type=checkbox] { justify-self: start; }
.te-mono { font-family: var(--mono) !important; font-size: 12.5px; }
.te-print { position: fixed; width: 0; height: 0; border: 0; left: -10px; top: -10px; }
.kbd-table { border-collapse: collapse; width: 100%; font-size: 13px; }
.kbd-table td { padding: 5px 6px; border-bottom: 1px solid var(--line-soft); vertical-align: top; }
kbd { font: 12px var(--mono); background: var(--hover); border: 1px solid var(--line); border-radius: 4px; padding: 1px 5px; white-space: nowrap; }
ul.feat { padding-left: 18px; margin: 4px 0; line-height: 1.55; font-size: 13px; }
.small { font-size: 12px; }
.load-error { max-width: 520px; padding: 16px; color: #b3261e; line-height: 1.5; }

@media (max-width: 700px) {
  #main { flex-direction: column; }
  #te-center { order: 1; min-height: 0; }
}
