/* Ofisbop — umumiy uslublar. Copyright (c) 2026 "VIJDON" MChJ. Barcha huquqlar himoyalangan. */
/*
 * Dizayn tamoyillari (batafsil: docs/DIZAYN.md):
 *  - oq, tinch "ish stoli": yuqori panel, yorliqlar va lenta bitta oq blok, mahsulot rangi faqat tepadagi
 *    ingichka chiziqda, faol yorliqda va asosiy tugmada;
 *  - har bir tugma kamida 28 px, aniq hover/bosilgan/fokus holati, matn kontrasti WCAG AA;
 *  - lenta sigʻmasa — yashirilmaydi, yon strelkalar bilan suriladi.
 */
:root {
  --accent: #4338ca;
  --accent-dark: #3730a3;
  --accent-soft: #eceefe;
  --accent-strong: var(--accent); /* oq yozuvli to'liq rangli tugmalar uchun (kontrast >= 4.5:1) */
  --bg: #eceef2;
  --panel: #ffffff;
  --chrome: #ffffff;
  --ribbon: #ffffff;
  --side: #f6f7f9;
  --border: #d9dde3;
  --border-soft: #e6e9ee;
  --text: #1f2328;
  --text-2: #3b424b;
  --muted: #5d6570;
  --hover: #eef0f3;
  --pressed: #e1e5eb;
  --danger: #b42318;
  --ok: #15803d;
  --warn: #b45309;
  --radius: 8px;
  --shadow: 0 1px 3px rgba(15, 23, 42, .10), 0 8px 24px rgba(15, 23, 42, .08);
  font-family: "Segoe UI", system-ui, -apple-system, Roboto, Arial, sans-serif;
  font-size: 13px;
  color: var(--text);
}
body { --accent-strong: var(--accent); } /* mavzu rangi body'da aniqlangani uchun shu yerda ham */
body.theme-sheet { --accent: #0f766e; --accent-dark: #115e59; --accent-soft: #e0f2ef; }
body.theme-slides { --accent: #d97706; --accent-dark: #a14d05; --accent-soft: #fdf1dc; --accent-strong: #b45309; }
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; background: var(--bg); }
body { display: flex; flex-direction: column; overflow: hidden; }
button, select, input { font: inherit; color: inherit; }
.hidden { display: none !important; }
/* ---------- Ikonkalar (common.js → icon): qalinlik ekran pikselida, oʻlchamga bogʻliq emas ---------- */
svg.ico { --sw: 1.5px; stroke-width: var(--sw); overflow: visible; shape-rendering: geometricPrecision; }
svg.ico * { vector-effect: non-scaling-stroke; }
svg.ico .f { fill: currentColor; stroke: none; }
svg.ico .p { fill: var(--panel, #fff); }
svg.ico .o { opacity: .45; }
svg.ico .t { stroke-width: calc(var(--sw) * .75); }
svg.ico .w { stroke-width: calc(var(--sw) * 1.45); }
svg.ico .a { stroke: var(--accent); }
svg.ico .f.a { fill: var(--accent); stroke: none; }
svg.ico .d { stroke: var(--danger, #b42318); }
.btn.on svg.ico .a, .tbtn.tb-save svg.ico .a, .file-tab svg.ico .a { stroke: currentColor; }
.btn.big svg.ico, .recent-item svg.ico { --sw: 1.65px; }
svg.ico.caret { --sw: 2px; }
button:focus-visible, a:focus-visible, select:focus-visible, [tabindex]:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }

/* ---------- Yuqori panel: uy, nom, holat, asosiy amallar ---------- */
.titlebar {
  display: flex; align-items: center; gap: 4px; flex: none;
  background: var(--chrome); color: var(--text); height: 48px; padding: 0 10px 0 8px;
  border-top: 3px solid var(--accent); /* mahsulot rangi — varaq chetidagi chiziq */
}
.titlebar .logo { display: flex; align-items: center; justify-content: center; width: 36px; height: 36px; border-radius: var(--radius); text-decoration: none; flex: none; }
.titlebar .logo:hover { background: var(--hover); }
.titlebar .logo svg { width: 24px; height: 24px; color: var(--accent); }
.titlebar .logo img.tb-ic { width: 26px; height: 26px; }
.titlebar .tb-doc { display: flex; align-items: center; gap: 6px; min-width: 0; flex: 0 1 auto; }
.titlebar .docname {
  background: transparent; border: 1px solid transparent; color: var(--text); border-radius: 6px;
  padding: 4px 8px; min-width: 120px; max-width: 340px; font-size: 14.5px; font-weight: 600; text-overflow: ellipsis;
}
.titlebar .docname:hover { border-color: var(--border); }
.titlebar .docname:focus { background: #fff; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); outline: none; }
/* Fayl formati: Ctrl+S qaysi turda saqlashini doim ko'rsatadi */
.fmt-badge {
  flex: none; border: 1px solid var(--border); background: #fff; color: var(--text-2); border-radius: 999px;
  font-size: 11.5px; font-weight: 600; padding: 1px 8px; cursor: pointer; line-height: 18px; white-space: nowrap;
}
.fmt-badge:hover { border-color: var(--accent); color: var(--accent-dark); }
/* Saqlanish holati: rangli nuqta + matn (common.js data-state qo'yadi) */
.titlebar .status { font-size: 12px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 300px; }
.titlebar #saveStatus { display: inline-flex; align-items: center; gap: 6px; }
.titlebar #saveStatus:empty { display: none; }
#saveStatus::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: #9aa3ad; flex: none; }
#saveStatus[data-state=ok]::before { background: var(--ok); }
#saveStatus[data-state=busy]::before { background: #f59e0b; }
#saveStatus[data-state=warn]::before { background: var(--warn); }
#saveStatus[data-state=err] { color: var(--danger); }
#saveStatus[data-state=err]::before { background: var(--danger); }
.titlebar .spacer { flex: 1; }
.titlebar .cloud-status[data-kind=ok] { color: var(--ok); }
.titlebar .cloud-status[data-kind=err] { color: var(--danger); }
.titlebar .tb-sep { width: 1px; height: 22px; background: var(--border); margin: 0 4px; flex: none; }
#cloudBox { display: inline-flex; }
#cloudBox .tbtn img, #cloudBox .tbtn > span:first-child { flex: none; }
#cloudBox .tbtn > span:first-child[style*="border-radius:50%"] { box-shadow: inset 0 0 0 1px var(--border); }
.titlebar .tbtn {
  background: transparent; border: 0; color: var(--text-2); height: 34px; min-width: 34px; padding: 0 8px; border-radius: var(--radius); cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center; gap: 6px; white-space: nowrap; flex: none; text-decoration: none;
}
.titlebar .tbtn:hover { background: var(--hover); color: var(--text); }
.titlebar .tbtn:active { background: var(--pressed); }
.titlebar .tbtn svg { width: 18px; height: 18px; }
.titlebar .tbtn.tb-save { background: var(--accent-strong); color: #fff; padding: 0 14px 0 11px; font-weight: 600; margin-left: 4px; }
.titlebar .tbtn.tb-save:hover { background: var(--accent-dark); }
.titlebar .tbtn.tb-show { border: 1px solid var(--border); font-weight: 600; color: var(--accent-dark); }
.titlebar .tbtn.tb-show svg { width: 15px; height: 15px; }
/* "Avto-saqlash" (autosave.js inline uslubini yorug' panelga moslash) */
.titlebar #autoFileBtn { border-color: var(--border) !important; background: #fff !important; color: var(--text-2) !important; }

/* ---------- Yorliqlar ---------- */
.tabs { display: flex; align-items: center; gap: 2px; background: var(--chrome); padding: 0 8px 6px; flex: none; }
.tabs button {
  background: transparent; border: 0; color: var(--text-2); height: 30px; padding: 0 13px; cursor: pointer;
  border-radius: var(--radius); font-size: 13px; white-space: nowrap;
}
.tabs button:hover { background: var(--hover); color: var(--text); }
.tabs button.active { background: var(--accent-soft); color: var(--accent-dark); font-weight: 600; }
.tabs button.file-tab { background: var(--accent-strong); color: #fff; font-weight: 600; margin-right: 6px; padding: 0 14px 0 11px; display: inline-flex; align-items: center; gap: 7px; }
.tabs button.file-tab::before { content: ""; width: 12px; height: 9px; flex: none; background: linear-gradient(currentColor 0 0) 0 0 / 100% 1.6px no-repeat, linear-gradient(currentColor 0 0) 0 50% / 100% 1.6px no-repeat, linear-gradient(currentColor 0 0) 0 100% / 100% 1.6px no-repeat; }
.tabs button.file-tab:hover { background: var(--accent-dark); }

/* ---------- Lenta ---------- */
.ribbon-wrap { position: relative; flex: none; }
.ribbon {
  background: var(--ribbon); border-bottom: 1px solid var(--border); flex: none;
  display: flex; align-items: stretch; padding: 6px 8px; min-height: 72px; overflow-x: auto; overflow-y: hidden;
  scrollbar-width: none; box-shadow: 0 1px 2px rgba(15, 23, 42, .04);
}
.ribbon::-webkit-scrollbar { display: none; }
.ribbon .panel { display: none; align-items: stretch; gap: 0; }
.ribbon .panel.active { display: flex; }
.group {
  display: flex; flex-direction: column; justify-content: center; padding: 0 10px; position: relative; flex: none;
}
.group + .group::before { content: ""; position: absolute; left: 0; top: 6px; bottom: 6px; width: 1px; background: var(--border-soft); }
.group .gbody { display: flex; align-items: center; gap: 3px; flex: 1; }
.group .gcol, .group .gbody.gcol { display: flex; flex-direction: column; align-items: flex-start; justify-content: center; gap: 4px; }
.group .grow { display: flex; align-items: center; gap: 3px; }
/* Guruh nomlari ekranda ko'rsatilmaydi (shovqinni kamaytirish) — common.js ularni aria-label qilib qo'yadi */
.group .glabel { display: none; }
/* Sig'masa: yon strelkalar */
.rb-arrow {
  position: absolute; top: 0; bottom: 1px; width: 30px; border: 0; cursor: pointer; z-index: 3; display: none;
  color: var(--text-2); font-size: 20px; line-height: 1; padding: 0;
}
.rb-arrow.l { left: 0; background: linear-gradient(90deg, #fff 55%, rgba(255, 255, 255, 0)); text-align: left; padding-left: 6px; }
.rb-arrow.r { right: 0; background: linear-gradient(270deg, #fff 55%, rgba(255, 255, 255, 0)); text-align: right; padding-right: 6px; }
.rb-arrow:hover { color: var(--accent-dark); }
.ribbon-wrap.ov-l .rb-arrow.l, .ribbon-wrap.ov-r .rb-arrow.r { display: block; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 5px; color: var(--text-2);
  background: transparent; border: 1px solid transparent; border-radius: 6px; cursor: pointer;
  min-width: 28px; height: 28px; padding: 0 6px; white-space: nowrap; position: relative;
}
.btn:hover { background: var(--hover); color: var(--text); }
.btn:active { background: var(--pressed); }
.btn.on { background: var(--accent-soft); color: var(--accent-dark); border-color: color-mix(in srgb, var(--accent) 35%, transparent); }
.btn:disabled { opacity: .4; pointer-events: none; }
.btn svg { width: 18px; height: 18px; flex: none; }
.btn.big { flex-direction: column; height: 58px; min-width: 56px; padding: 4px 8px; gap: 3px; font-size: 12px; line-height: 1.15; border-radius: var(--radius); }
.btn.big svg { width: 24px; height: 24px; }
.btn .caret, .btn.big svg.caret { width: 9px; height: 9px; opacity: .55; }
.btn.big svg.caret { position: absolute; right: 4px; top: 9px; }
.btn .swatch { position: absolute; left: 6px; right: 6px; bottom: 3px; height: 3px; border-radius: 2px; }
.btn.letter { font-weight: 700; font-family: Georgia, "Times New Roman", serif; font-size: 15px; width: 30px; }
select.sel, input.inp {
  height: 28px; border: 1px solid var(--border); border-radius: 6px; background: #fff; padding: 0 6px; color: var(--text);
}
select.sel:hover, input.inp:hover { border-color: #b8bfc9; }
select.sel:focus, input.inp:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }

.script-hint { max-width: 380px; font-size: 12px; line-height: 1.45; color: var(--muted); white-space: normal; padding: 4px 6px; }

/* ---------- Ochiluvchi menyu ---------- */
.menu {
  position: fixed; z-index: 1000; background: var(--panel); border: 1px solid var(--border); border-radius: 10px;
  box-shadow: var(--shadow); padding: 5px; min-width: 190px; max-height: 70vh; overflow: auto;
}
.menu .mi {
  display: flex; align-items: center; gap: 9px; padding: 0 10px; min-height: 32px; border-radius: 6px; cursor: pointer; white-space: nowrap;
}
.menu .mi:hover { background: var(--accent-soft); color: var(--accent-dark); }
.menu .mi svg { width: 18px; height: 18px; flex: none; }
.menu .mi .kbd { margin-left: auto; color: var(--muted); font-size: 11px; padding-left: 20px; }
.menu .sep { height: 1px; background: var(--border-soft); margin: 4px 2px; }
.menu .mh { padding: 7px 10px 3px; color: var(--muted); font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .04em; }
.palette { display: grid; grid-template-columns: repeat(10, 18px); gap: 3px; padding: 6px; }
.palette span { width: 18px; height: 18px; border: 1px solid rgba(0, 0, 0, .15); cursor: pointer; border-radius: 3px; }
.palette span:hover { outline: 2px solid var(--accent); }

/* ---------- Holat qatori ---------- */
.statusbar {
  display: flex; align-items: center; gap: 14px; height: 28px; padding: 0 10px 0 12px; flex: none;
  background: var(--chrome); border-top: 1px solid var(--border); color: var(--muted); font-size: 12px;
}
.statusbar .spacer { flex: 1; }
.statusbar > span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.statusbar .btn { height: 22px; min-width: 24px; color: var(--muted); }
.statusbar input[type=range] { width: 110px; accent-color: var(--accent); }
.statusbar .st-click { cursor: pointer; border-radius: 4px; padding: 2px 6px; margin: 0 -6px; }
.statusbar .st-click:hover { background: var(--hover); color: var(--text); }

/* ---------- Modal oyna ---------- */
.modal-back {
  position: fixed; inset: 0; background: rgba(15, 23, 42, .38); z-index: 2000;
  display: flex; align-items: center; justify-content: center;
}
.modal {
  background: var(--panel); border-radius: 12px; box-shadow: 0 20px 60px rgba(15, 23, 42, .28); min-width: 340px; max-width: 92vw;
  max-height: 88vh; display: flex; flex-direction: column;
}
.modal h3 { margin: 0; padding: 16px 20px 8px; font-size: 16.5px; }
.modal .mbody { padding: 6px 20px 12px; overflow: auto; line-height: 1.5; }
.modal .mfoot { display: flex; justify-content: flex-end; gap: 8px; padding: 12px 20px 16px; }
.modal label { display: block; margin: 8px 0 4px; color: var(--muted); font-size: 12px; }
.modal input.inp, .modal select.sel { width: 100%; height: 32px; }
.pbtn {
  border: 1px solid var(--border); background: #fff; border-radius: var(--radius); min-height: 34px; padding: 0 16px; cursor: pointer; color: var(--text);
}
.pbtn:hover { background: var(--hover); }
.pbtn.primary { background: var(--accent); border-color: var(--accent); color: #fff; font-weight: 600; }
.pbtn.primary:hover { background: var(--accent-dark); }

/* ---------- Bildirishnoma ---------- */
.toast {
  position: fixed; bottom: 44px; left: 50%; transform: translateX(-50%); z-index: 3000;
  background: #1f2937; color: #fff; padding: 9px 16px; border-radius: var(--radius); box-shadow: var(--shadow);
  font-size: 13px; transition: opacity .3s; max-width: calc(100vw - 32px);
}

/* ---------- Fayl menyusi (backstage) ---------- */
.backstage {
  position: fixed; inset: 48px 0 0 0; z-index: 900; display: flex; background: var(--panel); border-top: 1px solid var(--border);
}
.backstage .bs-side { width: 248px; background: var(--side); color: var(--text); padding: 10px 8px; display: flex; flex-direction: column; overflow-y: auto; border-right: 1px solid var(--border); }
.backstage .bs-side button {
  background: transparent; border: 0; color: var(--text); text-align: left; padding: 0 12px; min-height: 36px; cursor: pointer; border-radius: var(--radius);
  display: flex; align-items: center; gap: 11px; font-size: 13.5px; flex: none;
}
.backstage .bs-side button:hover { background: var(--accent-soft); color: var(--accent-dark); }
.backstage .bs-side button svg { width: 18px; height: 18px; flex: none; color: var(--text-2); }
.backstage .bs-side button:hover svg { color: inherit; }
.backstage .bs-side button small { margin-left: auto; color: var(--muted); font-size: 11.5px; }
.backstage .bs-side .back { font-size: 14px; font-weight: 600; margin-bottom: 6px; color: var(--accent-dark); }
.backstage .bs-side .bs-h { color: var(--muted); font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .05em; padding: 12px 12px 4px; }
.backstage .bs-side .bs-sep { height: 1px; background: var(--border); margin: 8px 10px; flex: none; }
.backstage .bs-main { flex: 1; padding: 28px 40px; overflow: auto; }
.backstage h2 { font-weight: 600; font-size: 18px; margin: 0 0 12px; }
.bs-card { display: flex; gap: 16px; align-items: center; max-width: 720px; border: 1px solid var(--border); border-radius: 12px; padding: 14px 18px; margin-bottom: 28px; }
.bs-card img { width: 40px; height: 40px; flex: none; }
.bs-card .bc-name { font-size: 16px; font-weight: 600; }
.bs-card dl { display: grid; grid-template-columns: auto 1fr; gap: 3px 14px; margin: 6px 0 0; font-size: 12.5px; }
.bs-card dt { color: var(--muted); }
.bs-card dd { margin: 0; }
.recent-list { display: flex; flex-direction: column; gap: 2px; max-width: 720px; }
.recent-item {
  display: flex; align-items: center; gap: 12px; padding: 7px 10px; border-radius: var(--radius); cursor: pointer;
}
.recent-item:hover { background: var(--hover); }
.recent-item svg { width: 26px; height: 26px; flex: none; }
.recent-item > div { min-width: 0; }
.recent-item .ri-name { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.recent-item .ri-date { color: var(--muted); font-size: 12px; }
.recent-item .ri-del { margin-left: auto; opacity: 0; flex: none; }
.recent-item:hover .ri-del, .recent-item .ri-del:focus-visible { opacity: 1; }

@media print {
  .no-print, .titlebar, .tabs, .ribbon, .ribbon-wrap, .statusbar, .toast { display: none !important; }
  html, body { background: #fff !important; overflow: visible; height: auto; }
  :root { --bg: #fff; }
}

/* ---------- Lenta sig'masa (common.js .compact qo'yadi): kichik tugmalar yozuvi yashiriladi, ikonka va maslahat qoladi ---------- */
.ribbon-wrap.compact .grow > .btn[data-icon][title]:not(.big), .ribbon-wrap.compact .gcol > .btn[data-icon][title]:not(.big) { font-size: 0; gap: 0; }
.ribbon-wrap.compact .grow > .btn[data-icon][title]:not(.big) .caret, .ribbon-wrap.compact .gcol > .btn[data-icon][title]:not(.big) .caret { margin-left: 2px; }
.ribbon-wrap.compact .style-item { width: 74px; }
.ribbon-wrap.compact .group { padding: 0 7px; }
@media screen and (max-width: 1180px) {
  .titlebar .tbtn.tb-show span { display: none; }
  .titlebar .docname { max-width: 220px; min-width: 90px; }
}
@media screen and (max-width: 980px) {
  .titlebar #cloudStatus { display: none; }
  .titlebar .status { max-width: 150px; }
}

/* ---------- Telefon va kichik ekranlar ---------- */
@media screen and (max-width: 760px), screen and (max-height: 500px) and (pointer: coarse) {
  html, body { overflow-x: hidden; }
  .titlebar { gap: 2px; padding: 0 4px; overflow: hidden; }
  .titlebar .status, #autoFileBtn { display: none !important; }
  .titlebar .docname { flex: 1 1 auto; min-width: 60px; width: 0; max-width: none; }
  .titlebar .tbtn { padding: 0 7px; }
  .titlebar #cloudBox .tbtn span:not(:first-child) { display: none; }
  .tabs { overflow-x: auto; flex-wrap: nowrap; scrollbar-width: none; flex: none; }
  .tabs::-webkit-scrollbar { display: none; }
  .tabs button { white-space: nowrap; padding: 0 10px; flex: none; }
  .ribbon { min-height: 0; padding: 3px 4px; }
  .statusbar { gap: 8px; padding: 0 8px; overflow: hidden; font-size: 11px; }
  .statusbar input[type=range] { width: 64px; }
  .modal { min-width: 0; width: calc(100vw - 20px); }
  .modal .mbody { padding: 6px 12px 10px; }
  .menu { max-width: calc(100vw - 8px); }
  .findbar { left: 8px; right: 8px; width: auto; top: 120px; }
}

/* Qisqa tugmalar roʻyxati (keys.js: F1 yoki Ctrl+/) */
.keys-wrap { width: min(560px, 86vw); }
.keys-q { width: 100%; margin-bottom: 8px; }
.keys-box { max-height: 58vh; overflow: auto; }
.keys-box h4 { margin: 10px 0 4px; font-size: 12px; color: var(--muted); text-transform: uppercase; letter-spacing: .03em; }
.keys-box .keys-sec:first-child h4 { margin-top: 0; }
.keys-box table { width: 100%; border-collapse: collapse; font-size: 13px; }
.keys-box td { padding: 3px 6px; vertical-align: top; }
.keys-box tr:nth-child(odd) td { background: color-mix(in srgb, var(--border) 18%, transparent); }
.keys-box td:first-child { width: 44%; white-space: nowrap; }
.keys-box kbd { font: 12px/1.6 ui-monospace, Consolas, monospace; padding: 1px 6px; border: 1px solid var(--border); border-bottom-width: 2px; border-radius: 5px; background: var(--panel); }
.keys-empty, .keys-foot { color: var(--muted); font-size: 12px; margin: 8px 0 0; }
/* Unumdorlik: «Yengil» rejim (perf.js) — eski kompyuterda har kadr arzon boʻlsin: oʻtish effektlari, animatsiya,
   soya va orqa fon xiralashtirish yoʻq (dasturiy chizishda ular eng qimmat). Kutish belgisi (aylanuvchi) qoladi. */
html.perf-yengil *, html.perf-yengil *::before, html.perf-yengil *::after { transition: none !important; scroll-behavior: auto !important; backdrop-filter: none !important; text-shadow: none !important; }
html.perf-yengil *:not(.pc-spin):not(.spin):not([class*="spinner"]), html.perf-yengil *::before, html.perf-yengil *::after { animation-duration: 1ms !important; animation-delay: 0s !important; animation-iteration-count: 1 !important; }
html.perf-yengil *:not(:focus-visible) { box-shadow: none !important; }
@media screen { html.perf-yengil .page, html.perf-yengil .modal, html.perf-yengil .menu { outline: 1px solid rgba(0, 0, 0, .14); } } /* soya oʻrniga ingichka chegara */

/* ---------- «Yangi alifbo» yorligʻi va paneli (common.js → NewAlphabet) ---------- */
/* Yorliq boshida kichik «Ö» belgisi — boʻlim lentada darhol koʻzga tashlanadi */
.tabs button.tab-alifbo { display: inline-flex; align-items: center; gap: 6px; }
.tabs button.tab-alifbo::before {
  content: "Ö"; display: inline-grid; place-items: center; width: 18px; height: 18px; border-radius: 5px;
  background: var(--accent-soft); color: var(--accent-dark); font-weight: 700; font-size: 12px; line-height: 1;
}
.tabs button.tab-alifbo.active::before { background: var(--accent-strong); color: #fff; }
.abc-map { display: grid; grid-template-columns: repeat(2, auto); gap: 4px 6px; padding: 0 2px; }
.abc-chip, .abc-pair {
  display: inline-flex; align-items: baseline; gap: 5px; height: 26px; padding: 0 9px; border-radius: 6px;
  border: 1px solid var(--border); background: var(--panel, #fff); color: var(--text-2); font-size: 13px; line-height: 24px; cursor: pointer;
}
.abc-chip:hover { border-color: var(--accent); background: var(--accent-soft); }
.abc-chip:active { background: var(--pressed); }
.abc-old { color: var(--muted); min-width: 1.4em; text-align: right; }
.abc-to { color: var(--muted); font-size: 11px; }
.abc-new { color: var(--accent-dark); font-weight: 700; font-size: 14.5px; min-width: .9em; }
.abc-pair { cursor: default; }
/* «Sinab koʻrish» oynasi */
.abc-dlg { width: min(620px, calc(100vw - 72px)); display: flex; flex-direction: column; gap: 12px; }
.abc-panes { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.abc-pane { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.abc-pane-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; min-height: 28px; }
.abc-src { width: 100%; min-height: 132px; resize: vertical; font-family: inherit; font-size: 14px; line-height: 1.55; padding: 8px 10px; border: 1px solid var(--border); border-radius: 6px; }
.abc-src:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.abc-out {
  min-height: 132px; max-height: 240px; overflow: auto; padding: 8px 10px; border-radius: 6px; font-size: 14px; line-height: 1.55;
  background: var(--side); border: 1px solid var(--border-soft); white-space: pre-wrap; overflow-wrap: anywhere;
}
.abc-out mark { background: var(--accent-soft); color: var(--accent-dark); font-weight: 700; border-radius: 3px; padding: 0 1px; }
.abc-empty { color: var(--muted); }
.abc-legend { display: flex; flex-wrap: wrap; gap: 6px; }
.abc-pane-head .sh-lbl, .abc-pane > .sh-lbl { margin: 0; }
@media (max-width: 640px) { .abc-panes { grid-template-columns: 1fr; } .abc-dlg { width: auto; } }

/* Tugmalar guruhi (bitta tanlov): ulashish muddati, oʻgirish yoʻnalishi */
.seg { display: inline-flex; padding: 3px; gap: 2px; border-radius: 8px; background: var(--side); border: 1px solid var(--border-soft); align-self: flex-start; }
.seg > span { display: contents; }
.seg input[type="radio"] { position: absolute; opacity: 0; width: 1px; height: 1px; pointer-events: none; }
.seg label, .seg .seg-b {
  display: inline-flex; align-items: center; margin: 0; height: 30px; padding: 0 14px; border-radius: 6px; border: 0; background: transparent;
  color: var(--text-2); font-size: 13px; cursor: pointer; white-space: nowrap;
}
.seg label:hover, .seg .seg-b:hover { color: var(--text); background: var(--hover); }
.seg input:checked + label, .seg .seg-b[aria-checked="true"] { background: var(--panel, #fff); color: var(--accent-dark); font-weight: 600; box-shadow: 0 0 0 1px var(--border), 0 1px 2px rgba(15, 23, 42, .06); }
.seg input:focus-visible + label { outline: 2px solid var(--accent); outline-offset: 1px; }

/* ---------- Havola orqali ulashish (common.js → ShareLink) ---------- */
.titlebar .tbtn.tb-share { border: 1px solid var(--border); color: var(--accent-dark); font-weight: 600; padding: 0 12px 0 10px; margin-left: 4px; }
.titlebar .tbtn.tb-share:hover { border-color: var(--accent); background: var(--accent-soft); color: var(--accent-dark); }
.share-dlg { width: min(460px, calc(100vw - 72px)); display: flex; flex-direction: column; gap: 14px; line-height: 1.5; }
.share-file { display: flex; gap: 12px; align-items: flex-start; padding: 12px; border-radius: 8px; background: var(--side); border: 1px solid var(--border-soft); }
.share-file .sf-ic svg { width: 28px; height: 28px; color: var(--accent); --sw: 1.6px; }
.share-file b { display: block; font-size: 14px; color: var(--text); overflow-wrap: anywhere; }
.share-file span:not(.sf-ic) { display: block; font-size: 12.5px; color: var(--muted); margin-top: 2px; }
.share-field { display: flex; flex-direction: column; gap: 6px; }
.modal .share-dlg .sh-lbl, .sh-lbl { display: block; margin: 0; font-size: 12px; font-weight: 600; color: var(--text-2); }
.sh-hint { font-size: 12px; color: var(--muted); margin: 0; }
.share-lead { margin: 0; }
.share-urlrow { display: flex; gap: 8px; align-items: center; }
.modal .share-urlrow input.share-url { flex: 1; min-width: 0; height: 38px; font: 13px/1 Consolas, "Cascadia Mono", monospace; color: var(--text); background: var(--side); }
.share-urlrow .pbtn { display: inline-flex; align-items: center; gap: 6px; height: 38px; flex: none; }
.share-urlrow .pbtn svg { width: 16px; height: 16px; }
.share-copy.done { background: var(--ok); border-color: var(--ok); }
.share-meta { margin: 0; padding: 0 0 0 18px; color: var(--muted); font-size: 12.5px; }
.share-mine { border-top: 1px solid var(--border-soft); padding-top: 10px; }
.share-mine summary { cursor: pointer; font-weight: 600; color: var(--text-2); font-size: 13px; }
.share-mine-row { display: flex; align-items: center; gap: 8px; margin-top: 8px; font-size: 13px; }
.share-mine-row .sm-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.share-mine-row .sm-until { color: var(--muted); font-size: 12px; white-space: nowrap; }
.pbtn.sm { min-height: 28px; padding: 0 10px; font-size: 12.5px; display: inline-flex; align-items: center; gap: 5px; }
.pbtn.sm svg { width: 15px; height: 15px; }
.pbtn.danger { color: var(--danger); }
.pbtn.danger:hover { border-color: var(--danger); background: #fdf0ef; }
.modal .mfoot .pbtn.danger { margin-right: auto; }
@media (max-width: 640px) { .share-dlg { width: auto; } .share-urlrow { flex-wrap: wrap; } .modal .share-urlrow input.share-url { flex-basis: 100%; } }

/* ---------- Tez maslahat (common.js): tugma nomi + qisqa tugma ---------- */
.ui-tip {
  position: fixed; z-index: 10000; pointer-events: none; display: none; align-items: center; gap: 8px; max-width: 320px;
  padding: 5px 9px; border-radius: 6px; background: #1f2328; color: #fff; font-size: 12px; line-height: 1.4; box-shadow: 0 4px 14px rgba(15, 23, 42, .18);
}
.ui-tip.show { display: inline-flex; }
.ui-tip kbd { flex: none; font: 11px/1 "Segoe UI", system-ui, sans-serif; padding: 3px 5px; border-radius: 4px; background: rgba(255, 255, 255, .14); border: 1px solid rgba(255, 255, 255, .22); color: #fff; }
@media (prefers-reduced-motion: no-preference) { .ui-tip.show { animation: uiTipIn .12s ease-out; } }
@keyframes uiTipIn { from { opacity: 0; transform: translateY(-2px); } to { opacity: 1; transform: none; } }
