/* ⭐ LaTeX Studio (2026-10-23) — loaded on demand with latex-studio.js */

#studentLatexView { padding: 0; }

/* ---------- projects list ---------- */
.lx-home { max-width: 1100px; margin: 0 auto; padding: 20px 16px 40px; }
.lx-loading { display: flex; align-items: center; justify-content: center; gap: 10px; padding: 70px 16px; color: var(--text-secondary); }
.lx-home-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 18px; }
.lx-home-head h2 { margin: 0 0 4px; font-size: 22px; color: var(--text-primary); display: flex; align-items: center; gap: 10px; }
.lx-home-head h2 i { color: var(--brand-600); }
.lx-home-head p { margin: 0; color: var(--text-secondary); font-size: 14px; max-width: 620px; }
.lx-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 12px; }
.lx-card {
  display: flex; align-items: center; gap: 12px; padding: 14px 14px 14px 16px; cursor: pointer;
  background: var(--bg-surface); border: 1px solid var(--border-subtle); border-radius: var(--radius-md);
  transition: border-color .15s, box-shadow .15s;
}
.lx-card:hover, .lx-card:focus-visible { border-color: var(--brand-300); box-shadow: var(--shadow-md, 0 4px 14px rgba(0,0,0,.08)); outline: none; }
.lx-card-ico { width: 40px; height: 40px; border-radius: 10px; display: grid; place-items: center; flex-shrink: 0;
  background: rgba(79,70,229,.1); color: var(--brand-600); font-size: 18px; }
.lx-card-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.lx-card-main strong { color: var(--text-primary); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lx-card-main span { font-size: 12px; color: var(--text-secondary); }
.lx-card-main .ok { color: #059669; } .lx-card-main .bad { color: #d97706; }
.lx-card-acts { display: flex; gap: 2px; flex-shrink: 0; }
.lx-empty { text-align: center; padding: 60px 16px; color: var(--text-secondary); background: var(--bg-surface);
  border: 1px dashed var(--border-default); border-radius: var(--radius-lg, 16px); }
.lx-empty > i { font-size: 34px; color: var(--brand-600); margin-bottom: 10px; display: block; }
.lx-empty h3 { margin: 4px 0 6px; color: var(--text-primary); }
.lx-empty p { margin: 0 auto 16px; max-width: 460px; }

.lx-icon-btn { width: 34px; height: 34px; border: 0; border-radius: 8px; background: transparent; color: var(--text-secondary);
  display: inline-grid; place-items: center; cursor: pointer; flex-shrink: 0; }
.lx-icon-btn:hover { background: var(--bg-surface-2); color: var(--text-primary); }
.lx-icon-btn.danger:hover { color: #dc2626; background: rgba(220,38,38,.08); }
.lx-icon-btn:focus-visible { outline: 2px solid var(--brand-500); outline-offset: 1px; }

/* ---------- dialogs ---------- */
.lx-dialog.wide { max-width: 760px; width: calc(100vw - 32px); }
.lx-dialog-body { margin: 8px 0 4px; }
.lx-field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 12px; font-size: 13px; color: var(--text-secondary); }
.lx-field input, .lx-field select { padding: 10px 12px; border: 1px solid var(--border-default); border-radius: 8px;
  background: var(--bg-surface); color: var(--text-primary); font-size: 14px; }
.lx-tpls { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 8px; max-height: 52vh; overflow: auto; }
.lx-tpl { display: flex; flex-direction: column; align-items: flex-start; gap: 4px; padding: 12px; text-align: left; cursor: pointer;
  background: var(--bg-surface-2); border: 1.5px solid var(--border-subtle); border-radius: 10px; color: var(--text-primary); }
.lx-tpl i { color: var(--brand-600); font-size: 18px; margin-bottom: 2px; }
.lx-tpl span { font-size: 12px; color: var(--text-secondary); line-height: 1.4; }
.lx-tpl.on { border-color: var(--brand-500); background: rgba(79,70,229,.08); box-shadow: 0 0 0 1px var(--brand-500); }
.lx-tpl[hidden] { display: none; }
.lx-tpl strong { display: flex; align-items: center; gap: 6px; font-size: 13.5px; }
.lx-tpl strong i { font-size: 13px; margin: 0; }
.lx-tpl strong em { font-style: normal; font-weight: 500; font-size: 10.5px; padding: 1px 6px; border-radius: 99px; background: rgba(227,160,8,.15); color: #b7791f; }
.lx-tpl-pic { width: 100%; aspect-ratio: 4 / 3; border-radius: 6px; overflow: hidden; background: #fff; border: 1px solid var(--border-subtle);
  display: flex; align-items: flex-start; justify-content: center; margin-bottom: 6px; position: relative; }
.lx-tpl-pic > i { align-self: center; font-size: 30px !important; opacity: .25; }
.lx-tpl-pic.has > i { display: none; }
.lx-tpl-pic img { width: 100%; height: 100%; object-fit: cover; object-position: top center; }
.lx-tpl-cats { margin: 0 0 10px; flex-wrap: wrap; }
.lx-tpls { max-height: 56vh; }
@media (max-width: 560px) {
  .lx-tpls { grid-template-columns: 1fr 1fr; gap: 6px; }
  .lx-tpl { padding: 8px; }
  .lx-tpl > span { display: none; }
  .lx-tpl strong { font-size: 12.5px; }
  .lx-tpl strong > i { display: none; }
  .lx-chips.lx-tpl-cats { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; padding-bottom: 2px; }
  .lx-tpl-cats .lx-chip { flex: none; }
}
.lx-log { max-height: 60vh; overflow: auto; font-size: 11.5px; line-height: 1.45; background: var(--bg-surface-2); padding: 12px;
  border-radius: 8px; white-space: pre-wrap; word-break: break-word; margin: 0; }
.lx-keys { width: 100%; border-collapse: collapse; font-size: 13px; }
.lx-keys td { padding: 7px 4px; border-bottom: 1px solid var(--border-subtle); color: var(--text-primary); }
.lx-keys kbd { font-family: inherit; font-size: 11px; padding: 2px 6px; border: 1px solid var(--border-default); border-bottom-width: 2px; border-radius: 5px; background: var(--bg-surface-2); }

/* ---------- editor shell ---------- */
.lx-ed { display: flex; flex-direction: column; min-height: 420px; background: var(--bg-surface);
  border-top: 1px solid var(--border-subtle); overflow: hidden; }
.lx-top { display: flex; align-items: center; gap: 6px; padding: 6px 10px; border-bottom: 1px solid var(--border-subtle); flex-shrink: 0; min-height: 50px; }
.lx-grow { flex: 1; }
.lx-title { display: inline-flex; align-items: center; gap: 8px; max-width: 34vw; border: 0; background: none; cursor: pointer;
  font-weight: 700; font-size: 15px; color: var(--text-primary); padding: 6px 8px; border-radius: 8px; }
.lx-title span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lx-title i { font-size: 11px; color: var(--text-secondary); opacity: 0; transition: opacity .15s; }
.lx-title:hover { background: var(--bg-surface-2); } .lx-title:hover i { opacity: 1; }
.lx-save { font-size: 12px; color: var(--text-secondary); white-space: nowrap; display: inline-flex; align-items: center; gap: 5px; }
.lx-save.dirty i { font-size: 7px; color: #d97706; } .lx-save.saved i { color: #059669; } .lx-save.error { color: #dc2626; }
.lx-compile { white-space: nowrap; }
.lx-issues-btn { border: 0; border-radius: 999px; padding: 5px 10px; font-weight: 700; font-size: 12px; cursor: pointer; display: inline-flex; align-items: center; gap: 5px; }
.lx-issues-btn.err { background: rgba(220,38,38,.12); color: #dc2626; }
.lx-issues-btn.warn { background: rgba(217,119,6,.12); color: #b45309; }
.lx-panes { display: none; gap: 2px; background: var(--bg-surface-2); padding: 3px; border-radius: 10px; }
.lx-panes button { border: 0; background: none; padding: 6px 10px; border-radius: 8px; font-size: 12px; font-weight: 600; color: var(--text-secondary); cursor: pointer; }
.lx-panes button.on { background: var(--bg-surface); color: var(--text-primary); box-shadow: 0 1px 2px rgba(0,0,0,.08); }

.lx-body { flex: 1; min-height: 0; display: grid; grid-template-columns: 230px minmax(0, 1fr) minmax(0, 1fr); }
.lx-files { border-right: 1px solid var(--border-subtle); display: flex; flex-direction: column; min-height: 0; background: var(--bg-surface-2); }
.lx-files.drop { outline: 2px dashed var(--brand-500); outline-offset: -6px; }
.lx-files-bar { display: flex; align-items: center; gap: 0; padding: 6px 6px 6px 12px; border-bottom: 1px solid var(--border-subtle); }
.lx-files-bar > span { flex: 1; font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .4px; color: var(--text-secondary); }
.lx-files-bar .lx-icon-btn { width: 30px; height: 30px; }
.lx-tree { flex: 1; overflow: auto; padding: 6px 4px; }
.lx-files-hint { font-size: 11.5px; color: var(--text-secondary); padding: 8px 12px; margin: 0; }
.lx-node { display: flex; align-items: center; gap: 6px; padding: 5px 6px 5px calc(8px + var(--d, 0) * 14px); border-radius: 6px;
  cursor: pointer; font-size: 13px; color: var(--text-primary); position: relative; min-height: 30px; }
.lx-node:hover { background: var(--bg-surface); }
.lx-node.on { background: rgba(79,70,229,.12); color: var(--brand-700, #4338ca); font-weight: 600; }
.lx-node .lx-ico { width: 16px; text-align: center; color: var(--text-secondary); flex-shrink: 0; }
.lx-node.dir .lx-ico { color: #e3a008; }
.lx-chev { font-size: 9px; width: 10px; color: var(--text-secondary); transition: transform .15s; }
.lx-node.dir.open .lx-chev { transform: rotate(90deg); }
.lx-node.file { padding-left: calc(24px + var(--d, 0) * 14px); }
.lx-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lx-main { color: #e3a008; font-size: 12px; }
.lx-node-acts { display: none; gap: 0; }
.lx-node:hover .lx-node-acts, .lx-node:focus-within .lx-node-acts { display: inline-flex; }
.lx-node-acts button { border: 0; background: none; color: var(--text-secondary); width: 24px; height: 24px; border-radius: 5px; cursor: pointer; font-size: 11px; }
.lx-node-acts button:hover { background: var(--bg-surface-2); color: var(--text-primary); }

.lx-code { display: flex; flex-direction: column; min-width: 0; min-height: 0; border-right: 1px solid var(--border-subtle); }
.lx-code-bar { display: flex; align-items: center; gap: 8px; padding: 7px 12px; font-size: 12.5px; color: var(--text-secondary);
  border-bottom: 1px solid var(--border-subtle); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lx-cm { flex: 1; min-height: 0; position: relative; }
.lx-cm .CodeMirror { position: absolute; inset: 0; height: 100%; font-family: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: var(--lx-fs, 14px); line-height: 1.55; background: var(--bg-surface); color: var(--text-primary); }
.lx-cm .CodeMirror-gutters { background: var(--bg-surface-2); border-right: 1px solid var(--border-subtle); }
.lx-cm .CodeMirror-linenumber { color: var(--text-secondary); opacity: .7; }
.lx-cm .CodeMirror-cursor { border-left-color: var(--text-primary); }
.lx-cm .CodeMirror-activeline-background { background: rgba(79,70,229,.05); }
.lx-cm .CodeMirror-selected, .lx-cm .CodeMirror-focused .CodeMirror-selected { background: rgba(79,70,229,.18); }
.lx-cm .lx-err-line { background: rgba(220,38,38,.12); }
.lx-cm .cm-s-lx .cm-tag, .lx-cm .cm-tag { color: #4f46e5; }
.lx-cm .cm-keyword { color: #7c3aed; }
.lx-cm .cm-atom { color: #b45309; }
.lx-cm .cm-builtin { color: #0f766e; }
.lx-cm .cm-bracket { color: #64748b; }
.lx-cm .cm-comment { color: #94a3b8; font-style: italic; }
.lx-cm .cm-string, .lx-cm .cm-string-2 { color: #059669; }
.lx-cm .cm-number { color: #c2410c; }
.lx-cm .cm-error { color: #dc2626; background: none; }
.lx-cm .CodeMirror-matchingbracket { color: inherit !important; background: rgba(5,150,105,.2); }
.lx-preview { flex: 1; overflow: auto; padding: 20px; }
.lx-binary { text-align: center; color: var(--text-secondary); }
.lx-binary > i { font-size: 40px; margin-bottom: 10px; }
.lx-binary img { max-width: 100%; max-height: 55vh; display: block; margin: 0 auto 14px; border-radius: 8px; border: 1px solid var(--border-subtle);
  background: repeating-conic-gradient(#e5e7eb 0 25%, #fff 0 50%) 50% / 16px 16px; }
.lx-binary code { font-size: 12px; background: var(--bg-surface-2); padding: 3px 6px; border-radius: 5px; word-break: break-all; }

.lx-pdf { display: flex; flex-direction: column; min-width: 0; min-height: 0; position: relative; background: var(--bg-surface-2); }
.lx-pdf-bar { display: flex; align-items: center; gap: 2px; padding: 4px 8px; border-bottom: 1px solid var(--border-subtle); background: var(--bg-surface); }
.lx-zoom { border: 0; background: none; font-size: 12px; font-weight: 600; color: var(--text-secondary); min-width: 50px; cursor: pointer; padding: 6px; border-radius: 6px; }
.lx-zoom:hover { background: var(--bg-surface-2); }
.lx-pdf-info { font-size: 12px; color: var(--text-secondary); padding-right: 4px; }
.lx-pdf-pages { flex: 1; overflow: auto; position: relative; display: flex; flex-direction: column; touch-action: pan-x pan-y; outline: none; }
/* wider than the box when zoomed: it grows (and scrolls) to the right instead of being cut on the left */
.lx-pdf-inner { display: flex; flex-direction: column; align-items: flex-start; gap: 12px; padding: 12px 14px; min-width: 100%; width: max-content;
  box-sizing: border-box; transform-origin: 0 0; flex-shrink: 0; }
.lx-pdf-inner .lx-page { margin: 0 auto; }
.lx-page { background: #fff; box-shadow: 0 1px 4px rgba(0,0,0,.18); flex-shrink: 0; max-width: none; }
.lx-page canvas { display: block; }
.lx-pdf-empty { margin: auto; text-align: center; color: var(--text-secondary); padding: 30px 16px; }
.lx-pdf-empty i { font-size: 34px; opacity: .5; margin-bottom: 8px; }
.lx-issues { position: absolute; left: 8px; right: 8px; bottom: 8px; max-height: 55%; display: flex; flex-direction: column;
  background: var(--bg-surface); border: 1px solid var(--border-default); border-radius: 12px; box-shadow: 0 10px 30px rgba(0,0,0,.18); overflow: hidden; }
.lx-issues[hidden] { display: none; }
.lx-issues-head { display: flex; align-items: center; padding: 6px 6px 6px 12px; border-bottom: 1px solid var(--border-subtle); font-size: 13px; color: var(--text-primary); }
.lx-issues-list { overflow: auto; padding: 4px; }
.lx-issue { display: flex; gap: 10px; width: 100%; text-align: left; padding: 8px 10px; border: 0; background: none; border-radius: 8px; cursor: pointer; color: var(--text-primary); }
.lx-issue:hover { background: var(--bg-surface-2); }
.lx-issue > i { margin-top: 3px; } .lx-issue.error > i { color: #dc2626; } .lx-issue.warning > i { color: #d97706; }
.lx-issue span { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.lx-issue b { font-weight: 600; font-size: 13px; overflow-wrap: anywhere; }
.lx-issue small { font-size: 11.5px; color: var(--text-secondary); overflow-wrap: anywhere; }

.lx-menu { position: fixed; z-index: 3000; min-width: 230px; padding: 6px; background: var(--bg-surface);
  border: 1px solid var(--border-default); border-radius: 12px; box-shadow: 0 12px 32px rgba(0,0,0,.18); }
.lx-menu button { display: flex; align-items: center; gap: 10px; width: 100%; padding: 9px 12px; border: 0; background: none;
  text-align: left; font-size: 13px; color: var(--text-primary); border-radius: 8px; cursor: pointer; }
.lx-menu button:hover { background: var(--bg-surface-2); }
.lx-menu i { width: 16px; color: var(--text-secondary); }

/* ---------- dark theme ---------- */
[data-theme="dark"] .lx-cm .cm-tag { color: #a5b4fc; }
[data-theme="dark"] .lx-cm .cm-keyword { color: #c4b5fd; }
[data-theme="dark"] .lx-cm .cm-atom { color: #fbbf24; }
[data-theme="dark"] .lx-cm .cm-builtin { color: #5eead4; }
[data-theme="dark"] .lx-cm .cm-comment { color: #7c8597; }
[data-theme="dark"] .lx-cm .cm-string, [data-theme="dark"] .lx-cm .cm-string-2 { color: #6ee7b7; }
[data-theme="dark"] .lx-cm .cm-number { color: #fdba74; }
[data-theme="dark"] .lx-node.on { color: #c7d2fe; }
[data-theme="dark"] .lx-pdf-pages { background: #1b1d22; }

/* ---------- tablets & phones: one pane at a time ---------- */
@media (max-width: 899px) {
  .lx-panes { display: inline-flex; }
  .lx-body { grid-template-columns: minmax(0, 1fr); }
  .lx-ed[data-pane="files"] .lx-code, .lx-ed[data-pane="files"] .lx-pdf,
  .lx-ed[data-pane="code"] .lx-files, .lx-ed[data-pane="code"] .lx-pdf,
  .lx-ed[data-pane="pdf"] .lx-files, .lx-ed[data-pane="pdf"] .lx-code { display: none; }
  .lx-code { border-right: 0; }
  .lx-files { border-right: 0; }
  .lx-node-acts { display: inline-flex; }
  .lx-top { flex-wrap: wrap; row-gap: 6px; }
  .lx-title { max-width: 52vw; }
  .lx-save { display: none; }
  .lx-compile span { display: none; }
  .lx-grid { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 480px) {
  .lx-panes button { padding: 6px 8px; }
  .lx-panes button i { display: none; }
  .lx-home-head .btn { width: 100%; }
}
.lx-issues-btn[hidden] { display: none; }

/* ⭐ 2026-10-24 — auto-compile switch, document picker, SyncTeX, uploads */
.lx-auto { display: inline-flex; align-items: center; gap: 7px; border: 1px solid var(--border-subtle); background: var(--bg-surface);
  color: var(--text-secondary); font-size: 12px; font-weight: 700; padding: 5px 10px 5px 6px; border-radius: 999px; cursor: pointer; white-space: nowrap; }
.lx-auto:hover { border-color: var(--brand-300); }
.lx-auto:focus-visible { outline: 2px solid var(--brand-500); outline-offset: 1px; }
.lx-switch { width: 26px; height: 15px; border-radius: 999px; background: var(--border-default); position: relative; transition: background .15s; flex-shrink: 0; }
.lx-switch::after { content: ""; position: absolute; top: 2px; left: 2px; width: 11px; height: 11px; border-radius: 50%; background: #fff;
  box-shadow: 0 1px 2px rgba(0,0,0,.25); transition: transform .15s; }
.lx-auto.on { color: var(--brand-600); border-color: rgba(79,70,229,.35); }
.lx-auto.on .lx-switch { background: var(--brand-600); }
.lx-auto.on .lx-switch::after { transform: translateX(11px); }
.lx-compile.busy { opacity: .85; }
.lx-target { max-width: 46%; min-width: 0; margin-left: 6px; padding: 5px 8px; font-size: 12px; border-radius: 8px;
  border: 1px solid var(--border-default); background: var(--bg-surface); color: var(--text-primary); }
.lx-target[hidden] { display: none; }
.lx-code-bar .lx-sync { width: 28px; height: 28px; }
.lx-page { position: relative; cursor: text; }
.lx-sync-hl { position: absolute; border-radius: 4px; background: rgba(250,204,21,.38); outline: 2px solid rgba(234,179,8,.8);
  pointer-events: none; animation: lxPulse 1.8s ease-out forwards; }
@keyframes lxPulse { 0% { opacity: 1; } 70% { opacity: 1; } 100% { opacity: 0; } }
.lx-cm .lx-flash-line { background: rgba(250,204,21,.28); transition: background .4s; }
.lx-tpl.up { border-style: dashed; }
.lx-tpl.up i { color: #e3a008; }
@media (max-width: 899px) {
  .lx-auto-txt { display: none; }
  .lx-auto { padding: 6px; }
  .lx-target { max-width: 52%; }
}

/* ⭐ 2026-10-24 — Phase 2: outline, share, history, read-only links */
.lx-files { overflow: hidden; }
.lx-tree { min-height: 80px; }
.lx-outline { border-top: 1px solid var(--border-subtle); display: flex; flex-direction: column; max-height: 42%; min-height: 0; }
.lx-outline-head { display: flex; align-items: center; gap: 8px; border: 0; background: none; padding: 8px 12px; cursor: pointer;
  font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .4px; color: var(--text-secondary); text-align: left; }
.lx-outline-head i { font-size: 10px; transition: transform .15s; }
.lx-outline.closed .lx-outline-head i { transform: rotate(-90deg); }
.lx-outline.closed .lx-outline-list { display: none; }
.lx-outline-list { overflow: auto; padding: 0 4px 8px; }
.lx-ol-item { display: block; width: 100%; text-align: left; border: 0; background: none; cursor: pointer; border-radius: 6px;
  padding: 4px 8px 4px calc(8px + var(--l, 0) * 12px); font-size: 12.5px; color: var(--text-primary);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lx-ol-item:hover { background: var(--bg-surface); }
.lx-ol-item.on { background: rgba(79,70,229,.12); color: var(--brand-700, #4338ca); font-weight: 600; }
[data-theme="dark"] .lx-ol-item.on { color: #c7d2fe; }
.lx-files-bar.ro .lx-icon-btn { display: none; }
.lx-title.ro { cursor: default; }
.lx-title.ro:hover { background: none; }
.lx-ro-badge { font-size: 12px; font-weight: 600; color: #0f766e; background: rgba(13,148,136,.1); padding: 4px 10px; border-radius: 999px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 40vw; }
.lx-menu hr { border: 0; border-top: 1px solid var(--border-subtle); margin: 4px 6px; }
.lx-menu .lx-on { margin-left: auto; font-size: 10px; font-weight: 700; color: #059669; background: rgba(5,150,105,.12); padding: 1px 6px; border-radius: 999px; }
.lx-share-txt { font-size: 14px; color: var(--text-secondary); line-height: 1.55; margin: 0 0 12px; }
.lx-share-row { display: flex; gap: 8px; margin-bottom: 12px; }
.lx-share-row input { flex: 1; min-width: 0; padding: 9px 10px; border: 1px solid var(--border-default); border-radius: 8px; background: var(--bg-surface-2); color: var(--text-primary); font-size: 12.5px; }
.lx-share-off { color: #dc2626; border-color: rgba(220,38,38,.35); }
.lx-hist .lx-hist-save { display: flex; gap: 8px; margin: 6px 0 4px; }
.lx-hist .lx-hist-save input { flex: 1; min-width: 0; padding: 9px 10px; border: 1px solid var(--border-default); border-radius: 8px; background: var(--bg-surface); color: var(--text-primary); }
.lx-hist-body { max-height: 56vh; overflow: auto; margin-top: 8px; display: flex; flex-direction: column; gap: 6px; }
.lx-ver { border: 1px solid var(--border-subtle); border-radius: 10px; background: var(--bg-surface-2); }
.lx-ver-head { display: flex; align-items: center; gap: 10px; padding: 8px 10px; }
.lx-ver-head > i { color: var(--brand-600); width: 16px; text-align: center; }
.lx-ver-name { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.lx-ver-name b { font-size: 13.5px; color: var(--text-primary); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lx-ver-name small { font-size: 11.5px; color: var(--text-secondary); }
.lx-ver-detail { padding: 0 10px 10px; display: flex; flex-direction: column; gap: 3px; }
.lx-vf { display: flex; align-items: center; gap: 8px; text-align: left; font-size: 12.5px; border: 0; background: var(--bg-surface); color: var(--text-primary);
  padding: 6px 8px; border-radius: 6px; cursor: pointer; }
.lx-vf small { color: var(--text-secondary); margin-left: auto; }
.lx-vf.changed i { color: #d97706; } .lx-vf.deleted i { color: #dc2626; } .lx-vf.added { cursor: default; } .lx-vf.added i { color: #059669; }
.lx-vdiff { margin-top: 6px; font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 12px; max-height: 40vh; overflow: auto;
  background: var(--bg-surface); border: 1px solid var(--border-subtle); border-radius: 8px; }
.lx-vdiff:empty { display: none; }
.lx-vdiff-head { position: sticky; top: 0; padding: 6px 10px; background: var(--bg-surface-2); border-bottom: 1px solid var(--border-subtle); font-family: inherit; display: flex; gap: 10px; }
.lx-vdiff-head .del { color: #dc2626; } .lx-vdiff-head .add { color: #059669; }
.lx-d { white-space: pre-wrap; word-break: break-word; padding: 1px 10px 1px 26px; position: relative; }
.lx-d span { position: absolute; left: 10px; opacity: .7; }
.lx-d.add { background: rgba(5,150,105,.12); } .lx-d.del { background: rgba(220,38,38,.12); text-decoration: line-through; text-decoration-color: rgba(220,38,38,.4); }
.lx-d.gap { color: var(--text-secondary); text-align: center; padding: 2px; }
@media (max-width: 899px) {
  .lx-ro-badge { max-width: 60vw; }
  .lx-ver-head { flex-wrap: wrap; }
  .lx-ver-name { flex-basis: calc(100% - 30px); }
}

/* ⭐ 2026-10-24 — the projects page: templates strip, search, filters, cards with the first page, list view */
.lx-home2 { max-width: 1240px; }
.lx-head-right { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.lx-usage { display: flex; flex-direction: column; gap: 5px; min-width: 140px; font-size: 12px; color: var(--text-secondary); }
.lx-usage-bar { height: 6px; border-radius: 999px; background: var(--bg-surface-2); border: 1px solid var(--border-subtle); overflow: hidden; }
.lx-usage-bar i { display: block; height: 100%; background: var(--brand-500); border-radius: 999px; }
.lx-usage-bar i.full { background: #dc2626; }
.lx-split { display: inline-flex; }
.lx-split .btn:first-child { border-top-right-radius: 0; border-bottom-right-radius: 0; }
.lx-split-more { border-top-left-radius: 0 !important; border-bottom-left-radius: 0 !important; padding-left: 10px !important; padding-right: 10px !important;
  border-left: 1px solid rgba(255,255,255,.25) !important; }

.lx-strip { display: flex; gap: 10px; overflow-x: auto; padding: 4px 2px 12px; margin: 4px 0 14px; scrollbar-width: thin; }
.lx-strip-card { flex: 0 0 auto; display: flex; flex-direction: column; align-items: center; gap: 8px; width: 118px; padding: 12px 8px 10px;
  border: 1px solid var(--border-subtle); border-radius: 12px; background: var(--bg-surface); color: var(--text-primary);
  font-size: 12.5px; font-weight: 600; cursor: pointer; text-align: center; transition: transform .15s, border-color .15s, box-shadow .15s; }
.lx-strip-card:hover, .lx-strip-card:focus-visible { transform: translateY(-2px); border-color: var(--brand-300); box-shadow: 0 6px 16px rgba(0,0,0,.08); outline: none; }
.lx-strip-ico { width: 54px; height: 66px; border-radius: 6px; display: grid; place-items: center; font-size: 20px; color: var(--brand-600);
  background: linear-gradient(180deg, #fff, #f3f4ff); border: 1px solid var(--border-subtle); box-shadow: 0 1px 2px rgba(0,0,0,.06); }
.lx-strip-card.up .lx-strip-ico { color: #e3a008; border-style: dashed; background: var(--bg-surface-2); }
[data-theme="dark"] .lx-strip-ico { background: linear-gradient(180deg, #2a2b36, #23242e); }

.lx-bar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 12px; }
.lx-search { display: flex; align-items: center; gap: 8px; padding: 0 12px; height: 38px; min-width: 240px; flex: 0 1 320px;
  border: 1px solid var(--border-default); border-radius: 10px; background: var(--bg-surface); color: var(--text-secondary); }
.lx-search:focus-within { border-color: var(--brand-500); box-shadow: 0 0 0 3px rgba(79,70,229,.12); }
.lx-search input { flex: 1; min-width: 0; border: 0; outline: 0; background: none; color: var(--text-primary); font-size: 14px; height: 100%; }
.lx-chips { display: flex; gap: 6px; flex-wrap: wrap; }
.lx-chip { border: 1px solid var(--border-subtle); background: var(--bg-surface); color: var(--text-secondary); border-radius: 999px;
  padding: 6px 12px; font-size: 12.5px; font-weight: 600; cursor: pointer; }
.lx-chip span { font-weight: 700; opacity: .7; margin-left: 2px; }
.lx-chip.on { background: var(--brand-600); border-color: var(--brand-600); color: #fff; }
.lx-chip.on span { opacity: .9; }
.lx-sort { height: 38px; padding: 0 10px; border: 1px solid var(--border-default); border-radius: 10px; background: var(--bg-surface); color: var(--text-primary); font-size: 13px; }
.lx-views { display: inline-flex; border: 1px solid var(--border-default); border-radius: 10px; overflow: hidden; }
.lx-views button { width: 38px; height: 36px; border: 0; background: var(--bg-surface); color: var(--text-secondary); cursor: pointer; }
.lx-views button.on { background: var(--bg-surface-2); color: var(--brand-600); }
.lx-bulk { display: flex; align-items: center; gap: 8px; padding: 8px 12px; margin-bottom: 10px; border-radius: 10px;
  background: rgba(79,70,229,.08); border: 1px solid rgba(79,70,229,.25); font-size: 13px; font-weight: 600; color: var(--text-primary); }
.lx-bulk[hidden] { display: none; }
.lx-bulk span { flex: 1; }

.lx-results.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 14px; }
.lx-pcard { display: flex; flex-direction: column; border: 1px solid var(--border-subtle); border-radius: 14px; background: var(--bg-surface);
  overflow: hidden; cursor: pointer; transition: transform .15s, box-shadow .15s, border-color .15s; }
.lx-pcard:hover, .lx-pcard:focus-visible { transform: translateY(-2px); box-shadow: 0 10px 24px rgba(0,0,0,.10); border-color: var(--brand-300); outline: none; }
.lx-thumb { position: relative; aspect-ratio: 4 / 3; background: var(--bg-surface-2); border-bottom: 1px solid var(--border-subtle); overflow: hidden; }
.lx-thumb img { position: absolute; left: 50%; top: 10px; transform: translateX(-50%); width: 78%; background: #fff; box-shadow: 0 2px 8px rgba(0,0,0,.18); border-radius: 2px; }
.lx-thumb-wait { position: absolute; left: 11%; right: 11%; top: 10px; bottom: -10px; background: linear-gradient(90deg, #eef0f4 25%, #f7f8fa 50%, #eef0f4 75%);
  background-size: 200% 100%; animation: lxShimmer 1.2s infinite linear; border-radius: 2px; }
.lx-thumb-wait.fail { animation: none; }
[data-theme="dark"] .lx-thumb-wait { background: linear-gradient(90deg, #2a2b35 25%, #32333e 50%, #2a2b35 75%); background-size: 200% 100%; }
@keyframes lxShimmer { from { background-position: 200% 0; } to { background-position: -200% 0; } }
.lx-thumb-none { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; color: var(--text-secondary); font-size: 12px; }
.lx-thumb-none i { font-size: 26px; opacity: .45; }
.lx-star { position: absolute; top: 8px; right: 8px; width: 32px; height: 32px; border-radius: 50%; border: 0; cursor: pointer;
  background: rgba(255,255,255,.92); color: #9ca3af; box-shadow: 0 1px 4px rgba(0,0,0,.15); opacity: 0; transition: opacity .15s, transform .15s; }
.lx-pcard:hover .lx-star, .lx-pcard:focus-within .lx-star, .lx-star.on { opacity: 1; }
.lx-star.on { color: #f59e0b; }
.lx-star:hover { transform: scale(1.08); }
.lx-star.sm { position: static; width: 28px; height: 28px; opacity: 1; box-shadow: none; background: none; }
.lx-tag { position: absolute; left: 8px; top: 8px; font-size: 11px; font-weight: 700; padding: 3px 8px; border-radius: 999px; }
.lx-tag.shared { background: rgba(13,148,136,.92); color: #fff; }
.lx-tag.sm { position: static; padding: 1px 6px; font-size: 10px; }
.lx-pcard-body { padding: 10px 12px 12px; display: flex; flex-direction: column; gap: 5px; }
.lx-pcard-top { display: flex; align-items: center; gap: 6px; }
.lx-pcard-top strong { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 14.5px; color: var(--text-primary); }
.lx-pcard-top .lx-icon-btn { width: 30px; height: 30px; margin-right: -6px; }
.lx-pcard-meta { display: flex; align-items: center; justify-content: space-between; gap: 8px; font-size: 12px; color: var(--text-secondary); }
.lx-pcard-meta.sub { justify-content: flex-start; gap: 12px; opacity: .85; }
.lx-pcard-meta.sub span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lx-st { display: inline-flex; align-items: center; gap: 5px; font-weight: 600; white-space: nowrap; }
.lx-st.ok { color: #059669; } .lx-st.bad { color: #d97706; } .lx-st.none { color: var(--text-secondary); } .lx-st.none i { font-size: 7px; }

.lx-results.list { display: flex; flex-direction: column; border: 1px solid var(--border-subtle); border-radius: 12px; overflow: hidden; background: var(--bg-surface); }
.lx-prow { display: grid; grid-template-columns: 34px 32px minmax(0, 1fr) 130px 80px 110px 40px; align-items: center; gap: 8px; padding: 8px 12px;
  border-bottom: 1px solid var(--border-subtle); cursor: pointer; font-size: 13px; }
.lx-prow:last-child { border-bottom: 0; }
.lx-prow:hover, .lx-prow:focus-visible { background: var(--bg-surface-2); outline: none; }
.lx-prow.sel { background: rgba(79,70,229,.07); }
.lx-prow.head { cursor: default; font-size: 11.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .4px; color: var(--text-secondary); background: var(--bg-surface-2); }
.lx-prow-name { display: flex; flex-direction: column; min-width: 0; }
.lx-prow-name strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--text-primary); }
.lx-prow-name small { font-size: 11.5px; color: var(--text-secondary); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lx-muted { color: var(--text-secondary); font-size: 12.5px; }
.lx-check { display: grid; place-items: center; width: 30px; height: 30px; cursor: pointer; }
.lx-check input { width: 16px; height: 16px; accent-color: var(--brand-600); cursor: pointer; }
.lx-none { grid-column: 1 / -1; text-align: center; padding: 48px 16px; color: var(--text-secondary); }
.lx-none i { font-size: 26px; opacity: .5; margin-bottom: 8px; }
.lx-menu button.danger { color: #dc2626; }
.lx-menu button.danger i { color: #dc2626; }

@media (max-width: 760px) {
  .lx-head-right { width: 100%; justify-content: space-between; }
  .lx-search { flex: 1 1 100%; min-width: 0; }
  .lx-bar .lx-grow { display: none; }
  .lx-results.grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .lx-pcard-meta.sub { display: none; }
  .lx-star { opacity: 1; }
  .lx-prow { grid-template-columns: 30px 28px minmax(0, 1fr) 70px 34px; }
  .lx-hide-sm { display: none; }
  .lx-prow.head span:nth-child(4), .lx-prow.head span:nth-child(5) { display: none; }
}
@media (max-width: 380px) { .lx-results.grid { grid-template-columns: minmax(0, 1fr); } }

/* ⭐ 2026-10-24 — editor: tabs, toolbar, symbols, snippets, gutter, folding, layout, status */
.lx-sr { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.lx-code-bar { padding: 0 6px 0 0; gap: 4px; min-height: 38px; background: var(--bg-surface-2); }
.lx-tabs { display: flex; align-items: stretch; flex: 1; min-width: 0; overflow-x: auto; scrollbar-width: thin; align-self: stretch; }
.lx-tabs::-webkit-scrollbar { height: 3px; } .lx-tabs::-webkit-scrollbar-thumb { background: var(--border-default); }
.lx-tab { display: inline-flex; align-items: center; gap: 6px; padding: 0 6px 0 12px; font-size: 12.5px; color: var(--text-secondary); cursor: pointer;
  border-right: 1px solid var(--border-subtle); white-space: nowrap; flex-shrink: 0; position: relative; user-select: none; max-width: 230px; }
.lx-tab > span { overflow: hidden; text-overflow: ellipsis; }
.lx-tab small { opacity: .65; font-size: 10.5px; }
.lx-tab i { font-size: 11px; }
.lx-tab:hover { background: var(--bg-surface); color: var(--text-primary); }
.lx-tab.on { background: var(--bg-surface); color: var(--text-primary); font-weight: 600; }
.lx-tab.on::after { content: ""; position: absolute; left: 0; right: 0; top: 0; height: 2px; background: var(--brand-500); }
.lx-tab:focus-visible { outline: 2px solid var(--brand-500); outline-offset: -2px; }
.lx-tab-x { border: 0; background: none; color: inherit; width: 20px; height: 20px; border-radius: 5px; cursor: pointer; font-size: 11px; opacity: 0; display: grid; place-items: center; }
.lx-tab:hover .lx-tab-x, .lx-tab.on .lx-tab-x { opacity: .7; }
.lx-tab-x:hover { opacity: 1 !important; background: var(--bg-surface-2); }
.lx-tab.dirty .lx-tab-x { opacity: 1; }
.lx-tab.dirty .lx-tab-x i::before { content: "\f111"; font-size: 7px; color: #d97706; }
.lx-tab.dirty .lx-tab-x:hover i::before { content: "\f00d"; font-size: 11px; color: inherit; }

.lx-tools { display: flex; align-items: center; gap: 1px; padding: 3px 6px; border-bottom: 1px solid var(--border-subtle); background: var(--bg-surface);
  overflow-x: auto; scrollbar-width: none; flex-shrink: 0; }
.lx-tools::-webkit-scrollbar { display: none; }
.lx-tools[hidden] { display: none; }
.lx-tools button { border: 0; background: none; color: var(--text-secondary); min-width: 30px; height: 30px; padding: 0 6px; border-radius: 6px;
  cursor: pointer; font-size: 13px; flex-shrink: 0; display: inline-grid; place-items: center; }
.lx-tools button:hover { background: var(--bg-surface-2); color: var(--text-primary); }
.lx-tools button.on { background: rgba(79,70,229,.14); color: var(--brand-600); }
.lx-tools button:focus-visible, .lx-layout button:focus-visible { outline: 2px solid var(--brand-500); outline-offset: -1px; }
.lx-tx { font-family: "Times New Roman", Georgia, serif; font-size: 14.5px; font-weight: 600; line-height: 1; }
.lx-tx sub { font-size: 10px; }
.lx-tsep { width: 1px; height: 18px; background: var(--border-subtle); margin: 0 4px; flex-shrink: 0; }
.lx-head { height: 28px; padding: 0 6px; font-size: 12.5px; border-radius: 6px; border: 1px solid var(--border-subtle); background: var(--bg-surface);
  color: var(--text-primary); margin-right: 4px; flex-shrink: 0; cursor: pointer; }

.lx-symbols { border-bottom: 1px solid var(--border-subtle); background: var(--bg-surface-2); flex-shrink: 0; }
.lx-symbols[hidden] { display: none; }
.lx-sym-tabs { display: flex; align-items: center; gap: 2px; padding: 4px 6px 0; overflow-x: auto; scrollbar-width: none; }
.lx-sym-tabs [data-st] { border: 0; background: none; font-size: 12px; font-weight: 600; color: var(--text-secondary); padding: 5px 9px; border-radius: 6px; cursor: pointer; white-space: nowrap; }
.lx-sym-tabs [data-st].on { background: var(--bg-surface); color: var(--brand-600); box-shadow: 0 1px 2px rgba(0,0,0,.06); }
.lx-sym-tabs .lx-icon-btn { width: 28px; height: 28px; }
.lx-sym-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(38px, 1fr)); gap: 3px; padding: 6px; max-height: 128px; overflow: auto; }
.lx-sym-grid button { height: 34px; border: 1px solid var(--border-subtle); background: var(--bg-surface); border-radius: 6px; cursor: pointer;
  font-family: "Cambria Math", "STIX Two Math", "Times New Roman", serif; font-size: 16px; color: var(--text-primary); padding: 0 2px; white-space: nowrap; overflow: hidden; }
.lx-sym-grid button:hover { border-color: var(--brand-500); background: rgba(79,70,229,.08); }
.lx-sym-hint { font-size: 11px; color: var(--text-secondary); padding: 0 10px 6px; }

.lx-cm .lx-ph { background: rgba(79,70,229,.12); outline: 1px dashed rgba(79,70,229,.55); border-radius: 2px; }
.CodeMirror-hints { z-index: 3001; }
.CodeMirror-hint.lx-hint-snip { color: var(--brand-600, #4f46e5); font-weight: 600; }
.CodeMirror-hint.lx-hint-snip::before { content: "⚡ "; }
.lx-cm .lx-gut { width: 16px; }
.lx-gm { display: inline-block; width: 16px; text-align: center; font-size: 11px; cursor: help; }
.lx-gm.err { color: #dc2626; } .lx-gm.warn { color: #d97706; }
.lx-cm .CodeMirror-foldgutter { width: 14px; }
.lx-cm .CodeMirror-foldgutter-open, .lx-cm .CodeMirror-foldgutter-folded { color: var(--text-secondary); cursor: pointer; opacity: .55; }
.lx-cm .CodeMirror-foldgutter-open:hover, .lx-cm .CodeMirror-foldgutter-folded { opacity: 1; }
.lx-cm .CodeMirror-foldmarker { color: var(--brand-600); text-shadow: none; font-family: inherit; background: rgba(79,70,229,.12); border-radius: 4px; padding: 0 6px; margin: 0 4px; }

.lx-status { display: flex; align-items: center; gap: 8px; padding: 2px 10px; min-height: 24px; font-size: 11.5px; color: var(--text-secondary);
  border-top: 1px solid var(--border-subtle); background: var(--bg-surface-2); flex-shrink: 0; }
.lx-st-words { border: 0; background: none; color: inherit; font-size: 11.5px; cursor: pointer; padding: 2px 6px; border-radius: 5px; }
.lx-st-words:hover { background: var(--bg-surface); color: var(--text-primary); }
.lx-preview:not([hidden]) ~ .lx-status .lx-st-pos { visibility: hidden; }

.lx-tpick { padding: 10px; min-width: 0; }
.lx-tpick-grid { display: grid; gap: 3px; }
.lx-tpick-grid button { width: 18px; height: 18px; padding: 0; border: 1px solid var(--border-default); border-radius: 3px; background: var(--bg-surface); cursor: pointer; }
.lx-tpick-grid button.on { background: rgba(79,70,229,.35); border-color: var(--brand-500); }
.lx-tpick-lbl { font-size: 12px; color: var(--text-secondary); text-align: center; margin-top: 8px; }

.lx-layout { display: inline-flex; align-items: center; gap: 1px; background: var(--bg-surface-2); padding: 2px; border-radius: 9px; }
.lx-layout button { border: 0; background: none; width: 30px; height: 28px; border-radius: 7px; color: var(--text-secondary); cursor: pointer; font-size: 12.5px; }
.lx-layout button:hover { color: var(--text-primary); }
.lx-layout button.on { background: var(--bg-surface); color: var(--brand-600); box-shadow: 0 1px 2px rgba(0,0,0,.08); }
.lx-layout .lx-tsep { margin: 0 2px; }
@media (min-width: 900px) {
  .lx-ed.lx-nofiles .lx-files { display: none; }
  .lx-ed[data-layout="code"] .lx-pdf { display: none; }
  .lx-ed[data-layout="pdf"] .lx-code { display: none; }
  .lx-ed[data-layout="code"] .lx-code { border-right: 0; }
}
.lx-split-h { position: absolute; left: -4px; top: 0; bottom: 0; width: 8px; cursor: col-resize; z-index: 6; }
.lx-split-h:hover, .lx-resizing .lx-split-h { background: linear-gradient(90deg, transparent 3px, var(--brand-500) 3px, var(--brand-500) 5px, transparent 5px); }
.lx-ed:not([data-layout="split"]) .lx-split-h { display: none; }
.lx-resizing { user-select: none; cursor: col-resize; }
.lx-resizing .lx-pdf-pages, .lx-resizing .CodeMirror { pointer-events: none; }
.lx-ed.lx-full { position: fixed; inset: 0; z-index: 2000; height: 100vh !important; border-top: 0; }
html.lx-noscroll, html.lx-noscroll body { overflow: hidden; }

.lx-check { display: flex; align-items: center; gap: 8px; font-size: 13.5px; color: var(--text-primary); padding: 6px 0; cursor: pointer; }
.lx-check input { width: 16px; height: 16px; accent-color: var(--brand-600); }
.lx-2col { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.lx-wc td:last-child { text-align: right; font-weight: 700; font-variant-numeric: tabular-nums; }

@media (max-width: 899px) {
  .lx-layout { display: none; }
  .lx-split-h { display: none; }
  .lx-tab { padding-left: 10px; }
  .lx-tab-x { opacity: .7; }
}
@media (max-width: 480px) {
  .lx-2col { grid-template-columns: 1fr; }
  .lx-st-pos { display: none; }
}

/* ⭐ 2026-10-24 — maths preview, search in all files */
.lx-mathpv { z-index: 8; margin-top: 4px; padding: 8px 14px; max-width: min(640px, 92%); overflow-x: auto; background: var(--bg-surface);
  color: var(--text-primary); border: 1px solid var(--border-default); border-radius: 10px; box-shadow: 0 8px 24px rgba(0,0,0,.16); font-size: 1.1em; }
.lx-mathpv .katex-display { margin: 2px 0; }
.lx-mathpv.bad { font-size: 12px; color: var(--text-secondary); font-family: inherit; }
.lx-files-bar.ro .lx-icon-btn.lx-keep { display: inline-grid; place-items: center; }
.lx-files.searching .lx-tree, .lx-files.searching .lx-outline, .lx-files.searching > .lx-files-hint { display: none; }
.lx-psearch { display: flex; flex-direction: column; flex: 1; min-height: 0; }
.lx-psearch[hidden] { display: none; }
.lx-ps-head { display: flex; align-items: center; padding: 6px 6px 2px 12px; font-size: 12.5px; color: var(--text-primary); }
.lx-ps-head i { color: var(--brand-600); margin-right: 4px; }
.lx-ps-row { display: flex; gap: 4px; padding: 4px 8px; align-items: center; }
.lx-ps-row input { flex: 1; min-width: 0; padding: 7px 9px; border: 1px solid var(--border-default); border-radius: 7px; background: var(--bg-surface);
  color: var(--text-primary); font-size: 13px; font-family: "JetBrains Mono", ui-monospace, monospace; }
.lx-ps-row input:focus { outline: 2px solid var(--brand-500); outline-offset: -1px; }
.lx-ps-row .btn { white-space: nowrap; padding: 6px 8px; font-size: 12px; }
.lx-ps-opts { display: inline-flex; gap: 1px; }
.lx-ps-opts button { border: 1px solid transparent; background: none; color: var(--text-secondary); font-size: 11.5px; font-weight: 700; width: 26px; height: 28px;
  border-radius: 6px; cursor: pointer; font-family: ui-monospace, monospace; }
.lx-ps-opts button:hover { background: var(--bg-surface); }
.lx-ps-opts button.on { background: rgba(79,70,229,.14); color: var(--brand-600); border-color: rgba(79,70,229,.35); }
.lx-ps-sum { font-size: 11.5px; color: var(--text-secondary); padding: 4px 12px 6px; }
.lx-ps-res { flex: 1; overflow: auto; padding: 0 4px 8px; }
.lx-ps-file { display: flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 700; color: var(--text-primary); padding: 8px 8px 3px; }
.lx-ps-file i { color: var(--text-secondary); }
.lx-ps-file span { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lx-ps-file b { font-size: 10.5px; background: var(--bg-surface); border-radius: 99px; padding: 1px 7px; color: var(--text-secondary); }
.lx-ps-hit { display: flex; gap: 8px; width: 100%; text-align: left; border: 0; background: none; padding: 4px 8px 4px 14px; border-radius: 6px; cursor: pointer;
  font-size: 12px; color: var(--text-primary); font-family: "JetBrains Mono", ui-monospace, monospace; }
.lx-ps-hit:hover, .lx-ps-hit:focus-visible { background: var(--bg-surface); outline: none; }
.lx-ps-ln { color: var(--text-secondary); min-width: 26px; text-align: right; flex-shrink: 0; }
.lx-ps-tx { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.lx-ps-tx mark { background: rgba(250,204,21,.55); color: inherit; border-radius: 2px; padding: 0 1px; }
[data-theme="dark"] .lx-ps-tx mark { background: rgba(250,204,21,.35); }

/* ⭐ 2026-10-24 — PDF viewer: zoom menu, page number, drag */
.lx-zoom { min-width: 58px; }
.lx-zoom::after { content: " ▾"; font-size: 9px; opacity: .6; }
.lx-zmenu { min-width: 170px; }
.lx-zmenu hr { border: 0; border-top: 1px solid var(--border-subtle); margin: 4px 0; }
.lx-zmenu [aria-checked="true"] { color: var(--brand-600); font-weight: 700; }
.lx-zmenu kbd { margin-left: auto; font-size: 10.5px; opacity: .6; }
.lx-pg { display: inline-flex; align-items: center; gap: 2px; margin-left: 6px; font-size: 12px; color: var(--text-secondary); }
.lx-pg[hidden] { display: none; }
.lx-pg .lx-icon-btn { width: 26px; height: 26px; font-size: 11px; }
.lx-pg-in { width: 34px; text-align: center; padding: 3px 2px; font-size: 12px; border: 1px solid var(--border-subtle); border-radius: 6px;
  background: var(--bg-surface); color: var(--text-primary); }
.lx-pg-n { white-space: nowrap; padding: 0 2px; }
.lx-pdf-pages:focus-visible { box-shadow: inset 0 0 0 2px var(--brand-500); }
.lx-pdf-pages.lx-grabbing, .lx-pdf-pages.lx-grabbing .lx-page { cursor: grabbing; }
@media (max-width: 899px) {
  .lx-pg .lx-icon-btn { display: none; }
}

/* ⭐ 2026-10-24 — Trash */
.lx-trash-head { display: flex; align-items: center; gap: 10px; padding: 10px 14px; margin-bottom: 8px; border-radius: 10px; font-size: 13px;
  background: var(--bg-surface-2); color: var(--text-secondary); flex-wrap: wrap; }
.lx-trash-head > i { color: #dc2626; }
.lx-trash-head span { flex: 1; min-width: 200px; }
.lx-trow { grid-template-columns: 32px minmax(0, 1fr) auto auto auto !important; cursor: default; }
.lx-trow-ico { color: var(--text-secondary); text-align: center; }
.lx-icon-btn.danger:hover { color: #dc2626; }
.lx-soon { color: #dc2626; }
.lx-sort[hidden], .lx-views[hidden] { display: none; }

/* ⭐ 2026-10-24 — errors explained */
.lx-issue { flex-direction: column; gap: 0; padding: 0; cursor: default; }
.lx-issue:hover { background: none; }
.lx-issue-go { display: flex; gap: 10px; width: 100%; text-align: left; padding: 8px 10px; border: 0; background: none; border-radius: 8px; cursor: pointer; color: var(--text-primary); }
.lx-issue-go:hover { background: var(--bg-surface-2); }
.lx-issue-go > i { margin-top: 3px; } .lx-issue.error .lx-issue-go > i { color: #dc2626; } .lx-issue.warning .lx-issue-go > i { color: #d97706; }
.lx-issue-go span { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.lx-tip { display: flex; gap: 8px; margin: 0 10px 8px 34px; padding: 8px 10px; border-radius: 8px; background: rgba(250,204,21,.12); font-size: 12.5px; line-height: 1.5; color: var(--text-primary); }
.lx-tip > i { color: #ca8a04; margin-top: 3px; }
.lx-tip p { margin: 0; }
.lx-tip code { font-size: 11.5px; background: var(--bg-surface); padding: 1px 4px; border-radius: 4px; }
.lx-fixes { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.lx-fix { font-size: 12px; padding: 4px 10px; }

/* ⭐ 2026-10-24 — add a reference */
.lx-cite-row { display: flex; gap: 6px; }
.lx-cite-row input { flex: 1; min-width: 0; }
.lx-cite-out { margin: -2px 0 12px; }
.lx-cite-card { display: flex; flex-direction: column; gap: 3px; padding: 10px 12px; border-radius: 10px; background: rgba(79,70,229,.07); border: 1px solid rgba(79,70,229,.25); }
.lx-cite-card b { font-size: 14px; color: var(--text-primary); }
.lx-cite-card span { font-size: 12.5px; color: var(--text-secondary); }
.lx-cite-card code { align-self: flex-start; font-size: 12px; margin-top: 2px; background: var(--bg-surface); padding: 1px 6px; border-radius: 5px; }
.lx-cite-bib { max-height: 160px; overflow: auto; font-size: 11.5px; line-height: 1.45; background: var(--bg-surface-2); padding: 10px; border-radius: 8px; margin: 8px 0 0; white-space: pre-wrap; }
.lx-cite-err { color: #dc2626; font-size: 13px; margin: 0; }

/* ⭐ 2026-10-24 — PDF text layer (select / copy), links, search */
.lx-tl { position: absolute; inset: 0; overflow: hidden; line-height: 1; text-align: initial; -webkit-text-size-adjust: none; text-size-adjust: none;
  forced-color-adjust: none; transform-origin: 0 0; z-index: 2; opacity: 1; }
.lx-tl :is(span, br):not(.lx-hl) { color: transparent; position: absolute; white-space: pre; cursor: text; transform-origin: 0% 0%; }
.lx-tl span.markedContent { top: 0; height: 0; }
.lx-tl ::selection { background: rgba(37,99,235,.28); color: transparent; }
.lx-tl br::selection { background: transparent; }
.lx-tl .endOfContent { display: block; position: absolute; inset: 100% 0 0; z-index: -1; cursor: default; user-select: none; }
.lx-tl .endOfContent.active { top: 0; }
.lx-tl .lx-hl { color: transparent; background: rgba(250,204,21,.5); border-radius: 2px; margin: -1px; padding: 1px; }
.lx-tl .lx-hl.cur { background: rgba(249,115,22,.65); box-shadow: 0 0 0 1px rgba(234,88,12,.9); }
.lx-links { position: absolute; inset: 0; z-index: 3; pointer-events: none; }
.lx-links a { position: absolute; pointer-events: auto; border-radius: 2px; }
.lx-links a:hover { background: rgba(37,99,235,.12); outline: 1px solid rgba(37,99,235,.45); }
.lx-pfind { display: flex; align-items: center; gap: 4px; padding: 4px 8px; border-bottom: 1px solid var(--border-subtle); background: var(--bg-surface); }
.lx-pfind[hidden] { display: none; }
.lx-pfind > i { color: var(--text-secondary); font-size: 12px; margin: 0 4px; }
.lx-pf-q { flex: 1; min-width: 0; padding: 5px 8px; font-size: 13px; border: 1px solid var(--border-default); border-radius: 7px; background: var(--bg-surface); color: var(--text-primary); }
.lx-pf-q:focus { outline: 2px solid var(--brand-500); outline-offset: -1px; }
.lx-pf-n { font-size: 12px; color: var(--text-secondary); white-space: nowrap; min-width: 52px; text-align: center; font-variant-numeric: tabular-nums; }
.lx-pf-n.none { color: #dc2626; }
.lx-pfind .lx-icon-btn { width: 28px; height: 28px; }
/* the text layer / links stay inside the pages box: the error list and other panels float above them */
.lx-pdf-pages { z-index: 0; }
.lx-issues { z-index: 5; }
