/* ============================================================
   Sharh — sayt uslublari
   Palitra sharh.lex.uz asosida: asosiy #0445b1, fon #f7f9fb / #eef2f8,
   matn #131d2d, chegaralar #e5e9ee, shrift Inter.
   ============================================================ */
:root {
    --primary: #0445b1;
    --primary-2: #2a63c9;
    --primary-soft: #e4f2ff;
    --on-primary: #ffffff;
    --accent: #ff9633;
    --accent-soft: #fff3e6;
    --bg: #f7f9fb;
    --surface: #ffffff;
    --surface-2: #eef2f8;
    --text: #131d2d;
    --muted: #5f6577;
    --border: #e5e9ee;
    --success: #1f8a2b;
    --success-soft: #e8f7ea;
    --warning: #a15c07;
    --warning-soft: #fff3e0;
    --danger: #d62020;
    --danger-soft: #ffebeb;
    --info: #0445b1;
    --info-soft: #e4f2ff;
    --shadow: 0 1px 2px rgba(19, 29, 45, .04), 0 6px 20px rgba(19, 29, 45, .06);
    --radius: 16px;
    --font: "Inter", "Segoe UI", system-ui, -apple-system, Roboto, Arial, sans-serif;
    --serif: "Inter", "Segoe UI", system-ui, sans-serif;
    --reader-size: 18px;
    color-scheme: light;
}

:root[data-theme="dark"] {
    --primary: #5b8cff; --primary-2: #7ea4ff; --primary-soft: #1a2a4a; --on-primary: #0b1220;
    --accent: #ffa64d; --accent-soft: #3a2a18;
    --bg: #0f1520; --surface: #171f2c; --surface-2: #1d2738; --text: #e8edf5; --muted: #a3acbd; --border: #2a3446;
    --success: #4ade80; --success-soft: #133024; --warning: #fbbf24; --warning-soft: #3a2e12;
    --danger: #f87171; --danger-soft: #3b1717; --info: #7ea4ff; --info-soft: #1a2a4a;
    --shadow: 0 1px 2px rgba(0,0,0,.3), 0 6px 20px rgba(0,0,0,.25);
    color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 100px; }
body { margin: 0; font-family: var(--font); font-size: 16px; line-height: 1.65; color: var(--text); background: var(--bg); -webkit-font-smoothing: antialiased; }
img { max-width: 100%; height: auto; }
a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3, h4 { line-height: 1.25; margin: 0 0 .5em; font-weight: 700; letter-spacing: -.01em; }
h1 { font-size: clamp(28px, 3.4vw, 38px); }
h2 { font-size: clamp(22px, 2.6vw, 28px); }
h3 { font-size: 20px; }
p { margin: 0 0 1em; }
.container { width: 100%; max-width: 1280px; margin: 0 auto; padding: 0 20px; }
.container.narrow { max-width: 900px; }
.muted { color: var(--muted); }
.small { font-size: 14px; }
.h-sm { font-size: 20px; }
.skip { position: absolute; left: -999px; top: 0; background: var(--primary); color: #fff; padding: 8px 12px; z-index: 100; }
.skip:focus { left: 8px; }
mark { background: #ffe9a8; color: inherit; padding: 0 2px; border-radius: 3px; }
:focus-visible { outline: 2px solid var(--primary-2); outline-offset: 2px; }

/* ---------- Tugmalar ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; padding: 11px 22px; border-radius: 50px; border: 1px solid transparent;
    font: inherit; font-weight: 600; font-size: 15px; line-height: 1.2; cursor: pointer; text-decoration: none !important; transition: .15s; white-space: nowrap; background: var(--surface-2); color: var(--text); }
.btn.primary { background: var(--primary); color: var(--on-primary); }
.btn.primary:hover { background: var(--primary-2); }
.btn.ghost { background: var(--surface); border-color: var(--border); color: var(--text); }
.btn.ghost:hover { background: var(--surface-2); color: var(--primary); }
.btn.sm { padding: 7px 14px; font-size: 14px; }
.btn.block { width: 100%; }
.icon-btn { background: none; border: 0; color: inherit; cursor: pointer; padding: 6px 8px; border-radius: 50px; font-size: 18px; line-height: 1; }
.icon-btn:hover { background: var(--surface-2); }
.link-btn { background: none; border: 0; padding: 0; font: inherit; font-size: 14px; color: var(--muted); cursor: pointer; }
.link-btn:hover { color: var(--primary); }

/* ---------- Topbar / Header ---------- */
.topbar { background: var(--surface-2); color: var(--text); font-size: 14px; border-bottom: 1px solid var(--border); }
.topbar a { color: inherit; }
.topbar a:hover { color: var(--primary); }
.topbar-in { display: flex; justify-content: space-between; align-items: center; min-height: 40px; gap: 12px; }
.topbar-contacts { display: flex; gap: 20px; flex-wrap: wrap; font-weight: 500; }
.topbar-right { display: flex; align-items: center; gap: 10px; }
.langs { display: flex; gap: 2px; background: var(--surface); border: 1px solid var(--border); border-radius: 50px; padding: 2px; }
.langs a { padding: 3px 10px; border-radius: 50px; font-weight: 600; font-size: 13px; color: var(--muted); text-decoration: none; }
.langs a:hover { color: var(--primary); }
.langs a.active { background: var(--primary); color: var(--on-primary); }

.header { background: var(--surface); border-bottom: 1px solid var(--border); position: sticky; top: 0; z-index: 50; }
.header-in { display: flex; align-items: center; gap: 24px; min-height: 76px; }
.brand { display: flex; align-items: center; gap: 12px; color: var(--text); text-decoration: none !important; flex-shrink: 0; }
.brand img.brand-logo { height: 46px; width: auto; display: block; }
.footer .brand img.brand-logo { height: 44px; }
.brand strong { display: block; font-size: 21px; letter-spacing: -.02em; color: var(--primary); }
.brand small { display: block; font-size: 13px; color: var(--muted); max-width: 240px; line-height: 1.35; }
.header-search { flex: 1; display: flex; max-width: 480px; margin-left: auto; position: relative; }
.header-search input { width: 100%; height: 46px; padding: 0 48px 0 18px; border: 1px solid transparent; border-radius: 12px; background: var(--surface-2); color: var(--text); font: inherit; font-size: 15px; }
.header-search input:focus { outline: 0; border-color: var(--primary); background: var(--surface); }
.header-search button { position: absolute; right: 6px; top: 6px; bottom: 6px; width: 36px; border: 0; background: none; color: var(--muted); cursor: pointer; }
.header-user { display: flex; gap: 8px; align-items: center; }
.avatar { width: 32px; height: 32px; border-radius: 50%; background: var(--primary-soft); color: var(--primary); display: inline-grid; place-items: center; font-size: 13px; font-weight: 700; }
.dropdown { position: relative; }
.dropdown-menu { position: absolute; right: 0; top: calc(100% + 8px); min-width: 220px; background: var(--surface); border: 1px solid var(--border); border-radius: 14px;
    box-shadow: var(--shadow); padding: 6px; display: none; z-index: 60; }
.dropdown.open .dropdown-menu { display: block; }
.dropdown-menu a, .dropdown-menu button { display: block; width: 100%; text-align: left; padding: 10px 14px; border-radius: 10px; color: var(--text); background: none; border: 0; font: inherit; font-size: 15px; cursor: pointer; }
.dropdown-menu a:hover, .dropdown-menu button:hover { background: var(--surface-2); color: var(--primary); text-decoration: none; }
.burger { display: none; background: none; border: 0; padding: 8px; cursor: pointer; }
.burger span { display: block; width: 24px; height: 2px; background: var(--text); margin: 5px 0; border-radius: 2px; }

.nav { border-top: 1px solid var(--border); }
.nav-in { display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; }
.nav a { padding: 14px 16px; color: var(--text); font-weight: 500; font-size: 15px; border-bottom: 2px solid transparent; white-space: nowrap; text-decoration: none; }
.nav a:hover { color: var(--primary); }
.nav a.active { color: var(--primary); font-weight: 600; border-bottom-color: var(--primary); }

/* ---------- Alerts / badges / chips ---------- */
.flashes { margin-top: 18px; }
.alert { position: relative; padding: 14px 44px 14px 18px; border-radius: 12px; margin-bottom: 10px; background: var(--info-soft); color: var(--info); font-size: 15px; }
.alert.success { background: var(--success-soft); color: var(--success); }
.alert.danger { background: var(--danger-soft); color: var(--danger); }
.alert.warning { background: var(--warning-soft); color: var(--warning); }
.alert-close { position: absolute; right: 10px; top: 10px; background: none; border: 0; font-size: 22px; color: inherit; cursor: pointer; opacity: .6; }
.badge { display: inline-block; padding: 3px 12px; border-radius: 50px; font-size: 13px; font-weight: 600; background: var(--surface-2); color: var(--muted); }
.badge.success { background: var(--success-soft); color: var(--success); }
.badge.warning { background: var(--warning-soft); color: var(--warning); }
.badge.danger { background: var(--danger-soft); color: var(--danger); }
.badge.info { background: var(--info-soft); color: var(--info); }
.chip { display: inline-block; padding: 4px 12px; border-radius: 50px; font-size: 13px; font-weight: 500; background: var(--surface-2); color: var(--text); }
.chip.outline { background: none; border: 1px solid var(--border); color: var(--muted); }

/* ---------- Hero ---------- */
.hero { background: linear-gradient(180deg, #e4f2ff 0%, #f7f9fb 100%); color: var(--text); padding: 64px 0 56px; position: relative; overflow: hidden; border-bottom: 1px solid var(--border); }
:root[data-theme="dark"] .hero { background: linear-gradient(180deg, #16233c 0%, var(--bg) 100%); }

.hero::after { content: "§"; position: absolute; right: -30px; top: -100px; font-size: 440px; font-family: Georgia, serif; color: rgba(4, 69, 177, .05); line-height: 1; pointer-events: none; }
.hero-in { display: grid; grid-template-columns: 1.4fr 1fr; gap: 48px; align-items: center; position: relative; z-index: 1; }
.hero h1 { font-size: clamp(30px, 4.2vw, 46px); letter-spacing: -.025em; color: var(--text); }
.hero p { color: var(--muted); font-size: 19px; max-width: 640px; }
.hero-search { display: flex; align-items: center; gap: 10px; background: var(--surface); border: 1px solid var(--border); border-radius: 16px; padding: 6px 6px 6px 18px;
    max-width: 660px; box-shadow: 0 10px 30px rgba(4, 69, 177, .08); color: var(--muted); }
.hero-search input { flex: 1; border: 0; outline: 0; font: inherit; font-size: 17px; padding: 12px 4px; background: none; color: var(--text); min-width: 0; }
.hero-search.inline { box-shadow: none; margin-top: 14px; }
.hero-links { display: flex; gap: 12px; margin-top: 18px; flex-wrap: wrap; }
.hero-links a { padding: 8px 18px; border-radius: 50px; background: var(--surface); border: 1px solid var(--border); color: var(--primary); font-weight: 600; font-size: 15px; text-decoration: none; }
.hero-links a:hover { border-color: var(--primary); }
.hero-stats { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.stat { background: var(--surface); border: 1px solid var(--border); border-radius: 18px; padding: 22px; box-shadow: var(--shadow); }
.stat strong { display: block; font-size: 36px; line-height: 1.1; color: var(--primary); font-weight: 800; }
.stat span { color: var(--muted); font-size: 15px; }

/* ---------- Sections ---------- */
.section { padding: 56px 0; }
.section.alt { background: var(--surface); border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); }
.section-head { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 24px; gap: 12px; }
.section-head h2 { margin: 0; }
.more { font-weight: 600; font-size: 15px; }
.cat-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 14px; margin-bottom: 28px; }
.cat-grid.small { grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); }
.cat-tile { display: grid; grid-template-columns: 46px 1fr; grid-template-rows: auto auto; column-gap: 14px; align-items: center; padding: 16px 18px; background: var(--surface);
    border: 1px solid var(--border); border-radius: var(--radius); color: var(--text); text-decoration: none !important; transition: .15s; }
.cat-tile:hover { border-color: var(--primary); box-shadow: var(--shadow); }
.cat-icon { grid-row: span 2; width: 46px; height: 46px; border-radius: 12px; background: var(--primary-soft); color: var(--primary); display: grid; place-items: center; font-size: 22px; font-family: Georgia, serif; font-weight: 700; }
.cat-name { font-weight: 600; font-size: 16px; line-height: 1.3; }
.cat-count { font-size: 14px; color: var(--muted); }

/* ---------- Hujjat kartochkasi ---------- */
.doc-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 20px; }
.doc-grid.three { grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); }
.doc-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; display: flex; flex-direction: column; transition: .15s; }
.doc-card:hover { box-shadow: var(--shadow); border-color: #cfd8e6; }
.doc-cover { display: block; aspect-ratio: 16 / 10; position: relative; background: var(--surface-2); overflow: hidden; }
.doc-cover img { width: 100%; height: 100%; object-fit: cover; display: block; }
.doc-cover-ph { position: absolute; inset: 0; display: flex; flex-direction: column; justify-content: space-between; padding: 18px;
    background: linear-gradient(135deg, #0445b1, #3f7ee6); color: #fff; }
.doc-cover-ph.manual { background: linear-gradient(135deg, #0d70a5, #3fb0d9); }
.ph-initials { font-size: 46px; font-weight: 800; opacity: .95; letter-spacing: -.02em; }
.ph-type { font-size: 13px; text-transform: uppercase; letter-spacing: .1em; font-weight: 600; opacity: .9; }
.ribbon { position: absolute; top: 12px; right: 12px; background: var(--accent); color: #fff; font-size: 12px; font-weight: 700; padding: 4px 11px; border-radius: 50px; }
.doc-body { padding: 16px 18px 18px; display: flex; flex-direction: column; flex: 1; }
.doc-meta { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 10px; }
.doc-title { font-size: 18px; line-height: 1.35; margin: 0 0 8px; font-weight: 600; }
.doc-title a { color: var(--text); }
.doc-title a:hover { color: var(--primary); text-decoration: none; }
.doc-text { color: var(--muted); font-size: 15px; margin-bottom: 14px; }
.doc-foot { margin-top: auto; display: flex; justify-content: space-between; align-items: center; font-size: 14px; padding-top: 12px; border-top: 1px solid var(--border); }
.price { font-weight: 700; color: var(--primary); }
.price.free { color: var(--success); }
.views { color: var(--muted); display: inline-flex; gap: 5px; align-items: center; }

.sites { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 14px; }
.site { display: flex; gap: 14px; align-items: center; padding: 16px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); color: var(--text); text-decoration: none !important; }
.site:hover { border-color: var(--primary); }
.site img { width: 48px; height: 48px; object-fit: contain; }
.site-ph { width: 48px; height: 48px; display: grid; place-items: center; font-size: 22px; background: var(--surface-2); border-radius: 12px; }
.site strong { font-size: 16px; font-weight: 600; }
.site small { display: block; color: var(--muted); font-size: 14px; }

/* ---------- Sahifa sarlavhasi ---------- */
.page-head { background: var(--surface); border-bottom: 1px solid var(--border); padding: 28px 0; }
.crumbs { font-size: 14px; color: var(--muted); margin-bottom: 10px; }
.crumbs a { color: var(--muted); }
.crumbs a:hover { color: var(--primary); }
.page-head h1 { margin: 0 0 6px; }
.page-head p { margin: 0; font-size: 17px; }

/* ---------- Ro'yxat ---------- */
.list-layout { display: grid; grid-template-columns: 280px 1fr; gap: 32px; padding-top: 32px; padding-bottom: 56px; }
.side-block { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 18px; margin-bottom: 16px; }
.side-block h3 { font-size: 16px; font-weight: 600; color: var(--text); margin-bottom: 10px; }
.cat-list { list-style: none; margin: 0; padding: 0; }
.cat-list a { display: flex; justify-content: space-between; gap: 8px; padding: 9px 12px; border-radius: 10px; color: var(--text); font-size: 15px; text-decoration: none; }
.cat-list a:hover { background: var(--surface-2); color: var(--primary); }
.cat-list a.active { background: var(--primary-soft); color: var(--primary); font-weight: 600; }
.count { color: var(--muted); font-size: 14px; }
.filter-toggle { display: none; margin-bottom: 12px; }
.toolbar { display: flex; gap: 10px; margin-bottom: 10px; flex-wrap: wrap; }
.toolbar input[type=search] { flex: 1; min-width: 200px; }
.toolbar input, .toolbar select { height: 46px; padding: 0 16px; border: 1px solid var(--border); border-radius: 12px; font: inherit; font-size: 15px; background: var(--surface); color: var(--text); }
.toolbar input:focus, .toolbar select:focus { outline: 0; border-color: var(--primary); }
.empty, .empty-box { text-align: center; color: var(--muted); padding: 36px; font-size: 16px; }
.empty-box { background: var(--surface); border: 1px dashed var(--border); border-radius: var(--radius); }
.pagination { display: flex; gap: 6px; justify-content: center; margin-top: 32px; flex-wrap: wrap; }
.pagination a, .pagination span { min-width: 42px; height: 42px; padding: 0 12px; display: inline-grid; place-items: center; border-radius: 50px; border: 1px solid var(--border); background: var(--surface); color: var(--text); text-decoration: none; font-size: 15px; }
.pagination a:hover { border-color: var(--primary); color: var(--primary); }
.pagination .current { background: var(--primary); border-color: var(--primary); color: var(--on-primary); font-weight: 700; }
.pagination .gap { border: 0; background: none; }

/* ---------- Hujjat sahifasi ---------- */
.doc-head-grid { display: grid; grid-template-columns: 1fr 360px; gap: 36px; align-items: start; }
.lead { font-size: 19px; color: var(--muted); }
.doc-facts { list-style: none; padding: 0; margin: 14px 0; display: grid; gap: 8px; font-size: 16px; }
.doc-facts li { position: relative; padding-left: 38px; min-height: 28px; line-height: 1.55; padding-top: 2px; }
.doc-facts span { color: var(--muted); }
.doc-facts .df-ico { position: absolute; left: 0; top: 0; width: 28px; height: 28px; border-radius: 8px; display: grid; place-items: center; background: var(--primary-soft); color: var(--primary); }
.doc-counters { display: flex; gap: 24px; flex-wrap: wrap; font-size: 15px; color: var(--muted); }
.doc-counters strong { color: var(--primary); font-size: 22px; }
.access { border-radius: var(--radius); padding: 22px; border: 1px solid var(--border); background: var(--surface-2); }
.access strong { display: block; font-size: 18px; margin-bottom: 6px; }
.access p { color: var(--muted); font-size: 15px; }
.access.free { background: var(--success-soft); border-color: transparent; }
.access.free strong { color: var(--success); }
.access.ok { background: var(--info-soft); border-color: transparent; }
.access.ok strong { color: var(--primary); }
.access.locked { background: var(--surface-2); }
.sub-form { display: grid; gap: 10px; }
.sub-option { display: flex; align-items: center; gap: 10px; padding: 12px 16px; border: 1px solid var(--border); border-radius: 12px; background: var(--surface); cursor: pointer; font-size: 15px; }
.sub-option span { flex: 1; }
.sub-option:has(input:checked) { border-color: var(--primary); box-shadow: 0 0 0 1px var(--primary); }

.doc-layout { display: grid; grid-template-columns: 320px minmax(0, 1fr); gap: 32px; padding-top: 32px; padding-bottom: 64px; }
.toc { position: relative; }
.toc-in { position: sticky; top: calc(var(--header-h, 66px) + 14px); max-height: calc(100vh - var(--header-h, 66px) - 28px); overflow: auto; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px; }
.toc-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px; font-size: 17px; }
.toc-close { display: none; }
.toc-filter { width: 100%; height: 42px; padding: 0 14px; border: 1px solid transparent; border-radius: 10px; background: var(--surface-2); color: var(--text); font: inherit; font-size: 15px; margin-bottom: 10px; }
.toc-filter:focus { outline: 0; border-color: var(--primary); background: var(--surface); }
.toc-list, .toc-list ol { list-style: none; margin: 0; padding: 0; }
.toc-list ol { padding-left: 12px; border-left: 2px solid var(--border); margin: 2px 0 10px 8px; }
.toc-list a { display: block; padding: 6px 10px; border-radius: 8px; font-size: 15px; color: var(--text); line-height: 1.4; text-decoration: none; }
.toc-list a:hover { background: var(--surface-2); color: var(--primary); }
.toc-list a.current { background: var(--primary-soft); color: var(--primary); font-weight: 600; }
.toc-ch-link { font-weight: 600; }
.reader-tools { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-bottom: 18px; position: sticky; top: var(--header-h, 66px); z-index: 5; background: var(--bg); padding: 10px 0; box-shadow: 0 -12px 0 var(--bg); }
.tool-group { display: inline-flex; gap: 4px; }
.toc-open { display: none; }
.author-box { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 22px; margin-bottom: 22px; }
.chapter { margin-bottom: 32px; }
.chapter-title { font-size: 17px; line-height: 1.4; text-align: center; padding: 11px 16px; background: var(--primary-soft); color: var(--primary); border-radius: 12px; margin: 0 0 14px; }
.article { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 24px 28px; margin-bottom: 16px; }
.article:target { box-shadow: 0 0 0 2px var(--primary); }
.article-clause { font-size: 18px; }
.article-text { font-size: var(--reader-size); line-height: 1.8; }
.article-text strong { color: var(--text); }
.rich p { margin: 0 0 .8em; }
.rich p:last-child { margin-bottom: 0; }
.rich table { border-collapse: collapse; width: 100%; margin: 1em 0; }
.rich td, .rich th { border: 1px solid var(--border); padding: 8px 12px; }
.rich img { border-radius: 10px; }
.rich blockquote { margin: 1em 0; padding: 10px 18px; border-left: 3px solid var(--primary); background: var(--surface-2); border-radius: 0 10px 10px 0; }
.rich iframe { max-width: 100%; border-radius: 10px; }
.commentary { margin-top: 18px; border-radius: 14px; background: var(--surface-2); border-left: 4px solid var(--primary); padding: 4px 22px 18px; }
.commentary summary { cursor: pointer; padding: 12px 0; font-weight: 600; font-size: 16px; color: var(--text); list-style: none; display: flex; align-items: center; gap: 10px; }
.commentary summary::-webkit-details-marker { display: none; }
.commentary summary::after { content: "▾"; margin-left: auto; transition: .2s; color: var(--primary); }
.commentary:not([open]) summary::after { transform: rotate(-90deg); }
/* Sharh sarlavhasi (chapdan): modda | 4 ta tugma ▾ */
.commentary summary { flex-wrap: wrap; row-gap: 8px; column-gap: 8px; padding: 14px 0; }
/* tugmali sarlavhada ▾ chapda (yolg'iz qatorga tushib qolmasin) */
.commentary summary:has(.c-tools)::after { display: none; }
.commentary summary:has(.c-tools)::before { content: "▾"; color: var(--primary); transition: .2s; }
.commentary:not([open]) summary:has(.c-tools)::before { transform: rotate(-90deg); }
.c-clause { color: var(--muted); font-weight: 500; font-size: 15px; padding-right: 12px; border-right: 1px solid var(--border); white-space: nowrap; }
.c-tools { display: flex; gap: 2px; flex-wrap: wrap; }
.c-tools-end { margin-left: auto; padding-left: 10px; border-left: 1px solid var(--border); }
.c-tool { display: inline-flex; align-items: center; gap: 7px; padding: 8px 11px; white-space: nowrap; border: 0; border-radius: 10px; background: transparent; color: var(--text); font: inherit; font-size: 15px; font-weight: 500; cursor: pointer; transition: background .15s, color .15s; }
.c-tool svg { color: var(--muted); flex: none; }
.c-tool:hover { background: var(--surface); }
.c-tool.js-ctab.is-on { background: var(--surface); box-shadow: 0 1px 3px rgba(19, 29, 45, .08); }
.c-tool.js-ctab.is-on svg, .c-tool:hover svg { color: var(--primary); }
.c-tool.js-cplay.is-on { background: var(--primary-soft); color: var(--primary); font-weight: 600; }
.c-tool.js-cplay.is-on svg { color: var(--primary); }
.c-tool[data-tab="video"] svg { color: #e62117; }
.c-tool[data-tab="info"] svg { color: #0e9f6e; }
/* AI sharh */
.c-tool.c-ai svg { color: #7c3aed; }
.c-tool.c-ai.is-on { color: #6d28d9; }
.c-ai-pane { border-radius: 14px; }
.ai-badge { display: inline-flex; align-items: center; gap: 6px; margin: 2px 0 12px; padding: 4px 12px; border-radius: 50px; background: #f1eafe; color: #6d28d9; font-size: 13px; font-weight: 600; }
.ai-player { margin-top: 0; }
.ai-wait { display: flex; align-items: center; gap: 10px; color: var(--muted); }
.ai-spin { width: 18px; height: 18px; border-radius: 50%; border: 2.5px solid #d9ccfb; border-top-color: #7c3aed; animation: aispin .8s linear infinite; flex: none; }
@keyframes aispin { to { transform: rotate(360deg); } }
.ai-err { color: var(--danger); }
.ai-note { margin: 14px 0 0; padding-top: 10px; border-top: 1px dashed var(--border); color: var(--muted); font-size: 13px; }
/* "Xatolik haqida xabar" — boshqa tugmalardan chiziq bilan ajratilgan, to'q sariq */
.c-tool.c-report { color: var(--warning); background: var(--warning-soft); }
.c-tool.c-report svg { color: var(--warning); }
.c-tool.c-report:hover { background: #ffe6c2; color: #8a4b00; }
.c-tool.c-report:hover svg { color: #8a4b00; }
/* video havolasi va infografika */
.c-vlink { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin: 10px 0 4px; padding: 8px 12px; border-radius: 10px; background: var(--surface); font-size: 14px; }
.c-vlink svg { color: var(--muted); flex: none; }
.c-vlink a { color: var(--primary); word-break: break-all; }
.c-vcopy { margin-left: auto; padding: 5px 12px; border: 1px solid var(--primary-2); border-radius: 50px; background: transparent; color: var(--primary-2); font: inherit; font-size: 13px; font-weight: 600; cursor: pointer; }
.c-vcopy:hover { background: var(--primary-soft); }
.c-vlink + .c-video { margin-top: 18px; }
.c-info-img { display: block; width: 100%; height: auto; border-radius: 12px; background: var(--surface); }
.c-info-img + .c-info-img { margin-top: 14px; }
.c-info-img.js-zoom { cursor: zoom-in; }

/* Sharh matnini nusxalash yopiq (body.protect — admin bo'lmagan foydalanuvchilar) */
.protect .commentary .c-pane[data-pane="text"], .protect .commentary .c-pane[data-pane="info"], .protect .commentary .c-pane[data-pane="ai"], .protect .cp-head { -webkit-user-select: none; -moz-user-select: none; user-select: none; -webkit-touch-callout: none; }

/* Abzas bo'yicha xatolik haqida xabar: belgilangan abzas va o'ng tomondagi tugma */
.rp-hl { background: #e8e6fb; border-radius: 6px; box-shadow: 0 0 0 6px #e8e6fb; transition: background .15s, box-shadow .15s; }
.rp-btn { position: absolute; z-index: 60; width: 44px; height: 44px; border: 0; border-radius: 12px; display: grid; place-items: center; background: var(--primary); color: #fff; cursor: pointer; box-shadow: 0 6px 16px rgba(4, 69, 177, .3); transition: transform .12s, background .12s; }
.rp-btn:hover { background: var(--primary-2); transform: scale(1.05); }
.rp-btn[hidden] { display: none; }
@media print { .rp-btn { display: none !important; } .rp-hl { background: none; box-shadow: none; } }

/* Sharh pleyeri */
.c-player { display: flex; align-items: center; gap: 18px; margin: 4px 0 18px; padding: 16px 20px; max-width: 100%; overflow: hidden; border-radius: 16px; background: var(--surface); box-shadow: 0 1px 2px rgba(19, 29, 45, .05), 0 8px 24px rgba(19, 29, 45, .08); }
.c-player[hidden] { display: none; }
.cp-play { flex: none; width: 60px; height: 60px; border: 0; border-radius: 50%; display: grid; place-items: center; background: var(--primary-2); color: #fff; cursor: pointer; box-shadow: 0 6px 16px rgba(42, 99, 201, .3); transition: transform .15s, background .15s; }
.cp-play:hover { background: var(--primary); transform: scale(1.04); }
.cp-play .i-play { margin-left: 3px; }
.cp-play .i-pause, .c-player.is-playing .cp-play .i-play { display: none; }
/* ovoz serverda tayyorlanayotganda — play tugmasi atrofida aylanuvchi halqa */
.cp-play { position: relative; }
.c-player.is-loading .cp-play::after { content: ""; position: absolute; inset: -5px; border-radius: 50%; border: 3px solid transparent; border-top-color: var(--primary-2); animation: cpspin .8s linear infinite; }
@keyframes cpspin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .c-player.is-loading .cp-play::after { animation-duration: 2.4s; } }
.c-player.is-playing .cp-play .i-pause { display: block; }
.cp-main { flex: 1; min-width: 0; }
.cp-head { display: flex; align-items: baseline; gap: 12px; margin-bottom: 8px; min-width: 0; }
.cp-head strong { font-size: 17px; white-space: nowrap; }
.cp-head span { color: var(--muted); font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cp-wave { display: flex; align-items: center; gap: 4px; height: 38px; cursor: pointer; outline-offset: 4px; }
.cp-wave i { flex: 1; min-width: 4px; max-width: 12px; border-radius: 3px; background: #cad9f4; transition: background .2s; }
.cp-wave i.on { background: var(--primary-2); }
.cp-time { flex: none; color: var(--muted); font-size: 15px; font-variant-numeric: tabular-nums; }
.cp-rate { flex: none; min-width: 64px; padding: 8px 14px; border: 1.5px solid var(--primary-2); border-radius: 50px; background: transparent; color: var(--primary-2); font: inherit; font-weight: 600; font-size: 14px; cursor: pointer; }
.cp-rate:hover { background: var(--primary-soft); }
.cp-close { flex: none; width: 40px; height: 40px; border: 0; border-radius: 50%; display: grid; place-items: center; background: transparent; color: var(--muted); cursor: pointer; }
.cp-close:hover { background: var(--surface-2); color: var(--text); }
@media (max-width: 600px) {
    .c-player { flex-wrap: wrap; gap: 10px 12px; padding: 14px; }
    .cp-play { width: 48px; height: 48px; }
    .cp-main { flex-basis: calc(100% - 60px); max-width: calc(100% - 60px); }
    /* ustunda — uzun hujjat nomi ekran kengligidan chiqmasin, "…" bilan qisqarsin */
    .cp-head { flex-direction: column; align-items: stretch; gap: 0; }
    .cp-head strong, .cp-head span { display: block; max-width: 100%; min-width: 0; overflow: hidden; text-overflow: ellipsis; }
    .cp-time { margin-left: 60px; font-size: 13px; }
    .cp-rate { margin-left: auto; min-width: 54px; padding: 5px 10px; }
    .cp-close { width: 34px; height: 34px; }
}
.c-video { position: relative; aspect-ratio: 16 / 9; border-radius: 12px; overflow: hidden; background: #000; }
.c-video + .c-video { margin-top: 14px; }
.c-video iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.c-badge { background: var(--primary); color: var(--on-primary); font-size: 12px; text-transform: uppercase; letter-spacing: .06em; padding: 3px 10px; border-radius: 50px; }
.comment { font-size: calc(var(--reader-size) - 1px); line-height: 1.75; }
.comment + .comment { margin-top: 14px; padding-top: 14px; border-top: 1px dashed var(--border); }
.locked-block { margin-top: 16px; padding: 16px 18px; border-radius: 12px; background: var(--accent-soft); color: var(--text); font-size: 15px; }
.locked-block a { font-weight: 600; margin-left: 6px; }
.article-actions { display: flex; gap: 20px; margin-top: 16px; padding-top: 12px; border-top: 1px solid var(--border); flex-wrap: wrap; }
.related { margin-top: 44px; }

/* ---------- Modal ---------- */
.modal { border: 0; border-radius: 20px; padding: 0; width: min(540px, calc(100% - 32px)); background: var(--surface); color: var(--text); box-shadow: 0 20px 60px rgba(19, 29, 45, .25); }
.modal::backdrop { background: rgba(19, 29, 45, .45); }
.modal form { padding: 24px; }
.modal-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 14px; }
.modal-head h3 { margin: 0; font-size: 20px; }
.modal-foot { display: flex; justify-content: flex-end; gap: 8px; margin-top: 14px; }
.selected-quote { margin: 0 0 14px; padding: 10px 14px; background: var(--surface-2); border-left: 3px solid var(--primary); font-size: 15px; max-height: 120px; overflow: auto; }
.form-msg { margin: 10px 0 0; font-size: 15px; }
.form-msg.ok { color: var(--success); }
.form-msg.err { color: var(--danger); }

/* ---------- Formalar ---------- */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 28px; box-shadow: var(--shadow); }
.card + .card { margin-top: 18px; }
.form .field, label.field { display: block; margin-bottom: 16px; }
.field > span, .field-label { display: block; font-size: 15px; font-weight: 500; margin-bottom: 8px; color: var(--text); }
.field input, .field textarea, .field select { width: 100%; min-height: 46px; padding: 11px 16px; border: 1px solid transparent; border-radius: 12px; font: inherit; font-size: 16px; background: var(--bg); color: var(--text); }
.field input, .field textarea, .field select { background: var(--surface-2); }
.field input:focus, .field textarea:focus, .field select:focus { outline: 0; border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-soft); background: var(--surface); }
.field input:disabled { opacity: .7; }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.hp { position: absolute; left: -9999px; }
.auth-wrap { display: grid; place-items: center; padding: 56px 20px; min-height: 60vh; }
.auth-card { width: 100%; max-width: 480px; }
.auth-card h1 { font-size: 30px; }
.auth-alt { text-align: center; margin: 16px 0 0; font-size: 15px; }
.error-card { text-align: center; max-width: 500px; }
.error-code { font-size: 96px; font-weight: 800; color: var(--primary); line-height: 1; }
.kv { display: grid; grid-template-columns: max-content 1fr; gap: 10px 18px; margin: 0 0 20px; font-size: 16px; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; }
.big { font-size: 24px; }
.providers { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-bottom: 16px; }
.provider input { position: absolute; opacity: 0; }
.pv { display: grid; place-items: center; height: 60px; border-radius: 14px; border: 2px solid var(--border); font-weight: 800; font-size: 19px; cursor: pointer; }
.pv.payme { color: #00a6b4; }
.pv.click { color: #0070f0; }
.provider input:checked + .pv { border-color: var(--primary); background: var(--primary-soft); }

.promo-form { display: flex; gap: 8px; align-items: center; margin-bottom: 16px; flex-wrap: wrap; }
.promo-form input { flex: 1; min-width: 160px; height: 42px; padding: 0 14px; border: 1px solid var(--border); border-radius: 12px; font: inherit; background: var(--surface-2); color: var(--text); text-transform: uppercase; }
.ads { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 16px; }
.ad { display: block; border-radius: var(--radius); overflow: hidden; border: 1px solid var(--border); background: var(--surface); text-decoration: none !important; color: var(--text); }
.ad img { display: block; width: 100%; height: auto; }
.ad span { display: block; padding: 10px 14px; font-weight: 600; font-size: 15px; }
.ads-section { padding: 28px 0 0; }
.doc-ads { margin: 28px 0 0; }
.audio-box { margin-top: 14px; display: grid; gap: 8px; }
.audio-box audio { width: 100%; max-width: 520px; height: 40px; }
.audio-box small { color: var(--muted); }
.contact-grid { display: grid; grid-template-columns: 1fr 1.2fr; gap: 24px; align-items: start; }
.contact-list { list-style: none; padding: 0; margin: 18px 0; display: grid; gap: 16px; font-size: 16px; }
.contact-list li { display: flex; gap: 14px; align-items: flex-start; }
.contact-list li > span { width: 46px; height: 46px; display: grid; place-items: center; background: var(--primary-soft); border-radius: 12px; flex-shrink: 0; }
.contact-list small { display: block; color: var(--muted); font-size: 14px; }
.map iframe { width: 100%; height: 300px; border: 0; border-radius: 14px; }

.result-list { list-style: none; padding: 0; margin: 0 0 36px; }
.result-list li { padding: 16px 0; border-bottom: 1px solid var(--border); font-size: 17px; }
.result-list p { margin: 6px 0 0; color: var(--muted); font-size: 15px; }

.account-nav { display: flex; gap: 6px; margin-bottom: 20px; }
.account-nav a { padding: 10px 20px; border-radius: 50px; color: var(--text); font-weight: 600; text-decoration: none; background: var(--surface); border: 1px solid var(--border); }
.account-nav a.active { background: var(--primary); border-color: var(--primary); color: var(--on-primary); }
.account-grid { display: grid; grid-template-columns: 1.2fr 1fr; gap: 22px; align-items: start; }
.sub-list { list-style: none; padding: 0; margin: 0; }
.sub-list li { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 14px 0; border-bottom: 1px solid var(--border); }
.sub-list li.expired { opacity: .6; }
.table-wrap { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; font-size: 15px; }
.table th, .table td { text-align: left; padding: 12px 14px; border-bottom: 1px solid var(--border); vertical-align: top; }
.table th { font-size: 13px; font-weight: 600; color: var(--muted); background: var(--surface-2); }
.page-body { padding: 36px; font-size: 17px; }
.page-body h3 { margin-top: 1.2em; }

/* ---------- Footer ---------- */
.footer { background: var(--surface); color: var(--muted); margin-top: 48px; border-top: 1px solid var(--border); }
.footer a { color: var(--text); }
.footer a:hover { color: var(--primary); }
.footer-grid { display: grid; grid-template-columns: 1.5fr 1fr 1fr 1.2fr; gap: 32px; padding-top: 48px; padding-bottom: 36px; }
.footer h4 { color: var(--text); font-size: 17px; margin-bottom: 14px; }
.footer ul { list-style: none; padding: 0; margin: 0; display: grid; gap: 10px; font-size: 15px; }
.footer-about { margin-top: 14px; font-size: 15px; }
.socials { display: flex; gap: 8px; margin-top: 16px; }
.socials a { width: 40px; height: 40px; display: grid; place-items: center; border-radius: 50%; background: var(--surface-2); color: var(--primary); }
.socials a:hover { background: var(--primary); color: #fff; }
.footer-bottom { border-top: 1px solid var(--border); padding: 18px 0; font-size: 14px; background: var(--surface-2); }
.to-top { position: fixed; right: 20px; bottom: 20px; width: 48px; height: 48px; border-radius: 50%; border: 0; background: var(--primary); color: #fff; font-size: 20px; cursor: pointer;
    box-shadow: var(--shadow); opacity: 0; pointer-events: none; transition: .2s; z-index: 40; }
.to-top.show { opacity: 1; pointer-events: auto; }
.toast { position: fixed; left: 50%; bottom: 26px; transform: translateX(-50%); background: var(--text); color: var(--surface); padding: 12px 20px; border-radius: 50px; z-index: 200; font-size: 15px; }

/* ---------- Moslashuvchan (responsive) ---------- */
@media (max-width: 1024px) {
    .hero-in { grid-template-columns: 1fr; }
    .doc-head-grid { grid-template-columns: 1fr; }
    .doc-layout { grid-template-columns: 1fr; }
    .toc { position: fixed; inset: 0; z-index: 70; background: rgba(19, 29, 45, .45); display: none; }
    .toc.open { display: block; }
    .toc-in { position: absolute; left: 0; top: 0; bottom: 0; width: min(360px, 88vw); max-height: none; border-radius: 0; }
    .toc-close, .toc-open { display: inline-flex; }
    .reader-tools { top: 76px; }
    .footer-grid { grid-template-columns: 1fr 1fr; }
    .account-grid, .contact-grid { grid-template-columns: 1fr; }
}
@media (max-width: 800px) {
    .header-search { display: none; }
    .burger { display: block; }
    .header-user { margin-left: auto; }
    .nav { display: none; }
    .nav.open { display: block; }
    .nav-in { flex-direction: column; }
    .nav a { border-bottom: 1px solid var(--border); }
    .hide-sm { display: none; }
    .list-layout { grid-template-columns: 1fr; }
    .filter-toggle { display: flex; }
    .filters { display: none; }
    .filters.open { display: block; }
    .brand small { display: none; }
    .topbar-contacts a + a { display: none; }
}
@media (max-width: 560px) {
    body { font-size: 16px; }
    .container { padding: 0 16px; }
    .hero { padding: 40px 0; }
    .hero p { font-size: 17px; }
    .hero-search { flex-wrap: wrap; padding: 10px; }
    .hero-search .btn { width: 100%; }
    .hero-stats { grid-template-columns: 1fr 1fr; }
    .stat { padding: 16px; }
    .stat strong { font-size: 28px; }
    .row2 { grid-template-columns: 1fr; }
    .article { padding: 18px; }
    .footer-grid { grid-template-columns: 1fr; }
    .card, .page-body { padding: 20px; }
    .doc-grid { grid-template-columns: 1fr; }
}

@media print {
    .topbar, .header, .footer, .toc, .reader-tools, .article-actions, .access-box, .to-top, .related, .locked-block { display: none !important; }
    body { background: #fff; color: #000; }
    .doc-layout { display: block; }
    .article { border: 0; padding: 0; }
    .commentary { background: none; border-left: 2px solid #999; }
}

/* ============================================================
   Sarlavha va bosh sahifa — asl sharh.lex.uz dizayni bo'yicha
   ============================================================ */
.topbar { background: var(--primary); color: #fff; border-bottom: 0; font-size: 14px; }
.topbar-in { min-height: 36px; }
.topbar-sites { display: flex; gap: 22px; flex-wrap: wrap; }
.topbar-sites a { color: #fff; font-weight: 500; opacity: .95; }
.topbar-sites a:hover { opacity: 1; text-decoration: underline; color: #fff; }
.topbar-socials { display: flex; gap: 8px; }
.topbar-socials a { width: 24px; height: 24px; border-radius: 50%; background: #fff; color: var(--primary); display: grid; place-items: center; }
.topbar-socials a svg { width: 13px; height: 13px; }
.topbar-socials a:hover { background: #e4f2ff; }

.header-in { gap: 20px; min-height: 72px; }
.brand-text strong { font-size: 22px; font-weight: 800; letter-spacing: -.03em; color: var(--primary); }
.header .nav { border-top: 0; display: flex; gap: 2px; flex: 1; min-width: 0; }
.header .nav a { padding: 8px 8px; border-bottom: 0; border-radius: 10px; font-weight: 500; font-size: 14.5px; color: var(--text); white-space: nowrap; }
.header .nav a:hover { color: var(--primary); background: var(--surface-2); text-decoration: none; }
.header .nav a.active { color: var(--primary); font-weight: 600; background: none; }
.header-tools { display: flex; align-items: center; gap: 8px; margin-left: auto; flex-shrink: 0; }
.round-btn { width: 42px; height: 42px; border-radius: 50%; border: 1px solid var(--border); background: var(--surface); color: var(--text); display: grid; place-items: center; cursor: pointer; }
.round-btn:hover, .round-btn[aria-pressed="true"] { border-color: var(--primary); color: var(--primary); background: var(--primary-soft); }
.lang-btn { display: inline-flex; align-items: center; gap: 6px; height: 42px; padding: 0 8px; border: 0; background: none; color: var(--text); font: inherit; font-size: 15px; font-weight: 500; cursor: pointer; border-radius: 10px; }
.lang-btn:hover { color: var(--primary); }
.dropdown-menu a.current { color: var(--primary); font-weight: 600; background: var(--primary-soft); }
.login-btn { padding: 11px 24px; border-radius: 10px; }
.header .nav { justify-content: center; }
@media (max-width: 1240px) { #searchToggle { display: none; } }
@media (max-width: 1100px) { #searchToggle { display: grid; } }
.user-btn { border-radius: 10px; }
.search-panel { border-top: 1px solid var(--border); background: var(--surface); padding: 14px 0; }
.search-panel-in { display: flex; align-items: center; gap: 12px; color: var(--muted); }
.search-panel-in input { flex: 1; height: 46px; padding: 0 16px; border: 1px solid var(--border); border-radius: 12px; font: inherit; font-size: 16px; background: var(--surface-2); color: var(--text); }
.search-panel-in input:focus { outline: 0; border-color: var(--primary); background: var(--surface); }

/* ---------- Slayder ---------- */
.hero-slider { background: #eef2f8; padding: 44px 0 40px; overflow: hidden; }
.hero-slider .container { position: relative; }
.slide { display: grid; grid-template-columns: 1.15fr 1fr; gap: 40px; align-items: center; min-height: 380px; }
.slide[hidden] { display: none; }
.slide.active { animation: slideIn .5s ease; }
@keyframes slideIn { from { opacity: 0; transform: translateX(20px); } to { opacity: 1; transform: none; } }
.slide-badge { display: inline-block; padding: 4px 12px; border-radius: 50px; background: #dce8fb; color: var(--primary); font-size: 13px; font-weight: 500; margin-bottom: 18px; }
.slide-title { font-size: clamp(28px, 3.4vw, 38px); line-height: 1.22; font-weight: 700; letter-spacing: -.02em; margin: 0 0 18px; }
.slide-title a { color: var(--text); }
.slide-title a:hover { color: var(--primary); text-decoration: none; }
.slide-desc { color: var(--muted); font-size: 16px; max-width: 480px; margin-bottom: 24px; }
.slide-more { border-radius: 10px; padding: 12px 22px; }
.slide-visual { display: flex; justify-content: center; align-items: center; min-height: 360px; text-decoration: none !important; }
.slider-nav { display: flex; align-items: center; gap: 14px; margin-top: 26px; }
.slider-btn { width: 44px; height: 44px; border-radius: 50%; border: 0; background: var(--primary); color: #fff; font-size: 22px; line-height: 1; cursor: pointer; display: grid; place-items: center; }
.slider-btn:hover { background: var(--primary-2); }
.slider-bars { display: inline-flex; gap: 6px; align-items: center; margin-left: 8px; }
.slider-bars .bar { width: 10px; height: 3px; border: 0; padding: 0; border-radius: 3px; background: #b8c8e0; cursor: pointer; transition: width .3s; }
.slider-bars .bar.active { width: 22px; background: var(--primary); }
.slider-count { color: var(--muted); font-size: 14px; }
.slider-count b { font-weight: 500; color: var(--muted); }

/* Kitob muqovasi */
.book { position: relative; display: flex; flex-direction: column; align-items: center; justify-content: space-between; width: 230px; aspect-ratio: 3 / 4.1;
    padding: 18px 20px; border-radius: 4px 10px 10px 4px; color: #fff; text-align: center;
    background: linear-gradient(135deg, #4d70b8 0%, #3a5ca5 45%, #2d4c93 100%);
    box-shadow: -14px 14px 0 -2px #d5ddea, -14px 14px 26px rgba(19, 29, 45, .18), 0 26px 40px rgba(19, 29, 45, .25);
    transform: rotate(8deg); transition: transform .3s; }
.slide-visual:hover .book { transform: rotate(5deg) translateY(-4px); }
.book.manual { background: linear-gradient(135deg, #2c8fb8 0%, #1b74a0 50%, #135b82 100%); }
.book::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 10px; background: linear-gradient(90deg, rgba(0,0,0,.18), rgba(255,255,255,0)); border-radius: 4px 0 0 4px; }
.book-lines { width: 100%; height: 7px; border-top: 2px dotted rgba(255,255,255,.75); border-bottom: 2px dotted rgba(255,255,255,.75); }
.book-emblem { width: 28px; height: 28px; border: 2px solid rgba(255,255,255,.9); border-radius: 50%; margin-top: 18px; }
.book-title { font-size: 9.5px; font-weight: 700; line-height: 1.45; letter-spacing: .02em; padding: 0 4px; }
.book-kind { font-size: 15px; font-weight: 800; letter-spacing: .25em; margin-bottom: 14px; }
.book-img { padding: 0; overflow: hidden; background: #fff; }
.book-img img { width: 100%; height: 100%; object-fit: cover; }

/* ---------- Statistik kartochkalar ---------- */
.home-cards { padding-top: 44px; }
.home-cards-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 22px; }
.stat-panel { background: #f6f8fc; border: 1px solid var(--border); border-radius: 18px; padding: 26px 26px 22px; display: flex; flex-direction: column; }
.stat-panel h2 { font-size: 21px; font-weight: 700; margin-bottom: 18px; }
.stat-panel-top { display: flex; align-items: center; gap: 28px; margin-bottom: 22px; }
.donut { position: relative; width: 112px; height: 112px; flex-shrink: 0; }
.donut-svg { width: 100%; height: 100%; }
.donut-label { position: absolute; inset: 0; display: grid; place-items: center; font-size: 13.5px; font-weight: 600; color: var(--text); }
.stat-nums { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; flex: 1; }
.stat-num { color: var(--text); text-decoration: none !important; }
.stat-num strong { display: block; font-size: 24px; font-weight: 700; line-height: 1.2; }
.stat-num span { display: block; font-size: 13px; color: var(--muted); line-height: 1.35; margin-top: 4px; }
.stat-num:hover span { color: var(--primary); }
.feats { list-style: none; margin: 0 0 22px; padding: 0; display: grid; gap: 14px; flex: 1; }
.feats li { display: flex; gap: 14px; align-items: flex-start; }
.feat-ico { width: 38px; height: 38px; border-radius: 50%; border: 1px dashed #c5d3ea; background: var(--surface); color: var(--primary); display: grid; place-items: center; flex-shrink: 0; }
.feats strong { display: block; font-size: 15px; font-weight: 600; }
.feats small { display: block; font-size: 13.5px; color: var(--muted); line-height: 1.45; margin-top: 2px; }
.all-btn { background: var(--surface); border-color: var(--border); color: var(--primary); border-radius: 12px; padding: 12px; }
.all-btn:hover { border-color: var(--primary); background: var(--surface); }

@media (max-width: 1100px) {
    .header .nav { display: none; }
    .header .nav.open { display: flex; flex-direction: column; position: absolute; left: 0; right: 0; top: 100%; background: var(--surface); border-bottom: 1px solid var(--border); padding: 8px 16px 14px; box-shadow: 0 10px 20px rgba(19,29,45,.08); z-index: 55; }
    .header-in { position: relative; }
    .burger { display: block; }
}
@media (max-width: 900px) {
    .slide { grid-template-columns: 1fr; min-height: 0; gap: 24px; }
    .slide-visual { min-height: 0; order: -1; }
    .book { width: 170px; }
    .home-cards-grid { grid-template-columns: 1fr; }
}
@media (max-width: 560px) {
    .topbar-sites { gap: 12px; font-size: 13px; }
    .header-tools { gap: 6px; }
    .round-btn { width: 38px; height: 38px; }
    .lang-btn span { display: none; }
    .login-btn { padding: 9px 16px; }
    .stat-panel-top { flex-direction: column; align-items: flex-start; gap: 18px; }
    .stat-panel { padding: 20px; }
    .hero-slider { padding: 28px 0; }
}

/* ============================================================
   Mobil versiya — tuzatishlar
   ============================================================ */
.nav-mobile-extra { display: none; }

/* Keng kontent ustunni kengaytirib yubormasligi uchun (hujjat, ro'yxat) */
.doc-layout { grid-template-columns: 300px minmax(0, 1fr); }
.rich { overflow-wrap: anywhere; }
.rich table { display: block; max-width: 100%; overflow-x: auto; -webkit-overflow-scrolling: touch; }
.rich img, .rich video { max-width: 100%; height: auto; }
.rich iframe { max-width: 100%; }
.rich iframe[src*="youtube"] { width: 100%; height: auto; aspect-ratio: 16 / 9; }
.rich pre { overflow-x: auto; }

@media (max-width: 1100px) {
    .header .nav.open { max-height: calc(100vh - 120px); overflow-y: auto; }
    .header .nav.open > a { padding: 13px 6px; font-size: 16px; border-radius: 0; border-bottom: 1px solid var(--border); }
}
@media (max-width: 1024px) {
    .doc-layout { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 800px) {
    .list-layout { grid-template-columns: minmax(0, 1fr); }
}

@media (max-width: 560px) {
    /* Yuqori chiziq: saytlar bir qatorda, suriladi */
    .topbar-in { flex-wrap: nowrap; gap: 10px; }
    .topbar-sites { flex-wrap: nowrap; overflow-x: auto; white-space: nowrap; scrollbar-width: none; gap: 14px; min-width: 0; }
    .topbar-sites::-webkit-scrollbar { display: none; }
    .topbar-socials { gap: 6px; flex-shrink: 0; }
    .topbar-socials a { width: 22px; height: 22px; }

    /* Sarlavha: logotip + kirish/profil + burger */
    .header-in { gap: 10px; min-height: 62px; }
    .brand img.brand-logo { height: 36px; width: auto; }
    .brand-text strong { font-size: 19px; }
    .header-tools #searchToggle, .header-tools .lang-dd { display: none !important; }
    .user-btn { padding: 4px; border: 0; }
    .login-btn { padding: 9px 16px; font-size: 15px; }
    .burger { padding: 6px; }

    /* Burger menyusi ichidagi qidiruv, tillar, ko'zi ojizlar rejimi */
    .header .nav.open .nav-mobile-extra { display: grid; gap: 12px; padding: 14px 0 6px; }
    .nav-search { position: relative; display: flex; }
    .nav-search input { width: 100%; height: 46px; padding: 0 46px 0 14px; border: 1px solid var(--border); border-radius: 12px; font: inherit; font-size: 16px; background: var(--surface-2); color: var(--text); }
    .nav-search input:focus { outline: 0; border-color: var(--primary); background: var(--surface); }
    .nav-search button { position: absolute; right: 4px; top: 4px; bottom: 4px; width: 40px; border: 0; background: none; color: var(--muted); }
    .nav-langs { display: flex; gap: 6px; }
    .nav-langs a { flex: 1; text-align: center; padding: 9px 6px; border: 1px solid var(--border); border-radius: 10px; color: var(--text); font-size: 14px; font-weight: 500; text-decoration: none; }
    .nav-langs a.active { background: var(--primary); border-color: var(--primary); color: var(--on-primary); }

    /* Hujjat matni: tor ekranda "justify" katta bo'shliqlar beradi — chapga tekislaymiz */
    .rich p, .rich li, .rich div, .rich span { text-align: left !important; }
    .rich [style*="margin-left"] { margin-left: 0 !important; }
    .rich [style*="text-indent"] { text-indent: 0 !important; }
    .page-head { padding: 20px 0; }
    .page-head h1 { font-size: 26px; }
    .doc-facts { font-size: 15px; }
    .doc-counters { gap: 14px 20px; }
    .access { padding: 18px; }
    .reader-tools { top: 62px; flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; margin-left: -16px; margin-right: -16px; padding: 8px 16px; }
    .reader-tools::-webkit-scrollbar { display: none; }
    .reader-tools .btn, .reader-tools .tool-group { flex-shrink: 0; }
    .chapter-title { font-size: 15px; padding: 10px 12px; }
    .article { padding: 16px 14px; border-radius: 14px; }
    .article-text { font-size: calc(var(--reader-size) - 1px); line-height: 1.7; }
    .commentary { padding: 2px 12px 12px; margin-left: -2px; margin-right: -2px; }
    .article-actions { gap: 14px; }
    .toc-in { width: 88vw; }
    .page-body { padding: 18px; font-size: 16px; }
    .card { padding: 18px; }
    .auth-wrap { padding: 28px 16px; min-height: 0; }
    .account-nav a { padding: 9px 16px; }
    .toolbar input[type=search] { min-width: 0; width: 100%; flex-basis: 100%; }
    .modal form { padding: 18px; }
    .footer-grid { gap: 24px; padding-top: 32px; }
    .stat-nums { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; width: 100%; }
    .stat-num strong { font-size: 22px; }
}

/* Rasm yuklanguncha "skelet" fon */
.doc-cover, .book-img { background: linear-gradient(100deg, #e9eef6 30%, #f4f7fb 50%, #e9eef6 70%) 0 0 / 300% 100%; animation: imgShimmer 1.4s linear infinite; }
.doc-cover.img-ready, .book-img.img-ready { animation: none; background: var(--surface-2); }
@keyframes imgShimmer { to { background-position: -150% 0; } }
@media (prefers-reduced-motion: reduce) { .doc-cover, .book-img { animation: none; } }

/* ---------- Muqovalar: turiga qarab ko'rsatish ---------- */
/* Slayder: tayyor 3D kitob rasmi — o'z holicha, ramkasiz */
.cover-mockup { display: flex; align-items: center; justify-content: center; }
.cover-mockup img { display: block; width: auto; max-width: min(400px, 100%); max-height: 380px;
    filter: drop-shadow(0 24px 26px rgba(19, 29, 45, .22)); transition: transform .3s; }
.cover-mockup.white img { filter: none; }   /* foni server tomonida shaffof qilingan, soya rasmning o'zida */
.slide-visual:hover .cover-mockup img { transform: translateY(-5px); }
/* Slayder: kvadrat plakat — kesilmasdan, kartochka ko'rinishida */
.cover-card { display: block; transform: rotate(3deg); transition: transform .3s; }
.cover-card img { display: block; width: auto; max-width: min(340px, 100%); max-height: 340px; border-radius: 14px;
    box-shadow: -10px 12px 0 -2px #d5ddea, 0 22px 40px rgba(19, 29, 45, .22); }
.slide-visual:hover .cover-card { transform: rotate(1deg) translateY(-4px); }

/* Kartochkalar: muqova kesilmaydi (contain), fon bilan uyg'un */
.doc-cover.has-img img { object-fit: contain; padding: 12px; }
.doc-cover.kind-mockup img { filter: drop-shadow(0 10px 12px rgba(19, 29, 45, .18)); }
.doc-cover.kind-white img { filter: none; }
.doc-cover.kind-flat img { padding: 14px 0; filter: drop-shadow(0 8px 12px rgba(19, 29, 45, .22)); }
.doc-cover.kind-square img { padding: 10px; }
.doc-cover.has-img.img-ready { background: #eef2f8; }

@media (max-width: 900px) {
    .cover-mockup img { max-height: 260px; }
    .cover-card img { max-height: 240px; }
}

/* lex.uz dan olingan o'zgarish manbasi izohi (modda matni ostida) */
.lex-note { font-size: .88em; color: var(--muted); }

/* Profil rasmi */
.avatar { overflow: hidden; flex-shrink: 0; color: var(--text); }
.avatar.has-img { background: var(--surface-2); }
.avatar img { width: 100%; height: 100%; object-fit: cover; display: block; }
.avatar-row { display: flex; align-items: center; gap: 20px; flex-wrap: wrap; }
.avatar-preview .avatar { box-shadow: 0 0 0 4px var(--surface), 0 0 0 5px var(--border); font-size: 34px !important; }
.avatar-actions { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; flex: 1; min-width: 200px; }
.avatar-actions p { width: 100%; margin: 0; }
.avatar-pick { cursor: pointer; }
.danger-text { color: var(--danger); }[hidden] { display: none !important; }   /* .btn kabi uslublar hidden atributini bekor qilmasin */

/* Sharh tugmalari: telefonda alohida qatorda, print'da yashirin */
@media (max-width: 600px) {
    .c-tools { margin-left: 0; width: 100%; order: 3; }
    .c-tools-end { order: 4; border-left: 0; padding-left: 0; }
    .c-tool { padding: 6px 9px; font-size: 13px; }
}
@media print {
    .c-tools, .c-player, .c-pane[data-pane="video"] { display: none !important; }
    .protect .commentary { display: none !important; }   /* Ctrl+P → PDF orqali ham sharh ko'chirilmasin */
}

/* =========================================================
   QO'LLANMALAR — asl sharh.lex.uz ko'rinishida
   ========================================================= */
/* --- ro'yxat --- */
.m-list { display: grid; grid-template-columns: 300px minmax(0, 1fr); gap: 28px; padding-top: 28px; padding-bottom: 64px; align-items: start; }
.m-list-side { display: grid; gap: 18px; position: sticky; top: calc(var(--header-h, 66px) + 14px); }
.m-list-search { position: relative; display: block; }
.m-list-search svg { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); color: var(--muted); pointer-events: none; }
.m-list-search input { width: 100%; height: 46px; padding: 0 14px 0 42px; border: 1px solid var(--border); border-radius: 12px; background: var(--surface); color: var(--text); font: inherit; font-size: 15px; }
.m-list-search input:focus { outline: 0; border-color: var(--primary); }
.m-list-side .filters { display: grid; gap: 18px; }
.m-filter { background: var(--surface); border: 1px solid var(--border); border-radius: 16px; padding: 20px 22px; box-shadow: 0 1px 2px rgba(19, 29, 45, .04), 0 6px 20px rgba(19, 29, 45, .05); }
.m-filter h3 { margin: 0 0 12px; font-size: 19px; }
.m-filter ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; }
.m-filter a { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 8px 0; color: var(--muted); font-size: 16px; text-decoration: none; }
.m-filter a:hover { color: var(--primary); }
.m-filter a.on { color: var(--primary); font-weight: 600; }
.m-filter a.on::after { content: ""; width: 16px; height: 10px; border: solid var(--primary); border-width: 0 0 2.4px 2.4px; transform: rotate(-45deg) translate(2px, -2px); flex: none; }
.m-list-title { margin: 6px 0 22px; font-size: 28px; }
.m-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 22px; }
.m-card { display: flex; flex-direction: column; padding: 16px; border-radius: 18px; background: var(--surface); border: 1px solid var(--border); box-shadow: 0 1px 2px rgba(19, 29, 45, .04), 0 8px 24px rgba(19, 29, 45, .06); min-width: 0; transition: box-shadow .2s, transform .2s; }
.m-card:hover { transform: translateY(-2px); box-shadow: 0 2px 4px rgba(19, 29, 45, .05), 0 14px 32px rgba(19, 29, 45, .1); }
.m-cover { display: block; aspect-ratio: 1 / 0.95; border-radius: 12px; overflow: hidden; background: var(--surface-2); }
.m-cover img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform .35s; }
.m-card:hover .m-cover img { transform: scale(1.03); }
.m-cover-ph { height: 100%; display: grid; place-items: center; padding: 20px; text-align: center; font-weight: 700; font-size: 15px; color: var(--primary); background: linear-gradient(135deg, var(--primary-soft), var(--surface-2)); text-transform: uppercase; line-height: 1.35; }
.m-card-body { display: flex; flex-direction: column; flex: 1; padding-top: 16px; }
.m-cat { font-size: 13px; color: var(--muted); }
.m-card-title { margin: 6px 0 18px; font-size: 17px; line-height: 1.35; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; min-height: calc(3 * 1.35em); }
.m-card-title a { color: var(--text); text-decoration: none; }
.m-card-title a:hover { color: var(--primary); }
.m-dl { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 12px 12px; margin: auto 0 16px; font-size: 15px; align-items: center; }
.m-dl dt { color: var(--muted); line-height: 1.3; }
.m-dl dd { margin: 0; text-align: right; color: var(--text); font-variant-numeric: tabular-nums; }
.m-more { display: flex; align-items: center; justify-content: center; gap: 10px; height: 44px; border-radius: 10px; border: 1px solid var(--border); color: var(--text); font-weight: 500; font-size: 16px; text-decoration: none; transition: border-color .15s, color .15s; }
.m-more:hover { border-color: var(--primary); color: var(--primary); }
@media (max-width: 1200px) { .m-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 860px) {
    .m-list { grid-template-columns: minmax(0, 1fr); }
    .m-list-side { position: static; }
}
@media (max-width: 800px) {
    .m-list-side .filter-toggle { margin: 0; }
    .m-list-side .filters { display: none; }
    .m-list-side .filters.open { display: grid; }
}
@media (max-width: 560px) { .m-grid { grid-template-columns: minmax(0, 1fr); } }

/* --- qo'llanma sahifasi --- */
.m-layout { display: grid; grid-template-columns: 380px minmax(0, 1fr); gap: 40px; padding-top: 28px; padding-bottom: 64px; align-items: start; }
.m-side .m-side-in { display: grid; gap: 14px; align-content: start; padding: 0; background: none; border: 0; }
.m-side-top { display: flex; align-items: center; gap: 10px; }
.m-back { width: 46px; height: 46px; border-radius: 12px; display: grid; place-items: center; border: 1px solid var(--border); background: var(--surface); color: var(--text); box-shadow: 0 1px 2px rgba(19, 29, 45, .05); }
.m-back:hover { border-color: var(--primary); color: var(--primary); }
.m-font { margin-left: auto; }
.m-info { background: var(--surface); border: 1px solid var(--border); border-radius: 14px; box-shadow: 0 1px 2px rgba(19, 29, 45, .04), 0 6px 18px rgba(19, 29, 45, .05); }
.m-info summary { cursor: pointer; list-style: none; display: flex; align-items: center; gap: 10px; padding: 14px 18px; font-size: 15px; color: var(--muted); }
.m-info summary::-webkit-details-marker { display: none; }
.m-info summary::before { content: "›"; font-size: 20px; line-height: 1; transition: transform .2s; color: var(--text); }
.m-info[open] summary::before { transform: rotate(90deg); }
.m-info .doc-facts { margin: 0; padding: 0 18px 14px; font-size: 14px; }
.m-authors { padding: 0 18px 16px; font-size: 14px; color: var(--muted); }
.m-toc-box { display: grid; gap: 14px; background: var(--surface); border: 1px solid var(--border); border-radius: 16px; padding: 12px; box-shadow: 0 1px 2px rgba(19, 29, 45, .04), 0 6px 18px rgba(19, 29, 45, .05); }
.m-search { position: relative; display: block; }
.m-search svg { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); color: var(--muted); pointer-events: none; }
.m-search .toc-filter { margin: 0; height: 44px; padding-left: 42px; }
.m-toc-title { font-weight: 700; font-size: 16px; line-height: 1.35; padding: 2px 4px; }
.m-toc > .toc-ch { margin-bottom: 8px; border-radius: 12px; background: var(--surface-2); }
.m-toc-row { display: flex; align-items: flex-start; gap: 6px; }
.m-toc-row .toc-ch-link { flex: 1; padding: 12px 14px; font-size: 15px; font-weight: 500; }
.m-toc-tg { flex: none; width: 40px; height: 44px; border: 0; background: none; color: var(--primary); display: grid; place-items: center; cursor: pointer; transition: transform .2s; }
.m-toc .toc-ch > ol { display: none; margin: 0 10px 10px 14px; }
.m-toc .toc-ch.open > ol { display: block; }
.m-toc .toc-ch.open .m-toc-tg { transform: rotate(45deg); }
.m-toc .toc-ch > ol a { font-size: 14px; color: var(--muted); }
.m-content { min-width: 0; font-size: var(--reader-size); }
.m-tools { display: none; }
.m-title { margin: 6px 0 28px; text-align: center; font-size: 17px; line-height: 1.6; font-weight: 700; color: #1a2a80; text-transform: uppercase; letter-spacing: .01em; text-wrap: balance; }
.m-chapter { margin-bottom: 18px; scroll-margin-top: calc(var(--header-h, 66px) + 16px); }
.m-ch-title { margin: 24px 0 8px; text-align: center; font-size: 22px; font-weight: 700; color: #1a2a80; }
.m-article { background: none; border: 0; border-radius: 0; padding: 0; margin: 0; box-shadow: none; scroll-margin-top: calc(var(--header-h, 66px) + 16px); }
.m-sub { margin: 18px 0 8px; font-size: 1em; font-weight: 600; color: #b0125b; text-transform: uppercase; }
.m-text { line-height: 1.6; text-align: justify; }
.m-text p { margin: 0; text-indent: 1.5em; }
.m-text img { display: block; max-width: 100%; height: auto; margin: 16px auto; border-radius: 4px; }
.m-text table { width: 100%; }
.m-access { margin: 0 0 24px; }
.m-audio { margin-bottom: 18px; display: grid; gap: 6px; }
.m-audio audio { width: 100%; }
@media (max-width: 1024px) {
    .m-layout { grid-template-columns: minmax(0, 1fr); }
    .m-tools { display: block; margin-bottom: 10px; }
    .m-side .m-side-in { padding: 16px; background: var(--bg); overflow: auto; }
}
@media (prefers-color-scheme: dark) { .m-title, .m-ch-title { color: #8fa8ff; } .m-sub { color: #ff7ab0; } }

/* CKEditor 5 bilan yozilgan matnlar */
.rich figure { margin: 1em 0; }
.rich figure.image { display: table; clear: both; text-align: center; margin: 1em auto; max-width: 100%; }
.rich figure.image img { display: block; margin: 0 auto; max-width: 100%; min-width: 100%; }
.rich figure.image_resized { max-width: 100%; display: block; box-sizing: border-box; }
.rich figure.image_resized img { width: 100%; }
.rich img.image_resized { height: auto; }
.rich figcaption, .rich .table > figcaption { display: table-caption; caption-side: bottom; padding: .5em; font-size: .85em; color: var(--muted); text-align: center; }
.rich .image-style-side, .rich .image-style-align-right { float: right; margin: .2em 0 1em 1.5em; max-width: 50%; }
.rich .image-style-align-left { float: left; margin: .2em 1.5em 1em 0; max-width: 50%; }
.rich .image-style-align-center, .rich .image-style-block-align-center { margin-left: auto; margin-right: auto; }
.rich .image-style-block-align-left { margin-left: 0; margin-right: auto; }
.rich .image-style-block-align-right { margin-left: auto; margin-right: 0; }
.rich img.image_resized, .rich img.image-style-align-left, .rich img.image-style-align-right { display: inline-block; }
.rich::after { content: ""; display: table; clear: both; }
.rich figure.table { display: table; margin: 1em auto; max-width: 100%; }
.rich figure.table > table { margin: 0; }
.rich .text-tiny { font-size: .7em; } .rich .text-small { font-size: .85em; } .rich .text-big { font-size: 1.4em; } .rich .text-huge { font-size: 1.8em; }
.rich mark { padding: 0 .1em; border-radius: 2px; }
.rich .marker-yellow { background: #fdfd77; } .rich .marker-green { background: #62f962; } .rich .marker-pink { background: #fc7899; } .rich .marker-blue { background: #72ccfd; }
.rich .pen-red { color: #e71313; background: transparent; } .rich .pen-green { color: #128a00; background: transparent; }
.rich hr { border: 0; border-top: 1px solid var(--border); margin: 1.4em 0; }
.rich .page-break { display: none; }
.rich pre { background: var(--surface-2); border: 1px solid var(--border); border-radius: 8px; padding: 12px 14px; font-size: .88em; }
.rich code { background: var(--surface-2); border-radius: 4px; padding: .1em .3em; font-size: .9em; }
.rich pre code { background: none; padding: 0; }
.rich sub, .rich sup { font-size: .75em; }
.rich figure.media { margin: 1em 0; }
.rich .todo-list { list-style: none; padding-left: 0; }
@media (max-width: 560px) { .rich .image-style-side, .rich .image-style-align-right, .rich .image-style-align-left { float: none; margin: 1em auto; max-width: 100%; } }

/* Infografika: kattalashtirib ko'rish oynasi */
.zm { position: fixed; inset: 0; z-index: 2000; background: rgba(10, 14, 24, .96); display: none; touch-action: none; user-select: none; -webkit-user-select: none; }
.zm.open { display: block; }
html.zm-lock, html.zm-lock body { overflow: hidden; }
.zm-stage { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; overflow: hidden; cursor: zoom-out; }
.zm.zoomed .zm-stage { cursor: grab; }
.zm.zoomed .zm-stage:active { cursor: grabbing; }
.zm-img { max-width: calc(100vw - 32px); max-height: calc(100vh - 110px); object-fit: contain; border-radius: 6px; transform-origin: center center; transition: transform .12s ease-out; will-change: transform; cursor: zoom-in; -webkit-user-drag: none; }
.zm.zoomed .zm-img { cursor: inherit; }
.zm-bar { position: absolute; left: 50%; bottom: 18px; transform: translateX(-50%); display: flex; align-items: center; gap: 4px; padding: 6px; border-radius: 14px; background: rgba(20, 26, 40, .9); box-shadow: 0 8px 28px rgba(0, 0, 0, .35); color: #fff; }
.zm-bar button, .zm-nav { width: 42px; height: 42px; border: 0; border-radius: 10px; background: none; color: #fff; display: grid; place-items: center; cursor: pointer; }
.zm-bar button:hover, .zm-nav:hover { background: rgba(255, 255, 255, .14); }
.zm-pct { min-width: 54px; text-align: center; font-size: 14px; font-variant-numeric: tabular-nums; }
.zm-count { font-size: 13px; opacity: .75; padding: 0 6px; }
.zm-count:empty { display: none; }
.zm-close { margin-left: 4px; }
.zm-nav { position: absolute; top: 50%; transform: translateY(-50%); background: rgba(20, 26, 40, .7); width: 48px; height: 48px; border-radius: 50%; }
.zm-prev { left: 16px; } .zm-next { right: 16px; }
.zm-nav[hidden] { display: none; }
@media (max-width: 560px) {
    .zm-bar { bottom: 12px; gap: 0; }
    .zm-bar button { width: 40px; height: 40px; }
    .zm-nav { width: 40px; height: 40px; }
    .zm-prev { left: 8px; } .zm-next { right: 8px; }
}
.zm.moving .zm-img { transition: none; }

/* Aksiya: kartochka lentasi, narx, filtr, obuna bloki */
:root { --sale: #e5383b; --sale-2: #ff7a1a; --sale-soft: #fff0ec; }
.badge.sale { background: linear-gradient(90deg, var(--sale), var(--sale-2)); color: #fff; }
.sale-ribbon { position: absolute; top: 12px; left: 12px; z-index: 2; display: inline-flex; align-items: center; gap: 6px; padding: 5px 12px 5px 10px; border-radius: 50px; background: linear-gradient(90deg, var(--sale), var(--sale-2)); color: #fff; font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .03em; box-shadow: 0 6px 16px rgba(229, 56, 59, .35); }
.sale-ribbon b { font-size: 13px; letter-spacing: 0; }
.doc-card.on-sale { border-color: rgba(229, 56, 59, .45); box-shadow: 0 0 0 1px rgba(229, 56, 59, .18), 0 10px 26px rgba(229, 56, 59, .1); }
.price.sale-price { display: flex; flex-direction: column; line-height: 1.25; color: var(--sale); }
.price.sale-price s { color: var(--muted); font-weight: 500; font-size: 13px; }
.price.sale-price small { color: var(--muted); font-weight: 500; font-size: 12px; }
.sale-filter { display: flex; align-items: center; gap: 12px; padding: 12px 14px; margin-bottom: 14px; border-radius: 14px; border: 1px solid rgba(229, 56, 59, .35); background: var(--sale-soft); color: var(--text); text-decoration: none; transition: box-shadow .15s, border-color .15s; }
.sale-filter:hover { border-color: var(--sale); }
.sale-filter.on { background: linear-gradient(90deg, var(--sale), var(--sale-2)); border-color: transparent; color: #fff; }
.sale-filter > span:nth-child(2) { display: grid; flex: 1; }
.sale-filter small { font-size: 12px; opacity: .8; }
.sale-filter-ico { width: 36px; height: 36px; flex: none; border-radius: 10px; display: grid; place-items: center; font-weight: 800; font-size: 18px; color: #fff; background: linear-gradient(135deg, var(--sale), var(--sale-2)); }
.sale-filter.on .sale-filter-ico { background: rgba(255, 255, 255, .2); }
.sale-filter-x { font-size: 20px; line-height: 1; }
.access.locked.on-sale { border-color: rgba(229, 56, 59, .4); background: var(--sale-soft); }
.sale-banner { display: flex; align-items: center; gap: 12px; margin: -4px 0 14px; padding: 10px 12px; border-radius: 12px; background: linear-gradient(90deg, var(--sale), var(--sale-2)); color: #fff; }
.sale-banner > span:last-child { display: grid; }
.sale-banner small { font-size: 12px; opacity: .9; }
.sale-banner-pct { font-size: 22px; font-weight: 800; padding-right: 12px; border-right: 1px solid rgba(255, 255, 255, .35); }
.sub-option .sub-old { flex: none; color: var(--muted); font-size: 13px; }
.sub-option .sub-sale { color: var(--sale); }
@media (prefers-color-scheme: dark) { :root { --sale-soft: rgba(229, 56, 59, .12); } }
.sub-option > span { white-space: nowrap; }

/* Bosh sahifa slayderi: aksiyadagi sharh */
.slide-badge.sale { background: linear-gradient(90deg, var(--sale), var(--sale-2)); color: #fff; font-weight: 700; text-transform: uppercase; letter-spacing: .03em; box-shadow: 0 6px 16px rgba(229, 56, 59, .3); }
.slide-prices { display: flex; flex-wrap: wrap; gap: 12px; margin: 4px 0 10px; }
.slide-price { display: grid; padding: 10px 16px; border-radius: 14px; background: var(--surface); border: 1px solid rgba(229, 56, 59, .35); box-shadow: 0 6px 18px rgba(229, 56, 59, .08); line-height: 1.3; }
.slide-price small { font-size: 12px; color: var(--muted); }
.slide-price s { font-size: 14px; color: var(--muted); }
.slide-price strong { font-size: 22px; color: var(--sale); }
.slide-sale-until { margin: 0 0 18px; font-size: 14px; color: var(--sale); font-weight: 500; }
.slide.on-sale .slide-more { background: linear-gradient(90deg, var(--sale), var(--sale-2)); border-color: transparent; }
.slide-visual { position: relative; }
.slide-sale-tag { position: absolute; top: 6%; right: 14%; z-index: 3; width: 84px; height: 84px; border-radius: 50%; display: grid; place-items: center; background: linear-gradient(135deg, var(--sale), var(--sale-2)); color: #fff; font-size: 24px; font-weight: 800; box-shadow: 0 10px 26px rgba(229, 56, 59, .4); transform: rotate(-12deg); }
@media (max-width: 560px) { .slide-sale-tag { width: 62px; height: 62px; font-size: 18px; right: 6%; } .slide-price strong { font-size: 19px; } }

/* Kitoblar to'plami */
.bundle-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 22px; }
.bundles-lead { margin: -8px 0 20px; }
.bundle-card { display: flex; flex-direction: column; border-radius: 18px; background: var(--surface); border: 1px solid var(--border); overflow: hidden; box-shadow: 0 1px 2px rgba(19, 29, 45, .04), 0 8px 24px rgba(19, 29, 45, .06); transition: transform .2s, box-shadow .2s; min-width: 0; }
.bundle-card:hover { transform: translateY(-2px); box-shadow: 0 2px 4px rgba(19, 29, 45, .05), 0 14px 32px rgba(19, 29, 45, .1); }
.bundle-card.on-sale { border-color: rgba(229, 56, 59, .45); }
.bundle-cover { position: relative; display: grid; place-items: center; aspect-ratio: 16 / 10; background: linear-gradient(135deg, var(--primary-soft), var(--surface-2)); overflow: hidden; text-decoration: none; }
.bundle-cover > img { width: 100%; height: 100%; object-fit: cover; display: block; }
.bundle-stack { position: relative; width: 70%; height: 82%; display: block; }
.bundle-stack > * { position: absolute; top: 6%; left: calc(var(--i) * 18%); width: 42%; height: 88%; object-fit: contain; filter: drop-shadow(0 10px 14px rgba(19, 29, 45, .25)); transform: rotate(calc(-8deg + var(--i) * 5deg)); z-index: calc(10 - var(--i)); }
.bundle-ph { display: grid; place-items: center; border-radius: 6px; background: var(--primary); color: #fff; font-weight: 800; font-size: 20px; }
.bundle-stack.big { width: 100%; height: 100%; min-height: 300px; }
.bundle-count { position: absolute; left: 12px; bottom: 12px; display: inline-flex; align-items: center; gap: 6px; padding: 5px 10px; border-radius: 50px; background: rgba(13, 26, 54, .78); color: #fff; font-size: 12px; font-weight: 600; }
.bundle-body { display: flex; flex-direction: column; flex: 1; padding: 16px 18px 18px; }
.bundle-title { margin: 0 0 10px; font-size: 18px; line-height: 1.35; }
.bundle-title a { color: var(--text); text-decoration: none; }
.bundle-title a:hover { color: var(--primary); }
.bundle-docs { list-style: none; margin: 0 0 16px; padding: 0; display: grid; gap: 6px; font-size: 14px; }
.bundle-docs li { position: relative; padding-left: 18px; line-height: 1.35; }
.bundle-docs li::before { content: ""; position: absolute; left: 2px; top: .45em; width: 8px; height: 8px; border-radius: 2px; background: var(--primary); opacity: .5; }
.bundle-docs li.muted::before { display: none; }
.bundle-foot { margin-top: auto; display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; padding-top: 12px; border-top: 1px solid var(--border); }
.bundle-foot .sale-price strong { font-size: 18px; }
.bundle-hero { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 6fr); gap: 40px; align-items: center; }
.bundle-hero-cover { position: relative; border-radius: 20px; overflow: hidden; background: linear-gradient(135deg, var(--primary-soft), var(--surface-2)); display: grid; place-items: center; min-height: 300px; }
.bundle-hero-cover > img { width: 100%; height: auto; display: block; }
.bundle-hero-text h1 { margin: 10px 0 12px; }
.bundle-buy { margin-top: 18px; max-width: 520px; }
.bundle-economy { display: block; font-size: 12px; color: var(--success); white-space: normal; }
.bundle-owned-note { margin: 10px 0 0; }
.bundle-doc { position: relative; display: flex; flex-direction: column; }
.bundle-doc > .doc-card { flex: 1; }
.bundle-owned { position: absolute; top: 12px; left: 12px; z-index: 3; display: inline-flex; align-items: center; gap: 4px; padding: 4px 10px; border-radius: 50px; background: var(--success); color: #fff; font-size: 12px; font-weight: 600; }
.bundle-desc { margin-top: 28px; max-width: 860px; }
.in-bundle { display: flex; align-items: center; gap: 12px; margin-top: 12px; padding: 10px 12px; border-radius: 12px; border: 1px dashed var(--primary); background: var(--surface); color: var(--text); text-decoration: none; }
.in-bundle:hover { background: var(--primary-soft); }
.in-bundle > span:nth-child(2) { display: grid; flex: 1; }
.in-bundle small { font-size: 12px; color: var(--muted); }
.in-bundle-ico { width: 34px; height: 34px; flex: none; border-radius: 10px; display: grid; place-items: center; background: var(--primary); color: #fff; }
.bundle-filter { border-color: rgba(11, 78, 162, .3); background: var(--primary-soft); }
.bundle-filter .sale-filter-ico { background: var(--primary); }
@media (max-width: 1100px) { .bundle-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 860px) { .bundle-hero { grid-template-columns: minmax(0, 1fr); gap: 24px; } }
@media (max-width: 600px) { .bundle-grid { grid-template-columns: minmax(0, 1fr); } }
.bundle-hero-cover .slide-sale-tag { top: 16px; right: 16px; }

/* Ommaviy oferta — to'lov sahifasidagi rozilik belgisi */
.offer-check { display: flex; gap: 10px; align-items: flex-start; margin: 14px 0 4px; padding: 12px 14px; border: 1px solid var(--border, #e3e8ef); border-radius: 10px; background: #f8fafc; font-size: 14px; line-height: 1.45; cursor: pointer; }
.offer-check input { margin-top: 3px; width: 17px; height: 17px; flex: none; accent-color: var(--primary, #1f5fbf); }
.offer-check a { font-weight: 600; text-decoration: underline; }
