/* ===== Shrift (ilova ichida, oflayn) — Onest, SIL OFL 1.1 ===== */
@font-face { font-family: "Onest"; font-style: normal; font-display: swap; font-weight: 100 900;
  src: url(../fonts/onest-cyrillic-ext-wght-normal.woff2) format("woff2"); unicode-range: U+0460-052F,U+1C80-1C8A,U+20B4,U+2DE0-2DFF,U+A640-A69F,U+FE2E-FE2F; }
@font-face { font-family: "Onest"; font-style: normal; font-display: swap; font-weight: 100 900;
  src: url(../fonts/onest-cyrillic-wght-normal.woff2) format("woff2"); unicode-range: U+0301,U+0400-045F,U+0490-0491,U+04B0-04B1,U+2116; }
@font-face { font-family: "Onest"; font-style: normal; font-display: swap; font-weight: 100 900;
  src: url(../fonts/onest-latin-ext-wght-normal.woff2) format("woff2"); unicode-range: U+0100-02BA,U+02BD-02C5,U+02C7-02CC,U+02CE-02D7,U+02DD-02FF,U+0304,U+0308,U+0329,U+1D00-1DBF,U+1E00-1E9F,U+1EF2-1EFF,U+2020,U+20A0-20AB,U+20AD-20C0,U+2113,U+2C60-2C7F,U+A720-A7FF; }
@font-face { font-family: "Onest"; font-style: normal; font-display: swap; font-weight: 100 900;
  src: url(../fonts/onest-latin-wght-normal.woff2) format("woff2"); unicode-range: U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD; }

/* ===== Tokenlar ===== */
:root {
  --bg: #eef7f5;
  --surface: #ffffff;
  --surface-2: #e2f0ec;
  --ink: #0f2f2c;
  --ink-2: #547370;
  --line: #d6e7e2;
  --accent: #0c7a64;
  --accent-2: #14a085;
  --on-accent: #ffffff;
  --ok: #2e8b57;
  --bad: #c0392b;
  --shadow: 0 1px 2px rgba(15, 60, 52, .05), 0 6px 20px rgba(15, 60, 52, .07);
  --radius-lg: 20px;
  --radius-sm: 12px;
  --font-body: "Onest", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-head: "Onest", system-ui, -apple-system, "Segoe UI", sans-serif;
  --safe-b: env(safe-area-inset-bottom, 0px);
  --safe-t: env(safe-area-inset-top, 0px);
  --side: 0px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0d1a1e; --surface: #142529; --surface-2: #1c3238; --ink: #e6f1ef;
    --ink-2: #97b2b0; --line: #26404a; --accent: #5fd4b8; --accent-2: #36b89c; --on-accent: #05221d;
    --shadow: 0 0 0 1px rgba(255,255,255,.05), 0 8px 22px rgba(0,0,0,.32); color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #0d1a1e; --surface: #142529; --surface-2: #1c3238; --ink: #e6f1ef;
  --ink-2: #97b2b0; --line: #26404a; --accent: #5fd4b8; --accent-2: #36b89c; --on-accent: #05221d;
  --shadow: 0 0 0 1px rgba(255,255,255,.05), 0 8px 22px rgba(0,0,0,.32); color-scheme: dark;
}

/* ===== Asos ===== */
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font: 400 16px/1.55 var(--font-body);
  min-height: 100dvh;
  padding-top: calc(56px + var(--safe-t));
  padding-bottom: calc(76px + var(--safe-b));
  -webkit-tap-highlight-color: transparent;
}
a { color: inherit; }
button { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 6px; }
main { max-width: 720px; margin: 0 auto; padding: 16px 16px 24px; outline: none; }
h1, h2, h3 { font-family: var(--font-head); font-weight: 700; letter-spacing: -.015em; line-height: 1.25; }
h2 { font-size: 1.45rem; margin: 0 0 6px; }
h3 { font-size: 1.05rem; margin: 22px 0 10px; }
.muted { color: var(--ink-2); }
.small { font-size: .88rem; }

/* ===== Yuqori panel ===== */
.topbar {
  position: fixed; inset: 0 0 auto var(--side); z-index: 10;
  height: calc(56px + var(--safe-t)); padding: var(--safe-t) 10px 0 10px;
  display: flex; align-items: center; gap: 4px;
  background: var(--bg);
}
.topbar-title {
  flex: 1; margin: 0 8px; font-size: 1.12rem; white-space: nowrap;
  overflow: hidden; text-overflow: ellipsis;
}
.brand { display: none; align-items: center; gap: 10px; text-decoration: none; flex: 1; font-weight: 700; font-size: 1.12rem; letter-spacing: -.01em; }
.brand img { width: 34px; height: 34px; border-radius: 10px; box-shadow: 0 2px 8px rgba(20, 60, 120, .18); }
.brand b, .side-brand b { color: var(--accent); font-weight: 700; }
.topbar.is-home .brand { display: flex; }
.topbar.is-home .topbar-title { display: none; }
.icon-btn {
  width: 44px; height: 44px; border: 0; background: none; border-radius: 14px;
  display: grid; place-items: center; cursor: pointer; color: var(--ink);
}
.icon-btn:active { background: var(--surface-2); }

/* ===== Pastki menyu ===== */
.tabbar {
  position: fixed; inset: auto 0 0 0; z-index: 10;
  display: grid; grid-template-columns: repeat(5, 1fr);
  padding: 6px 4px calc(6px + var(--safe-b));
  background: var(--surface); border-top: 1px solid var(--line);
  box-shadow: 0 -6px 24px rgba(15, 60, 52, .06);
}
.tabbar a {
  display: flex; flex-direction: column; align-items: center; gap: 2px;
  text-decoration: none; color: var(--ink-2); font-size: .7rem; font-weight: 500;
  padding: 5px 0; border-radius: 12px;
}
.tabbar svg { width: 24px; height: 24px; }
.tabbar a[aria-current="page"], .tabbar a[data-soft] { color: var(--accent); font-weight: 700; }
.tabbar .desk, .tabbar .side-brand { display: none; }
.tabbar .more-btn { display: flex; flex-direction: column; align-items: center; gap: 2px; border: 0; background: none; cursor: pointer; color: var(--ink-2); font-size: .7rem; font-weight: 500; padding: 5px 0; border-radius: 12px; }
.tabbar .more-btn[aria-expanded="true"] { color: var(--accent); font-weight: 700; }
#rdSearch { display: none; }
body.reading #rdSearch:not([hidden]) { display: grid; }

/* ===== Bosh sahifa ===== */
.hello { margin: 4px 0 18px; }
.hello p { margin: 0; }
.course-switch {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 4px;
  background: var(--surface); border: 1px solid var(--line); padding: 4px; border-radius: 16px; margin: 14px 0;
}
.course-switch button {
  border: 0; background: none; padding: 10px 0; border-radius: 12px;
  font-weight: 600; cursor: pointer; color: var(--ink-2);
}
.course-switch button[aria-pressed="true"] { background: linear-gradient(135deg, var(--accent-2), var(--accent)); color: var(--on-accent); box-shadow: 0 4px 12px color-mix(in srgb, var(--accent) 35%, transparent); }

.continue {
  display: block; text-decoration: none; background: linear-gradient(135deg, #0f6b5b, #0a4a47); color: #fff;
  border-radius: var(--radius-lg); padding: 16px 18px; margin-bottom: 22px;
}
.continue .small { opacity: .75; }
.continue strong { display: block; font-size: 1rem; margin-top: 2px; }

/* Fan "koreshoklari" — kitob javonidagi kitoblar kabi */
.shelf { display: flex; flex-direction: column; gap: 10px; }
.spine {
  --c: var(--accent);
  display: grid; grid-template-columns: 54px 1fr auto; align-items: center; gap: 14px;
  text-decoration: none; background: var(--surface); border-radius: var(--radius-lg);
  padding: 12px 14px 12px 12px; box-shadow: var(--shadow); position: relative; overflow: hidden;
}
.spine::before { content: ""; position: absolute; inset: 0 auto 0 0; width: 6px; background: var(--c); }
.spine-abbr {
  width: 54px; height: 54px; border-radius: 14px; display: grid; place-items: center;
  background: color-mix(in srgb, var(--c) 16%, transparent); color: var(--c);
  font-family: var(--font-head); font-weight: 700; font-size: .9rem;
}
.spine-name { font-weight: 600; line-height: 1.3; }
.spine-meta { font-size: .82rem; color: var(--ink-2); }
.progress { height: 4px; border-radius: 4px; background: var(--surface-2); margin-top: 6px; overflow: hidden; }
.progress i { display: block; height: 100%; background: var(--c); border-radius: 4px; }
.spine.soon { opacity: .55; box-shadow: none; border: 1px dashed var(--line); background: transparent; }
.chev { color: var(--ink-2); }

.empty { text-align: center; padding: 40px 12px; color: var(--ink-2); }

/* ===== Fan sahifasi ===== */
.subject-head { --c: var(--accent); border-left: 6px solid var(--c); padding: 4px 0 4px 14px; margin-bottom: 18px; }
.subject-head p { margin: 4px 0 0; }
.topics { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.topic-link {
  display: grid; grid-template-columns: 36px 1fr auto; gap: 12px; align-items: center;
  text-decoration: none; background: var(--surface); border-radius: var(--radius-sm);
  padding: 12px 14px; border: 1px solid var(--line);
}
.topic-no {
  width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center;
  font-weight: 700; font-size: .9rem; background: var(--surface-2); color: var(--ink-2);
}
.topic-link.done .topic-no { background: var(--accent); color: var(--on-accent); }
.topic-link.locked { opacity: .5; pointer-events: none; }

/* ===== Mavzu sahifasi ===== */
.seg {
  position: sticky; top: calc(56px + var(--safe-t)); z-index: 5;
  display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none;
  background: var(--bg); padding: 8px 0 10px; margin: -4px 0 10px;
}
.seg::-webkit-scrollbar { display: none; }
.seg button {
  flex: none; border: 1px solid var(--line); background: var(--surface);
  padding: 8px 14px; border-radius: 999px; font-weight: 600; font-size: .9rem; cursor: pointer;
}
.seg button:disabled { opacity: .55; cursor: default; }
.seg button[aria-selected="true"] { background: linear-gradient(135deg, var(--accent-2), var(--accent)); color: var(--on-accent); border-color: var(--accent); }

.prose { max-width: 68ch; }
.prose p { margin: 0 0 12px; }
.prose ul, .prose ol { padding-left: 1.2em; margin: 0 0 12px; }
.prose li { margin-bottom: 4px; }
.summary {
  background: var(--surface); border-radius: var(--radius-lg); padding: 16px 18px; box-shadow: var(--shadow);
}
.summary ol { margin: 0; padding-left: 1.2em; }
.summary li { margin-bottom: 8px; }
.note {
  border-left: 4px solid var(--accent); background: var(--surface-2);
  padding: 10px 14px; border-radius: 0 10px 10px 0; margin: 12px 0;
}
.table-wrap { overflow-x: auto; margin: 0 0 14px; border: 1px solid var(--line); border-radius: var(--radius-sm); }
table { width: 100%; border-collapse: collapse; font-size: .92rem; background: var(--surface); }
th, td { text-align: left; padding: 9px 12px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { background: var(--surface-2); font-weight: 600; }
tr:last-child td { border-bottom: 0; }

/* Bosqich kartochkalari */
.steps { display: flex; flex-direction: column; gap: 10px; }
.step { display: grid; grid-template-columns: 34px 1fr; gap: 12px; background: var(--surface); padding: 14px; border-radius: var(--radius-sm); border: 1px solid var(--line); }
.step b.n { width: 34px; height: 34px; border-radius: 50%; background: var(--accent); color: var(--on-accent); display: grid; place-items: center; }
.step p { margin: 2px 0 0; }

.topic-actions { display: flex; gap: 8px; margin: 20px 0 4px; flex-wrap: wrap; }
.btn {
  border: 1px solid var(--line); background: var(--surface); padding: 11px 16px;
  border-radius: 12px; font-weight: 600; cursor: pointer; text-decoration: none; display: inline-flex; align-items: center; gap: 6px;
}
.btn.primary { background: linear-gradient(135deg, var(--accent-2), var(--accent)); color: var(--on-accent); border-color: var(--accent); }
.btn[aria-pressed="true"] { background: var(--surface-2); }

/* ===== Test ===== */
.quiz-card { background: var(--surface); border-radius: var(--radius-lg); padding: 18px; box-shadow: var(--shadow); }
.quiz-meta { display: flex; justify-content: space-between; font-size: .85rem; color: var(--ink-2); margin-bottom: 10px; }
.quiz-q { font-weight: 600; font-size: 1.05rem; margin: 0 0 14px; }
.opts { display: flex; flex-direction: column; gap: 8px; }
.opt {
  text-align: left; border: 1.5px solid var(--line); background: var(--bg); padding: 12px 14px;
  border-radius: 12px; cursor: pointer; line-height: 1.4;
}
.opt.right { border-color: var(--ok); background: color-mix(in srgb, var(--ok) 14%, transparent); }
.opt.wrong { border-color: var(--bad); background: color-mix(in srgb, var(--bad) 12%, transparent); }
.opt:disabled { cursor: default; }
.explain { margin-top: 14px; padding: 12px 14px; border-radius: 12px; background: var(--surface-2); }
.score { font-family: var(--font-head); font-size: 2.6rem; margin: 6px 0; }

/* ===== Flashcard ===== */
.flash { perspective: 1000px; margin-bottom: 14px; }
.flash-inner {
  position: relative; min-height: 220px; transition: transform .45s; transform-style: preserve-3d; cursor: pointer;
}
.flash.flipped .flash-inner { transform: rotateY(180deg); }
.flash-face {
  position: absolute; inset: 0; backface-visibility: hidden; -webkit-backface-visibility: hidden;
  background: var(--surface); border-radius: var(--radius-lg); box-shadow: var(--shadow);
  padding: 22px; display: flex; flex-direction: column; justify-content: center; text-align: center;
}
.flash-back { transform: rotateY(180deg); background: var(--ink); color: var(--bg); }
.flash-hint { font-size: .8rem; opacity: .6; margin-top: 12px; }
/* ko'p ustunli kartochka orqasi (ustun nomi: qiymat) */
.flash-inner:has(.flash-cells) { min-height: 320px; }
.flash-back:has(.flash-cells) { justify-content: flex-start; overflow-y: auto; padding: 18px 20px; }
.flash-cells { text-align: left; font-size: .95rem; line-height: 1.45; margin: auto 0; }
.flash-cells div + div { margin-top: 7px; }

/* ===== Qidiruv ===== */
.search-input {
  width: 100%; padding: 14px 16px; border-radius: 16px; border: 1.5px solid var(--line);
  background: var(--surface); font: inherit; color: var(--ink); margin-bottom: 14px;
}
.search-input:focus { outline: none; border-color: var(--accent); }
.search-box { position: relative; display: block; }
.search-box svg { position: absolute; left: 14px; top: 15px; color: var(--ink-2); pointer-events: none; }
.search-box .search-input { padding-left: 44px; }
.result mark.jump, mark.jump { background: color-mix(in srgb, var(--accent) 32%, transparent); color: inherit; border-radius: 3px; padding: 0 1px; }
.flash-hit { animation: hit 2.6s ease; border-radius: 8px; }
@keyframes hit { 0%, 55% { box-shadow: 0 0 0 6px color-mix(in srgb, var(--accent) 28%, transparent); background: color-mix(in srgb, var(--accent) 12%, transparent); } 100% { box-shadow: 0 0 0 6px transparent; background: transparent; } }
.gloss-link { display: block; text-decoration: none; }
.empty-art { text-align: center; padding: 34px 12px; color: var(--ink-2); }
.empty-art p { margin: 12px 0 0; }
.result { display: block; text-decoration: none; padding: 12px 14px; background: var(--surface); border-radius: var(--radius-sm); border: 1px solid var(--line); margin-bottom: 8px; }
.result mark { background: color-mix(in srgb, var(--accent) 30%, transparent); color: inherit; border-radius: 3px; }

/* ===== Sozlamalar paneli ===== */
.settings { margin-top: 26px; background: var(--surface); border-radius: var(--radius-lg); padding: 6px 16px; }
.setting-row { display: flex; align-items: center; justify-content: space-between; padding: 12px 0; border-bottom: 1px solid var(--line); gap: 12px; }
.setting-row:last-child { border-bottom: 0; }
.stepper { display: flex; gap: 6px; }
.stepper button { width: 40px; height: 36px; border-radius: 10px; border: 1px solid var(--line); background: var(--bg); cursor: pointer; font-weight: 700; }

.toast {
  position: fixed; left: 50%; bottom: calc(86px + var(--safe-b)); transform: translate(-50%, 20px);
  background: var(--ink); color: var(--bg); padding: 10px 16px; border-radius: 12px; font-size: .9rem;
  opacity: 0; pointer-events: none; transition: .25s; z-index: 20; max-width: calc(100% - 32px);
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; animation: none !important; }
}

/* ===== Qo'llanma matni (v0.2) ===== */
.topic-title { font-weight: 600; line-height: 1.3; }
.prose h3 { font-size: 1rem; margin: 20px 0 8px; }
.prose h3:first-child { margin-top: 4px; }
.prose h4.sub { font-size: .95rem; margin: 16px 0 6px; font-family: var(--font-body); font-weight: 700; }
.prose li { margin-bottom: 6px; }
.prose strong { font-weight: 650; }
.prose sub, .prose sup, .summary-list sub, .summary-list sup { line-height: 0; font-size: .75em; }

/* Bo'limlar (ochiladigan) */
.sec { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-sm); margin-bottom: 8px; }
.sec > summary {
  list-style: none; cursor: pointer; padding: 14px 40px 14px 14px; font-weight: 650; line-height: 1.35;
  position: relative; min-height: 48px;
}
.sec > summary::-webkit-details-marker { display: none; }
.sec > summary::after {
  content: ""; position: absolute; right: 16px; top: 50%; width: 8px; height: 8px; margin-top: -6px;
  border-right: 2px solid var(--ink-2); border-bottom: 2px solid var(--ink-2); transform: rotate(45deg); transition: transform .2s;
}
.sec[open] > summary::after { transform: rotate(-135deg); margin-top: -2px; }
.sec[open] > summary { border-bottom: 1px solid var(--line); }
.sec-body { padding: 12px 14px 6px; max-width: none; }
.sec-tools { display: flex; justify-content: flex-end; margin: 0 0 10px; }
.sec-tools .btn { padding: 8px 12px; font-size: .88rem; }

/* Jadvallar */
.tbl { margin: 0 0 16px; }
.tbl-title { font-weight: 650; font-size: .88rem; margin: 0 0 6px; color: var(--ink-2); }
.table-wrap { margin: 0; -webkit-overflow-scrolling: touch; }
.table-wrap table { min-width: 100%; width: max-content; max-width: 760px; font-size: .86rem; line-height: 1.4; }
.table-wrap th, .table-wrap td { min-width: 96px; }
.table-wrap td:first-child, .table-wrap th:first-child { font-weight: 600; min-width: 110px; }

/* Rasmlar */
.fig { margin: 14px 0; }
.fig img { display: block; max-width: 100%; height: auto; border-radius: 10px; background: #fff; border: 1px solid var(--line); cursor: zoom-in; margin: 0 auto; }
.fig figcaption { font-size: .82rem; color: var(--ink-2); margin-top: 6px; line-height: 1.4; }
.lightbox { position: fixed; inset: 0; z-index: 50; background: rgba(0,0,0,.88); display: flex; flex-direction: column; }
.lb-close { align-self: flex-end; margin: calc(10px + var(--safe-t)) 12px 6px; width: 44px; height: 44px; border-radius: 50%; border: 0; background: rgba(255,255,255,.18); color: #fff; font-size: 1.1rem; cursor: pointer; }
.lb-scroll { flex: 1; overflow: auto; display: grid; place-items: center; padding: 0 8px calc(16px + var(--safe-b)); touch-action: pan-x pan-y pinch-zoom; }
.lb-scroll img { max-width: none; width: min(1100px, 240vw); background: #fff; border-radius: 6px; }
@media (min-width: 700px) { .lb-scroll img { width: min(1100px, 100%); } }
body.noscroll { overflow: hidden; }

/* Qutilar: Eslab qoling, Diqqat, Yodlash usuli, Klinik ahamiyati */
.box { --bc: var(--accent); border-radius: 12px; padding: 10px 14px 4px; margin: 14px 0;
  background: color-mix(in srgb, var(--bc) 10%, var(--surface)); border: 1px solid color-mix(in srgb, var(--bc) 35%, var(--line)); }
.box-label { font-weight: 700; font-size: .78rem; letter-spacing: .04em; text-transform: uppercase; color: var(--bc); margin-bottom: 4px; }
.box p, .box li { font-size: .95rem; }
.box-eslab { --bc: #b45309; }
.box-diqqat { --bc: #b91c1c; }
.box-yodlash { --bc: #6d28d9; }
.box-klinik { --bc: #0f766e; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .box-eslab { --bc: #f59e0b; }
  :root:not([data-theme="light"]) .box-diqqat { --bc: #f87171; }
  :root:not([data-theme="light"]) .box-yodlash { --bc: #a78bfa; }
  :root:not([data-theme="light"]) .box-klinik { --bc: #5cc3b2; }
}
:root[data-theme="dark"] .box-eslab { --bc: #f59e0b; }
:root[data-theme="dark"] .box-diqqat { --bc: #f87171; }
:root[data-theme="dark"] .box-yodlash { --bc: #a78bfa; }
:root[data-theme="dark"] .box-klinik { --bc: #5cc3b2; }

/* Qisqa xulosa */
.summary-list { display: flex; flex-direction: column; gap: 10px; }
.sum-item { background: var(--surface); border-radius: 12px; padding: 12px 14px; box-shadow: var(--shadow); }
.sum-item p { margin: 0; font-size: .96rem; }
.sum-label { display: inline-block; font-size: .72rem; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: var(--ink-2); margin-bottom: 4px; }
.sum-eslab .sum-label { color: #b45309; } .sum-diqqat .sum-label { color: #b91c1c; } .sum-yodlash .sum-label { color: #6d28d9; }
:root[data-theme="dark"] .sum-eslab .sum-label { color: #f59e0b; } :root[data-theme="dark"] .sum-diqqat .sum-label { color: #f87171; } :root[data-theme="dark"] .sum-yodlash .sum-label { color: #a78bfa; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .sum-eslab .sum-label { color: #f59e0b; }
  :root:not([data-theme="light"]) .sum-diqqat .sum-label { color: #f87171; }
  :root:not([data-theme="light"]) .sum-yodlash .sum-label { color: #a78bfa; }
}

/* Masalalar va savollar */
.case { background: var(--surface); border-radius: var(--radius-lg); padding: 16px; margin-bottom: 12px; box-shadow: var(--shadow); }
.case h3 { margin: 0 0 8px; }
.case p { margin: 0 0 10px; }
.reveal summary { cursor: pointer; font-weight: 650; color: var(--accent); padding: 8px 0; min-height: 44px; display: flex; align-items: center; }
.reveal[open] summary { margin-bottom: 4px; }
.qlist li { margin-bottom: 10px; }
.seg button { white-space: nowrap; }

/* ===== Simulyator va Kutubxona (v0.3) ===== */
main.wide { max-width: none; padding: 0; }
.sim-frame { display: block; width: 100%; border: 0; background: var(--bg);
  height: calc(100dvh - 56px - var(--safe-t) - 70px - var(--safe-b)); }
.group-label { font-family: var(--font-head); font-size: .95rem; margin: 22px 0 10px; }
.group-label:first-child { margin-top: 0; }
.lib-chips { display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; margin: 0 0 12px; padding-bottom: 2px; }
.lib-chips::-webkit-scrollbar { display: none; }
.lib-chips button { flex: none; border: 1px solid var(--line); background: var(--surface); padding: 8px 14px; border-radius: 999px; font-weight: 600; font-size: .9rem; cursor: pointer; }
.lib-chips button[aria-pressed="true"] { background: linear-gradient(135deg, var(--accent-2), var(--accent)); color: var(--on-accent); border-color: var(--accent); }
.shelf-title { display: flex; align-items: center; gap: 8px; font-family: var(--font-head); font-size: .95rem; margin: 22px 0 10px; }
.shelf-title i { width: 10px; height: 10px; border-radius: 3px; background: var(--c); }
.books { display: flex; flex-direction: column; gap: 10px; }
.book { --c: var(--accent); display: grid; grid-template-columns: 64px 1fr; gap: 14px; background: var(--surface); border-radius: var(--radius-lg); padding: 12px; box-shadow: var(--shadow); }
.cover { width: 64px; height: 90px; border-radius: 6px; overflow: hidden; background: color-mix(in srgb, var(--c) 18%, var(--surface-2)); display: grid; place-items: center; color: var(--c); font-family: var(--font-head); font-weight: 700; font-size: .8rem; border: 1px solid var(--line); }
.cover img { width: 100%; height: 100%; object-fit: cover; display: block; }
.book-title { font-weight: 650; line-height: 1.3; margin: 0; }
.book-title span { color: var(--ink-2); font-weight: 500; white-space: nowrap; }
.book-authors { margin: 2px 0 6px; font-size: .88rem; color: var(--ink-2); }
.tags { display: flex; flex-wrap: wrap; gap: 6px; margin: 0 0 6px; }
.tag { font-size: .74rem; padding: 2px 8px; border-radius: 999px; background: var(--surface-2); color: var(--ink-2); font-weight: 600; }
.book-note { font-size: .82rem; color: var(--ink-2); margin: 4px 0 0; }
.book .btn { margin-top: 8px; padding: 8px 14px; font-size: .88rem; }
.book .btn[aria-disabled="true"] { opacity: .55; pointer-events: none; }

/* Aralash imtihon sozlamalari */
.exam-row { display: flex; flex-wrap: wrap; gap: 8px; margin: 8px 0 4px; }
.exam-row .btn[aria-pressed="true"] { background: var(--accent); color: var(--on-accent); border-color: var(--accent); }
.exam-topics { display: grid; gap: 6px; margin: 10px 0; max-height: 46vh; overflow: auto; padding-right: 2px; }
.exam-topics label { display: flex; gap: 10px; align-items: flex-start; padding: 8px 10px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); font-size: .92rem; cursor: pointer; }
.exam-topics input { margin-top: 3px; width: 18px; height: 18px; accent-color: var(--accent); flex: none; }
.btn:disabled { opacity: .5; cursor: not-allowed; }

/* Atamalar lug'ati */
.gloss { padding: 12px 14px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); margin-bottom: 8px; }
.gloss strong { font-size: 1.02rem; }
.gloss p { margin: 6px 0 0; color: var(--ink-2); line-height: 1.5; }
.gloss-tag { float: right; font-size: .72rem; color: var(--ink-2); border: 1px solid var(--line); border-radius: 999px; padding: 1px 8px; margin-left: 8px; }
/* Qo'llanmani to'liq o'qish */
.book-toc .toc-list { margin: 0; padding-left: 0; list-style: none; }
.toc-link { all: unset; display: block; cursor: pointer; padding: 8px 2px; border-bottom: 1px solid var(--line); line-height: 1.4; font-size: .95rem; }
.toc-link:focus-visible { outline: 2px solid var(--accent); }
.book-topic { padding-top: 18px; margin-top: 18px; border-top: 2px solid var(--line); scroll-margin-top: 70px; }
.book-topic:first-child { border-top: 0; margin-top: 8px; }
.book-no { margin: 0; font-size: .8rem; letter-spacing: .06em; text-transform: uppercase; color: var(--accent); font-weight: 700; }
.book-topic h2 { margin: 4px 0 10px; line-height: 1.3; }
.book-topic h3 { margin-top: 22px; }
.bookread, .book-topic, .book-toc { min-width: 0; max-width: 100%; }
.bookread .table-wrap { max-width: 100%; }

/* Kutubxona: til bo'limlari */
.lang-chips { margin-top: -4px; }
.lang-chips button .cnt { opacity: .6; font-weight: 500; margin-left: 2px; }
.lang-title { display: flex; align-items: baseline; justify-content: space-between; font-family: var(--font-head); font-size: 1.15rem; margin: 28px 0 4px; padding-bottom: 6px; border-bottom: 2px solid var(--line); }
.lang-title span { font-size: .85rem; color: var(--muted, #888); font-weight: 600; }
.lang-sec .shelf-title { font-size: .92rem; margin: 16px 0 8px; }
/* Yuqoriga tugmasi */
.to-top { position: fixed; right: 16px; bottom: calc(76px + env(safe-area-inset-bottom, 0px)); z-index: 40; width: 48px; height: 48px; border-radius: 50%; border: 0; background: var(--ink); color: var(--bg); box-shadow: 0 4px 14px rgba(0,0,0,.3); display: grid; place-items: center; cursor: pointer; }
.to-top[hidden] { display: none; }
.to-top:active { transform: scale(.94); }

/* Kutubxona: belgilar */
.book-actions { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-top: 8px; }
.book-actions .btn { min-height: 40px; }
.btn.star { font-size: 1.2rem; padding: 0 14px; line-height: 1; }
.btn.star[aria-pressed="true"] { color: #d99a1c; border-color: #d99a1c; }
.continue.alt { background: var(--surface); color: var(--ink); border: 1px solid var(--line); }
.setting-row.about { line-height: 1.5; }

/* ===== Yangi dizayn (ALVORA Med) ===== */
.hero { margin: 2px 0 14px; }
.hero h2 { font-size: 1.6rem; margin: 0 0 2px; }
.hero p { margin: 0; }
.goal { display: flex; align-items: center; gap: 14px; text-decoration: none; background: var(--surface); border-radius: var(--radius-lg); padding: 14px 16px; box-shadow: var(--shadow); }
.goal-txt { flex: 1; display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.goal-txt small { color: var(--ink-2); font-size: .84rem; }
.ring { position: relative; display: inline-grid; place-items: center; flex: none; }
.ring svg { position: absolute; inset: 0; }
.ring b { font-size: .8rem; position: relative; }
.resume { display: flex; align-items: center; gap: 14px; text-decoration: none; margin-bottom: 14px; color: #fff; border-radius: var(--radius-lg); padding: 14px 16px;
  background: linear-gradient(120deg, #0b4d4a 0%, #0f7a68 55%, #3d5aa8 130%); box-shadow: var(--shadow); }
.resume.alt { background: linear-gradient(120deg, #1f3d5c 0%, #2a6a8a 100%); }
.resume .play { flex: none; width: 42px; height: 42px; border-radius: 50%; display: grid; place-items: center; background: rgba(255,255,255,.2); }
.resume-txt { display: flex; flex-direction: column; min-width: 0; }
.resume-txt small { opacity: .8; font-size: .78rem; }
.resume-txt strong { font-size: 1rem; line-height: 1.3; }
.quick-row { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin: 4px 0 6px; }
.quick { display: flex; flex-direction: column; align-items: center; gap: 6px; text-decoration: none; font-size: .76rem; font-weight: 600; background: var(--surface); border-radius: 16px; padding: 12px 4px 10px; box-shadow: var(--shadow); }
.quick-ico { position: relative; width: 40px; height: 40px; border-radius: 13px; display: grid; place-items: center; background: color-mix(in srgb, var(--accent) 13%, transparent); color: var(--accent); }
.badge { position: absolute; top: -6px; right: -8px; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px; background: var(--bad); color: #fff; font-style: normal; font-size: .68rem; display: grid; place-items: center; }
.sec-head { display: flex; align-items: baseline; justify-content: space-between; margin: 22px 0 10px; }
.sec-head h3 { margin: 0; }
.sec-head a { font-size: .86rem; font-weight: 600; color: var(--accent); text-decoration: none; }
.fan-grid { display: grid; grid-template-columns: 1fr; gap: 10px; }
.fan-card, .sim-card { --c: var(--accent); display: flex; align-items: center; gap: 14px; text-decoration: none; background: var(--surface); border-radius: var(--radius-lg); padding: 14px; box-shadow: var(--shadow); min-width: 0; }
.fan-card.soon, .sim-card.soon { opacity: .55; box-shadow: none; border: 1px dashed var(--line); background: transparent; }
.fan-ico { flex: none; width: 52px; height: 52px; border-radius: 16px; display: grid; place-items: center; color: var(--c); background: color-mix(in srgb, var(--c) 14%, transparent); }
.fan-ico.lg { width: 60px; height: 60px; border-radius: 18px; }
.fan-txt { display: flex; flex-direction: column; min-width: 0; flex: 1; gap: 1px; }
.fan-txt b { font-size: 1.02rem; color: var(--c); letter-spacing: .01em; }
.fan-name { font-size: .9rem; line-height: 1.3; color: var(--ink); }
.fan-name.strong { font-weight: 650; font-size: 1rem; }
.fan-meta { font-size: .8rem; color: var(--ink-2); line-height: 1.35; }
.fan-txt .progress { margin-top: 6px; }
.sim-card .chev { flex: none; }
.seg.flat { position: static; background: none; padding: 0; margin: 0 0 14px; }
.subj-head { display: flex; align-items: center; gap: 14px; border: 0; padding: 0; margin: 0 0 16px; }
.subj-txt { flex: 1; min-width: 0; }
.subj-txt h2 { font-size: 1.2rem; margin: 0; }
.subj-txt h2 .abbr { color: var(--c); }
.subj-txt p { margin: 3px 0 0; }
.tiles { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.tile { display: flex; align-items: center; gap: 12px; text-decoration: none; background: var(--surface); border-radius: var(--radius-lg); padding: 14px; box-shadow: var(--shadow); }
.tile-ico { flex: none; width: 42px; height: 42px; border-radius: 13px; display: grid; place-items: center; background: color-mix(in srgb, var(--accent) 13%, transparent); color: var(--accent); }
.tile b { display: block; line-height: 1.2; }
.tile small { color: var(--ink-2); font-size: .78rem; }
.topic-link { border: 0; box-shadow: var(--shadow); border-radius: 16px; }
.topic-no { background: color-mix(in srgb, var(--accent) 12%, transparent); color: var(--accent); }
.result, .gloss { border: 0; box-shadow: var(--shadow); border-radius: 16px; }
.soon-card { text-align: center; background: var(--surface); border-radius: var(--radius-lg); padding: 36px 20px; box-shadow: var(--shadow); }
.soon-ico { display: inline-grid; place-items: center; width: 84px; height: 84px; border-radius: 26px; color: var(--accent); background: color-mix(in srgb, var(--accent) 12%, transparent); }
.soon-card h3 { margin: 16px 0 6px; }
.soon-card p { margin: 0; }
.setting-col { padding: 12px 0; border-bottom: 1px solid var(--line); }
.settings { border-radius: var(--radius-lg); box-shadow: var(--shadow); }
.pdf-bar { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 6px 12px; height: 52px; }
.pdf-bar .btn { padding: 8px 14px; font-size: .88rem; }
.pdf-frame { height: calc(100dvh - 56px - var(--safe-t) - 52px - 70px - var(--safe-b)); }
.book .cover { border-radius: 10px; }
.book, .case, .quiz-card, .sum-item { border-radius: var(--radius-lg); }

/* Noutbuk va katta ekranlar: chap panel */
@media (min-width: 900px) {
  :root { --side: 248px; }
  body { padding-left: var(--side); padding-bottom: 24px; }
  main { max-width: 1040px; padding: 24px 32px 40px; }
  .prose { max-width: 74ch; }
  .table-wrap table { max-width: none; font-size: .92rem; }
  .fig img { max-height: 70vh; width: auto; max-width: 100%; }
  .fan-grid { grid-template-columns: 1fr 1fr; }
  .quick-row { max-width: 560px; }
  .topbar .brand, .topbar.is-home .brand { display: none; }
  .topbar.is-home .topbar-title { display: block; }
  .tabbar { inset: 0 auto 0 0; width: var(--side); display: flex; flex-direction: column; gap: 4px; padding: 18px 14px; border-top: 0; border-right: 1px solid var(--line); box-shadow: none; }
  .tabbar .side-brand { display: flex; }
  .tabbar .more-btn { flex-direction: row; gap: 12px; font-size: .95rem; padding: 11px 12px; border-radius: 14px; width: 100%; text-align: left; }
  .tabbar .more-btn[aria-current="page"] { background: color-mix(in srgb, var(--accent) 13%, transparent); color: var(--accent); font-weight: 700; }
  .tabbar .side-brand { flex-direction: row; gap: 10px; font-size: 1.15rem; font-weight: 700; color: var(--ink); padding: 4px 8px 18px; }
  .tabbar .side-brand img { border-radius: 11px; }
  .tabbar a { flex-direction: row; gap: 12px; font-size: .95rem; padding: 11px 12px; border-radius: 14px; }
  .tabbar a[aria-current="page"] { background: color-mix(in srgb, var(--accent) 13%, transparent); }
  .tabbar a[data-soft] { background: none; color: var(--ink-2); font-weight: 500; }
  .tabbar a[data-tab="home"] { order: 1; } .tabbar a[data-tab="assyst"] { order: 2; } .tabbar a[data-tab="sim"] { order: 3; }
  .tabbar a[data-tab="rooms"] { order: 4; } .tabbar .more-btn { order: 5; }
  .sim-frame { height: calc(100dvh - 56px - var(--safe-t)); }
  .pdf-frame { height: calc(100dvh - 56px - var(--safe-t) - 52px); }
  .toast { bottom: 28px; }
  .to-top { bottom: 24px; }
  .book-toc .toc-list { columns: 2; column-gap: 24px; }
  .toc-list li { break-inside: avoid; }
  .bookread { max-width: 780px; margin-inline: auto; }
}
@media (min-width: 1200px) { .fan-grid { grid-template-columns: repeat(3, 1fr); } }
@media (min-width: 1100px) {
  main:has(#libwrap) { max-width: 1180px; }
  .books { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
  .book { align-content: start; }
}
@media (min-width: 1500px) {
  main:has(#libwrap) { max-width: 1400px; }
  .books { grid-template-columns: repeat(3, 1fr); }
}

.gloss mark { background: color-mix(in srgb, var(--accent) 30%, transparent); color: inherit; border-radius: 3px; }
.seg.flat button { padding: 8px 11px; font-size: .86rem; }


/* ===================== v0.11: harakat, kartalar, yangi bo'limlar ===================== */
body { overscroll-behavior-y: contain; }
/* Sahifa almashinuvi va ro'yxat birin-ketin chiqishi */
main.enter { animation: pageIn .32s cubic-bezier(.2,.8,.2,1) backwards; }
@keyframes pageIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
.stag { animation: rise .42s cubic-bezier(.2,.8,.2,1) backwards; animation-delay: calc(var(--i, 0) * 38ms); }
@keyframes rise { from { opacity: 0; transform: translateY(14px) scale(.985); } to { opacity: 1; transform: none; } }
/* Bosilganda ozgina kichrayish */
.fan-card, .sim-card, .tile, .quick, .goal, .resume, .topic-link, .result, .btn, .seg button, .course-switch button, .lib-chips button, .opt, .plan-item, .badge-card, .icon-btn, .tabbar a {
  transition: transform .14s ease, background-color .2s ease, box-shadow .2s ease, color .2s ease; }
.fan-card:active, .sim-card:active, .tile:active, .quick:active, .goal:active, .resume:active, .topic-link:active, .result:active, .plan-item:active, .badge-card:active { transform: scale(.975); }
.btn:active, .seg button:active, .course-switch button:active, .lib-chips button:active, .opt:active { transform: scale(.96); }
@media (hover: hover) {
  .fan-card:hover, .sim-card:hover, .tile:hover, .quick:hover, .goal:hover, .topic-link:hover, .result:hover { transform: translateY(-2px); box-shadow: 0 2px 4px rgba(15,60,52,.06), 0 12px 28px rgba(15,60,52,.10); }
}

/* Pastki menyu: faol bo'lim uchun "tabletka" */
.tabbar .ti { display: grid; place-items: center; width: 56px; height: 30px; border-radius: 16px; transition: background-color .25s ease, transform .25s cubic-bezier(.2,.8,.2,1); }
.tabbar .ti svg { transition: fill .25s ease; }
.tabbar a[aria-current="page"] .ti, .tabbar a[data-soft] .ti { background: color-mix(in srgb, var(--accent) 16%, transparent); }
.tabbar a[aria-current="page"] .ti svg, .tabbar a[data-soft] .ti svg { fill: color-mix(in srgb, var(--accent) 22%, transparent); }
.tabbar a[aria-current="page"] .ti { animation: pill .35s cubic-bezier(.2,.8,.2,1); }
@keyframes pill { from { transform: scaleX(.6); opacity: .4; } to { transform: none; opacity: 1; } }
@media (min-width: 900px) { .tabbar .ti { width: auto; height: auto; background: none !important; animation: none !important; } }

/* Fan kartalari: o'z rangidagi gradient */
.fan-card:not(.soon), .sim-card:not(.soon) { position: relative; overflow: hidden;
  background: linear-gradient(135deg, color-mix(in srgb, var(--c) 11%, var(--surface)) 0%, var(--surface) 62%); }
.fan-card:not(.soon)::after, .sim-card:not(.soon)::after { content: ""; position: absolute; right: -28px; top: -28px; width: 96px; height: 96px; border-radius: 50%;
  background: color-mix(in srgb, var(--c) 7%, transparent); pointer-events: none; }
.fan-card:not(.soon) .fan-ico, .sim-card:not(.soon) .fan-ico, .subj-head .fan-ico {
  color: #fff; background: linear-gradient(140deg, color-mix(in srgb, var(--c) 72%, #fff) 0%, var(--c) 100%);
  box-shadow: 0 6px 16px color-mix(in srgb, var(--c) 38%, transparent); }
.fan-ico svg { width: 28px; height: 28px; }

/* Skelet (yuklanayotganda) */
.skel { display: grid; gap: 12px; }
.sk { border-radius: 16px; background: linear-gradient(90deg, var(--surface-2) 0%, color-mix(in srgb, var(--surface-2) 45%, var(--surface)) 50%, var(--surface-2) 100%); background-size: 200% 100%; animation: shimmer 1.2s linear infinite; }
.sk.h1 { height: 30px; width: 58%; } .sk.h2 { height: 16px; width: 40%; } .sk.card { height: 82px; } .sk.row { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; height: auto; background: none; animation: none; }
.sk.row i { height: 74px; border-radius: 16px; background: inherit; }
@keyframes shimmer { to { background-position: -200% 0; } }

/* Bo'sh holatlar */
.empty-state { text-align: center; padding: 30px 16px 20px; color: var(--ink-2); }
.empty-state .es-ico { display: inline-grid; place-items: center; width: 96px; height: 96px; border-radius: 50%; color: var(--accent);
  background: radial-gradient(circle, color-mix(in srgb, var(--accent) 18%, transparent) 0%, color-mix(in srgb, var(--accent) 7%, transparent) 70%); }
.empty-state h3 { color: var(--ink); margin: 14px 0 4px; }
.empty-state p { margin: 0 auto; max-width: 32ch; }
.empty-state .btn { margin-top: 14px; }

/* O'qish jarayoni chizig'i */
.read-progress { position: fixed; left: var(--side); right: 0; top: calc(56px + var(--safe-t)); height: 3px; z-index: 11; pointer-events: none; opacity: 0; transition: opacity .2s; }
.read-progress i { display: block; height: 100%; width: 0; background: linear-gradient(90deg, var(--accent-2), var(--accent)); border-radius: 0 3px 3px 0; }
body.reading .read-progress { opacity: 1; }

/* Mavzu sahifasi */
.topic-head { margin: 2px 0 10px; }
.topic-head .kicker { display: inline-block; font-size: .78rem; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: var(--accent);
  background: color-mix(in srgb, var(--accent) 12%, transparent); padding: 3px 10px; border-radius: 999px; margin-bottom: 8px; }
.topic-head h2 { font-size: 1.3rem; line-height: 1.3; margin: 0; }
.topic-head .meta { margin: 6px 0 0; font-size: .84rem; color: var(--ink-2); }
#tabBody .prose, #tabBody .sec-body { font-size: 1.02rem; line-height: 1.7; }
#tabBody .prose p, #tabBody .sec-body p { margin-bottom: 14px; }
.sum-item { position: relative; padding-left: 18px; border-left: 4px solid color-mix(in srgb, var(--ink-2) 35%, transparent); }
.sum-item.sum-eslab { border-left-color: #d97706; } .sum-item.sum-diqqat { border-left-color: #dc2626; } .sum-item.sum-yodlash { border-left-color: #7c3aed; } .sum-item.sum-klinik { border-left-color: var(--accent); }
.sum-label::before { margin-right: 5px; }
.sum-eslab .sum-label::before { content: "📌"; } .sum-diqqat .sum-label::before { content: "⚠️"; } .sum-yodlash .sum-label::before { content: "🧠"; } .sum-klinik .sum-label::before { content: "🩺"; }
.done-score { font-weight: 500; opacity: .85; }

/* Belgilash (marker) */
mark.hl { background: #ffe066; color: #2a2100; border-radius: 3px; padding: 0 1px; cursor: pointer; box-decoration-break: clone; -webkit-box-decoration-break: clone; }
:root[data-theme="dark"] mark.hl { background: #c9a227; color: #1b1500; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) mark.hl { background: #c9a227; color: #1b1500; } }
.hl-btn { position: fixed; left: 50%; bottom: calc(140px + var(--safe-b)); transform: translateX(-50%); z-index: 30; border: 0; border-radius: 999px; padding: 12px 20px;
  font-weight: 700; background: #ffe066; color: #2a2100; box-shadow: 0 8px 24px rgba(0,0,0,.25); cursor: pointer; animation: rise .25s ease both; }
.hl-card { display: block; text-decoration: none; background: var(--surface); border-radius: 16px; padding: 14px 16px; box-shadow: var(--shadow); margin-bottom: 10px; border-left: 4px solid #e8b923; }
.hl-card q { display: block; quotes: "“" "”"; line-height: 1.55; }
.hl-card .hl-meta { display: flex; justify-content: space-between; gap: 8px; align-items: center; margin-top: 8px; font-size: .8rem; color: var(--ink-2); }

/* Pastki varaq (sheet) */
.sheet-back { position: fixed; inset: 0; z-index: 60; background: rgba(5,20,18,.45); display: flex; align-items: flex-end; justify-content: center; animation: fadeIn .2s ease both; }
.sheet { width: 100%; max-width: 560px; background: var(--surface); border-radius: 24px 24px 0 0; padding: 10px 18px calc(18px + var(--safe-b)); box-shadow: 0 -10px 40px rgba(0,0,0,.2);
  animation: sheetUp .32s cubic-bezier(.2,.8,.2,1) both; max-height: 88dvh; overflow: auto; }
.sheet::before { content: ""; display: block; width: 40px; height: 4px; border-radius: 2px; background: var(--line); margin: 0 auto 14px; }
.sheet h3 { margin: 0 0 6px; }
.sheet .field { display: grid; gap: 6px; margin: 12px 0; font-weight: 600; font-size: .9rem; }
.sheet input, .sheet select { font: inherit; color: var(--ink); background: var(--bg); border: 1.5px solid var(--line); border-radius: 12px; padding: 11px 12px; width: 100%; }
.sheet input:focus, .sheet select:focus { outline: none; border-color: var(--accent); }
.sheet .row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.sheet .acts { display: flex; gap: 8px; margin-top: 16px; flex-wrap: wrap; }
.sheet .acts .btn { flex: 1; justify-content: center; }
.btn.danger { color: var(--bad); border-color: color-mix(in srgb, var(--bad) 40%, var(--line)); }
@media (min-width: 900px) { .sheet-back { align-items: center; } .sheet { border-radius: 24px; } }
@keyframes fadeIn { from { opacity: 0; } }
@keyframes sheetUp { from { transform: translateY(100%); } }

/* Pastga tortib yangilash */
.ptr { position: fixed; left: calc(50% + var(--side) / 2); top: calc(56px + var(--safe-t)); z-index: 12; width: 40px; height: 40px; margin-left: -20px; border-radius: 50%;
  display: grid; place-items: center; background: var(--surface); color: var(--accent); box-shadow: 0 4px 14px rgba(0,0,0,.18); transform: translateY(-60px); opacity: 0; pointer-events: none; }
.ptr.spin svg { animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* Yuqoriga (global) */
.to-top { transition: opacity .2s ease, transform .2s ease; }

/* Reja */
.week-nav { display: flex; align-items: center; gap: 8px; margin: 0 0 12px; }
.week-nav .wk { flex: 1; text-align: center; font-weight: 700; }
.week-nav .icon-btn { background: var(--surface); box-shadow: var(--shadow); }
.week-sum { background: var(--surface); border-radius: var(--radius-lg); padding: 14px 16px; box-shadow: var(--shadow); margin-bottom: 14px; }
.week-sum .progress { height: 8px; margin-top: 8px; }
.week-sum .progress i { background: linear-gradient(90deg, var(--accent-2), var(--accent)); }
.week-sum.won { background: linear-gradient(120deg, color-mix(in srgb, #e8b923 22%, var(--surface)), var(--surface)); }
.week-acts { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 10px; }
.week-acts .btn { padding: 8px 12px; font-size: .86rem; }
.day { margin-bottom: 14px; }
.day-h { display: flex; align-items: baseline; justify-content: space-between; margin: 0 2px 8px; }
.day-h b { font-size: .98rem; }
.day-h small { color: var(--ink-2); }
.day.today .day-h b { color: var(--accent); }
.day.today .day-h b::after { content: " · bugun"; font-weight: 600; font-size: .8rem; }
.day-add { border: 1.5px dashed var(--line); background: none; border-radius: 14px; width: 100%; padding: 10px; color: var(--ink-2); font-weight: 600; cursor: pointer; }
.plan-item { display: grid; grid-template-columns: auto 1fr auto; gap: 12px; align-items: center; background: var(--surface); border-radius: 16px; padding: 12px; box-shadow: var(--shadow); margin-bottom: 8px; }
.plan-item .tm { font-weight: 700; font-size: .9rem; background: color-mix(in srgb, var(--accent) 12%, transparent); color: var(--accent); border-radius: 10px; padding: 6px 8px; min-width: 56px; text-align: center; }
.plan-item a { text-decoration: none; min-width: 0; }
.plan-item .pt { display: block; font-weight: 600; line-height: 1.3; }
.plan-item .pm { font-size: .78rem; color: var(--ink-2); }
.plan-item.done { opacity: .7; } .plan-item.done .pt { text-decoration: line-through; }
.plan-item.late .tm { background: color-mix(in srgb, var(--bad) 14%, transparent); color: var(--bad); }
.tagx { display: inline-block; font-size: .7rem; font-weight: 700; border-radius: 999px; padding: 1px 7px; margin-left: 4px; }
.tagx.late { background: color-mix(in srgb, var(--bad) 14%, transparent); color: var(--bad); }
.tagx.ok { background: color-mix(in srgb, var(--ok) 16%, transparent); color: var(--ok); }
.pi-acts { display: flex; gap: 2px; }
.pi-acts button { width: 38px; height: 38px; border: 0; background: none; border-radius: 12px; color: var(--ink-2); cursor: pointer; display: grid; place-items: center; }
.pi-acts button:active { background: var(--surface-2); }
.pi-acts .chk[aria-pressed="true"] { color: var(--ok); }
.today-card { background: var(--surface); border-radius: var(--radius-lg); padding: 14px 16px 6px; box-shadow: var(--shadow); margin: 14px 0; }
.today-card .tc-h { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 8px; }
.today-card .tc-h a { font-size: .86rem; font-weight: 600; color: var(--accent); text-decoration: none; }
.today-card .plan-item { box-shadow: none; padding: 8px 0; margin: 0; border-top: 1px solid var(--line); border-radius: 0; background: none; }

/* Yutuqlar */
.stats3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-bottom: 16px; }
.stat { background: var(--surface); border-radius: 16px; padding: 12px 10px; box-shadow: var(--shadow); text-align: center; }
.stat b { display: block; font-size: 1.45rem; color: var(--accent); line-height: 1.2; }
.stat small { color: var(--ink-2); font-size: .74rem; }
.badges { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.badge-card { background: var(--surface); border-radius: 16px; padding: 12px 8px; text-align: center; box-shadow: var(--shadow); }
.badge-card .bi { font-size: 1.9rem; line-height: 1; display: block; margin-bottom: 6px; }
.badge-card b { display: block; font-size: .8rem; line-height: 1.25; }
.badge-card small { display: block; font-size: .7rem; color: var(--ink-2); margin-top: 2px; }
.badge-card.locked { opacity: .45; filter: grayscale(1); box-shadow: none; border: 1px dashed var(--line); background: transparent; }
.badge-card.got { background: linear-gradient(160deg, color-mix(in srgb, #e8b923 18%, var(--surface)), var(--surface)); }
.week-win { display: flex; align-items: center; gap: 12px; background: var(--surface); border-radius: 16px; padding: 12px 14px; box-shadow: var(--shadow); margin-bottom: 8px; }
.week-win .bi { font-size: 1.6rem; }
.read-row { display: grid; grid-template-columns: 1fr auto; gap: 10px; align-items: center; background: var(--surface); border-radius: 16px; padding: 12px 14px; box-shadow: var(--shadow); margin-bottom: 8px; }
.read-row a { text-decoration: none; }
.score-pill { border: 0; cursor: pointer; font: inherit; font-weight: 700; font-size: .88rem; padding: 6px 10px; border-radius: 10px; min-width: 52px;
  background: color-mix(in srgb, var(--accent) 13%, transparent); color: var(--accent); }
.score-pill.none { background: var(--surface-2); color: var(--ink-2); font-weight: 600; }
.score-pill.hi { background: color-mix(in srgb, var(--ok) 16%, transparent); color: var(--ok); }
.score-pill.lo { background: color-mix(in srgb, var(--bad) 13%, transparent); color: var(--bad); }

/* Qidiruv takliflari */
.chips { display: flex; gap: 6px; flex-wrap: wrap; margin: -4px 0 12px; }
.chips .lbl { width: 100%; font-size: .78rem; color: var(--ink-2); font-weight: 600; display: flex; justify-content: space-between; }
.chips .lbl button { border: 0; background: none; color: var(--accent); font: inherit; cursor: pointer; padding: 0; }
.chip { border: 1px solid var(--line); background: var(--surface); border-radius: 999px; padding: 7px 12px; font-size: .86rem; font-weight: 600; cursor: pointer; color: var(--ink); }
.chip.recent::before { content: "↺ "; color: var(--ink-2); }
.chip mark { background: none; color: var(--accent); }

@media (prefers-reduced-motion: reduce) { .stag, main.enter, .sk { animation: none !important; } }

.plan-item .pt { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.plan-item .pi-acts { align-self: center; }
.pi-more { grid-column: 2 / 4; display: flex; gap: 6px; margin-top: -4px; }
.pi-more button { border: 0; background: var(--surface-2); color: var(--ink-2); border-radius: 10px; padding: 6px 10px; font: inherit; font-size: .78rem; font-weight: 600; display: inline-flex; align-items: center; gap: 5px; cursor: pointer; }
.pi-more button:active { transform: scale(.96); }
.pi-more button[data-act="del"] { margin-left: auto; }
.plan-item { align-items: start; }
.plan-item .tm { align-self: start; }

/* ===== Test markazi ===== */
.tm-bank { display: flex; align-items: center; gap: 14px; background: var(--surface); border-radius: var(--radius-lg); padding: 14px 16px; box-shadow: var(--shadow); margin-bottom: 12px; }
.tm-bank-t b { display: block; line-height: 1.3; }
.tm-bank-t small { color: var(--ink-2); font-size: .8rem; }
.tm-chip { border: 1px solid var(--line); background: var(--surface); border-radius: 999px; padding: 8px 14px; font-size: .88rem; font-weight: 600; cursor: pointer; color: var(--ink); transition: transform .15s ease, background .2s ease; }
.tm-chip[aria-pressed="true"] { background: linear-gradient(135deg, var(--accent-2), var(--accent)); color: var(--on-accent); border-color: var(--accent); }
.tm-chip:active { transform: scale(.95); }
.tm-banks { margin: 0 0 12px; }
.tm-modes { display: grid; gap: 10px; margin-bottom: 6px; }
.tm-mode { display: flex; align-items: center; gap: 14px; text-decoration: none; background: var(--surface); border-radius: var(--radius-lg); padding: 15px 16px; box-shadow: var(--shadow); transition: transform .15s ease; }
.tm-mode:active { transform: scale(.98); }
.tm-mode > span:nth-child(2) { flex: 1; min-width: 0; }
.tm-mode b { display: block; line-height: 1.25; }
.tm-mode small { color: var(--ink-2); font-size: .8rem; line-height: 1.35; display: block; }
.tm-ico { flex: none; width: 46px; height: 46px; border-radius: 15px; display: grid; place-items: center; background: color-mix(in srgb, var(--accent) 13%, transparent); color: var(--accent); }
.tm-small .tm-mode { padding: 11px 14px; }
.tm-small .tm-ico { width: 40px; height: 40px; border-radius: 13px; }
.tm-quick { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.tm-q { text-decoration: none; background: var(--surface); border-radius: 16px; padding: 12px 14px; box-shadow: var(--shadow); }
.tm-q b { display: block; font-size: .95rem; } .tm-q small { color: var(--ink-2); font-size: .76rem; }
.tm-resume { margin-bottom: 12px; }
.tm-topics { display: grid; gap: 8px; }
.tm-topic { display: flex; gap: 12px; align-items: center; text-decoration: none; background: var(--surface); border-radius: 16px; padding: 12px 14px; box-shadow: var(--shadow); }
.tm-tn { flex: none; width: 34px; height: 34px; border-radius: 11px; display: grid; place-items: center; background: color-mix(in srgb, var(--accent) 13%, transparent); color: var(--accent); font-weight: 700; font-size: .9rem; }
.tm-tt { flex: 1; min-width: 0; } .tm-tt b { display: block; font-size: .93rem; line-height: 1.3; } .tm-tt small { color: var(--ink-2); font-size: .76rem; }
.tm-tt .progress { margin-top: 6px; }
.tm-lbl { font-size: .82rem; font-weight: 700; color: var(--ink-2); margin: 16px 0 8px; }
.tm-lbl small { font-weight: 500; }
.tm-range { display: flex; align-items: center; gap: 8px; color: var(--ink-2); font-size: .9rem; }
.tm-range input, .tm-sel, .tm-f input, .tm-f textarea { font: inherit; color: var(--ink); background: var(--surface); border: 1.5px solid var(--line); border-radius: 12px; padding: 10px 12px; }
.tm-range input { width: 86px; text-align: center; }
.tm-sel { width: 100%; }
.tm-f { display: grid; gap: 6px; font-weight: 600; font-size: .9rem; margin: 10px 0; }
.tm-f input, .tm-f textarea { width: 100%; font-weight: 400; }
.tm-f textarea { resize: vertical; min-height: 150px; line-height: 1.45; }
.tm-range input:focus, .tm-sel:focus, .tm-f input:focus, .tm-f textarea:focus { outline: none; border-color: var(--accent); }
.tm-err { color: var(--bad); font-size: .84rem; margin: 6px 0 0; }
.tm-errs { color: var(--bad); font-size: .82rem; padding-left: 18px; margin: 8px 0; }
.tm-sw { display: flex; align-items: center; gap: 10px; padding: 9px 0; cursor: pointer; font-size: .93rem; }
.tm-sw input { width: 20px; height: 20px; accent-color: var(--accent); flex: none; }
.tm-pick { max-height: 48vh; overflow: auto; margin: 8px 0; }
.tm-start { position: sticky; bottom: calc(76px + var(--safe-b)); display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 20px; padding: 12px 14px; background: var(--surface); border-radius: 18px; box-shadow: var(--shadow); border: 1px solid var(--line); z-index: 4; }
.tm-cnt { font-size: .88rem; color: var(--ink-2); }
.tm-cnt b { color: var(--ink); }
.tm-run { max-width: 720px; margin: 0 auto; }
.tm-top { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; flex-wrap: wrap; }
.tm-top .btn { padding: 7px 11px; min-height: 0; font-size: .88rem; }
.tm-top .btn.star { padding: 5px 11px; }
.tm-sp { flex: 1; }
.tm-prog { font-weight: 700; }
.tm-sc i { font-style: normal; font-weight: 700; font-size: .85rem; padding: 2px 8px; border-radius: 8px; margin-right: 4px; }
.tm-sc .g { background: color-mix(in srgb, var(--ok) 16%, transparent); color: var(--ok); }
.tm-sc .r { background: color-mix(in srgb, var(--bad) 14%, transparent); color: var(--bad); }
.tm-timer { font-variant-numeric: tabular-nums; font-weight: 700; background: var(--surface-2); padding: 4px 10px; border-radius: 10px; }
.tm-timer.low { background: color-mix(in srgb, var(--bad) 16%, transparent); color: var(--bad); animation: tmPulse 1s ease infinite; }
@keyframes tmPulse { 50% { opacity: .55; } }
.tm-bar { margin: 0 0 12px; }
.tm-card { padding: 16px; }
.tm-qn { margin: 0 0 6px; font-size: .8rem; color: var(--ink-2); font-weight: 600; }
.tm-multi { color: var(--accent); }
.tm-opts { display: flex; flex-direction: column; gap: 8px; }
.tm-opt { display: flex; gap: 10px; align-items: flex-start; text-align: left; border: 1.5px solid var(--line); background: var(--bg); padding: 11px 12px; border-radius: 14px; cursor: pointer; line-height: 1.4; transition: background .18s ease, border-color .18s ease, transform .12s ease; }
.tm-opt:active:not(:disabled) { transform: scale(.985); }
.tm-opt:disabled { cursor: default; }
.tm-l { flex: none; width: 26px; height: 26px; border-radius: 9px; display: grid; place-items: center; font-weight: 700; font-size: .8rem; background: var(--surface-2); color: var(--ink-2); }
.tm-ot { padding-top: 2px; }
.tm-opt.picked { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 11%, transparent); }
.tm-opt.picked .tm-l { background: var(--accent); color: var(--on-accent); }
.tm-opt.right { border-color: var(--ok); background: color-mix(in srgb, var(--ok) 14%, transparent); }
.tm-opt.right .tm-l { background: var(--ok); color: #fff; }
.tm-opt.wrong { border-color: var(--bad); background: color-mix(in srgb, var(--bad) 12%, transparent); }
.tm-opt.wrong .tm-l { background: var(--bad); color: #fff; }
.tm-fb { margin-top: 14px; }
.tm-fb.ok { background: color-mix(in srgb, var(--ok) 14%, transparent); }
.tm-fb.no { background: color-mix(in srgb, var(--bad) 12%, transparent); }
.tm-nav { display: flex; gap: 8px; margin-top: 14px; }
.tm-nav .btn { flex: 1; justify-content: center; }
.tm-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(44px, 1fr)); gap: 6px; margin: 10px 0 14px; max-height: 34vh; overflow: auto; }
.tm-grid button { border: 1.5px solid var(--line); background: var(--bg); border-radius: 10px; padding: 8px 0; font-weight: 600; cursor: pointer; }
.tm-grid button.ans { background: color-mix(in srgb, var(--accent) 16%, transparent); border-color: var(--accent); }
.tm-grid button.cur { outline: 2px solid var(--ink); }
.tm-res { text-align: center; max-width: 560px; margin: 0 auto; }
.tm-ring { display: flex; justify-content: center; margin: 8px 0; }
.tm-msg { margin: 6px 0 14px; }
.tm-acts { display: flex; flex-direction: column; gap: 8px; margin-top: 14px; }
.tm-acts .btn { justify-content: center; text-decoration: none; text-align: center; }
#ansList { text-align: left; margin-top: 14px; }
.tm-ans { background: var(--surface); border-radius: 14px; padding: 10px 12px; margin-bottom: 8px; box-shadow: var(--shadow); font-size: .93rem; }
.tm-ans summary { cursor: pointer; }
.tm-ans.ok summary b { color: var(--ok); } .tm-ans.no summary b { color: var(--bad); }
.tm-al { margin-top: 8px; display: grid; gap: 4px; font-size: .9rem; }
.tm-al .right { color: var(--ok); font-weight: 600; } .tm-al .wrong { color: var(--bad); }
.tm-chart { display: flex; align-items: flex-end; gap: 4px; height: 120px; background: var(--surface); border-radius: 16px; padding: 12px 10px 6px; box-shadow: var(--shadow); }
.tm-col { flex: 1; height: 100%; display: flex; flex-direction: column; justify-content: flex-end; align-items: center; gap: 4px; }
.tm-col i { width: 100%; max-width: 18px; border-radius: 5px 5px 2px 2px; background: linear-gradient(180deg, var(--accent-2), var(--accent)); }
.tm-col small { font-size: .62rem; color: var(--ink-2); }
.tm-trow { display: grid; grid-template-columns: 1fr 84px 38px; gap: 8px; align-items: center; font-size: .8rem; padding: 5px 0; }
.tm-trow small { color: var(--ink-2); text-align: right; }
.tm-tbar { position: relative; height: 8px; border-radius: 4px; background: var(--surface-2); overflow: hidden; }
.tm-tbar i { position: absolute; left: 0; top: 0; bottom: 0; border-radius: 4px; }
.tm-tbar .a { background: color-mix(in srgb, var(--accent) 35%, transparent); } .tm-tbar .o { background: var(--accent); }
.tm-legend { display: flex; gap: 14px; font-size: .78rem; color: var(--ink-2); margin-bottom: 6px; }
.tm-legend i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 4px; background: var(--accent); }
.tm-legend span:first-child i { background: color-mix(in srgb, var(--accent) 35%, transparent); }
.tm-ttl { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; line-height: 1.3; }

/* ===== Akkaunt ===== */
.acc-dot { width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; background: linear-gradient(135deg, var(--accent-2), var(--accent)); color: var(--on-accent); font-weight: 700; font-size: .9rem; }
.acc-card { background: var(--surface); border-radius: var(--radius-lg); padding: 16px; box-shadow: var(--shadow); }
.acc-google { width: 100%; display: flex; align-items: center; justify-content: center; gap: 10px; padding: 13px; border-radius: 14px; border: 1.5px solid var(--line); background: #fff; color: #1f2937; font-weight: 600; font-size: 1rem; cursor: pointer; }
.acc-google:active { transform: scale(.98); }
.acc-or { display: flex; align-items: center; gap: 10px; color: var(--ink-2); font-size: .8rem; margin: 14px 0; }
.acc-or::before, .acc-or::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.acc-tg { display: flex; justify-content: center; min-height: 48px; align-items: center; }
.acc-me { display: flex; align-items: center; gap: 14px; margin: 4px 0 16px; }
.acc-av { flex: none; width: 64px; height: 64px; border-radius: 50%; overflow: hidden; display: grid; place-items: center; background: linear-gradient(135deg, var(--accent-2), var(--accent)); color: var(--on-accent); font-weight: 700; font-size: 1.6rem; }
.acc-av img { width: 100%; height: 100%; object-fit: cover; }

.acc-dot { overflow: hidden; }
.acc-dot img { width: 100%; height: 100%; object-fit: cover; }
.acc-av-btn { position: relative; border: 0; padding: 0; cursor: pointer; overflow: visible; }
.acc-av-btn img { border-radius: 50%; }
.acc-cam { position: absolute; right: -2px; bottom: -2px; width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center; background: var(--surface); color: var(--accent); border: 1px solid var(--line); box-shadow: 0 1px 4px rgba(0,0,0,.18); }

/* Menyu varag'i */
.more-list { display: grid; gap: 4px; margin: 8px 0 4px; }
.more-list a { display: flex; align-items: center; gap: 14px; padding: 9px 10px; border-radius: 14px; color: var(--ink); text-decoration: none; font-weight: 600; }
.more-list a:active { background: var(--surface-2); }
.more-list .mi { flex: none; width: 38px; height: 38px; border-radius: 12px; display: grid; place-items: center; background: color-mix(in srgb, var(--accent) 12%, transparent); color: var(--accent); overflow: hidden; }
.more-list .mi img { width: 100%; height: 100%; object-fit: cover; }
.more-list small { display: block; color: var(--ink-2); font-weight: 500; font-size: .8rem; }
/* O'qishdagi tezkor qidiruv */
.qs .seg { margin: 4px 0 10px; }
.qs-res { max-height: 52vh; overflow: auto; margin-top: 10px; }
.qs-res .gloss { margin-bottom: 8px; }

/* Profilni tahrirlash va rasm kesish */
.crop-wrap { width: 280px; height: 280px; margin: 12px auto; border-radius: 50%; overflow: hidden; background: var(--surface-2); box-shadow: 0 0 0 3px var(--accent); touch-action: none; }
.crop-wrap canvas { display: block; width: 100%; height: 100%; cursor: grab; touch-action: none; }
.sheet input[type="range"] { padding: 0; border: 0; background: none; accent-color: var(--accent); }
.pf-form { display: grid; gap: 12px; margin-top: 8px; max-height: 62vh; overflow: auto; }
.pf-form .field { margin: 0; }
.acc-info { margin: 2px 0 0; display: flex; flex-wrap: wrap; gap: 6px; }
.acc-info span { font-size: .8rem; padding: 3px 10px; border-radius: 999px; background: var(--surface-2); color: var(--ink-2); }
.more-list { max-height: 68vh; overflow: auto; }

/* ===== Ovozli xonalar ===== */
.rm-top { margin: 0 0 14px; }
.rm-top .btn { display: inline-flex; align-items: center; gap: 6px; }
.rm-list { display: grid; gap: 10px; }
.rm-card { display: flex; align-items: center; gap: 12px; padding: 14px; border-radius: 18px; background: var(--surface); border: 1px solid var(--line); text-decoration: none; color: var(--ink); }
.rm-card:active { transform: scale(.99); }
.rm-ico { flex: none; width: 46px; height: 46px; border-radius: 14px; display: grid; place-items: center; background: color-mix(in srgb, var(--accent) 14%, transparent); color: var(--accent); }
.rm-ico.maruza { background: color-mix(in srgb, #7b5cd6 16%, transparent); color: #7b5cd6; }
.rm-ico.big { width: 72px; height: 72px; border-radius: 22px; margin: 0 auto 10px; }
.rm-txt { flex: 1; min-width: 0; display: grid; gap: 2px; }
.rm-txt b { font-size: 1rem; }
.rm-txt small { font-size: .82rem; overflow: hidden; text-overflow: ellipsis; }
.rm-lock { display: inline-flex; vertical-align: -2px; color: var(--ink-2); }
.rm-cnt { flex: none; font-size: .8rem; font-weight: 700; padding: 4px 10px; border-radius: 999px; background: var(--surface-2); color: var(--ink-2); }
.rm-cnt.on { background: color-mix(in srgb, var(--accent) 16%, transparent); color: var(--accent); }
.rm-pre { text-align: center; max-width: 460px; margin: 10px auto; }
.rm-pre h2 { margin: 0 0 4px; }
.rm-rules { text-align: left; color: var(--ink-2); padding-left: 18px; margin: 14px 0 18px; }
.rm-rules li { margin: 4px 0; }
.rm-join { width: 100%; justify-content: center; display: inline-flex; gap: 8px; align-items: center; padding: 14px; font-size: 1rem; }
.rm-head { margin: 0 0 12px; }
.rm-head h2 { margin: 0; }
.rm-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 10px; margin-bottom: 12px; }
.rm-grid.small { grid-template-columns: repeat(auto-fill, minmax(80px, 1fr)); }
.rm-grid.small .rm-av { width: 48px !important; height: 48px !important; font-size: 1.1rem; }
.rm-p { border: 0; background: none; padding: 6px 2px; display: grid; justify-items: center; gap: 4px; cursor: pointer; color: var(--ink); text-align: center; min-width: 0; }
.rm-pav { position: relative; }
.rm-av { border-radius: 50%; overflow: hidden; display: grid; place-items: center; background: linear-gradient(135deg, var(--accent-2), var(--accent)); color: var(--on-accent); font-weight: 700; font-size: 1.5rem; box-shadow: 0 0 0 3px transparent; transition: box-shadow .15s ease; }
.rm-av img { width: 100%; height: 100%; object-fit: cover; }
.rm-p.talk .rm-av { box-shadow: 0 0 0 3px var(--accent), 0 0 0 7px color-mix(in srgb, var(--accent) 25%, transparent); }
.rm-badge { position: absolute; width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; background: var(--surface); border: 1px solid var(--line); font-size: 12px; }
.rm-badge.crown { top: -4px; left: -4px; color: #d49a0b; }
.rm-badge.hand { top: -4px; right: -4px; }
.rm-badge.mute { bottom: -2px; right: -2px; color: var(--bad, #d33); }
.rm-pn { font-size: .82rem; font-weight: 600; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rm-ps { font-size: .7rem; color: var(--ink-2); max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rm-bar { position: sticky; bottom: calc(76px + var(--safe-b)); display: flex; gap: 8px; justify-content: center; padding: 10px; margin-top: 16px; border-radius: 22px; background: var(--surface); border: 1px solid var(--line); box-shadow: 0 8px 28px rgba(0,0,0,.12); }
.rm-btn { flex: 1; max-width: 120px; border: 0; background: var(--surface-2); color: var(--ink); border-radius: 16px; padding: 10px 6px; display: grid; justify-items: center; gap: 4px; font: inherit; font-size: .74rem; font-weight: 600; cursor: pointer; }
.rm-btn.on { background: var(--accent); color: var(--on-accent); }
.rm-btn.danger { color: var(--bad, #d33); }
.rm-person { text-align: center; display: grid; justify-items: center; gap: 4px; margin-bottom: 6px; }
.rm-person h3 { margin: 6px 0 0; }
.rm-person p { margin: 0; }
.rm-act { display: flex; align-items: center; gap: 12px; width: 100%; border: 0; background: none; padding: 12px 10px; border-radius: 14px; font: inherit; font-weight: 600; color: var(--ink); cursor: pointer; text-align: left; }
.rm-act:active { background: var(--surface-2); }
.rm-act.danger { color: var(--bad, #d33); }
.rm-reps { max-height: 60vh; overflow: auto; display: grid; gap: 8px; }
.rm-rep { padding: 10px; border-radius: 12px; background: var(--bg); }
.rm-rep p { margin: 4px 0 0; }
@media (min-width: 900px) { .rm-bar { bottom: 16px; } }

/* Konsilium: yorliqlar, yozishma, ekran */
.rm-tabs { margin: 0 0 12px; }
.rm-unread { display: inline-grid; place-items: center; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px; background: var(--accent); color: var(--on-accent); font-size: .7rem; margin-left: 4px; }
.rm-body[data-tab="people"] .rm-chatpane { display: none; }
.rm-body[data-tab="chat"] #rmPeople { display: none; }
.rm-chatpane { display: flex; flex-direction: column; gap: 8px; }
.rm-msgs { height: min(52vh, 460px); overflow: auto; display: grid; align-content: start; gap: 8px; padding: 10px; border-radius: 16px; background: var(--surface); border: 1px solid var(--line); }
.rm-msg { display: flex; gap: 8px; align-items: flex-end; max-width: 88%; }
.rm-msg .rm-av { flex: none; font-size: .8rem; }
.rm-msg.me { margin-left: auto; flex-direction: row-reverse; }
.rm-bub { background: var(--surface-2); border-radius: 14px 14px 14px 4px; padding: 6px 10px; min-width: 0; }
.rm-msg.me .rm-bub { background: color-mix(in srgb, var(--accent) 16%, var(--surface)); border-radius: 14px 14px 4px 14px; }
.rm-bub small { display: block; font-size: .7rem; color: var(--ink-2); }
.rm-bub p { margin: 2px 0 0; overflow-wrap: anywhere; white-space: pre-wrap; }
.rm-send { display: flex; gap: 8px; }
.rm-send input { flex: 1; min-width: 0; font: inherit; color: var(--ink); background: var(--surface); border: 1.5px solid var(--line); border-radius: 14px; padding: 11px 12px; }
.rm-send input:focus { outline: none; border-color: var(--accent); }
.rm-send .btn { display: grid; place-items: center; padding: 0 14px; }
.rm-stage { margin: 0 0 12px; border-radius: 18px; overflow: hidden; background: #000; border: 1px solid var(--line); }
.rm-stage-v { background: #000; display: grid; place-items: center; }
.rm-stage-v video { width: 100%; max-height: 62vh; object-fit: contain; display: block; }
.rm-stage-bar { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 8px 10px; background: var(--surface); }
.rm-stage-bar .small { display: inline-flex; align-items: center; gap: 6px; }
.rm-stage-acts { display: flex; gap: 6px; }
.rm-stage-acts .btn { padding: 6px 10px; display: inline-flex; align-items: center; }
.rm-badge.shield { top: -4px; left: -4px; color: var(--accent); }
.rm-badge.scr { bottom: -2px; left: -2px; color: var(--accent); }
.rm-shot { width: 100%; border-radius: 12px; border: 1px solid var(--line); margin: 6px 0; }
.rm-terms { margin: 10px 0 0; max-height: 40vh; overflow: auto; }
.rm-rep.auto { border-left: 3px solid var(--bad, #d33); }
.rm-bar { flex-wrap: wrap; }
@media (min-width: 900px) {
  .rm-tabs { display: none; }
  .rm-body { display: grid; grid-template-columns: 1fr 360px; gap: 16px; align-items: start; }
  .rm-body[data-tab] .rm-chatpane, .rm-body[data-tab] #rmPeople { display: flex; }
  .rm-body #rmPeople { display: block !important; }
  .rm-msgs { height: 56vh; }
}

/* Konsilium: so'rovlar, kichik panel */
.rm-reqs { display: grid; gap: 8px; padding: 10px; margin-bottom: 12px; border-radius: 16px; background: color-mix(in srgb, var(--accent) 10%, var(--surface)); border: 1px solid color-mix(in srgb, var(--accent) 30%, transparent); }
.rm-req { display: flex; align-items: center; gap: 10px; }
.rm-req > span:not(.rm-av) { flex: 1; min-width: 0; font-weight: 600; font-size: .9rem; }
.rm-req small { display: block; font-weight: 500; color: var(--ink-2); font-size: .78rem; }
.rm-req .btn { padding: 7px 12px; }
.rm-req .rm-av { font-size: .8rem; }
.rm-mini { position: fixed; z-index: 55; left: 10px; right: 10px; bottom: calc(74px + var(--safe-b)); display: flex; align-items: center; gap: 6px; padding: 8px; border-radius: 18px; background: var(--surface); border: 1px solid var(--line); box-shadow: 0 10px 30px rgba(0,0,0,.18); animation: fadeIn .2s ease both; }
.rm-mini-main { flex: 1; min-width: 0; display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--ink); }
.rm-mini-dot { flex: none; width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; background: color-mix(in srgb, var(--accent) 14%, transparent); color: var(--accent); }
.rm-mini-dot.on .rm-av { box-shadow: 0 0 0 3px var(--accent); }
.rm-mini-t { min-width: 0; display: grid; }
.rm-mini-t b { font-size: .88rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rm-mini-t small { font-size: .75rem; color: var(--ink-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rm-mini-b { flex: none; width: 40px; height: 40px; border: 0; border-radius: 12px; display: grid; place-items: center; background: var(--surface-2); color: var(--ink); cursor: pointer; }
.rm-mini-b.on { background: var(--accent); color: var(--on-accent); }
.rm-mini-b.danger { color: var(--bad, #d33); }
@media (min-width: 900px) { .rm-mini { left: auto; right: 20px; bottom: 20px; width: 380px; } }

.rm-hist { width: 100%; text-align: left; font: inherit; cursor: pointer; }
.rm-trans { height: auto; max-height: 50vh; }

/* Sozlamalar: ixcham profil */
.acc-sec { margin-bottom: 14px; }
.acc-sec .acc-me { margin: 0 0 10px; gap: 12px; }
.acc-sec .acc-av { width: 54px; height: 54px; font-size: 1.3rem; }
.acc-sec .acc-me h2 { font-size: 1.12rem; }
.acc-sec .acc-card { padding: 10px 12px; }
.acc-sync { display: flex; align-items: center; justify-content: space-between; gap: 10px; font-size: .84rem; color: var(--ink-2); padding: 8px 0 0; border-top: 1px solid var(--line); }
.acc-sync .btn { padding: 6px 12px; font-size: .82rem; }
.acc-more { margin-top: 10px; }
.acc-more summary { cursor: pointer; font-weight: 600; font-size: .9rem; color: var(--ink-2); list-style: none; }
.acc-more summary::-webkit-details-marker { display: none; }
.acc-more summary::after { content: " ›"; }
.acc-more[open] summary::after { content: " ⌄"; }
.acc-more .tm-acts { margin-top: 10px; }
.acc-login h3 { margin: 0 0 4px; font-size: 1rem; }
.acc-edit { margin-left: auto; flex: none; }
.rm-alone { margin: 0 0 12px; padding: 10px 12px; border-radius: 14px; background: color-mix(in srgb, #e0a100 14%, var(--surface)); border: 1px solid color-mix(in srgb, #e0a100 35%, transparent); }
.rm-btn.rec, .rm-mini-b.rec { background: #d93838; color: #fff; }
.rm-badge.recb { top: 40%; right: -8px; color: #d93838; font-size: 14px; line-height: 1; }

/* ---------- v1.0: kirish ekrani (hisobsiz kirib bo'lmaydi) ---------- */
body.gated { padding: 0 !important; }
body.gated .topbar, body.gated .tabbar, body.gated .read-progress, body.gated .to-top, body.gated .hl-btn, body.gated #rmMini { display: none !important; }
body.gated #view { max-width: none; padding: 0; }
.gate { min-height: 100vh; min-height: 100dvh; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 22px; padding: calc(32px + var(--safe-t)) 18px calc(28px + var(--safe-b));
  background: radial-gradient(110% 70% at 15% 0%, color-mix(in srgb, var(--accent-2) 22%, transparent) 0%, transparent 60%), var(--bg); }
.gate > * { width: 100%; max-width: 440px; }
.gate-hero { text-align: center; }
.gate-hero img { border-radius: 20px; box-shadow: 0 12px 34px rgba(12, 122, 100, .28); }
.gate-hero h1 { font: 800 2rem/1.1 var(--font-head); margin: 14px 0 6px; letter-spacing: -.5px; }
.gate-hero h1 b { color: var(--accent); }
.gate-hero p { margin: 0; color: var(--ink-2); }
.gate-feat { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.gate-feat li { display: flex; gap: 10px; align-items: flex-start; background: var(--surface); border: 1px solid var(--line); border-radius: 16px; padding: 12px; }
.gate-feat .gi { flex: none; display: grid; place-items: center; width: 36px; height: 36px; border-radius: 11px; background: color-mix(in srgb, var(--accent) 14%, transparent); color: var(--accent); }
.gate-feat b { display: block; font-size: .92rem; line-height: 1.25; }
.gate-feat small { display: block; color: var(--ink-2); font-size: .78rem; line-height: 1.3; margin-top: 2px; }
.gate-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg); padding: 20px; box-shadow: var(--shadow); text-align: center; }
.gate-card h2 { font: 700 1.2rem/1.25 var(--font-head); margin: 0 0 6px; }
.gate-card > p { margin: 0 0 14px; }
.gate-card .acc-google { margin: 0 auto; }
.gate-legal { text-align: center; margin: 0; }
.gate-legal a { color: var(--accent); }
@media (min-width: 900px) { .gate > * { max-width: 520px; } .gate-hero h1 { font-size: 2.4rem; } }

/* ---------- Statistika (admin) ---------- */
.ad-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.ad-tile { background: var(--surface); border: 1px solid var(--line); border-radius: 16px; padding: 14px; display: flex; flex-direction: column; gap: 2px; }
.ad-tile b { font: 800 1.6rem/1.1 var(--font-head); letter-spacing: -.5px; }
.ad-tile span { font-size: .88rem; font-weight: 600; }
.ad-tile small { color: var(--ink-2); font-size: .76rem; }
.ad-card { background: var(--surface); border: 1px solid var(--line); border-radius: 18px; padding: 16px; margin-top: 10px; }
.ad-card h3 { font: 700 .95rem/1.2 var(--font-head); margin: 0 0 12px; }
.ad-cols { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 10px; }
.ad-cols .ad-card { margin-top: 0; }
.ad-bar { display: grid; grid-template-columns: minmax(70px, 38%) 1fr auto; gap: 10px; align-items: center; font-size: .86rem; padding: 4px 0; }
.ad-bl { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ad-bn { font-weight: 700; font-variant-numeric: tabular-nums; }
.ad-bn small { color: var(--ink-2); font-weight: 500; }
.ad-bt { display: block; height: 8px; border-radius: 6px; background: var(--surface-2); overflow: hidden; }
.ad-bt i { display: block; height: 100%; border-radius: 6px; background: var(--accent); }
.ad-bt.big { height: 12px; margin: 6px 0 4px; }
.ad-bt.warn i { background: #d9822b; }
.ad-chart { display: block; width: 100%; height: 150px; }
.ad-c-act { fill: color-mix(in srgb, var(--accent) 35%, transparent); background: color-mix(in srgb, var(--accent) 35%, transparent); }
.ad-c-new { fill: var(--accent); background: var(--accent); }
.ad-axis { display: flex; justify-content: space-between; margin-top: 4px; }
.ad-legend { display: flex; gap: 16px; margin-top: 8px; color: var(--ink-2); }
.ad-legend i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 6px; vertical-align: -1px; }
.ad-lim { margin-bottom: 14px; }
.ad-lim-h { display: flex; justify-content: space-between; gap: 10px; font-size: .9rem; }
.ad-lim-h span { font-variant-numeric: tabular-nums; color: var(--ink-2); }
.ad-links p { margin: 6px 0 0; }
.ad-links a { color: var(--accent); }
.ad-tbl-wrap { overflow-x: auto; padding: 6px 10px; }
.ad-tbl { width: 100%; border-collapse: collapse; font-size: .85rem; min-width: 520px; }
.ad-tbl th { text-align: left; color: var(--ink-2); font-weight: 600; padding: 8px 6px; border-bottom: 1px solid var(--line); }
.ad-tbl td { padding: 9px 6px; border-bottom: 1px solid var(--line); vertical-align: top; }
.ad-tbl tr:last-child td { border-bottom: 0; }
.ad-tbl td small { display: block; color: var(--ink-2); }
.hello #adRe { margin-left: 8px; padding: 4px 12px; font-size: .8rem; vertical-align: middle; }

/* Email + parol bilan kirish */
.acc-pw { display: grid; gap: 10px; text-align: left; }
.acc-pw .field { display: grid; gap: 6px; font-weight: 600; font-size: .9rem; margin: 0; }
.acc-pw input { font: inherit; color: var(--ink); background: var(--bg); border: 1.5px solid var(--line); border-radius: 12px; padding: 12px; width: 100%; }
.acc-pw input:focus { outline: none; border-color: var(--accent); }
.acc-pw .acc-pw-go { width: 100%; padding: 13px; border-radius: 14px; font-size: 1rem; font-weight: 600; }
.acc-pw-links { display: flex; justify-content: space-between; gap: 10px; font-size: .88rem; }
.acc-pw-links a { color: var(--accent); text-decoration: none; font-weight: 600; }

/* Qurilmalar va til tanlash */
.acc-devs { display: grid; gap: 8px; margin: 12px 0; }
.acc-dev { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 10px 12px; border: 1.5px solid var(--line); border-radius: 12px; }
.acc-dev span { display: grid; gap: 2px; min-width: 0; }
.acc-dev small { color: var(--ink-2); }
.acc-langs { display: grid; gap: 10px; margin-top: 12px; }
.acc-langs .btn { width: 100%; padding: 14px; font-size: 1rem; border-radius: 14px; }
