/* PyCharm Online — Darcula mavzusi */
:root {
  --bg: #2b2b2b;
  --panel: #3c3f41;
  --panel-2: #313335;
  --border: #282828;
  --border-2: #4b4d4f;
  --text: #bbbbbb;
  --text-dim: #8c8c8c;
  --code: #a9b7c6;
  --accent: #4a88c7;
  --select: #0d293e;
  --hover: #4b6eaf;
  --green: #59a869;
  --red: #e05555;
  --yellow: #d9a343;
  --orange: #cc7832;
  --mono: 'JetBrains Mono', Consolas, monospace;
  --ui: 'Inter', 'Segoe UI', system-ui, sans-serif;
  --editor-size: 14px;
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; background: var(--bg); color: var(--text); font: 13px var(--ui); overflow: hidden; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }
kbd { font: 11px var(--mono); color: var(--text-dim); }
code { font-family: var(--mono); color: var(--code); }

#app { display: flex; flex-direction: column; height: 100vh; height: 100dvh; }

/* ---------- Menyu satri ---------- */
.menubar {
  display: flex; align-items: center; gap: 6px; height: 38px; padding: 0 8px;
  background: var(--panel); border-bottom: 1px solid var(--border); flex-shrink: 0;
}
.logo { display: flex; text-decoration: none; }
.logo-badge {
  width: 22px; height: 22px; border-radius: 4px; display: grid; place-items: center;
  font: 700 10px var(--mono); color: #000;
  background: linear-gradient(135deg, #21d789 0%, #fcf84a 55%, #07c3f2 100%);
}
/* Logotip ostidagi "saytga qaytish" maslahati — kichik, bosilmaydi, o'chirib qo'yish mumkin */
.home-tip {
  position: fixed; top: 44px; left: 6px; z-index: 60; display: flex; align-items: center; gap: 8px;
  padding: 5px 4px 5px 7px; border-radius: 6px; font-size: 12px; white-space: nowrap;
  background: #3c3f41; border: 1px solid var(--border-2); box-shadow: 0 6px 18px rgba(0, 0, 0, .45);
  animation: homeTipIn .25s ease-out;
}
.home-tip[hidden] { display: none; }
.home-tip::before {
  content: ''; position: absolute; top: -6px; left: 11px; width: 10px; height: 10px; transform: rotate(45deg);
  background: #3c3f41; border-left: 1px solid var(--border-2); border-top: 1px solid var(--border-2);
}
.home-tip .logo-badge { width: 18px; height: 18px; font-size: 8px; text-decoration: none; flex: none; }
.home-tip .x { width: 20px; height: 20px; border-radius: 4px; color: var(--text-dim); font-size: 11px; }
.home-tip .x:hover { background: #4c5052; color: var(--text); }
.home-tip.out { opacity: 0; transform: translateY(-4px); transition: opacity .3s, transform .3s; }
@keyframes homeTipIn { from { opacity: 0; transform: translateY(-4px); } }
.menus { display: flex; }
.menu { position: relative; padding: 4px 9px; border-radius: 4px; cursor: default; user-select: none; }
.menu:hover, .menu.open { background: #4c5052; }
.menu-pop {
  display: none; position: absolute; top: calc(100% + 4px); left: 0; z-index: 50; min-width: 270px;
  background: var(--panel); border: 1px solid var(--border-2); border-radius: 6px; padding: 4px;
  box-shadow: 0 8px 24px rgba(0,0,0,.5);
}
.menu.open .menu-pop { display: block; }
.menu-pop button {
  display: flex; justify-content: space-between; gap: 20px; width: 100%; text-align: left;
  padding: 5px 10px; border-radius: 4px;
}
.menu-pop button:hover { background: var(--hover); color: #fff; }
.menu-pop button:hover kbd { color: #dde; }
.menu-pop hr { border: 0; border-top: 1px solid var(--border-2); margin: 4px 0; }

.project-name { color: var(--text-dim); margin-left: 10px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.project-name .sep { margin: 0 4px; }
#crumbFile { color: var(--text); }

.toolbar { margin-left: auto; display: flex; align-items: center; gap: 4px; }
#runConfig {
  background: var(--panel-2); color: var(--text); border: 1px solid var(--border-2); border-radius: 4px;
  font: 12px var(--ui); padding: 4px 6px; max-width: 170px; outline: none;
}
.tool { width: 28px; height: 28px; border-radius: 4px; font-size: 14px; color: var(--text); }
.tool:hover { background: #4c5052; }
.tool.run { color: var(--green); }
.tool.test { color: #e2a64b; }
.tool.stop, .run-side .stop { color: #e05555; }
.run-side .stop:disabled { opacity: .35; cursor: default; }
.tool:disabled { opacity: .35; cursor: default; }

/* ---------- Asosiy qism ---------- */
.main { flex: 1; display: flex; min-height: 0; }
.stripe { width: 30px; background: var(--panel); border-right: 1px solid var(--border); display: flex; flex-direction: column; padding-top: 4px; flex-shrink: 0; }
.stripe-btn { width: 30px; height: 30px; color: var(--text-dim); }
.stripe-btn.active { background: #4c5052; color: var(--text); }

.project { width: 240px; min-width: 140px; background: var(--panel); display: flex; flex-direction: column; flex-shrink: 0; }
.project.hidden { display: none; }
.panel-head {
  display: flex; align-items: center; justify-content: space-between; height: 30px; padding: 0 6px 0 10px;
  border-bottom: 1px solid var(--border); font-weight: 600; flex-shrink: 0;
}
.panel-actions { display: flex; }
.panel-actions button { width: 24px; height: 24px; border-radius: 4px; color: var(--text-dim); font-size: 12px; }
.panel-actions button:hover { background: #4c5052; color: var(--text); }

.tree { flex: 1; overflow: auto; padding: 4px 0; user-select: none; }
.tree ul { list-style: none; margin: 0; padding: 0; }
.node {
  display: flex; align-items: center; gap: 6px; height: 24px; padding-right: 8px; white-space: nowrap; cursor: pointer;
}
.node:hover { background: #45494a; }
.node.active { background: var(--select); }
.tree:focus-within .node.active { background: #2f65ca; color: #fff; }
.node .chev { width: 12px; font-size: 9px; color: var(--text-dim); text-align: center; }
.node .ico { width: 16px; text-align: center; }
.ico.folder { color: #87939a; }
.ico.py { color: #ffd43b; }
.ico.test { color: #e2a64b; }
.ico.txt { color: #a9b7c6; }
.ico.md { color: #6897bb; }
.node .root-label { color: var(--text-dim); margin-left: 4px; font-size: 12px; }
.tree:focus { outline: none; }
.node.sel { background: #3b4754; }
.tree:focus .node.sel { background: #2f65ca; color: #fff; }
.tree.dragging .node:hover { background: transparent; }
.node.drop-into { background: #2e436e !important; box-shadow: inset 0 0 0 1px #4a88f7; }
.node.drop-into + ul { background: rgba(74, 136, 247, .08); }
.drag-ghost {
  position: fixed; top: -100px; left: -100px; padding: 4px 10px; border-radius: 4px;
  background: #2f65ca; color: #fff; font-size: 12px; white-space: nowrap;
}
.del-list { margin: 8px 0 0; padding-left: 18px; max-height: 180px; overflow: auto; }

.resizer { flex-shrink: 0; background: var(--border); }
.resizer.v { width: 3px; cursor: col-resize; }
.resizer.h { height: 3px; cursor: row-resize; }
.resizer:hover, .resizer.drag { background: var(--accent); }

.work { flex: 1; display: flex; flex-direction: column; min-width: 0; }

/* ---------- Tablar ---------- */
.tabs { display: flex; height: 32px; background: var(--panel); border-bottom: 1px solid var(--border); overflow-x: auto; flex-shrink: 0; scrollbar-width: thin; }
.tab {
  display: flex; align-items: center; gap: 7px; padding: 0 8px 0 12px; height: 100%;
  border-right: 1px solid var(--border); cursor: pointer; white-space: nowrap; position: relative; color: var(--text-dim);
}
.tab:hover { background: #45494a; }
.tab.active { background: var(--bg); color: var(--text); }
.tab.active::after { content: ''; position: absolute; left: 0; right: 0; bottom: 0; height: 3px; background: var(--accent); }
.tab .x { width: 16px; height: 16px; border-radius: 3px; font-size: 10px; color: var(--text-dim); visibility: hidden; }
.tab:hover .x, .tab.active .x { visibility: visible; }
.tab .x:hover { background: #5a5d5f; color: #fff; }
.tab.has-error .name { color: var(--red); text-decoration: underline wavy var(--red); text-underline-offset: 3px; }

/* ---------- Muharrir ---------- */
.editor-wrap { flex: 1; position: relative; min-height: 60px; }
#editor { position: absolute; inset: 0; }
.CodeMirror { height: 100%; font-family: var(--mono); font-size: var(--editor-size); line-height: 1.55; }
.cm-s-darcula .CodeMirror-gutters { background: var(--bg); border-right: 1px solid #353535; }
.cm-s-darcula .CodeMirror-linenumber { color: #606366; padding: 0 4px 0 10px; }
.cm-s-darcula .CodeMirror-activeline-background { background: #323232; }
.cm-s-darcula .CodeMirror-activeline-gutter .CodeMirror-linenumber { color: #a4a3a3; }
.run-gutter { width: 18px; }
.gutter-run { color: var(--green); font-size: 10px; cursor: pointer; padding-left: 4px; line-height: inherit; }
.gutter-run:hover { color: #7fdc8f; }
.CodeMirror-foldgutter { width: 12px; }
.CodeMirror-foldgutter-open, .CodeMirror-foldgutter-folded { color: #6a6d70; }
.cm-lint-error { text-decoration: underline wavy var(--red); text-decoration-skip-ink: none; text-underline-offset: 3px; }
.cm-lint-warning { text-decoration: underline wavy #be9117; text-decoration-skip-ink: none; text-underline-offset: 3px; }
.cm-lint-unused { opacity: .55; }
.lint-line-error { background: rgba(224, 85, 85, .08); }
.cm-flash { background: rgba(74,136,199,.35); transition: background .8s; }

.empty-editor { position: absolute; inset: 0; display: none; place-items: center; text-align: center; color: var(--text-dim); background: var(--bg); }
.empty-editor.show { display: grid; }
.empty-editor p { margin: 8px 0; }

/* Autocomplete */
.CodeMirror-hints {
  background: var(--panel); border: 1px solid var(--border-2); border-radius: 4px; box-shadow: 0 6px 18px rgba(0,0,0,.55);
  font: 13px var(--mono); max-height: 18em; z-index: 60; padding: 2px;
}
.CodeMirror-hint { color: var(--code); padding: 2px 8px 2px 4px; border-radius: 3px; display: flex; align-items: center; gap: 8px; }
li.CodeMirror-hint-active { background: #2f65ca; color: #fff; }
.hint-kind { width: 16px; height: 16px; border-radius: 50%; display: inline-grid; place-items: center; font: 700 9px var(--ui); color: #fff; flex-shrink: 0; }
.hint-kind.function, .hint-kind.f { background: #c26732; }
.hint-kind.class, .hint-kind.c { background: #2f80b3; }
.hint-kind.module, .hint-kind.m { background: #6d7a85; }
.hint-kind.keyword, .hint-kind.k { background: #8a5fb3; }
.hint-kind.instance, .hint-kind.statement, .hint-kind.param, .hint-kind.v, .hint-kind.property, .hint-kind.path { background: #4d8f53; }
.hint-type { margin-left: auto; color: var(--text-dim); font-size: 11px; padding-left: 16px; }
li.CodeMirror-hint-active .hint-type { color: #dde; }

.CodeMirror-dialog { background: var(--panel); color: var(--text); font-family: var(--ui); }
.CodeMirror-dialog input { color: var(--code); font-family: var(--mono); }

/* ---------- Pastki panel ---------- */
.bottom { height: 260px; min-height: 80px; display: flex; flex-direction: column; background: var(--bg); flex-shrink: 0; }
.bottom.hidden { display: none; }
.bottom-tabs { display: flex; align-items: center; height: 30px; background: var(--panel); border-bottom: 1px solid var(--border); flex-shrink: 0; overflow-x: auto; scrollbar-width: none; }
.btab { height: 100%; padding: 0 12px; color: var(--text-dim); white-space: nowrap; position: relative; }
.btab i { font-size: 11px; margin-right: 4px; }
.btab:hover { background: #45494a; }
.btab.active { color: var(--text); background: #4c5052; }
.btab .count:not(:empty) { background: #5a5d5f; border-radius: 8px; padding: 0 6px; font-size: 11px; margin-left: 3px; }
.btab .count.bad { background: var(--red); color: #fff; }
.btab .count.good { background: var(--green); color: #fff; }
.spacer { flex: 1; }
.bicon { width: 28px; height: 26px; color: var(--text-dim); border-radius: 4px; }
.bicon:hover { background: #4c5052; color: var(--text); }

.bpane { display: none; flex: 1; min-height: 0; }
.bpane.active { display: flex; }
.run-side { width: 30px; border-right: 1px solid #353535; display: flex; flex-direction: column; align-items: center; padding-top: 4px; flex-shrink: 0; }
.run-side button { width: 24px; height: 24px; color: var(--green); border-radius: 4px; }
.run-side button:hover { background: #4c5052; }

.out {
  margin: 0; flex: 1; overflow: auto; padding: 8px 12px; font: 13px/1.5 var(--mono); color: var(--code);
  white-space: pre-wrap; word-break: break-word; user-select: text;
}
.out .err { color: #ff6b68; }
.out .meta { color: var(--text-dim); }
.out .ok { color: var(--green); }
.out .in { color: #6fc07f; }
.out .con-input { background: transparent; border: 0; outline: 0; padding: 0; margin: 0; font: inherit; color: #6fc07f; caret-color: #6fc07f; width: 50%; min-width: 120px; }
.out .plot { position: relative; display: inline-block; margin: 6px 0; background: #fff; border-radius: 4px; padding: 4px; line-height: 0; }
.out .plot img { max-width: min(520px, 100%); max-height: 360px; cursor: zoom-in; }
.out .plot.big img { max-width: 100%; max-height: none; cursor: zoom-out; }
.out .plot-dl { position: absolute; top: 6px; right: 6px; width: 24px; height: 24px; border-radius: 4px; background: rgba(0,0,0,.55); color: #fff; font-size: 12px; opacity: 0; transition: opacity .15s; }
.out .plot:hover .plot-dl { opacity: 1; }
.out .cmd { color: #d0d0ff; }
.out .warn { color: var(--yellow); }
.out a.loc { color: #589df6; text-decoration: underline; cursor: pointer; }
.out .result { color: #9876aa; }

.repl { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.repl .out { padding-bottom: 0; }
.repl-line { display: flex; align-items: center; gap: 8px; padding: 4px 12px 8px; font: 13px var(--mono); }
.repl-line .ps { color: #cc7832; white-space: nowrap; }
.repl-line .term-ps { color: #6fc07f; }
.repl-line input { flex: 1; background: transparent; border: 0; outline: none; color: var(--code); font: inherit; min-width: 0; }
.repl-line input::placeholder { color: #5c5f61; }

/* Testlar */
.bpane[data-pane="tests"] { flex-direction: column; }
.tests-head { display: flex; align-items: center; gap: 12px; padding: 6px 12px; border-bottom: 1px solid #353535; flex-shrink: 0; }
.tests-progress { width: 160px; height: 6px; background: #45494a; border-radius: 3px; overflow: hidden; flex-shrink: 0; }
#testBar { height: 100%; width: 0; background: var(--green); transition: width .3s; }
#testBar.bad { background: var(--red); }
#testSummary { color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tests-body { flex: 1; display: flex; min-height: 0; }
.test-list { list-style: none; margin: 0; padding: 4px 0; width: 42%; min-width: 200px; overflow: auto; border-right: 1px solid #353535; }
.test-list li { display: flex; align-items: center; gap: 7px; padding: 3px 12px; cursor: pointer; white-space: nowrap; }
.test-list li.group { color: var(--text-dim); font-weight: 600; cursor: default; padding-top: 6px; }
.test-list li.case { padding-left: 28px; }
.test-list li:not(.group):hover { background: #45494a; }
.test-list li.sel { background: var(--select); }
.test-list .ms { margin-left: auto; color: var(--text-dim); font-size: 11px; }
.st-ok { color: var(--green); }
.st-fail, .st-error { color: var(--red); }
.st-skip { color: var(--text-dim); }
.test-detail { border: 0; }

/* Muammolar */
.problem-list { list-style: none; margin: 0; padding: 4px 0; flex: 1; overflow: auto; font: 13px var(--mono); }
.problem-list li { display: flex; gap: 8px; padding: 3px 12px; cursor: pointer; align-items: baseline; }
.problem-list li:hover { background: #45494a; }
.problem-list .file { color: var(--text-dim); }
.problem-list .pos { color: var(--text-dim); margin-left: auto; white-space: nowrap; }
.problem-list .empty { color: var(--text-dim); cursor: default; font-family: var(--ui); }
.problem-list .empty:hover { background: none; }
.sev-error { color: var(--red); }
.sev-warning { color: #be9117; }

/* ---------- Holat satri ---------- */
.statusbar {
  display: flex; align-items: center; gap: 14px; height: 24px; padding: 0 10px; flex-shrink: 0;
  background: var(--panel); border-top: 1px solid var(--border); font-size: 12px; color: var(--text-dim); white-space: nowrap; overflow: hidden;
}
.statusbar .grow { flex: 1; overflow: hidden; text-overflow: ellipsis; }
.dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--green); margin-right: 4px; vertical-align: 0; }
.dot.loading { background: var(--yellow); animation: pulse 1s infinite alternate; }
.dot.busy { background: var(--accent); animation: pulse .5s infinite alternate; }
.dot.fail { background: var(--red); }
@keyframes pulse { to { opacity: .3; } }

/* ---------- Kontekst menyu, modal, toast ---------- */
.ctx {
  position: fixed; display: none; z-index: 80; min-width: 210px; padding: 4px;
  background: var(--panel); border: 1px solid var(--border-2); border-radius: 6px; box-shadow: 0 8px 24px rgba(0,0,0,.5);
}
.ctx.show { display: block; }
.ctx button { display: flex; gap: 10px; align-items: center; width: 100%; text-align: left; padding: 5px 10px; border-radius: 4px; }
.ctx button i { width: 14px; color: var(--text-dim); }
.ctx button:hover { background: var(--hover); color: #fff; }
.ctx button:hover i { color: #fff; }
.ctx button.danger:hover { background: #a33; }
.ctx hr { border: 0; border-top: 1px solid var(--border-2); margin: 4px 0; }

.modal-bg { position: fixed; inset: 0; background: rgba(0,0,0,.45); display: none; place-items: center; z-index: 90; padding: 16px; }
.modal-bg.show { display: grid; }
.modal { width: min(420px, 100%); background: var(--panel); border: 1px solid var(--border-2); border-radius: 8px; padding: 16px; box-shadow: 0 16px 40px rgba(0,0,0,.6); }
.modal h4 { margin: 0 0 10px; font-size: 14px; color: #ddd; }
#modalBody { color: var(--text); line-height: 1.6; max-height: 60vh; overflow: auto; }
#modalBody table { width: 100%; border-collapse: collapse; }
#modalBody td { padding: 3px 0; }
#modalBody td:last-child { text-align: right; }
#modalInput {
  width: 100%; margin-top: 8px; padding: 6px 8px; background: var(--panel-2); color: var(--code); font: 13px var(--mono);
  border: 1px solid var(--accent); border-radius: 4px; outline: none;
}
.modal-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 14px; }
.modal-actions button { padding: 5px 14px; border-radius: 4px; border: 1px solid var(--border-2); }
.modal-actions button:hover { background: #4c5052; }
.modal-actions .primary { background: #365880; border-color: #4c708c; color: #fff; }
.modal-actions .primary:hover { background: #4a6f9e; }

.toast {
  position: fixed; right: 16px; bottom: 36px; z-index: 95; max-width: min(380px, calc(100vw - 32px));
  background: var(--panel); border: 1px solid var(--border-2); border-left: 3px solid var(--accent);
  border-radius: 6px; padding: 10px 14px; box-shadow: 0 8px 24px rgba(0,0,0,.5);
  opacity: 0; transform: translateY(8px); transition: .2s; pointer-events: none;
}
.toast.show { opacity: 1; transform: none; }
.toast.error { border-left-color: var(--red); }
.toast.success { border-left-color: var(--green); }

::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: #4e5254; border-radius: 5px; border: 2px solid transparent; background-clip: padding-box; }
::-webkit-scrollbar-track { background: transparent; }

/* ---------- Kichik ekranlar ---------- */
@media (max-width: 760px) {
  .project-name, .menus .menu[data-menu="help"], #btnFormat { display: none; }
  .project { position: absolute; z-index: 40; top: 38px; bottom: 24px; left: 30px; width: 220px; box-shadow: 4px 0 16px rgba(0,0,0,.5); }
  #resizeSide { display: none; }
  .bottom { height: 42%; }
  .test-list { width: 50%; min-width: 0; }
  .statusbar span:nth-child(n+4):not(#pyVersion) { display: none; }
  .menu { padding: 4px 6px; }
  #runConfig { max-width: 110px; }
}

/* Saqlash holati */
.folder-status { cursor: pointer; padding: 0 6px; border-radius: 4px; }
.folder-status:hover { background: #4c5052; color: var(--text); }
.folder-status.ok { color: #8fd49a; }
.folder-status.warn { color: var(--yellow); }

/* ================= Veb tillar: preview oynasi ================= */
.editor-wrap { display: flex; }
.ed-main { flex: 1; position: relative; min-width: 0; }
.preview { display: none; width: 46%; min-width: 220px; flex-direction: column; background: #1e1f22; border-left: 1px solid var(--border); }
.preview.show { display: flex; }
.pv-bar { display: flex; align-items: center; gap: 4px; height: 32px; padding: 0 6px; background: var(--panel); border-bottom: 1px solid var(--border); flex-shrink: 0; }
.pv-bar > i { color: var(--text-dim); margin: 0 4px; }
.pv-addr { flex: 1; min-width: 0; font: 12px var(--mono); color: var(--code); background: var(--panel-2); padding: 3px 8px; border-radius: 4px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pv-btn { width: 26px; height: 24px; border-radius: 4px; color: var(--text-dim); font-size: 12px; }
.pv-btn:hover, .pv-btn.on { background: #4c5052; color: var(--text); }
.pv-live { font-size: 11px; color: var(--text-dim); display: flex; align-items: center; gap: 3px; padding: 0 4px; cursor: pointer; }
.pv-stage { flex: 1; display: flex; justify-content: center; background: repeating-conic-gradient(#2a2b2e 0 25%, #26272a 0 50%) 0 0 / 20px 20px; overflow: auto; }
#previewFrame { width: 100%; height: 100%; border: 0; background: #fff; transition: width .2s; }
.btab.blink { color: var(--red); }

/* Fayl ikonlari */
.ico.html { color: #e44d26; }
.ico.css { color: #2965f1; }
.ico.js { color: #f7df1e; }
.ico.json { color: #cbcb41; }
.ico.sql { color: #e38c00; }

/* SQL natijalari */
.sql-table-wrap { overflow-x: auto; margin: 4px 0 2px; max-width: 100%; }
.sql-table { border-collapse: collapse; font: 12.5px var(--mono); }
.sql-table th { background: #3a3d41; color: #e8bf6a; text-align: left; padding: 3px 10px; border: 1px solid #4b4d4f; }
.sql-table td { padding: 2px 10px; border: 1px solid #3a3d41; color: var(--code); white-space: nowrap; max-width: 360px; overflow: hidden; text-overflow: ellipsis; }
.sql-table td.num { color: #6897bb; text-align: right; }
.sql-table td.null { color: #808080; font-style: italic; }
.sql-table tr:nth-child(even) td { background: rgba(255, 255, 255, .025); }

/* ================= PyCharm uslubidagi qidiruv paneli ================= */
.find-bar { display: none; position: absolute; top: 0; left: 0; right: 0; z-index: 8; background: var(--panel); border-bottom: 1px solid var(--border); padding: 4px 8px; box-shadow: 0 4px 12px rgba(0, 0, 0, .35); }
.find-bar.show { display: block; }
.find-bar.show ~ #editor { top: 34px; }
.find-bar.show.with-replace ~ #editor { top: 66px; }
.find-row, .replace-row { display: flex; align-items: center; gap: 4px; }
.replace-row { display: none; margin-top: 4px; padding-left: 28px; }
.find-bar.with-replace .replace-row { display: flex; }
.find-bar.with-replace #findToggleReplace i { transform: rotate(90deg); }
.fb-input { display: flex; align-items: center; gap: 6px; background: var(--panel-2); border: 1px solid var(--border-2); border-radius: 4px; padding: 0 4px 0 8px; height: 26px; width: min(380px, 45vw); }
.fb-input:focus-within { border-color: var(--accent); }
.fb-input > i { color: var(--text-dim); font-size: 11px; }
.fb-input input { flex: 1; min-width: 0; background: transparent; border: 0; outline: none; color: var(--code); font: 13px var(--mono); }
.fb-input input.bad { color: var(--red); }
.fb-opt { height: 20px; min-width: 22px; padding: 0 4px; border-radius: 3px; font: 600 11px var(--mono); color: var(--text-dim); }
.fb-opt:hover { background: #4c5052; }
.fb-opt.on { background: #365880; color: #fff; }
.fb-ico { width: 24px; height: 24px; border-radius: 4px; color: var(--text-dim); font-size: 12px; }
.fb-ico:hover { background: #4c5052; color: var(--text); }
.fb-ico i { transition: transform .15s; }
.fb-btn { height: 24px; padding: 0 10px; border-radius: 4px; border: 1px solid var(--border-2); font-size: 12px; color: var(--text); white-space: nowrap; }
.fb-btn:hover { background: #4c5052; }
.fb-count { color: var(--text-dim); font-size: 12px; min-width: 64px; text-align: center; white-space: nowrap; }
.fb-count.none { color: var(--red); }
.cm-pc-match { background: rgba(50, 89, 61, .85); border-radius: 2px; outline: 1px solid rgba(98, 151, 85, .7); }
.CodeMirror-selected, .CodeMirror-focused .CodeMirror-selected { background: #214283 !important; }
.cm-matchhighlight { background: rgba(68, 71, 90, .9); border-bottom: 1px solid #8c8c8c; }
.CodeMirror-cursors .CodeMirror-secondarycursor { border-left: 2px solid #9ab; }

/* Ctrl+bosish — havola ko'rinishi */
.ctrl-hover .CodeMirror-lines { cursor: pointer; }
.cm-goto, .cm-goto span { color: #589df6 !important; text-decoration: underline; cursor: pointer; }
.CodeMirror.shake { animation: shake .3s; }
@keyframes shake { 25% { transform: translateX(-4px); } 75% { transform: translateX(4px); } }

/* Barcha fayllarda qidirish */
.bpane[data-pane="search"] { flex-direction: column; }
.search-all { display: flex; flex-direction: column; flex: 1; min-height: 0; }
.sa-row { display: flex; gap: 6px; align-items: center; padding: 6px 10px; border-bottom: 1px solid #353535; flex-wrap: wrap; }
.search-results { list-style: none; margin: 0; padding: 4px 0; overflow: auto; flex: 1; font: 12.5px var(--mono); }
.search-results li { display: flex; gap: 10px; padding: 2px 12px 2px 28px; cursor: pointer; white-space: nowrap; }
.search-results li:hover { background: #45494a; }
.search-results li.sf { padding-left: 10px; color: var(--text); font-family: var(--ui); font-weight: 600; cursor: default; margin-top: 4px; }
.search-results li.sf:hover { background: none; }
.search-results li.empty { color: var(--text-dim); cursor: default; font-family: var(--ui); }
.search-results .ln { color: var(--text-dim); min-width: 32px; text-align: right; }
.search-results code { overflow: hidden; text-overflow: ellipsis; }
.search-results mark { background: rgba(50, 89, 61, .9); color: #fff; border-radius: 2px; }

/* Tanlash oynasi (faylga o'tish, so'nggi fayllar) */
.picker { position: fixed; inset: 0; z-index: 85; display: none; justify-content: center; align-items: flex-start; padding-top: 12vh; background: rgba(0, 0, 0, .25); }
.picker.show { display: flex; }
.pk-box { width: min(560px, calc(100vw - 32px)); background: var(--panel); border: 1px solid var(--border-2); border-radius: 8px; box-shadow: 0 16px 40px rgba(0, 0, 0, .6); overflow: hidden; }
.pk-title { padding: 8px 12px 4px; font-size: 12px; color: var(--text-dim); }
#pickerInput { width: calc(100% - 20px); margin: 4px 10px 8px; padding: 7px 10px; background: var(--panel-2); border: 1px solid var(--accent); border-radius: 4px; outline: none; color: var(--code); font: 13px var(--mono); }
#pickerList { list-style: none; margin: 0; padding: 0 0 6px; max-height: 50vh; overflow: auto; }
#pickerList li { display: flex; align-items: center; gap: 8px; padding: 5px 12px; cursor: pointer; white-space: nowrap; }
#pickerList li span { overflow: hidden; text-overflow: ellipsis; }
#pickerList li small { margin-left: auto; color: var(--text-dim); font-size: 11px; padding-left: 16px; overflow: hidden; text-overflow: ellipsis; }
#pickerList li.sel { background: #2f65ca; color: #fff; }
#pickerList li.sel small { color: #dde; }
#pickerList li.empty { color: var(--text-dim); cursor: default; }

/* Tezkor hujjat */
.doc-pop { position: fixed; z-index: 70; display: none; max-width: 460px; max-height: 320px; overflow: auto; background: #3c3f41; border: 1px solid var(--border-2); border-radius: 6px; padding: 8px 12px; box-shadow: 0 8px 24px rgba(0, 0, 0, .5); }
.doc-pop.show { display: block; }
.doc-pop b { color: #ffc66d; font-family: var(--mono); }
.doc-pop pre { margin: 6px 0 0; white-space: pre-wrap; font: 12px/1.5 var(--mono); color: var(--code); }

/* Qisqartmalar oynasi */
.modal:has(.sc-grid) { width: min(980px, 100%); }
.sc-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); gap: 12px 22px; }
.sc-grid h5 { margin: 4px 0 6px; color: var(--accent); font-size: 13px; }
.sc-grid td { font-size: 12.5px; padding: 2px 0; }
.sc-grid td:last-child { text-align: right; padding-left: 10px; }

@media (max-width: 760px) {
  .preview { position: absolute; inset: 0; width: 100% !important; z-index: 9; }
  #findAll { display: none; }
}

/* ================= Veb tillar uchun rang sxemasi =================
   Darcula'da HTML teglari, satrlar, CSS klasslari va izohlar hammasi yashil edi.
   Har bir element turi o'z rangiga ega bo'lishi uchun qayta belgilaymiz. */
.cm-s-darcula[data-lang="html"], .cm-s-darcula[data-lang="css"], .cm-s-darcula[data-lang="js"], .cm-s-darcula[data-lang="json"] { color: #d4d4d4; }
.cm-s-darcula[data-lang="html"] span.cm-tag,
.cm-s-darcula[data-lang="css"] span.cm-tag { color: #e8bf6a; font-weight: 500; font-style: normal; text-decoration: none; }
.cm-s-darcula[data-lang="html"] span.cm-tag.cm-bracket { color: #808080; font-weight: 400; }
.cm-s-darcula[data-lang="html"] span.cm-attribute { color: #9cdcfe; }
.cm-s-darcula[data-lang="html"] span.cm-string,
.cm-s-darcula[data-lang="css"] span.cm-string,
.cm-s-darcula[data-lang="js"] span.cm-string,
.cm-s-darcula[data-lang="json"] span.cm-string { color: #ce9178; }
.cm-s-darcula[data-lang="html"] span.cm-string-2,
.cm-s-darcula[data-lang="js"] span.cm-string-2 { color: #d16969; }
.cm-s-darcula[data-lang="html"] span.cm-comment,
.cm-s-darcula[data-lang="css"] span.cm-comment,
.cm-s-darcula[data-lang="js"] span.cm-comment,
.cm-s-darcula[data-lang="sql"] span.cm-comment { color: #7f848e; font-style: italic; }
.cm-s-darcula[data-lang="html"] span.cm-meta,
.cm-s-darcula[data-lang="css"] span.cm-meta { color: #c586c0; }
.cm-s-darcula[data-lang="html"] span.cm-atom { color: #6897bb; }

/* CSS (alohida fayl yoki <style> ichida) */
.cm-s-darcula[data-lang="html"] span.cm-qualifier,
.cm-s-darcula[data-lang="css"] span.cm-qualifier { color: #d7ba7d; }
.cm-s-darcula[data-lang="html"] span.cm-builtin,
.cm-s-darcula[data-lang="css"] span.cm-builtin { color: #ffc66d; }
.cm-s-darcula[data-lang="html"] span.cm-property,
.cm-s-darcula[data-lang="css"] span.cm-property { color: #9cdcfe; }
.cm-s-darcula[data-lang="css"] span.cm-atom,
.cm-s-darcula[data-lang="css"] span.cm-keyword { color: #569cd6; font-weight: 400; }
.cm-s-darcula[data-lang="css"] span.cm-variable-2,
.cm-s-darcula[data-lang="css"] span.cm-variable-3 { color: #4fc1ff; }
.cm-s-darcula[data-lang="html"] span.cm-number,
.cm-s-darcula[data-lang="css"] span.cm-number,
.cm-s-darcula[data-lang="js"] span.cm-number,
.cm-s-darcula[data-lang="json"] span.cm-number,
.cm-s-darcula[data-lang="sql"] span.cm-number { color: #b5cea8; }

/* JavaScript (alohida fayl yoki <script> ichida) */
.cm-s-darcula[data-lang="js"] span.cm-keyword { color: #cc7832; font-weight: 600; }
.cm-s-darcula[data-lang="js"] span.cm-def { color: #dcdcaa; font-style: normal; }
.cm-s-darcula[data-lang="js"] span.cm-variable { color: #d4d4d4; }
.cm-s-darcula[data-lang="js"] span.cm-variable-2 { color: #9cdcfe; }
.cm-s-darcula[data-lang="js"] span.cm-variable-3,
.cm-s-darcula[data-lang="js"] span.cm-type { color: #4ec9b0; }
.cm-s-darcula[data-lang="js"] span.cm-property { color: #c39ac9; }
.cm-s-darcula[data-lang="js"] span.cm-atom { color: #569cd6; }
.cm-s-darcula[data-lang="js"] span.cm-operator { color: #d4d4d4; }
.cm-s-darcula[data-lang="json"] span.cm-string.cm-property { color: #9cdcfe; }
.cm-s-darcula[data-lang="json"] span.cm-atom { color: #569cd6; }

/* SQL */
.cm-s-darcula[data-lang="sql"] span.cm-keyword { color: #cc7832; font-weight: 600; }
.cm-s-darcula[data-lang="sql"] span.cm-builtin,
.cm-s-darcula[data-lang="sql"] span.cm-type { color: #4ec9b0; font-weight: 400; }
.cm-s-darcula[data-lang="sql"] span.cm-string { color: #ce9178; }
.cm-s-darcula[data-lang="sql"] span.cm-atom { color: #569cd6; }
.cm-s-darcula[data-lang="sql"] span.cm-variable-2 { color: #9cdcfe; }

/* HTML teglarining juftini ajratib ko'rsatish (matchtags) */
.cm-s-darcula .CodeMirror-matchingtag { background: rgba(232, 191, 106, .16); border-bottom: 1px solid rgba(232, 191, 106, .5); }

/* Emmet: Tab bilan o'tiladigan bo'sh joylar */
.cm-tabstop { outline: 1px dashed rgba(88, 157, 246, .7); border-radius: 2px; min-width: 2px; }

/* Switcher (Alt+`) */
.picker.switcher { background: rgba(0, 0, 0, .15); padding-top: 18vh; }
.picker.switcher #pickerInput { display: none; }

/* ================= Rang namunalari va rang tanlash oynasi ================= */
.cm-color-swatch { display: inline-block; width: 12px; height: 12px; margin: 0 3px -1px 1px; border-radius: 3px; cursor: pointer; vertical-align: baseline;
  background: repeating-conic-gradient(#bbb 0 25%, #fff 0 50%) 0 0 / 6px 6px; box-shadow: 0 0 0 1px rgba(255, 255, 255, .35); overflow: hidden; }
.cm-color-swatch i { display: block; width: 100%; height: 100%; }
.cm-color-swatch:hover { transform: scale(1.25); box-shadow: 0 0 0 1px #fff; }
.cm-color-swatch.tw { border-radius: 50%; }
.color-pop { position: fixed; z-index: 90; width: 300px; display: none; background: #3c3f41; border: 1px solid var(--border-2); border-radius: 10px;
  box-shadow: 0 16px 40px rgba(0, 0, 0, .6); padding: 10px; user-select: none; font-size: 12px; }
.color-pop.show { display: block; }
.color-pop.picking { opacity: .15; }
.cp-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; color: var(--text); font-weight: 600; }
.cp-x { width: 22px; height: 22px; border-radius: 4px; font-size: 16px; color: var(--text-dim); }
.cp-x:hover { background: #4c5052; }
.cp-sv { position: relative; height: 150px; border-radius: 6px; cursor: crosshair; overflow: hidden; touch-action: none; }
.cp-sv-white { position: absolute; inset: 0; background: linear-gradient(to right, #fff, rgba(255, 255, 255, 0)); }
.cp-sv-black { position: absolute; inset: 0; background: linear-gradient(to top, #000, rgba(0, 0, 0, 0)); }
.cp-thumb { position: absolute; width: 14px; height: 14px; margin: -7px 0 0 -7px; border: 2px solid #fff; border-radius: 50%; box-shadow: 0 0 0 1px rgba(0, 0, 0, .5), inset 0 0 0 1px rgba(0, 0, 0, .3); pointer-events: none; }
.cp-row { display: flex; align-items: center; gap: 8px; margin-top: 10px; }
.cp-eye { width: 32px; height: 32px; border-radius: 6px; background: #4c5052; color: #fff; font-size: 14px; flex-shrink: 0; }
.cp-eye:hover { background: var(--accent); }
.cp-sliders { flex: 1; display: flex; flex-direction: column; gap: 8px; }
.cp-sliders input { -webkit-appearance: none; appearance: none; width: 100%; height: 10px; border-radius: 5px; margin: 0; cursor: pointer; }
.cp-hue { background: linear-gradient(to right, #f00, #ff0, #0f0, #0ff, #00f, #f0f, #f00); }
.cp-alpha { background: linear-gradient(to right, transparent, var(--c, #000)), repeating-conic-gradient(#999 0 25%, #ddd 0 50%) 0 0 / 8px 8px; }
.cp-sliders input::-webkit-slider-thumb { -webkit-appearance: none; width: 14px; height: 14px; border-radius: 50%; background: #fff; box-shadow: 0 0 0 1px rgba(0, 0, 0, .5); }
.cp-sliders input::-moz-range-thumb { width: 14px; height: 14px; border-radius: 50%; background: #fff; border: 0; }
.cp-preview { display: flex; width: 44px; height: 32px; border-radius: 6px; overflow: hidden; flex-shrink: 0; background: repeating-conic-gradient(#999 0 25%, #ddd 0 50%) 0 0 / 8px 8px; }
.cp-preview i { flex: 1; }
.cp-inputs select { background: var(--panel-2); color: var(--text); border: 1px solid var(--border-2); border-radius: 4px; padding: 4px; font-size: 12px; }
.cp-inputs input { flex: 1; min-width: 0; background: var(--panel-2); color: var(--code); border: 1px solid var(--border-2); border-radius: 4px; padding: 5px 8px; font: 12.5px var(--mono); outline: none; }
.cp-inputs input:focus { border-color: var(--accent); }
.cp-inputs input.bad { border-color: var(--red); }
.cp-tabs { display: flex; gap: 2px; margin: 10px 0 6px; border-bottom: 1px solid var(--border-2); }
.cp-tabs button { padding: 4px 10px; font-size: 12px; color: var(--text-dim); border-bottom: 2px solid transparent; }
.cp-tabs button.on { color: var(--text); border-bottom-color: var(--accent); }
.cp-pal { max-height: 170px; overflow-y: auto; }
.cp-pal.grid { display: grid; grid-template-columns: repeat(12, 1fr); gap: 4px; }
.cp-pal.grid p { grid-column: 1 / -1; color: var(--text-dim); padding: 8px 0; }
.cp-pal i { display: block; aspect-ratio: 1; border-radius: 3px; cursor: pointer; box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .12); }
.cp-pal i:hover { transform: scale(1.25); position: relative; z-index: 1; box-shadow: 0 0 0 2px #fff; }
.cp-pal i.sel { box-shadow: 0 0 0 2px #fff, 0 0 0 4px var(--accent); position: relative; z-index: 1; }
.cp-tw-row { display: grid; grid-template-columns: 52px repeat(11, 1fr); gap: 2px; align-items: center; margin-bottom: 2px; }
.cp-tw-row span { font-size: 10px; color: var(--text-dim); }
.cp-tw-row i { border-radius: 2px; }
.cp-foot { display: flex; align-items: center; gap: 6px; margin-top: 10px; }
.cp-foot span { flex: 1; color: var(--text-dim); font-size: 11px; }
.cp-foot button { padding: 5px 12px; border-radius: 4px; border: 1px solid var(--border-2); font-size: 12px; }
.cp-foot button:hover { background: #4c5052; }
.cp-foot button.ok { background: #365880; border-color: #4c708c; color: #fff; }

/* ================= Qo'shimcha imkoniyatlar ================= */
.cm-indent-guide { box-shadow: inset 1px 0 0 rgba(255, 255, 255, .14); }
.CodeMirror-activeline .cm-indent-guide { box-shadow: inset 1px 0 0 rgba(255, 255, 255, .22); }
.project-name .crumb { color: #ffc66d; }
.rn-opt { display: flex; gap: 8px; align-items: center; margin-top: 8px; font-size: 12.5px; color: var(--text); }
.set-list { display: flex; flex-direction: column; gap: 4px; }
.set-row { display: flex; align-items: center; gap: 10px; padding: 7px 8px; border-radius: 6px; cursor: pointer; }
.set-row:hover { background: rgba(255, 255, 255, .04); }
.set-row span { flex: 1; display: flex; flex-direction: column; }
.set-row small { color: var(--text-dim); font-size: 11.5px; }
.set-row input[type=number] { width: 64px; background: var(--panel-2); color: var(--code); border: 1px solid var(--border-2); border-radius: 4px; padding: 4px 6px; }
.todo-todo { color: #a8c023; }
.todo-fixme { color: #e05555; }
.todo-xxx, .todo-hack { color: #d9a343; }
.todo-note { color: #589df6; }

/* ================= Ma'lumotlar bazasi oynasi ================= */
.ico.db { color: #4ec9b0; }
.ico.lib { color: #c9a26d; }
.db-view { position: absolute; inset: 0; z-index: 7; display: none; flex-direction: column; background: var(--bg); }
.db-view.show { display: flex; }
.dbv-head { display: flex; align-items: center; gap: 8px; height: 34px; padding: 0 10px; background: var(--panel); border-bottom: 1px solid var(--border); flex-shrink: 0; }
.dbv-head > i { color: #4ec9b0; }
.dbv-head b { color: var(--text); font-weight: 600; }
.dbv-head span { color: var(--text-dim); font-size: 12px; }
.dbv-spacer { flex: 1; }
.dbv-head button { height: 24px; padding: 0 8px; border-radius: 4px; color: var(--text-dim); font-size: 12px; }
.dbv-head button:hover { background: #4c5052; color: var(--text); }
.dbv-body { flex: 1; display: flex; min-height: 0; }
.dbv-side { width: 210px; flex-shrink: 0; border-right: 1px solid var(--border); overflow: auto; background: var(--panel-2); }
.dbv-side-title { padding: 8px 10px 4px; font-size: 11px; text-transform: uppercase; letter-spacing: .6px; color: var(--text-dim); }
.dbv-side ul { list-style: none; margin: 0; padding: 0 0 8px; }
.dbv-side li { display: flex; align-items: center; gap: 8px; padding: 5px 10px; cursor: pointer; white-space: nowrap; }
.dbv-side li:hover { background: #45494a; }
.dbv-side li.sel { background: var(--select); }
.dbv-side li i { color: #e8bf6a; font-size: 11px; width: 14px; }
.dbv-side li span { overflow: hidden; text-overflow: ellipsis; }
.dbv-side li small { margin-left: auto; color: var(--text-dim); font-size: 11px; }
.dbv-side li.empty { color: var(--text-dim); cursor: default; white-space: normal; line-height: 1.5; font-size: 12px; }
.dbv-side li.empty:hover { background: none; }
.dbv-main { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.dbv-tabs { display: flex; height: 30px; background: var(--panel); border-bottom: 1px solid var(--border); flex-shrink: 0; }
.dbv-tabs button { padding: 0 14px; color: var(--text-dim); font-size: 12.5px; border-bottom: 2px solid transparent; }
.dbv-tabs button i { font-size: 11px; margin-right: 4px; }
.dbv-tabs button.on { color: var(--text); border-bottom-color: var(--accent); background: var(--bg); }
.dbv-pane { display: none; flex: 1; min-height: 0; flex-direction: column; }
.dbv-pane.on { display: flex; }
.dbv-tools { display: flex; align-items: center; gap: 8px; padding: 6px 10px; border-bottom: 1px solid #353535; flex-shrink: 0; }
.dbv-tools input { flex: 1; max-width: 420px; background: var(--panel-2); border: 1px solid var(--border-2); border-radius: 4px; padding: 4px 8px; color: var(--code); font: 12.5px var(--mono); outline: none; }
.dbv-tools input:focus { border-color: var(--accent); }
.dbv-tools span { color: var(--text-dim); font-size: 12px; }
.dbv-tools button { width: 24px; height: 22px; border-radius: 4px; border: 1px solid var(--border-2); }
.dbv-tools button:hover { background: #4c5052; }
.dbv-grid-wrap { flex: 1; overflow: auto; }
.dbv-grid { border-collapse: collapse; font: 12.5px var(--mono); min-width: 100%; }
.dbv-grid th { position: sticky; top: 0; z-index: 1; background: #3a3d41; color: #e8bf6a; text-align: left; padding: 4px 10px; border: 1px solid #4b4d4f; white-space: nowrap; cursor: pointer; font-weight: 600; }
.dbv-grid th small { display: block; color: var(--text-dim); font-weight: 400; font-size: 10.5px; }
.dbv-grid th.sorted { color: #fff; }
.dbv-grid th.rn, .dbv-grid td.rn { color: var(--text-dim); text-align: right; background: #313335; cursor: default; }
.dbv-grid td { padding: 3px 10px; border: 1px solid #3a3d41; color: var(--code); white-space: nowrap; max-width: 340px; overflow: hidden; text-overflow: ellipsis; }
.dbv-grid td.num { color: #6897bb; text-align: right; }
.dbv-grid td.null { color: #808080; font-style: italic; }
.dbv-grid td.blob { color: #9876aa; font-style: italic; }
.dbv-grid td.empty { color: var(--text-dim); text-align: center; padding: 16px; font-family: var(--ui); }
.dbv-grid td.err { color: var(--red); white-space: normal; }
.dbv-grid tbody tr:nth-child(even) td:not(.rn) { background: rgba(255, 255, 255, .02); }
.dbv-grid tbody tr:hover td:not(.rn) { background: rgba(74, 136, 199, .12); }
.dbv-grid td.act { width: 28px; text-align: center; padding: 0; }
.dbv-grid td.act button { color: var(--text-dim); width: 22px; height: 20px; border-radius: 3px; visibility: hidden; }
.dbv-grid tr:hover td.act button { visibility: visible; }
.dbv-grid td.act button:hover { background: var(--red); color: #fff; }
.dbv-edit { width: 100%; min-width: 120px; background: #1e1f22; color: #fff; border: 1px solid var(--accent); border-radius: 2px; font: 12.5px var(--mono); padding: 1px 4px; outline: none; }
.dbv-hint { margin: 0; padding: 4px 10px; font-size: 11px; color: var(--text-dim); border-top: 1px solid #353535; flex-shrink: 0; }
#dbvStruct { padding: 12px 16px; overflow: auto; flex: 1; }
#dbvStruct h4 { margin: 0 0 10px; color: var(--text); }
#dbvStruct h5 { margin: 16px 0 6px; color: var(--accent); }
#dbvStruct ul { margin: 0; padding-left: 20px; }
#dbvStruct a { color: #589df6; cursor: pointer; text-decoration: underline; }
.dbv-grid.struct { min-width: 0; }
.dbv-grid.struct th { cursor: default; }
.dbv-grid.struct td.type { color: #cc7832; }
.ddl { background: #1e1f22; border: 1px solid #3a3d41; border-radius: 6px; padding: 10px 12px; font: 12.5px/1.5 var(--mono); color: var(--code); white-space: pre-wrap; margin: 0; }
.dbv-empty { color: var(--text-dim); }
.dbv-sql-bar { display: flex; align-items: center; gap: 10px; padding: 6px 10px; border-bottom: 1px solid #353535; flex-shrink: 0; font-size: 11.5px; color: var(--text-dim); }
.dbv-sql-bar .run { background: #3d7a46; color: #fff; padding: 4px 12px; border-radius: 4px; font-size: 12px; }
.dbv-sql-bar .run:hover { background: #4a9656; }
.dbv-sql-ed { height: 38%; min-height: 100px; border-bottom: 1px solid var(--border); flex-shrink: 0; }
.dbv-sql-ed .CodeMirror { height: 100%; }
.dbv-sql-out { flex: 1; overflow: auto; }
.dbv-loading { position: absolute; inset: 34px 0 0; display: none; align-items: center; justify-content: center; background: rgba(43, 43, 43, .9); color: var(--text-dim); z-index: 2; }

/* SQL fayl uchun "data source" tugmasi */
.sql-chip { position: absolute; top: 6px; right: 18px; z-index: 6; display: none; align-items: center; gap: 6px; height: 24px; padding: 0 10px; border-radius: 12px;
  background: rgba(78, 201, 176, .15); border: 1px solid rgba(78, 201, 176, .5); color: #9fe3d4; font: 12px var(--ui); box-shadow: 0 2px 8px rgba(0, 0, 0, .3); }
.sql-chip:hover { background: rgba(78, 201, 176, .28); }
.sql-chip.none { background: rgba(217, 163, 67, .18); border-color: rgba(217, 163, 67, .6); color: #f2c77a; }
.find-bar.show ~ .sql-chip { top: 40px; }

/* Avto-import taklifi */
.fix-pop { position: fixed; z-index: 95; display: none; min-width: 300px; max-width: 520px; background: #3c3f41; border: 1px solid var(--border-2); border-radius: 8px; box-shadow: 0 10px 30px rgba(0, 0, 0, .55); padding: 6px; }
.fix-pop.show { display: block; }
.fx-head { padding: 4px 8px 6px; color: var(--text); font-size: 12.5px; }
.fx-head i { color: var(--red); }
.fx-head b { font-family: var(--mono); color: #ffc66d; }
.fx-sub { padding: 2px 8px 6px; color: var(--text-dim); font-size: 11.5px; }
.fx-sub kbd { color: var(--text); }
.fix-pop button { display: flex; align-items: center; gap: 8px; width: 100%; padding: 6px 8px; border-radius: 5px; text-align: left; font: 12.5px var(--mono); color: var(--code); }
.fix-pop button i { color: #589df6; }
.fix-pop button small { margin-left: auto; color: var(--text-dim); font: 11px var(--ui); padding-left: 12px; }
.fix-pop button:hover, .fix-pop button.sel { background: #2f65ca; color: #fff; }
.fix-pop button:hover small, .fix-pop button.sel small { color: #dde; }

/* Kutubxona fayllari — faqat o'qish uchun */
.CodeMirror.readonly { background: #262626 !important; }
.CodeMirror.readonly .CodeMirror-gutters { background: #262626 !important; }
.CodeMirror.readonly::after { content: '📚 Kutubxona kodi — faqat o\'qish uchun'; position: absolute; right: 16px; bottom: 8px; z-index: 5; font: 11px var(--ui); color: #c9a26d;
  background: rgba(60, 63, 65, .9); padding: 3px 8px; border-radius: 4px; pointer-events: none; }

/* ================= Ikkilik fayllar (rasm, audio, video, PDF) ================= */
.ico.img { color: #c792ea; }
.ico.media { color: #e8a85d; }
.ico.pdf { color: #e05555; }
.bin-view { position: absolute; inset: 0; z-index: 7; display: none; flex-direction: column; background: var(--bg); }
.bin-view.show { display: flex; }
.bin-view .dbv-head #binIco i { margin: 0; }
.bin-zoom { display: inline-flex; gap: 2px; }
.bin-body { flex: 1; min-height: 0; overflow: auto; display: flex; align-items: center; justify-content: center; padding: 16px; }
.bin-body img { display: block; margin: auto; image-rendering: auto; cursor: zoom-in; box-shadow: 0 0 0 1px var(--border); }
.bin-body img.fit { max-width: 100%; max-height: 100%; object-fit: contain; cursor: zoom-out; }
.bin-body.img.bg0 { background: repeating-conic-gradient(#3a3d40 0 25%, #2b2d30 0 50%) 0 0 / 16px 16px; }
.bin-body.img.bg1 { background: #111; }
.bin-body.img.bg2 { background: #fff; }
.bin-body audio { width: min(520px, 100%); }
.bin-body video { max-width: 100%; max-height: 100%; }
.bin-body iframe { width: 100%; height: 100%; border: 0; background: #fff; }
.bin-other { text-align: center; color: var(--text-dim); line-height: 1.7; }
.bin-other > i { font-size: 48px; margin-bottom: 8px; }
.bin-other code { color: var(--code); }
