/* ══════════════════════════════════════════════════════════════
   main.css — layout, komponentlar, editor, tree, dialoglar
   ══════════════════════════════════════════════════════════════ */

/* ───────────────────────── 1. Base / reset ───────────────────────── */
*, *::before, *::after { box-sizing: border-box; }

html { height: 100%; }

body {
  margin: 0;
  /* Ilova birinchi ekranni to'ldiradi, pastda esa matnli (SEO) bo'lim
     bo'lgani uchun sahifa vertikal scroll qiladi. */
  min-height: 100%;
  overflow-x: hidden;
  background: var(--bg);
  color: var(--text);
  font: 14px/1.5 var(--font-ui);
  -webkit-font-smoothing: antialiased;
  -webkit-text-size-adjust: 100%;
}

/* `display` beruvchi klass selektorlari UA'ning [hidden] qoidasidan
   kuchli bo'ladi — shuning uchun bu yerda majburlaymiz. */
[hidden] { display: none !important; }

button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; border: 0; background: none; }
h2, h3 { margin: 0; }
code { font: 12px var(--font-mono); background: var(--surface-3); padding: 1px 5px; border-radius: 4px; }

:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }

/* thin, theme-aware scrollbars */
* { scrollbar-width: thin; scrollbar-color: var(--border-strong) transparent; }
::-webkit-scrollbar { width: 12px; height: 12px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-corner { background: transparent; }
::-webkit-scrollbar-thumb {
  background: var(--border-strong);
  border: 3px solid transparent;
  background-clip: content-box;
  border-radius: 10px;
}
::-webkit-scrollbar-thumb:hover { background: var(--text-3); background-clip: content-box; }

.icon {
  width: 16px; height: 16px; flex: none;
  fill: none; stroke: currentColor;
  stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round;
}
.icon--xs { width: 12px; height: 12px; }
.spacer { flex: 1 1 auto; min-width: 0; }
.dot-sep::before { content: "·"; opacity: 0.5; }
.sr-only {
  position: absolute; width: 1px; height: 1px; overflow: hidden;
  clip-path: inset(50%); white-space: nowrap;
}

/* ───────────────────────── 2. App shell ───────────────────────── */
.app { height: 100dvh; display: flex; flex-direction: column; }

/* Ichki panellarda scroll tugaganda sahifa siljib ketmasin. */
.ed-scroll, .pane__body, .state, .tree, .raw, .modal__body { overscroll-behavior: contain; }

.appbar {
  flex: none;
  display: flex; align-items: center; gap: 10px;
  height: 54px; padding: 0 12px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  box-shadow: var(--shadow-1);
  z-index: 5;
}

/* Sahifaning yagona <h1>'i — appbar brendi. Ko'rinishi oddiy matn. */
.brand { display: flex; align-items: center; gap: 9px; white-space: nowrap; margin: 0; font-size: 14.5px; font-weight: 400; }
.brand__mark {
  width: 29px; height: 29px; border-radius: 8px;
  display: grid; place-items: center;
  font: 700 13px/1 var(--font-mono); color: #fff;
  background: linear-gradient(135deg, var(--accent), var(--purple));
  box-shadow: 0 3px 10px -3px var(--accent);
}
/* Logo belgisi pseudo-element orqali — <h1> matni faqat "JSON Viewer
   & Formatter" bo'lib qolishi uchun (qidiruv tizimlari matnni DOM'dan oladi). */
.brand__mark::before { content: "{}"; }
.brand__text { font-weight: 650; letter-spacing: -0.01em; font-size: 14.5px; }
.brand__sub { color: var(--text-3); font-weight: 500; font-size: 12px; }

.appbar__tools {
  flex: 1 1 auto; min-width: 0;
  display: flex; align-items: center; gap: 5px;
  padding: 0 4px; overflow-x: auto;
  scrollbar-width: none;
}
.appbar__tools::-webkit-scrollbar { display: none; }
.appbar__right { flex: none; display: flex; align-items: center; gap: 5px; }
.tgroup { display: flex; align-items: center; gap: 4px; }
.tsep { flex: none; width: 1px; height: 22px; background: var(--border); margin: 0 4px; }

/* ───────────────────────── 3. Buttons & fields ───────────────────────── */
.btn {
  display: inline-flex; align-items: center; gap: 7px;
  height: 32px; padding: 0 11px;
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  background: var(--surface-2);
  color: var(--text-2);
  font-size: 13px; font-weight: 500; white-space: nowrap;
  text-decoration: none;                /* <a class="btn"> uchun */
  transition: background var(--dur), color var(--dur), border-color var(--dur), transform var(--dur);
}
.btn:hover { background: var(--surface-3); color: var(--text); border-color: var(--border-strong); }
.btn:active { transform: translateY(1px); }
.btn--primary {
  background: var(--accent); border-color: transparent;
  color: var(--accent-fg); font-weight: 600;
}
.btn--primary:hover { background: var(--accent); color: var(--accent-fg); filter: brightness(1.1); }
.btn--icon { width: 32px; padding: 0; justify-content: center; }
.btn--sm { height: 28px; }
.btn--sm.btn--icon { width: 28px; }
.btn--ghost { background: transparent; border-color: transparent; }
.btn--ghost:hover { background: var(--surface-2); }
.btn[aria-pressed="true"] {
  background: var(--accent-soft); border-color: var(--accent); color: var(--accent);
}
.btn:disabled {
  opacity: 0.45; cursor: not-allowed;
  background: var(--surface-2); border-color: var(--border); color: var(--text-3);
}

.iconbtn {
  width: 22px; height: 22px; flex: none;
  display: grid; place-items: center;
  border-radius: 5px; color: var(--text-3);
  transition: background var(--dur), color var(--dur);
}
.iconbtn:hover { background: var(--surface-3); color: var(--accent); }
.iconbtn .icon { width: 13px; height: 13px; }

.field { display: inline-flex; align-items: center; gap: 6px; }
.field__label { font-size: 11.5px; color: var(--text-3); }
.select, .input {
  height: 28px; padding: 0 7px;
  border: 1px solid var(--border); border-radius: var(--r-sm);
  background: var(--surface-3); font-size: 12.5px;
}
.input { width: 100%; height: 38px; padding: 0 12px; background: var(--bg-2); font-family: var(--font-mono); }
.input:focus, .select:focus { border-color: var(--accent); outline: none; }

.seg {
  flex: none; display: inline-flex; gap: 2px; padding: 2px;
  background: var(--surface-3); border: 1px solid var(--border); border-radius: var(--r-md);
}
.seg__btn {
  display: inline-flex; align-items: center; gap: 6px;
  height: 24px; padding: 0 10px; border-radius: 7px;
  color: var(--text-3); font-size: 12px; font-weight: 600;
  transition: background var(--dur), color var(--dur);
}
.seg__btn .icon { width: 13px; height: 13px; }
.seg__btn:hover { color: var(--text-2); }
.seg__btn[aria-selected="true"] { background: var(--surface); color: var(--text); box-shadow: var(--shadow-1); }

.search { position: relative; display: flex; align-items: center; flex: 0 1 240px; min-width: 110px; }
.search > .icon { position: absolute; left: 9px; width: 14px; height: 14px; color: var(--text-3); pointer-events: none; }
.search input {
  width: 100%; height: 28px; padding: 0 26px 0 29px;
  border: 1px solid var(--border); border-radius: 999px;
  background: var(--bg-2); font-size: 12.5px;
}
.search input::-webkit-search-cancel-button { display: none; }
.search input:focus { outline: none; border-color: var(--accent); background: var(--surface); }
.search__clear { position: absolute; right: 4px; width: 20px; height: 20px; display: grid; place-items: center; color: var(--text-3); border-radius: 50%; }
.search__clear:hover { color: var(--text); background: var(--surface-3); }
.hint-count { font: 11.5px var(--font-mono); color: var(--text-3); white-space: nowrap; }

.pill {
  flex: none; display: inline-flex; align-items: center; gap: 6px;
  height: 22px; padding: 0 9px; border-radius: 999px;
  font-size: 11.5px; font-weight: 600;
  background: var(--surface-3); color: var(--text-3);
}
.pill__dot { width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.pill[data-state="ok"] { background: var(--green-soft); color: var(--green); }
.pill[data-state="error"] { background: var(--red-soft); color: var(--red); }
.pill[data-state="busy"] { background: var(--amber-soft); color: var(--amber); }

.kbd {
  display: inline-block; min-width: 20px; text-align: center;
  font: 11px/16px var(--font-mono);
  padding: 1px 5px; margin-right: 2px;
  border: 1px solid var(--border); border-bottom-width: 2px; border-radius: 5px;
  background: var(--surface-2); color: var(--text-2);
}

/* ───────────────────────── 4. Workspace & panes ───────────────────────── */
.workspace {
  flex: 1 1 auto; min-height: 0;
  display: grid;
  grid-template-columns: minmax(0, var(--split, 50%)) 6px minmax(0, 1fr);
  background: var(--bg);
}

.pane {
  position: relative;
  display: flex; flex-direction: column;
  min-width: 0; min-height: 0;
  background: var(--surface);
}

.pane__head {
  flex: none; display: flex; align-items: center; gap: 8px;
  height: 40px; padding: 0 10px;
  background: var(--surface-2); border-bottom: 1px solid var(--border);
}
.pane__title {
  flex: none; font-size: 11px; font-weight: 700;
  letter-spacing: 0.07em; text-transform: uppercase; color: var(--text-3);
}
.pane__body { flex: 1 1 auto; min-height: 0; display: flex; flex-direction: column; position: relative; }
.pane__foot {
  flex: none; display: flex; align-items: center; gap: 7px;
  height: 26px; padding: 0 10px;
  background: var(--surface-2); border-top: 1px solid var(--border);
  font: 11.5px/1 var(--font-mono); color: var(--text-3);
  overflow: hidden;
}
.pane__foot .path {
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  color: var(--text-2);
}

/* drag & drop overlay */
.pane.is-drop::after {
  content: "Drop your .json file";
  position: absolute; inset: 6px; z-index: 9;
  display: grid; place-items: center;
  border: 2px dashed var(--accent); border-radius: var(--r-lg);
  background: var(--accent-soft); backdrop-filter: blur(2px);
  color: var(--accent); font-weight: 650; pointer-events: none;
}

/* ───────────────────────── 5. Splitter ───────────────────────── */
.splitter {
  position: relative; background: var(--border);
  cursor: col-resize; transition: background var(--dur);
}
.splitter::before { content: ""; position: absolute; inset: 0 -5px; } /* larger hit area */
.splitter::after {
  content: ""; position: absolute; top: 50%; left: 50%;
  width: 2px; height: 26px; border-radius: 2px;
  transform: translate(-50%, -50%);
  background: var(--border-strong);
}
.splitter:hover, .splitter:focus-visible, body.is-dragging .splitter { background: var(--accent); }
.splitter:hover::after, body.is-dragging .splitter::after { background: var(--accent-fg); opacity: 0.6; }
body.is-dragging { cursor: col-resize; user-select: none; }
body.is-dragging .editor, body.is-dragging .tree { pointer-events: none; }

/* ───────────────────────── 6. Editor (gutter + textarea) ───────────────────────── */
.editor {
  position: relative;
  flex: 1 1 auto; min-height: 0; display: flex;
  background: var(--bg-2);
  font: var(--fs-code) / var(--lh-code) var(--font-mono);
  tab-size: 2;
}
/* MUHIM: `align-items: flex-start` — aks holda (default `stretch`) .ed-body
   kontent balandligiga emas, konteynerning KO'RINADIGAN balandligiga cho'ziladi.
   O'sha holatda mirror ed-body'dan chiqib ketadi, textarea esa faqat bir ekran
   balandligida qolib, matn tashqi scroll bilan yurmaydi (kesilib qoladi). */
.ed-scroll { flex: 1 1 auto; min-width: 0; display: flex; align-items: flex-start; overflow: auto; }

/* Gutter'da faqat ko'rinadigan raqamlar bo'ladi (editor.js virtualizatsiya
   qiladi) va ular absolyut joylashtiriladi — shuning uchun padding yo'q.
   align-self: stretch → flex qatorining to'liq balandligini oladi (fon va
   o'ng chegara butun hujjat bo'ylab davom etsin). */
.ed-gutter-bg {
  position: absolute; left: 0; top: 0; bottom: 0; z-index: 1;
  width: var(--gutter-w); pointer-events: none;
  background: var(--bg-2); border-right: 1px solid var(--border);
}
.ed-gutter {
  position: sticky; left: 0; z-index: 2;
  flex: none; width: var(--gutter-w); padding: 0;
  color: var(--c-meta); user-select: none;
}
.ed-num {
  position: absolute; left: 0; right: 0;
  padding-right: 9px; text-align: right;
  overflow: hidden;
}
.ed-num.is-error {
  color: var(--red); font-weight: 700;
  background: var(--red-soft);
  box-shadow: inset 2px 0 0 var(--red);
}

.editor { --ed-pad-y: 10px; --ed-pad-x: 14px; --ed-tail: 45vh; }
.ed-body {
  position: relative; min-height: 100%;
  padding: var(--ed-pad-y) var(--ed-pad-x) var(--ed-tail);
}
.ed-mirror { visibility: hidden; }

/* Bitta belgining aniq o'lchamini bilish uchun (editor.js) */
.ed-probe {
  position: absolute; top: 0; left: 0;
  visibility: hidden; pointer-events: none;
  white-space: pre; font: inherit;
}

/* Textarea .ed-body'ning padding box'ini to'liq egallaydi. Yuqori/chap padding
   mirror bilan AYNAN bir xil (shu sababli matn ustma-ust tushadi), pastdagi
   padding esa ataylab kichik — natijada matn maydoni 45vh ga ortiq bo'lib,
   balandlikda mayda xatolik bo'lsa ham oxirgi qatorlar kesilib qolmaydi. */
.ed-input {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  margin: 0; border: 0;
  padding: var(--ed-pad-y) var(--ed-pad-x) var(--ed-pad-y);
  background: transparent; color: var(--text);
  font: inherit; tab-size: inherit;
  resize: none; overflow: hidden; outline: none;
}
.ed-input::placeholder { color: var(--text-3); opacity: 0.75; }
.ed-input::selection { background: var(--sel); }

/* wrap ON */
.editor[data-wrap="on"] .ed-body { flex: 1 1 auto; min-width: 0; }
.editor[data-wrap="on"] .ed-mirror,
.editor[data-wrap="on"] .ed-input { white-space: pre-wrap; overflow-wrap: break-word; }

/* wrap OFF → horizontal scroll, mirror defines the content width */
.editor[data-wrap="off"] .ed-body { flex: none; width: max-content; min-width: 100%; }
.editor[data-wrap="off"] .ed-mirror,
.editor[data-wrap="off"] .ed-input { white-space: pre; overflow-wrap: normal; }

/* fallback for gigantic documents (>100k lines): plain textarea, no gutter */
.editor[data-plain="true"] .ed-gutter,
.editor[data-plain="true"] .ed-mirror { display: none; }
.editor[data-plain="true"] .ed-body { flex: 1 1 auto; width: auto; min-width: 0; height: 100%; padding-bottom: 10px; }
.editor[data-plain="true"] .ed-input { position: static; height: 100%; overflow: auto; }

/* ───────────────────────── 7. JSON syntax colours ───────────────────────── */
.t-key { color: var(--c-key); }
.t-str { color: var(--c-string); }
.t-num { color: var(--c-number); }
.t-bool { color: var(--c-bool); font-weight: 600; }
.t-null { color: var(--c-null); font-style: italic; }
.t-punct { color: var(--c-punct); }

/* ───────────────────────── 8. Tree view ───────────────────────── */
.tree {
  flex: 1 1 auto; min-height: 0; overflow: auto;
  padding: 6px 0 45vh;
  font: var(--fs-code) / var(--lh-tree) var(--font-mono);
}

.node { --pad: calc(10px + var(--d, 0) * var(--indent-step)); }

.node__row {
  display: flex; align-items: flex-start;
  padding-left: var(--pad); padding-right: 10px;
  min-height: calc(var(--fs-code) * var(--lh-tree));
}
.node__row:hover { background: var(--row-hover); }
.node.is-selected > .node__row { background: var(--row-active); box-shadow: inset 2px 0 0 var(--accent); }

.node__toggle {
  flex: none; width: 16px; height: calc(var(--fs-code) * var(--lh-tree));
  display: grid; place-items: center;
  color: var(--text-3); border-radius: 4px;
}
.node__toggle .icon { width: 11px; height: 11px; transition: transform 0.15s ease; }
.node__toggle:hover { color: var(--text); background: var(--surface-3); }
.node.is-open > .node__row > .node__toggle .icon { transform: rotate(90deg); }
.node__spacer { flex: none; width: 16px; }

.node__k {
  color: var(--c-key); cursor: copy; border-radius: 3px;
  padding: 0 1px; margin: 0 -1px;
}
.node__k:hover { background: var(--accent-soft); text-decoration: underline dotted; }
.node__k--idx { color: var(--c-meta); }
.node__v {
  cursor: copy; border-radius: 3px; padding: 0 1px; margin: 0 -1px;
  overflow-wrap: anywhere;
}
.node__v:hover { background: var(--accent-soft); }
.node__v a { color: inherit; }

.node__meta {
  flex: none; margin-left: 8px; padding: 0 5px;
  border: 1px solid var(--border); border-radius: 5px;
  color: var(--c-meta); font-size: 11px; line-height: 16px;
  align-self: center; cursor: pointer; user-select: none;
}
.node__meta:hover { border-color: var(--border-strong); color: var(--text-2); }
.node__preview {
  margin-left: 8px; color: var(--text-3);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.node.is-open > .node__row > .node__preview { display: none; }

.node__acts { flex: none; display: flex; gap: 1px; margin-left: 8px; opacity: 0; transition: opacity var(--dur); }
.node__row:hover .node__acts, .node__row:focus-within .node__acts { opacity: 1; }
@media (hover: none) { .node__acts { opacity: 0.6; } }

.node__children { position: relative; display: none; }
.node.is-open > .node__children { display: block; }
.node__children::before {
  content: ""; position: absolute; top: 0; bottom: 0;
  left: calc(10px + var(--d, 0) * var(--indent-step) + 7px);
  width: 1px; background: var(--border);
}

/* keyboard focus: outline the row, not the whole subtree */
.node:focus { outline: none; }
.node:focus-visible { outline: none; }
.node:focus-visible > .node__row { outline: 2px solid var(--accent); outline-offset: -2px; }

.node__more {
  display: inline-flex; align-items: center; gap: 6px;
  margin: 3px 0 3px calc(10px + (var(--d, 0) + 1) * var(--indent-step) + 16px);
  padding: 2px 9px; border-radius: 999px;
  border: 1px dashed var(--border-strong);
  color: var(--text-3); font: 11.5px var(--font-mono);
}
.node__more:hover { color: var(--accent); border-color: var(--accent); background: var(--accent-soft); }

.tree mark, .raw mark { background: var(--mark); color: inherit; border-radius: 2px; padding: 0 1px; }

/* ───────────────────────── 9. Raw (highlighted) view ───────────────────────── */
.raw {
  flex: 1 1 auto; min-height: 0; overflow: auto;
  margin: 0; padding: 12px 16px 45vh;
  font: var(--fs-code) / var(--lh-code) var(--font-mono);
  white-space: pre; tab-size: 2;
}

/* ───────────────────────── 10. States: empty / error ───────────────────────── */
.state { flex: 1 1 auto; min-height: 0; overflow: auto; padding: 24px; }

.state--empty { display: grid; place-items: center; }
.empty { max-width: 420px; text-align: center; }
.empty__mark {
  width: 60px; height: 60px; margin: 0 auto 18px;
  display: grid; place-items: center;
  border-radius: 18px; border: 1px solid var(--border);
  background: var(--surface-2);
  font: 700 20px var(--font-mono); color: var(--accent);
}
.empty__title { font-size: 17px; font-weight: 650; margin-bottom: 6px; }
.empty__text { margin: 0 0 18px; color: var(--text-2); font-size: 13.5px; line-height: 1.6; }
.empty__actions { display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; }
.empty__keys {
  list-style: none; margin: 22px 0 0; padding: 16px 0 0;
  border-top: 1px solid var(--border);
  display: flex; flex-direction: column; gap: 7px;
  font-size: 12px; color: var(--text-3);
}
.empty__keys li { display: flex; align-items: center; gap: 6px; justify-content: center; }
.empty__privacy {
  display: flex; align-items: center; gap: 7px; justify-content: center;
  margin: 18px 0 0; font-size: 11.5px; color: var(--text-3);
}
.empty__privacy .icon { width: 13px; height: 13px; }

.errcard {
  max-width: 720px; margin: 0 auto;
  border: 1px solid var(--red); border-radius: var(--r-lg);
  background: var(--red-soft); overflow: hidden;
}
.errcard__head { display: flex; gap: 11px; padding: 14px 16px; }
.errcard__head > .icon { color: var(--red); margin-top: 2px; }
.errcard__msg { font-weight: 650; color: var(--red); font-size: 13.5px; }
.errcard__loc { margin-top: 3px; font: 12px var(--font-mono); color: var(--text-2); }
.errcard__hint {
  display: flex; gap: 9px; align-items: flex-start;
  margin: 0 16px 14px; padding: 10px 12px;
  border: 1px solid var(--border); border-radius: var(--r-md);
  background: var(--surface); color: var(--text-2); font-size: 13px; line-height: 1.5;
}
.errcard__hint .icon { color: var(--amber); margin-top: 2px; }
.errcard__actions { display: flex; gap: 8px; margin: 0 16px 14px; }

.snippet {
  margin: 0; padding: 12px 0;
  border-top: 1px solid var(--border);
  background: var(--bg-2);
  font: var(--fs-code) / var(--lh-code) var(--font-mono);
  overflow-x: auto;
}
.snippet__line { display: flex; white-space: pre; padding: 0 16px; }
.snippet__line.is-err { background: var(--red-soft); }
.snippet__no {
  flex: none; width: 44px; padding-right: 14px;
  text-align: right; color: var(--c-meta); user-select: none;
}
.snippet__line.is-err .snippet__no { color: var(--red); font-weight: 700; }
.snippet__caret { color: var(--red); font-weight: 700; }

/* ───────────────────────── 11. Toasts ───────────────────────── */
.toasts {
  position: fixed; left: 50%; bottom: 26px; z-index: 100;
  transform: translateX(-50%);
  display: flex; flex-direction: column-reverse; align-items: center; gap: 8px;
  pointer-events: none;
}
.toast {
  pointer-events: auto;
  display: flex; align-items: center; gap: 10px;
  max-width: min(92vw, 460px);
  padding: 9px 10px 9px 13px; border-radius: 999px;
  background: var(--surface-3); border: 1px solid var(--border-strong);
  box-shadow: var(--shadow-2); font-size: 13px;
  animation: toastIn 0.18s cubic-bezier(0.2, 0.9, 0.3, 1);
}
.toast__text { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.toast--ok > .icon { color: var(--green); }
.toast--err > .icon { color: var(--red); }
.toast--info > .icon { color: var(--accent); }
.toast__action {
  flex: none; height: 24px; padding: 0 10px; border-radius: 999px;
  background: var(--accent); color: var(--accent-fg); font-size: 12px; font-weight: 650;
}
.toast.is-out { animation: toastOut 0.16s ease forwards; }
@keyframes toastIn { from { opacity: 0; transform: translateY(10px) scale(0.96); } }
@keyframes toastOut { to { opacity: 0; transform: translateY(6px) scale(0.97); } }

/* ───────────────────────── 12. Modals ───────────────────────── */
.modal {
  position: fixed; inset: 0; z-index: 200;
  display: grid; place-items: center; padding: 20px;
  background: var(--scrim); backdrop-filter: blur(4px);
  animation: fadeIn 0.14s ease;
}
.modal[hidden] { display: none; }
.modal__card {
  width: 100%; max-width: 480px;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--r-lg); box-shadow: var(--shadow-2);
  animation: cardIn 0.18s cubic-bezier(0.2, 0.9, 0.3, 1);
}
.modal__head {
  display: flex; align-items: center; gap: 10px;
  padding: 14px 16px; border-bottom: 1px solid var(--border);
}
.modal__title { flex: 1; display: flex; align-items: center; gap: 9px; font-size: 14.5px; font-weight: 650; }
.modal__title .icon { color: var(--accent); }
.modal__body { padding: 16px; display: flex; flex-direction: column; gap: 12px; max-height: 62vh; overflow: auto; }
.modal__note { display: flex; gap: 9px; margin: 0; font-size: 12.5px; line-height: 1.55; color: var(--text-2); }
.modal__note .icon { flex: none; color: var(--accent); margin-top: 2px; }
/* uzun HTTP sarlavhasi nomi qatorlarga bo'linib ketmasin */
.modal__note code { white-space: nowrap; font-size: 11.5px; }
.modal__foot {
  display: flex; justify-content: flex-end; gap: 8px;
  padding: 12px 16px; border-top: 1px solid var(--border);
}
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip {
  max-width: 100%; padding: 4px 10px; border-radius: 999px;
  border: 1px solid var(--border); background: var(--surface-2);
  color: var(--text-2); font: 11.5px var(--font-mono);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.chip:hover { border-color: var(--accent); color: var(--accent); }

.keys { width: 100%; border-collapse: collapse; font-size: 13px; }
.keys td { padding: 5px 0; vertical-align: middle; }
.keys td:first-child { width: 165px; white-space: nowrap; }
.keys td:last-child { color: var(--text-2); }
.tips { margin: 4px 0 0; padding-left: 18px; font-size: 13px; line-height: 1.7; color: var(--text-2); }
.tips b { color: var(--text); font-weight: 600; }

@keyframes fadeIn { from { opacity: 0; } }
@keyframes cardIn { from { opacity: 0; transform: translateY(10px) scale(0.98); } }

/* ───────────────────────── 13. Responsive ───────────────────────── */
@media (max-width: 1180px) {
  .appbar .btn__label { display: none; }
  .appbar__tools .btn { width: 32px; padding: 0; justify-content: center; }
  .brand__sub { display: none; }
}
@media (max-width: 780px) {
  .app { height: auto; min-height: 100dvh; }
  .appbar { height: auto; min-height: 54px; flex-wrap: wrap; padding: 8px 10px; }
  .appbar__tools { order: 3; flex-basis: 100%; }
  .workspace { grid-template-columns: 1fr; grid-template-rows: auto auto; }
  .splitter { display: none; }
  .pane { height: 66vh; border-bottom: 1px solid var(--border); }
  .pane__head { flex-wrap: wrap; height: auto; min-height: 40px; padding: 6px 10px; }
  .search { flex-basis: 100%; order: 5; }
  /* <h1> matni mobil ko'rinishda ham qoladi (mobile-first indexing). */
  .brand__text { font-size: 13.5px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
}
