/* ============================================================
   ADLIX AI AGENT (#yordamchi) — js/org-ai.js, v96 (nom va .aiw belgisi — v100)
   v93 tizimi: tokenlar body.org-mode da (style.css): --g1/--g2/--g3 shisha, --op-* ranglar va radiuslar, body.dark — tun.
   Ustun ≤ 880px (oʻqish kengligi): sarlavha · savol namunalari / «tez orada» kartasi · suhbat (role=log) · yopishqoq yozish paneli (dock).
   Dock telefonda pastki tab paneli ustida (64px + xavfsiz zona; yotiq telefonda 48px). Javob matni — .oai-md (xodim paneli ham ishlatadi).
   ============================================================ */
.oai { width: 100%; max-width: 880px; margin-inline: auto; display: flex; flex-direction: column; gap: 16px; container: oai / inline-size;
  --oai-dock: 12px; }
.oai [hidden] { display: none !important; }
.oai-sr { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.oai :where(h1, h2, h3, p, ul, ol, figure), .oai-md :where(p, ul, ol) { margin: 0; padding: 0; }
.oai :where(.oai-intro, .oai-srcs) ul { list-style: none; }

/* --- Sarlavha --- */
.oai-head { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 14px 16px; align-items: start; }
.oai-ava { width: 52px; height: 52px; flex: 0 0 auto; display: grid; place-items: center; border-radius: 16px; color: #e9d28a;
  background: linear-gradient(150deg, #142a52, #2f54a8); box-shadow: 0 10px 22px rgba(20, 42, 82, .24), inset 0 1px 0 rgba(255, 255, 255, .16); }
.oai-ava svg { width: 26px; height: 26px; }
.oai-ava.sm { width: 32px; height: 32px; border-radius: 10px; box-shadow: 0 4px 10px rgba(20, 42, 82, .18); }
.oai-ava.sm svg { width: 17px; height: 17px; }
.oai-head-t { min-width: 0; display: flex; flex-direction: column; gap: 6px; }
.oai-head h1 { font: 800 28px/1.15 'Manrope', 'Inter', sans-serif; letter-spacing: -.015em; color: var(--op-ink); text-wrap: balance; }
.oai-head h1:focus { outline: none; }

/* --- «ADLIX AI AGENT» belgisi (.aiw): kabinet sarlavhasi (h1) va xodim paneli (#aiPanel .ai-head, .on-dark — navy fonda).
   «ADLIX» — siyoh rangi, «AI AGENT» — navy → oltin gradient matn, uchqun — oltin. Matn oddiy («ADLIX AI AGENT»), uchqun aria-hidden --- */
.aiw { font-family: 'Manrope', 'Inter', sans-serif; font-weight: 800; letter-spacing: .015em; }
.aiw-a { color: var(--op-ink, var(--navy, #142a52)); }
.aiw-n { white-space: nowrap; }
.aiw-b { color: #2f54a8; }
.aiw-s { display: inline-block; width: .5em; height: .5em; margin-left: .14em; vertical-align: .42em; fill: currentColor; color: #c9a227; }
.oai-head h1 .aiw { letter-spacing: .02em; }
body.dark .aiw-a, html[data-theme="dark"] .aiw-a, .aiw.on-dark .aiw-a { color: #f2f5fc; }
body.dark .aiw-b, html[data-theme="dark"] .aiw-b { color: #9db9ff; }
.aiw.on-dark .aiw-b { color: #f3e3a6; }
body.dark .aiw-s, html[data-theme="dark"] .aiw-s, .aiw.on-dark .aiw-s { color: #e9d28a; }
/* gradient faqat background-clip:text ishlaganda (aks holda matn ortida rangli toʻrtburchak chiqardi) — tun va navy fondagi variantlar ham shu yerda */
@supports ((-webkit-background-clip: text) or (background-clip: text)) {
  .aiw-b { background-image: linear-gradient(100deg, #1f3b73 0%, #2f54a8 48%, #a77b12 100%); -webkit-background-clip: text; background-clip: text;
    -webkit-text-fill-color: transparent; }
  body.dark .aiw-b, html[data-theme="dark"] .aiw-b { background-image: linear-gradient(100deg, #c9d8ff 0%, #9db9ff 45%, #e9d28a 100%); }
  .aiw.on-dark .aiw-b { background-image: linear-gradient(100deg, #ffffff 0%, #dfe8ff 42%, #f3e3a6 100%); }
}
/* xodim paneli: .ai-head span (style.css: 11.5px, xira) belgining ichki qismlariga tegmasin */
.ai-head .aiw { display: block; font-size: 15.5px; line-height: 1.25; }
.ai-head .aiw span { font-size: inherit; opacity: 1; }
.ai-head .aiw + span { display: block; margin-top: 1px; }
/* yuqori kontrast va chop etish: oddiy yaxlit rang (!important — tun / navy fon tanlovlaridan ustun boʻlsin) */
@media (forced-colors: active) {
  .aiw .aiw-b { background: none !important; -webkit-text-fill-color: currentColor !important; color: CanvasText !important; }
  .aiw .aiw-a, .aiw .aiw-s { color: CanvasText !important; }
}
@media print {
  .aiw .aiw-b { background: none !important; -webkit-text-fill-color: currentColor !important; }
  .aiw .aiw-a, .aiw .aiw-b, .aiw .aiw-s { color: #000 !important; }
}
.oai-head-t > p { max-width: 68ch; font-size: 14px; line-height: 1.5; color: var(--muted); }
.oai-new { align-self: center; white-space: nowrap; }
/* v111: sarlavhadagi amallar (Tarix, Yangi suhbat) */
.oai-hacts { align-self: center; display: flex; flex-wrap: wrap; gap: 8px; justify-content: flex-end; }
.oai-hbtn[aria-expanded="true"] { background: var(--op-tint-h); border-color: var(--op-line); }
@container oai (max-width: 559.98px) {
  .oai-head { grid-template-columns: auto minmax(0, 1fr); }
  .oai-head h1 { font-size: 22px; }
  .oai-ava { width: 44px; height: 44px; border-radius: 13px; }
  .oai-ava svg { width: 22px; height: 22px; }
  .oai-new { grid-column: 1 / -1; justify-self: start; }
  .oai-hacts { grid-column: 1 / -1; justify-content: flex-start; }
}

/* --- Kartalar: savol namunalari, «tez orada» --- */
.oai-card { padding: 18px; border-radius: var(--op-r-card, 20px); background: var(--g2-bg); border: var(--g2-border); box-shadow: var(--g2-hi), var(--g2-shadow);
  -webkit-backdrop-filter: saturate(var(--g2-sat)) blur(var(--g2-blur)); backdrop-filter: saturate(var(--g2-sat)) blur(var(--g2-blur)); }
.oai-card h2 { font: 800 17px/1.3 'Manrope', 'Inter', sans-serif; color: var(--op-ink); }
.oai-welcome { display: flex; flex-direction: column; gap: 14px; }
.oai-sgs { display: grid; grid-template-columns: minmax(0, 1fr); gap: 14px; }
@container oai (min-width: 700px) { .oai-sgs { grid-template-columns: repeat(2, minmax(0, 1fr)); align-items: start; } }
.oai-sg { min-width: 0; display: flex; flex-direction: column; gap: 8px; }
.oai-sg h3 { padding: 0 2px; font: 800 11.5px/1.3 'Inter', sans-serif; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.oai-sg ul { display: flex; flex-direction: column; gap: 6px; }
.oai-sug { width: 100%; min-height: 52px; display: flex; align-items: center; gap: 12px; padding: 8px 10px 8px 8px; border-radius: 14px; cursor: pointer; text-align: left;
  font: 600 14px/1.35 'Inter', sans-serif; color: var(--op-ink); background: var(--op-tint); border: 1px solid transparent;
  transition: background-color var(--m1, .15s), border-color var(--m1, .15s); }
.oai-sug:hover:not(:disabled) { background: var(--op-tint-h); border-color: rgba(47, 84, 168, .22); }
.oai-sug:disabled { cursor: default; opacity: .62; }
.oai-sug > span:nth-child(2) { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.oai-sug-ic { width: 34px; height: 34px; flex: 0 0 auto; display: grid; place-items: center; border-radius: 10px; color: var(--navy-light);
  background: var(--op-card); border: 1px solid var(--op-card-b); }
.oai-sug-ic svg { width: 17px; height: 17px; }
.oai-sug > svg { width: 16px; height: 16px; flex: 0 0 auto; color: var(--muted); opacity: .7; transition: transform var(--m1, .15s); }
.oai-sug:hover:not(:disabled) > svg { opacity: 1; transform: translateX(2px); }
.oai-hint { display: flex; gap: 8px; align-items: flex-start; font-size: 13px; line-height: 1.45; color: var(--muted); }
.oai-hint svg, .oai-disc svg { width: 16px; height: 16px; flex: 0 0 auto; margin-top: 1px; }
.oai-soon { display: flex; gap: 14px; align-items: flex-start; }
.oai-soon-ic { width: 44px; height: 44px; flex: 0 0 auto; display: grid; place-items: center; border-radius: 13px; color: #86650c;
  background: rgba(251, 243, 214, .9); border: 1px solid rgba(201, 162, 39, .45); }
.oai-soon-ic svg { width: 22px; height: 22px; }
.oai-soon > div { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 6px; }
.oai-soon p { font-size: 14px; line-height: 1.5; color: var(--text); }
.oai-acts-row { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 6px; }
.oai-acts-row .op-btn { text-decoration: none; }

/* --- Bepul tarif banneri --- */
.oai-planw:empty { display: none; }
.oai-trial { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; padding: 12px 14px; border-radius: var(--op-r-panel, 16px);
  background: rgba(251, 243, 214, .8); border: 1px solid rgba(201, 162, 39, .45); }
.oai-trial > svg { width: 20px; height: 20px; flex: 0 0 auto; color: #86650c; }
.oai-trial > div { flex: 1 1 260px; min-width: 0; }
.oai-trial b { font-size: 14px; color: var(--op-ink); }
.oai-trial p { margin-top: 2px; font-size: 13px; line-height: 1.45; color: var(--text); }

/* --- Suhbat --- */
.oai-log { display: flex; flex-direction: column; gap: 14px; min-width: 0; }
.oai-log:empty { display: none; }
.oai-msg { min-width: 0; display: flex; gap: 10px; }
.oai-msg.me { justify-content: flex-end; }
.oai-bub { max-width: min(80%, 620px); padding: 11px 15px; border-radius: 18px 18px 6px 18px; font-size: 15px; line-height: 1.5; white-space: pre-wrap; overflow-wrap: anywhere;
  color: #fff; background: linear-gradient(150deg, #1f3b73, #2f54a8); box-shadow: 0 4px 12px rgba(31, 59, 115, .18); }
.oai-msg.ai { align-items: flex-start; }
.oai-msg.ai > .oai-ava { margin-top: 2px; }
.oai-ans { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 12px; padding: 14px 16px 10px; border-radius: 6px 18px 18px 18px;
  background: var(--op-card); border: 1px solid var(--op-card-b); box-shadow: 0 1px 2px rgba(20, 42, 82, .05), 0 6px 18px rgba(20, 42, 82, .06); }
.oai-acts { display: flex; flex-wrap: wrap; gap: 6px; margin: 0 -6px; }
.oai-act { display: inline-flex; align-items: center; gap: 6px; min-height: 34px; padding: 0 10px; border: 0; border-radius: 10px; cursor: pointer;
  font: 600 12.5px/1 'Inter', sans-serif; color: var(--muted); background: none; transition: color var(--m1, .15s), background-color var(--m1, .15s); }
.oai-act:hover { color: var(--op-ink); background: var(--op-tint-h); }
.oai-act svg { width: 15px; height: 15px; flex: 0 0 auto; }
.oai-act.is-ok { color: #1f7a4d; }
.oai-msg.err { padding-left: 42px; }
.oai-errbox { flex: 1; min-width: 0; display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; padding: 12px 14px; border-radius: var(--op-r-panel, 16px);
  font-size: 14px; line-height: 1.45; color: #8c1d16; background: rgba(179, 38, 30, .06); border: 1px solid rgba(179, 38, 30, .28); }
.oai-errbox > p { flex: 1 1 220px; min-width: 0; }
.oai-err-ic { display: grid; flex: 0 0 auto; }
.oai-err-ic svg { width: 18px; height: 18px; }
.oai-wait { display: inline-flex; align-items: center; gap: 10px; min-height: 44px; padding: 10px 14px; border-radius: 6px 18px 18px 18px;
  font-size: 13.5px; color: var(--muted); background: var(--op-card); border: 1px solid var(--op-card-b); }
.oai-dots { display: inline-flex; gap: 4px; }
.oai-dots i { width: 7px; height: 7px; border-radius: 50%; background: var(--navy-light); animation: oaiDot 1.2s infinite; }
.oai-dots i:nth-child(2) { animation-delay: .2s; }
.oai-dots i:nth-child(3) { animation-delay: .4s; }
@keyframes oaiDot { 0%, 60%, 100% { transform: translateY(0); opacity: .4; } 30% { transform: translateY(-4px); opacity: 1; } }
@container oai (max-width: 559.98px) {
  .oai-msg.ai > .oai-ava { display: none; }
  .oai-msg.err { padding-left: 0; }
  .oai-bub { max-width: 88%; }
  .oai-ans { padding: 12px 13px 8px; }
}

/* --- Javob matni (xavfsiz markdown; xodim paneli .ai-msg ichida ham) --- */
.oai-md { min-width: 0; font-size: 15px; line-height: 1.6; color: var(--text); white-space: normal; overflow-wrap: anywhere; }
.oai-md > * + * { margin-top: .6em; }
.oai-md p.oai-h { margin-top: .9em; font-size: 15.5px; color: var(--op-ink, var(--navy)); }
.oai-md > .oai-sr + p.oai-h, .oai-md > p.oai-h:first-child { margin-top: 0; }
.oai-md strong { font-weight: 700; color: var(--op-ink, var(--navy)); }
.oai-md ul, .oai-md ol { padding-left: 1.35em; }
.oai-md ul { list-style: disc; }
.oai-md ol { list-style: decimal; }
.oai-md li + li { margin-top: .25em; }
.oai-md li > ul, .oai-md li > ol { margin-top: .25em; }
.oai-md li::marker { color: var(--navy-light); }
.oai-md a { color: var(--navy-light); font-weight: 600; text-decoration: underline; text-underline-offset: 2px; text-decoration-thickness: 1px; }
.oai-md a:hover { text-decoration-thickness: 2px; }
.oai-md a.oai-tel { white-space: nowrap; font-variant-numeric: tabular-nums; }
.oai-md code { padding: 1px 5px; border-radius: 5px; font: 500 .9em/1.4 ui-monospace, 'SF Mono', Menlo, Consolas, monospace; background: var(--op-tint-h, rgba(31, 59, 115, .085)); }
.oai-md p.oai-q { padding: 2px 0 2px 12px; border-left: 3px solid #c9a227; color: var(--text); }
.oai-md hr { height: 1px; margin: .9em 0; border: 0; background: var(--op-line, rgba(160, 180, 220, .45)); }
.oai-tw { max-width: 100%; overflow-x: auto; border-radius: 10px; border: 1px solid var(--op-line, rgba(160, 180, 220, .45)); }
.oai-tw table { width: 100%; border-collapse: collapse; font-size: 13.5px; line-height: 1.45; }
.oai-tw th, .oai-tw td { padding: 7px 10px; text-align: left; vertical-align: top; border-bottom: 1px solid var(--op-line, rgba(160, 180, 220, .45)); overflow-wrap: normal; min-width: 90px; }
.oai-tw th { font-weight: 700; color: var(--op-ink, var(--navy)); background: var(--op-tint, rgba(31, 59, 115, .045)); }
.oai-tw tr:last-child td { border-bottom: 0; }

/* --- Manbalar --- */
.oai-srcs { display: flex; flex-direction: column; gap: 6px; padding-top: 10px; border-top: 1px solid var(--op-line, rgba(160, 180, 220, .45)); }
.oai-srcs-l { font: 800 11px/1.3 'Inter', sans-serif; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.oai-srcs ul { display: flex; flex-wrap: wrap; gap: 6px; margin: 0; padding: 0; list-style: none; }
.oai-srcs li { min-width: 0; max-width: 100%; }
.oai-src { max-width: 100%; display: inline-flex; align-items: center; gap: 6px; min-height: 32px; padding: 0 10px 0 8px; border-radius: 10px; text-decoration: none;
  font: 600 12.5px/1.3 'Inter', sans-serif; color: var(--op-ink, var(--navy)); background: var(--op-tint, rgba(31, 59, 115, .045)); border: 1px solid var(--op-line, rgba(160, 180, 220, .45)); }
:is(a, button).oai-src { cursor: pointer; transition: background-color var(--m1, .15s), border-color var(--m1, .15s); }
:is(a, button).oai-src:hover { background: var(--op-tint-h, rgba(31, 59, 115, .085)); border-color: rgba(47, 84, 168, .35); }
button.oai-src { font: 600 12.5px/1.3 'Inter', sans-serif; }
.oai-src-ic { display: grid; flex: 0 0 auto; color: var(--navy-light); }
.oai-src-ic svg { width: 14px; height: 14px; }
.oai-src-k { flex: 0 0 auto; font-weight: 800; font-size: 11px; letter-spacing: .03em; color: var(--muted); }
.oai-src-t { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 34ch; }
.oai-src.k-lex .oai-src-ic { color: #86650c; }
@media (pointer: coarse) { .oai-src { min-height: 40px; } .oai-act { min-height: 44px; } }

/* --- Yozish paneli (dock) --- */
.oai-dock { position: sticky; bottom: var(--oai-dock); z-index: 5; display: flex; flex-direction: column; gap: 8px; padding: 8px 8px 6px; border-radius: 20px;
  background: var(--g3-bg); border: var(--g3-border); box-shadow: var(--g3-hi), 0 8px 28px rgba(20, 42, 82, .16);
  -webkit-backdrop-filter: saturate(var(--g3-sat)) blur(var(--g3-blur)); backdrop-filter: saturate(var(--g3-sat)) blur(var(--g3-blur)); }
.oai-form { display: flex; align-items: flex-end; gap: 8px; }
.oai-form textarea { flex: 1; min-width: 0; min-height: 48px; max-height: 200px; padding: 13px 14px; border-radius: 14px; resize: none; overflow-y: auto;
  font: 400 15px/1.45 'Inter', sans-serif; color: var(--text); background: var(--op-field); border: 1px solid rgba(31, 59, 115, .2); outline: none;
  -webkit-appearance: none; appearance: none; }
.oai-form textarea::placeholder { color: #5d6b85; opacity: 1; }
.oai-form textarea:focus { border-color: var(--navy-light); box-shadow: 0 0 0 3px rgba(47, 84, 168, .16); }
.oai-form textarea:disabled { cursor: not-allowed; opacity: .75; }
.oai-send { width: 48px; height: 48px; flex: 0 0 auto; display: grid; place-items: center; border: 0; border-radius: 14px; cursor: pointer; color: #fff;
  background: linear-gradient(150deg, #1f3b73, #2f54a8); box-shadow: 0 4px 12px rgba(31, 59, 115, .22); transition: transform var(--m1, .15s), opacity var(--m1, .15s); }
.oai-send svg { width: 20px; height: 20px; }
.oai-send:hover:not(:disabled) { transform: translateY(-1px); }
.oai-send:disabled { opacity: .45; cursor: default; box-shadow: none; }
.oai.is-busy .oai-send:disabled { opacity: .6; }
.oai-foot { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 2px 12px; min-height: 22px; padding: 0 6px;
  font-size: 12.5px; line-height: 1.4; color: var(--muted); font-variant-numeric: tabular-nums; }
.oai-foot b { color: var(--op-ink); }
.oai-quota .is-warn b, .oai-cnt.is-warn { color: #b42318; }
.oai-cnt { margin-left: auto; }
.oai-tlink { display: inline-flex; align-items: center; min-height: 28px; padding: 0 2px; border: 0; background: none; cursor: pointer; text-decoration: underline;
  text-underline-offset: 3px; font: 700 12.5px/1.3 'Inter', sans-serif; color: var(--navy-light); }
.oai-lock { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; padding: 10px 12px; border-radius: 14px;
  background: rgba(251, 243, 214, .85); border: 1px solid rgba(201, 162, 39, .45); }
.oai-lock > svg { width: 20px; height: 20px; flex: 0 0 auto; color: #86650c; }
.oai-lock > div { flex: 1 1 220px; min-width: 0; }
.oai-lock b { font-size: 14px; color: var(--op-ink); }
.oai-lock p { margin-top: 2px; font-size: 13px; line-height: 1.45; color: var(--text); }
.oai-lock.is-soon { background: var(--op-tint); border-color: var(--op-line); }
.oai-lock.is-soon > svg { color: var(--navy-light); }
.op-btn.oai-gold { color: #142a52; border-color: transparent; background: linear-gradient(135deg, #f3e3a6, #c9a227); box-shadow: 0 3px 10px rgba(20, 42, 82, .16); }
.op-btn.oai-gold:hover { background: linear-gradient(135deg, #f6e9b8, #d1ab35); }
.oai-disc { display: flex; gap: 8px; align-items: flex-start; padding: 0 4px; font-size: 12.5px; line-height: 1.5; color: var(--muted); }
@media (max-width: 1023.98px) {
  .oai { --oai-dock: calc(72px + env(safe-area-inset-bottom, 0px)); }
  html.op-root:has(.oai) { scroll-padding-bottom: calc(190px + env(safe-area-inset-bottom, 0px)); }
}
@media (max-width: 1023.98px) and (max-height: 500px) { .oai { --oai-dock: calc(54px + env(safe-area-inset-bottom, 0px)); } }
@media (min-width: 1024px) { html.op-root:has(.oai) { scroll-padding-bottom: 150px; } }
@container oai (max-width: 559.98px) {
  .oai-dock { padding: 6px 6px 4px; border-radius: 18px; }
  .oai-form textarea { padding: 12px; font-size: 16px; }   /* iOS: 16px — maydonga bosilganda sahifa kattalashmaydi */
}

/* --- Tun rejimi --- */
body.dark .oai-ava { box-shadow: 0 10px 22px rgba(0, 0, 0, .35), inset 0 1px 0 rgba(255, 255, 255, .12); }
body.dark .oai-sug-ic, body.dark .oai-src-ic, body.dark .oai-md a, body.dark .oai-tlink { color: #9db9ff; }
body.dark .oai-md li::marker { color: #9db9ff; }
body.dark .oai-src.k-lex .oai-src-ic { color: #e9d28a; }
body.dark .oai-ans, body.dark .oai-wait { box-shadow: 0 1px 2px rgba(0, 0, 0, .25), 0 6px 18px rgba(0, 0, 0, .25); }
body.dark .oai-errbox { color: #ffb4ab; background: rgba(255, 155, 143, .08); border-color: rgba(255, 155, 143, .3); }
body.dark .oai-form textarea { color: #e3ebfb; border-color: rgba(120, 145, 195, .35); color-scheme: dark; }
body.dark .oai-form textarea::placeholder { color: #8395b8; }
body.dark .oai-send { background: linear-gradient(150deg, #2f54a8, #3d63b8); }
body.dark .oai-dots i { background: #9db9ff; }
body.dark .oai-lock, body.dark .oai-trial { background: rgba(201, 162, 39, .12); border-color: rgba(233, 210, 138, .38); }
body.dark .oai-trial > svg { color: #e9d28a; }
body.dark .oai-lock > svg, body.dark .oai-soon-ic { color: #e9d28a; }
body.dark .oai-soon-ic { background: rgba(201, 162, 39, .14); border-color: rgba(233, 210, 138, .4); }
body.dark .oai-lock.is-soon { background: var(--op-tint); border-color: var(--op-line); }
body.dark .oai-lock.is-soon > svg { color: #9db9ff; }
body.dark .oai-quota .is-warn b, body.dark .oai-cnt.is-warn { color: #ffb4ab; }
body.dark .oai-act.is-ok { color: #8fdcb4; }
body.dark .oai-dock { box-shadow: var(--g3-hi), 0 8px 28px rgba(0, 0, 0, .4); }
body.dark .oai :focus-visible, body.dark .ai-msg .oai-srcs :focus-visible { outline-color: rgba(157, 185, 255, .8); }

@media (prefers-reduced-motion: reduce) {
  .oai-dots i { animation: none; opacity: .8; }
  .oai-sug, .oai-sug > svg, .oai-send, .oai-act, .oai-src { transition: none; }
  .oai-sug:hover:not(:disabled) > svg, .oai-send:hover:not(:disabled) { transform: none; }
}
/* ---------- v111: suhbatlar tarixi paneli (kabinet #oaiHist va xodim paneli) ---------- */
.oai-hist { margin: 14px 0 4px; padding: 14px 14px 10px; border-radius: var(--op-r-card, 18px); background: var(--g1-bg, rgba(255, 255, 255, .78));
  border: 1px solid var(--op-line); box-shadow: var(--shadow-sm); }
.oai-hist[hidden] { display: none; }
.oai-hh { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
.oai-hh b { font: 800 15.5px/1.3 'Manrope', 'Inter', sans-serif; color: var(--op-ink, #16223d); }
.oai-hh-n { font-size: 12.5px; font-weight: 700; color: var(--muted); }
.oai-hx { margin-left: auto; width: 34px; height: 34px; display: grid; place-items: center; border: 0; border-radius: 10px; background: transparent; color: var(--muted); cursor: pointer; }
.oai-hx:hover { background: var(--op-tint-h, rgba(31, 59, 115, .08)); color: var(--op-ink); }
.oai-hx svg { width: 17px; height: 17px; }
.oai-hs { display: flex; align-items: center; gap: 8px; min-height: 40px; padding: 0 12px; border-radius: 12px; border: 1px solid var(--op-line); background: var(--op-field, rgba(255, 255, 255, .85)); }
.oai-hs svg { width: 16px; height: 16px; color: var(--muted); flex: none; }
.oai-hs input { flex: 1; min-width: 0; height: 38px; border: 0; outline: 0; background: transparent; font: 400 14px 'Inter', sans-serif; color: var(--op-ink, inherit); }
.oai-hs:focus-within { border-color: var(--navy-light, #2f54a8); box-shadow: 0 0 0 3px rgba(47, 84, 168, .12); }
.oai-hl { list-style: none; margin: 8px 0 0; padding: 0; max-height: min(52vh, 420px); overflow-y: auto; overscroll-behavior: contain; }
.oai-hrow { display: flex; align-items: stretch; gap: 4px; border-radius: 12px; }
.oai-hrow + .oai-hrow { margin-top: 2px; }
.oai-hrow.is-cur { background: var(--op-tint-h, rgba(31, 59, 115, .08)); }
.oai-hi { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; padding: 9px 10px; border: 0; border-radius: 12px; background: transparent; text-align: left; cursor: pointer; color: inherit; font: inherit; }
.oai-hi:hover { background: var(--op-tint-h, rgba(31, 59, 115, .06)); }
.oai-hi b { font-size: 14px; font-weight: 650; color: var(--op-ink, inherit); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.oai-hi small { font-size: 12.5px; color: var(--muted); }
.oai-hdel { flex: none; display: inline-flex; align-items: center; gap: 6px; min-width: 40px; padding: 0 10px; border: 0; border-radius: 12px; background: transparent; color: var(--muted); cursor: pointer; font: 600 12.5px 'Inter', sans-serif; }
.oai-hdel svg { width: 16px; height: 16px; }
.oai-hdel:hover { color: #b3261e; background: rgba(214, 69, 69, .08); }
.oai-hdel.is-arm { color: #fff; background: #c43a3a; }
.oai-hdel span:empty { display: none; }
.oai-hmsg { padding: 14px 10px; font-size: 13.5px; color: var(--muted); }
.oai-hf { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 6px 12px; margin-top: 8px; padding-top: 8px; border-top: 1px solid var(--op-line); font-size: 12px; color: var(--muted); }
.oai-hf > span { display: inline-flex; align-items: center; gap: 6px; }
.oai-hf svg { width: 14px; height: 14px; flex: none; }
.oai-hclr { border: 0; background: transparent; color: #b3261e; font: 600 12.5px 'Inter', sans-serif; cursor: pointer; padding: 6px 4px; border-radius: 8px; }
.oai-hclr:hover { background: rgba(214, 69, 69, .08); }
.oai-hi:focus-visible, .oai-hdel:focus-visible, .oai-hclr:focus-visible, .oai-hx:focus-visible { outline: 2px solid var(--navy-light, #2f54a8); outline-offset: 1px; }
body.dark .oai-hist { background: rgba(20, 32, 60, .72); }
body.dark .oai-hs { background: rgba(20, 32, 60, .6); }
body.dark .oai-hdel:hover, body.dark .oai-hclr { color: #ff9b94; }
body.dark .oai-hdel.is-arm { color: #fff; background: #b23a3a; }
@media (pointer: coarse) { .oai-hi { min-height: 52px; } .oai-hdel { min-width: 48px; } }

/* ---------- v111: javobni chop etish / PDF (body.oai-printing — faqat .oai-print varagʻi) ---------- */
.oai-print { display: none; }
@media print {
  body.oai-printing > *:not(.oai-print) { display: none !important; }
  body.oai-printing { background: #fff !important; }
  body.oai-printing .oai-print { display: block; color: #000; font: 12pt/1.5 'Times New Roman', serif; }
  .oai-print h1 { font: 700 16pt/1.3 'Times New Roman', serif; text-align: center; margin: 0 0 2pt; }
  .oai-print-m { text-align: center; color: #555; font-size: 10pt; margin: 0 0 14pt; }
  .oai-print h2 { font: 700 13pt/1.3 'Times New Roman', serif; margin: 12pt 0 4pt; }
  .oai-print .oai-md, .oai-print .oai-md * { color: #000 !important; }
  .oai-print .oai-md table { border-collapse: collapse; width: 100%; }
  .oai-print .oai-md th, .oai-print .oai-md td { border: 1px solid #999; padding: 3pt 5pt; }
  .oai-print .oai-md a { color: #000; text-decoration: underline; }
  .oai-print-d { margin-top: 16pt; padding-top: 6pt; border-top: 1px solid #bbb; font-size: 10pt; font-style: italic; color: #333; }
  @page { size: A4; margin: 18mm 16mm; }
}
@media print {
  .oai-dock, .oai-intro, .oai-planw, .oai-new, .oai-acts, .oai-msg.err, .oai-msg.is-wait, .oai-hacts, .oai-hist { display: none !important; }
  .oai-dock { position: static; }
  .oai-ans, .oai-bub { box-shadow: none; }
  .oai-bub { color: #000; background: #eef2fa; }
}

/* --- Xodim paneli (app.js #aiPanel): markdown javob, manbalar, Pro kvota qatori --- */
.ai-msg .oai-md { font-size: inherit; line-height: inherit; }
.ai-msg .oai-md > * + * { margin-top: .5em; }
.ai-msg.bot.ai-md-msg { max-width: 92%; }
.ai-msg .oai-srcs { margin-top: 10px; padding-top: 8px; }
.ai-msg .oai-src-t { max-width: 24ch; }
.ai-quota.is-pro { color: var(--muted); background: rgba(31, 59, 115, .05); border-top-color: rgba(31, 59, 115, .12); }
.ai-quota.is-pro b { color: #142a52; }
.ai-quota.is-pro.out b { color: #b42318; }
body.dark .ai-quota.is-pro { color: #c9d6f2; background: rgba(120, 145, 195, .1); border-top-color: rgba(120, 145, 195, .22); }
body.dark .ai-quota.is-pro b { color: #e6ecf9; }
body.dark .ai-quota.is-pro.out b { color: #f4a69c; }
body.dark .ai-msg .oai-md strong, body.dark .ai-msg .oai-md p.oai-h, body.dark .ai-msg .oai-tw th { color: #e6ecf9; }
body.dark .ai-msg .oai-src { color: #c9d6f2; background: rgba(120, 145, 195, .12); border-color: rgba(120, 145, 195, .3); }

/* Lex uslubi belgilari (✅ ❌ 📍 🔸 ❗ → SVG): matn qatorida, matn rangiga mos; emoji emas */
.oai-mk { display: inline-flex; align-items: center; justify-content: center; width: 1.25em; height: 1.25em; margin-right: .35em;
  vertical-align: -0.22em; border-radius: 6px; flex: none; }
.oai-mk svg { width: .9em; height: .9em; }
.oai-mk-ok { color: #157347; background: rgba(21, 115, 71, .12); }
.oai-mk-no { color: #b42318; background: rgba(180, 35, 24, .1); }
.oai-mk-pin { color: #1f3b73; background: rgba(31, 59, 115, .1); }
.oai-mk-dot { color: #a77b12; background: rgba(201, 162, 39, .16); }
.oai-mk-warn { color: #9a5b00; background: rgba(214, 137, 16, .16); }
body.dark .oai-mk-ok, html[data-theme="dark"] .oai-mk-ok { color: #6fd39d; background: rgba(111, 211, 157, .14); }
body.dark .oai-mk-no, html[data-theme="dark"] .oai-mk-no { color: #ff8f84; background: rgba(255, 143, 132, .14); }
body.dark .oai-mk-pin, html[data-theme="dark"] .oai-mk-pin { color: #a9c1f2; background: rgba(169, 193, 242, .14); }
body.dark .oai-mk-dot, html[data-theme="dark"] .oai-mk-dot { color: #e7c25a; background: rgba(231, 194, 90, .16); }
body.dark .oai-mk-warn, html[data-theme="dark"] .oai-mk-warn { color: #f4b860; background: rgba(244, 184, 96, .16); }

/* Telefon: yozish qutisi pastki tab paneliga zich tegadi (orada aylanayotgan matn koʻrinmasin) */
@media (max-width: 1023.98px) { .oai { --oai-dock: calc(64px + env(safe-area-inset-bottom, 0px)); } }

/* --- v111: xodim paneli — «Tarix» / «Yangi suhbat» (navy sarlavhada), tarix roʻyxati va javobni saqlash tugmalari --- */
.ai-head .ai-hacts { margin-left: auto; display: flex; gap: 6px; align-self: center; }
.ai-hb { height: 30px; padding: 0 10px; border-radius: 9px; border: 1px solid rgba(255, 255, 255, .28); background: rgba(255, 255, 255, .1); color: #fff;
  font: 600 12px/1 'Inter', sans-serif; cursor: pointer; white-space: nowrap; }
.ai-hb:hover, .ai-hb[aria-expanded="true"] { background: rgba(255, 255, 255, .22); }
.ai-hb:focus-visible { outline: 2px solid #ebc65a; outline-offset: 1px; }
.ai-hist { margin: 8px 10px 0; padding: 10px; max-height: 58%; display: flex; flex-direction: column; }
.ai-hist .oai-hl { max-height: none; flex: 1; min-height: 0; }
.ai-saves { display: flex; gap: 6px; margin-top: 8px; }
.ai-saves button { height: 28px; padding: 0 10px; border-radius: 8px; border: 1px solid var(--op-line, rgba(31, 59, 115, .16)); background: transparent;
  color: var(--muted, #5d6b85); font: 600 12px/1 'Inter', sans-serif; cursor: pointer; }
.ai-saves button:hover { color: var(--text, #16223d); background: rgba(31, 59, 115, .06); }
body.dark .ai-saves button:hover { color: #e7edfb; background: rgba(140, 165, 215, .12); }
