:root {
  --bg: #f4f6f9; --surface: #ffffff; --surface2: #f0f3f7; --text: #18212d; --muted: #5b6878;
  --primary: #1b5fd6; --primary-text: #ffffff; --primary-soft: #e6efff; --border: #d9e0e8;
  --ok: #17803d; --ok-soft: #e1f5e8; --warn: #9a5b00; --warn-soft: #fff1d6; --bad: #bf2f25; --bad-soft: #fde7e5;
  --shadow: 0 1px 2px rgba(20, 30, 50, .06), 0 4px 14px rgba(20, 30, 50, .05);
  --radius: 12px; color-scheme: light;
}
:root[data-theme="dark"] {
  --bg: #0e151e; --surface: #16202d; --surface2: #1d2a3a; --text: #e7edf5; --muted: #98a6b8;
  --primary: #5b95ff; --primary-text: #08111f; --primary-soft: #1a2c4a; --border: #28374b;
  --ok: #4cc27a; --ok-soft: #12301e; --warn: #f0b24d; --warn-soft: #382b10; --bad: #ff8078; --bad-soft: #3a1815;
  --shadow: 0 1px 2px rgba(0, 0, 0, .4); color-scheme: dark;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--text); font: 16px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; }
h1 { font-size: 1.45rem; margin: 0 0 14px; } h2 { font-size: 1.08rem; margin: 0 0 12px; } h3 { font-size: 1rem; margin: 14px 0 8px; }
a { color: var(--primary); }
.muted { color: var(--muted); } small { color: var(--muted); }
[hidden] { display: none !important; }
.sr { position: absolute; left: -9999px; }

/* ---------- yuqori panel ---------- */
.topbar { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 6px; padding: 6px max(12px, env(safe-area-inset-right)) 6px max(12px, env(safe-area-inset-left)); background: var(--surface); border-bottom: 1px solid var(--border); }
.brand { font-weight: 700; color: var(--primary); white-space: nowrap; text-decoration: none; }
.spacer { flex: 1; }
.who { color: var(--muted); font-size: 13px; white-space: nowrap; }
main { padding: 16px; max-width: 1080px; margin: 0 auto; outline: none; }

/* ---------- komponentlar ---------- */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 18px; margin-bottom: 16px; box-shadow: var(--shadow); }
.narrow { max-width: 400px; margin: 40px auto; }
.grid { display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); margin-bottom: 16px; }
.grid.two { grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); }
.stat { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 14px 16px; box-shadow: var(--shadow); }
.stat-v { font-size: 1.55rem; font-weight: 700; line-height: 1.2; } .stat-l { color: var(--muted); font-size: 14px; } .stat-s { font-size: 13px; margin-top: 4px; color: var(--muted); }
.stat.ok .stat-v { color: var(--ok); } .stat.bad .stat-v { color: var(--bad); } .stat.warn .stat-v { color: var(--warn); }
.row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-bottom: 12px; }
.row.end { justify-content: flex-end; } .row.between { justify-content: space-between; }
.btn { min-height: 44px; padding: 0 18px; font: inherit; font-size: 15px; cursor: pointer; border: 1px solid transparent; border-radius: 10px; background: var(--primary); color: var(--primary-text); }
.btn:hover:not(:disabled) { filter: brightness(1.07); }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn.ghost { background: transparent; color: var(--text); border-color: var(--border); }
.btn.danger { background: var(--bad); color: #fff; }
.btn.ok { background: var(--ok); color: #fff; }
.btn.sm { min-height: 34px; padding: 0 12px; font-size: 14px; }
.btn:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible, a:focus-visible, .tab:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }
.field { display: block; margin-bottom: 12px; }
.field .lbl { display: block; font-size: 14px; color: var(--muted); margin-bottom: 4px; }
input, select, textarea { width: 100%; padding: 11px 12px; font: inherit; font-size: 16px; color: var(--text); background: var(--bg); border: 1px solid var(--border); border-radius: 10px; }
textarea { min-height: 110px; resize: vertical; }
input[type="checkbox"], input[type="radio"] { width: 20px; height: 20px; padding: 0; accent-color: var(--primary); flex: none; }
.inline { display: flex; gap: 8px; align-items: center; } .inline > input[type="text"], .inline > input:not([type]) { flex: 1; }
.error { color: var(--bad); margin: 8px 0; font-size: 14px; }
.badge { display: inline-block; padding: 2px 10px; border-radius: 999px; font-size: 12px; font-weight: 600; background: var(--surface2); color: var(--muted); white-space: nowrap; }
.badge.ok { background: var(--ok-soft); color: var(--ok); } .badge.warn { background: var(--warn-soft); color: var(--warn); } .badge.bad { background: var(--bad-soft); color: var(--bad); }
.table-wrap { overflow-x: auto; margin-bottom: 8px; }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th { text-align: left; color: var(--muted); font-weight: 600; padding: 8px 10px; border-bottom: 1px solid var(--border); white-space: nowrap; }
td { padding: 9px 10px; border-bottom: 1px solid var(--border); vertical-align: middle; }
tr:last-child td { border-bottom: 0; }
td .btn { margin: 2px 4px 2px 0; }
.pager { display: flex; align-items: center; gap: 12px; justify-content: center; margin-top: 10px; }
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--border); margin-bottom: 14px; overflow-x: auto; }
.tab { background: none; border: 0; border-bottom: 3px solid transparent; padding: 10px 14px; font: inherit; cursor: pointer; color: var(--muted); white-space: nowrap; }
.tab.active { color: var(--primary); border-bottom-color: var(--primary); font-weight: 600; }
.list { list-style: none; padding: 0; margin: 0; display: grid; gap: 8px; }
.item { padding: 12px 14px; border: 1px solid var(--border); border-radius: 10px; background: var(--surface); }
.item h3 { margin: 0 0 4px; }
.bar { height: 8px; border-radius: 99px; background: var(--surface2); overflow: hidden; } .bar > span { display: block; height: 100%; background: var(--primary); }
.bell { position: relative; } .bell .dot { position: absolute; top: -4px; right: -4px; background: var(--bad); color: #fff; font-size: 11px; min-width: 18px; height: 18px; line-height: 18px; border-radius: 99px; text-align: center; padding: 0 4px; }
.pre { white-space: pre-wrap; word-break: break-word; }

/* ---------- modal / toast ---------- */
.backdrop { position: fixed; inset: 0; z-index: 50; background: rgba(8, 14, 24, .55); display: flex; align-items: flex-start; justify-content: center; padding: 4vh 12px; overflow-y: auto; }
.modal { background: var(--surface); border-radius: 14px; width: 100%; max-width: 520px; box-shadow: 0 20px 60px rgba(0, 0, 0, .35); border: 1px solid var(--border); }
.modal.wide { max-width: 860px; }
.modal-head { display: flex; justify-content: space-between; align-items: center; padding: 14px 18px; border-bottom: 1px solid var(--border); } .modal-head h2 { margin: 0; }
.modal-body { padding: 16px 18px; max-height: 70vh; overflow-y: auto; }
.modal .error { padding: 0 18px; }
.modal-foot { display: flex; justify-content: flex-end; gap: 8px; padding: 12px 18px; border-top: 1px solid var(--border); flex-wrap: wrap; }
#toasts { position: fixed; z-index: 60; right: 12px; bottom: 12px; display: grid; gap: 8px; max-width: min(380px, calc(100vw - 24px)); }
.toast { background: var(--text); color: var(--bg); padding: 11px 14px; border-radius: 10px; box-shadow: var(--shadow); font-size: 14px; }
.toast.ok { background: var(--ok); color: #fff; } .toast.bad { background: var(--bad); color: #fff; }

/* ---------- imtihon ---------- */
.exam-head { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; justify-content: space-between; position: sticky; top: 53px; z-index: 10; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 10px 14px; margin-bottom: 14px; box-shadow: var(--shadow); }
.timer { font-variant-numeric: tabular-nums; font-size: 1.5rem; font-weight: 700; } .timer.low { color: var(--bad); }
.qnav { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 14px; }
.qnav button { width: 40px; height: 40px; border-radius: 8px; border: 1px solid var(--border); background: var(--surface); color: var(--text); font: inherit; cursor: pointer; position: relative; }
.qnav button.answered { background: var(--primary-soft); border-color: var(--primary); }
.qnav button.current { outline: 2px solid var(--primary); outline-offset: 1px; font-weight: 700; }
.qnav button.flagged::after { content: "⚑"; position: absolute; top: -6px; right: -3px; font-size: 12px; color: var(--warn); }
.qnav button.right { background: var(--ok-soft); border-color: var(--ok); } .qnav button.wrong { background: var(--bad-soft); border-color: var(--bad); }
.qtext { font-size: 1.15rem; margin: 0 0 14px; white-space: pre-wrap; }
.opts { display: grid; gap: 10px; }
.opt { display: flex; gap: 12px; align-items: flex-start; text-align: left; width: 100%; padding: 13px 14px; min-height: 52px; border: 2px solid var(--border); border-radius: 12px; background: var(--surface); color: var(--text); font: inherit; cursor: pointer; }
.opt:hover:not(:disabled) { border-color: var(--primary); }
.opt.sel { border-color: var(--primary); background: var(--primary-soft); }
.opt.right { border-color: var(--ok); background: var(--ok-soft); } .opt.wrong { border-color: var(--bad); background: var(--bad-soft); }
.opt .mark { flex: none; width: 26px; height: 26px; border-radius: 50%; border: 2px solid var(--border); display: grid; place-items: center; font-size: 13px; font-weight: 700; }
.opt.multi .mark { border-radius: 6px; }
.opt.sel .mark { background: var(--primary); border-color: var(--primary); color: var(--primary-text); }
.opt:disabled { cursor: default; }
.explain { margin-top: 12px; padding: 12px 14px; border-radius: 10px; background: var(--surface2); }
.score { font-size: 2.6rem; font-weight: 800; line-height: 1; }
.verdict { display: inline-block; padding: 6px 16px; border-radius: 99px; font-weight: 700; }
.verdict.ok { background: var(--ok-soft); color: var(--ok); } .verdict.bad { background: var(--bad-soft); color: var(--bad); }
.review .item { margin-bottom: 10px; }
.review .item.right { border-left: 5px solid var(--ok); } .review .item.wrong { border-left: 5px solid var(--bad); }
.review .rev-opt { padding: 6px 10px; border-radius: 8px; margin: 4px 0; }
.rev-opt.is-correct { background: var(--ok-soft); } .rev-opt.is-wrong { background: var(--bad-soft); }

@media (max-width: 640px) {
  main { padding: 12px; } .card { padding: 14px; } .topbar .who { display: none; }
  .exam-head { top: 49px; } .timer { font-size: 1.25rem; }
  td, th { padding: 8px 6px; } .modal-body { max-height: 66vh; }
}
@media (prefers-reduced-motion: no-preference) { .btn, .opt, .nav a { transition: background-color .15s, border-color .15s, filter .15s; } }
@media print { .topbar, .nav, .btn, .tabs { display: none !important; } body { background: #fff; } .card { box-shadow: none; } }

.media { display: block; max-width: 100%; max-height: 420px; border-radius: 10px; margin: 8px 0; background: var(--surface2); }
.media.small { max-height: 110px; max-width: 180px; }
.gallery { display: flex; flex-wrap: wrap; gap: 12px; align-items: flex-start; margin: 8px 0; }
.gallery .thumb { display: flex; flex-direction: column; gap: 6px; }
.picker { border: 1px dashed var(--border); border-radius: 10px; padding: 10px; }

.bar { height: 10px; background: var(--surface2); border-radius: 999px; overflow: hidden; margin-top: 6px; }
.bar span { display: block; height: 100%; background: var(--primary); }
.week { display: flex; gap: 8px; align-items: flex-end; margin: 12px 0; }
.week .day { flex: 1; text-align: center; display: flex; flex-direction: column; gap: 2px; }
.week .col { height: 60px; display: flex; align-items: flex-end; background: var(--surface2); border-radius: 6px; overflow: hidden; }
.week .col span { display: block; width: 100%; background: var(--primary); min-height: 2px; }
.signs { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; }
.sign { display: flex; flex-direction: column; gap: 6px; align-items: center; text-align: center; padding: 10px; background: var(--surface); border: 1px solid var(--border); border-radius: 12px; cursor: pointer; color: inherit; font: inherit; }
.sign .noimg { font-size: 40px; }
a.btn { display: inline-flex; align-items: center; text-decoration: none; }

/* ================= v1.1: ikonkali yuqori panel, ochiladigan menyu, mobil moslashuv ================= */
.icon-btn { position: relative; display: inline-grid; place-items: center; width: 44px; height: 44px; padding: 0; border: 0; border-radius: 12px; background: transparent; color: var(--text); cursor: pointer; -webkit-tap-highlight-color: transparent; }
.icon-btn:hover { background: var(--surface2); }
.icon-btn svg { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.icon-btn .dot { position: absolute; top: 3px; right: 2px; background: var(--bad); color: #fff; font-size: 11px; min-width: 18px; height: 18px; line-height: 18px; border-radius: 99px; text-align: center; padding: 0 4px; }
.vsep { width: 1px; height: 24px; background: var(--border); }
.ico-sun { display: none; } :root[data-theme="dark"] .ico-sun { display: block; } :root[data-theme="dark"] .ico-moon { display: none; }
.brand { overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.btn.block { display: flex; width: 100%; align-items: center; justify-content: center; }
.login-alt { margin-top: 18px; padding-top: 16px; border-top: 1px solid var(--border); display: grid; gap: 10px; text-align: center; }
.back-link { font-size: 14px; }

.drawer-backdrop { position: fixed; inset: 0; z-index: 40; background: rgba(8, 14, 24, .5); }
.drawer { position: fixed; z-index: 45; top: 0; bottom: 0; left: 0; width: min(320px, 86vw); display: flex; flex-direction: column; background: var(--surface); border-right: 1px solid var(--border);
  transform: translateX(-102%); visibility: hidden; transition: transform .22s ease, visibility .22s; padding-top: env(safe-area-inset-top); }
.drawer.open { transform: none; visibility: visible; box-shadow: 0 0 40px rgba(0, 0, 0, .3); }
.drawer-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 8px 8px 8px 16px; border-bottom: 1px solid var(--border); }
.drawer-head .who { color: var(--text); font-weight: 600; overflow: hidden; text-overflow: ellipsis; }
.drawer-nav { flex: 1; overflow-y: auto; padding: 8px; display: flex; flex-direction: column; gap: 2px; overscroll-behavior: contain; }
.drawer-nav a { display: flex; align-items: center; min-height: 48px; padding: 0 14px; border-radius: 12px; color: var(--text); text-decoration: none; font-size: 16px; }
.drawer-nav a:hover { background: var(--surface2); }
.drawer-nav a.active { background: var(--primary-soft); color: var(--primary); font-weight: 600; }
.drawer-foot { padding: 12px 16px calc(12px + env(safe-area-inset-bottom)); border-top: 1px solid var(--border); }
.drawer-foot .btn { width: 100%; }
body.drawer-open { overflow: hidden; }

/* test/imtihon paytida: yuqori panel yashirin, ekran to'liq tanlovga beriladi */
body.focus .topbar, body.focus .drawer, body.focus .drawer-backdrop { display: none; }
body.focus main { padding-top: 8px; }
body.focus .exam-head { top: 0; }
.timer-wrap { display: inline-flex; align-items: center; gap: 6px; padding: 4px 12px; border-radius: 999px; background: var(--primary-soft); color: var(--primary); }
.timer-wrap .timer { font-size: 1.35rem; min-width: 4.2ch; text-align: center; color: inherit; }
.timer-wrap:has(.timer.low) { background: var(--bad-soft); color: var(--bad); }
.exam-head { top: 53px; }
body.focus .exam-head { top: 0; box-shadow: var(--shadow); }

/* ---- mobil ---- */
@media (max-width: 640px) {
  body { font-size: 16px; }
  main { padding: 12px max(12px, env(safe-area-inset-right)) 28px max(12px, env(safe-area-inset-left)); }
  h1 { font-size: 1.3rem; }
  .btn { min-height: 46px; } .btn.sm { min-height: 40px; padding: 0 14px; }
  .row { gap: 8px; } .row > .btn, .row > a.btn { flex: 1 1 auto; justify-content: center; }
  .row > input, .row > select { flex: 1 1 100%; }
  .grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; } .grid.two { grid-template-columns: 1fr; }
  .stat { padding: 12px; } .stat-v { font-size: 1.3rem; }
  .narrow { margin: 16px auto; }
  .exam-head { gap: 8px; padding: 8px 10px; } .exam-head .btn { min-height: 40px; }
  .qnav { flex-wrap: nowrap; overflow-x: auto; padding-bottom: 6px; scrollbar-width: thin; } .qnav button { flex: none; width: 42px; height: 42px; }
  .opt { padding: 14px; } .qtext { font-size: 1.1rem; }
  /* jadval -> kartochka ko'rinishi */
  .table-wrap { overflow: visible; }
  table, thead, tbody, tr, td { display: block; width: 100%; }
  thead { position: absolute; left: -9999px; }
  tr { border: 1px solid var(--border); border-radius: 12px; padding: 6px 12px; margin-bottom: 10px; background: var(--surface); }
  td { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 7px 0; border-bottom: 1px dashed var(--border); text-align: right; word-break: break-word; }
  td:last-child { border-bottom: 0; }
  td::before { content: attr(data-label); flex: none; max-width: 42%; color: var(--muted); font-size: 13px; text-align: left; }
  td[data-label=""]::before, td:not([data-label])::before { content: none; }
  td > div { display: flex; flex-wrap: wrap; gap: 6px; justify-content: flex-end; }
  td .btn { margin: 0; }
  /* oynalar: pastdan chiquvchi varaq */
  .backdrop { padding: 0; align-items: flex-end; }
  .modal, .modal.wide { max-width: none; border-radius: 16px 16px 0 0; max-height: 94vh; display: flex; flex-direction: column; }
  .modal-body { max-height: none; flex: 1; overflow-y: auto; }
  .modal-foot { padding-bottom: calc(12px + env(safe-area-inset-bottom)); }
  .modal-foot .btn { flex: 1; }
  .tabs { scrollbar-width: none; }
  #toasts { left: 12px; right: 12px; bottom: calc(12px + env(safe-area-inset-bottom)); max-width: none; }
  .pager .btn { flex: 1; }
  .gallery .thumb { max-width: 100%; }
}
@media (max-width: 380px) { .brand { font-size: 15px; } .grid { grid-template-columns: 1fr; } }
@media print { .drawer, .drawer-backdrop { display: none !important; } }

/* ---------- boy matn ---------- */
.rt { line-height: 1.6; overflow-wrap: anywhere; }
.rt h1 { font-size: 1.5rem; margin: .8em 0 .4em; } .rt h2 { font-size: 1.25rem; margin: .8em 0 .4em; } .rt h3 { font-size: 1.1rem; margin: .8em 0 .4em; }
.rt p { margin: 0 0 .6em; } .rt ul, .rt ol { margin: 0 0 .6em; padding-left: 1.5em; } .rt blockquote { margin: 0 0 .6em; padding-left: 12px; border-left: 3px solid var(--border); color: var(--muted); }
.rt-c-red { color: #c62828; } .rt-c-orange { color: #e65100; } .rt-c-green { color: #2e7d32; } .rt-c-blue { color: #1565c0; } .rt-c-purple { color: #6a1b9a; } .rt-c-gray { color: #6b7280; }
:root[data-theme="dark"] .rt-c-red { color: #ff8a80; } :root[data-theme="dark"] .rt-c-orange { color: #ffb74d; } :root[data-theme="dark"] .rt-c-green { color: #81c784; }
:root[data-theme="dark"] .rt-c-blue { color: #90caf9; } :root[data-theme="dark"] .rt-c-purple { color: #ce93d8; } :root[data-theme="dark"] .rt-c-gray { color: #9ca3af; }
.rt-s-sm { font-size: .85em; } .rt-s-lg { font-size: 1.3em; } .rt-s-xl { font-size: 1.7em; }
.rt-wrap { border: 1px solid var(--border); border-radius: 10px; overflow: hidden; background: var(--surface); }
.rt-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; padding: 6px; background: var(--surface2); border-bottom: 1px solid var(--border); }
.rt-btn { min-width: 36px; min-height: 36px; padding: 0 8px; border: 1px solid var(--border); border-radius: 8px; background: var(--surface); color: var(--text); font: inherit; cursor: pointer; }
.rt-btn.b { font-weight: 800; } .rt-btn.i { font-style: italic; } .rt-btn.u { text-decoration: underline; }
.rt-select { width: auto; max-width: 140px; min-height: 36px; border: 1px solid var(--border); border-radius: 8px; background: var(--surface); color: var(--text); font: inherit; padding: 0 6px; }
.rt-group { display: inline-flex; gap: 4px; padding: 0 4px; }
.rt-swatch { width: 24px; height: 24px; border-radius: 50%; border: 2px solid var(--surface); box-shadow: 0 0 0 1px var(--border); cursor: pointer; padding: 0; background: #18212d; }
.rt-swatch[data-c="red"] { background: #c62828; } .rt-swatch[data-c="orange"] { background: #e65100; } .rt-swatch[data-c="green"] { background: #2e7d32; } .rt-swatch[data-c="blue"] { background: #1565c0; } .rt-swatch[data-c="purple"] { background: #6a1b9a; } .rt-swatch[data-c="gray"] { background: #6b7280; }
.rt-editor { padding: 12px; outline: none; max-height: 50vh; overflow: auto; background: var(--surface); color: var(--text); }
.rt-editor:focus { box-shadow: inset 0 0 0 2px var(--primary); }
/* ---------- reyting ---------- */
.lb { list-style: none; margin: 12px 0 0; padding: 0; display: grid; gap: 6px; }
.lb-row { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border: 1px solid var(--border); border-radius: 12px; background: var(--surface); }
.lb-row.me:not(.lb-r1):not(.lb-r2):not(.lb-r3):not(.lb-top10) { border-color: var(--primary); background: var(--primary-soft); }
.lb-rank { width: 2.2ch; min-width: 32px; text-align: center; font-weight: 800; font-variant-numeric: tabular-nums; }
.lb-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lb-pts { font-weight: 800; font-variant-numeric: tabular-nums; color: var(--primary); }
.seg { display: inline-flex; gap: 4px; } .seg .btn.on { background: var(--primary); color: var(--primary-text); border-color: var(--primary); }

/* ---------- avatar va profil ---------- */
.ava { display: inline-grid; place-items: center; flex: none; border-radius: 50%; overflow: hidden; background: var(--primary-soft); color: var(--primary); font-weight: 800; user-select: none; }
.ava img { width: 100%; height: 100%; object-fit: cover; display: block; }
.ava-sm { width: 28px; height: 28px; font-size: 11px; } .ava-md { width: 40px; height: 40px; font-size: 14px; } .ava-lg { width: 60px; height: 60px; font-size: 20px; } .ava-xl { width: 104px; height: 104px; font-size: 34px; }
.who-link { display: flex; align-items: center; gap: 10px; min-width: 0; text-decoration: none; color: inherit; border-radius: 12px; padding: 4px 6px; }
.who-link:hover, .who-link:focus-visible { background: var(--surface2); }
.who-text { display: grid; min-width: 0; line-height: 1.25; } .who-text strong, .who-text small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; } .who-text small { color: var(--muted); font-size: 12px; }
.profile-head { display: flex; align-items: center; gap: 20px; flex-wrap: wrap; } .profile-who { min-width: 0; display: grid; gap: 8px; } .profile-who h2 { margin: 0; overflow-wrap: anywhere; }
.profile-dl { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 12px 24px; margin: 0; }
.profile-dl div { border-bottom: 1px solid var(--border); padding-bottom: 8px; min-width: 0; } .profile-dl dt { font-size: 12px; color: var(--muted); } .profile-dl dd { margin: 2px 0 0; font-weight: 600; overflow-wrap: anywhere; }
.small { font-size: 13px; }

/* ---------- reyting: o'rinlarga qarab fon ---------- */
.lb-row { position: relative; overflow: hidden; }
.lb-row.me { outline: 2px solid var(--primary); outline-offset: -2px; }
.lb-name { display: grid; } .lb-name small { color: var(--muted); font-size: 12px; overflow: hidden; text-overflow: ellipsis; }
.lb-idle { font-size: 12px; font-weight: 700; color: var(--muted); white-space: nowrap; }
.lb-warn { margin-top: 10px; padding: 10px 12px; border-radius: 12px; background: #fff4e0; color: #7a4a00; font-weight: 600; }
:root[data-theme="dark"] .lb-warn { background: #3a2a10; color: #ffd28a; }
/* 4–10: tinted gradient */
.lb-top10 { border-color: transparent; border-left: 4px solid #6d8cff; background: linear-gradient(90deg, rgba(99, 132, 255, .16), rgba(168, 120, 255, .12) 60%, rgba(99, 132, 255, .05)); }
.lb-top10 .lb-rank { color: #4a63d6; } :root[data-theme="dark"] .lb-top10 .lb-rank { color: #9db2ff; }
/* 3: bronza */
.lb-r3 { border-color: transparent; color: #3a2008; background: linear-gradient(120deg, #ffd9b0, #f2a766 55%, #ffd2a3); box-shadow: 0 2px 10px rgba(214, 133, 61, .35); }
/* 2: kumush, oqib turuvchi yaltiroq */
.lb-r2 { border-color: transparent; color: #1e2a38; background: linear-gradient(110deg, #e9eef5, #ffffff 30%, #b5c3d4 55%, #ffffff 80%, #e9eef5); background-size: 250% 100%; animation: lb-flow 6s linear infinite; box-shadow: 0 3px 12px rgba(120, 140, 165, .45); }
.lb-r2::after { content: ""; position: absolute; inset: 0; background: linear-gradient(100deg, transparent 35%, rgba(255, 255, 255, .8) 50%, transparent 65%); transform: translateX(-120%); animation: lb-shine 4.5s ease-in-out infinite; pointer-events: none; }
/* 1: oltin, eng katta va eng jonli */
.lb-r1 { border-color: transparent; color: #3b2600; padding: 18px 16px; margin: 6px 0 8px; border-radius: 18px; gap: 16px; font-size: 1.12em;
  background: linear-gradient(110deg, #ffcf3f, #fff4b8 25%, #ffb300 50%, #fff4b8 75%, #ffcf3f); background-size: 300% 100%;
  animation: lb-flow 3.5s linear infinite, lb-glow 2.2s ease-in-out infinite; box-shadow: 0 6px 24px rgba(255, 179, 0, .55); }
.lb-r1::after { content: ""; position: absolute; inset: 0; background: linear-gradient(100deg, transparent 30%, rgba(255, 255, 255, .9) 50%, transparent 70%); transform: translateX(-120%); animation: lb-shine 2.6s ease-in-out infinite; pointer-events: none; }
.lb-r1::before { content: "✨"; position: absolute; right: 14px; top: 6px; font-size: 18px; animation: lb-twinkle 1.6s ease-in-out infinite; }
.lb-r1 .lb-rank { font-size: 1.9em; animation: lb-bob 1.8s ease-in-out infinite; }
.lb-r1 .lb-name strong { font-size: 1.12em; } .lb-r1 .lb-pts { font-size: 1.2em; }
.lb-r1 .ava { box-shadow: 0 0 0 3px #fff, 0 0 0 6px #ffb300; }
.lb-r1 .lb-pts, .lb-r2 .lb-pts, .lb-r3 .lb-pts { color: inherit; } .lb-r1 .lb-name small, .lb-r2 .lb-name small, .lb-r3 .lb-name small, .lb-r1 .lb-idle, .lb-r2 .lb-idle, .lb-r3 .lb-idle { color: inherit; opacity: .75; }
.lb-r1 .ava, .lb-r2 .ava, .lb-r3 .ava { background: rgba(255, 255, 255, .7); color: #3b2600; }
@keyframes lb-flow { to { background-position: -300% 0; } }
@keyframes lb-shine { 0%, 55% { transform: translateX(-120%); } 100% { transform: translateX(120%); } }
@keyframes lb-glow { 0%, 100% { box-shadow: 0 6px 22px rgba(255, 179, 0, .45); } 50% { box-shadow: 0 8px 34px rgba(255, 179, 0, .9); } }
@keyframes lb-bob { 0%, 100% { transform: translateY(0) rotate(-6deg); } 50% { transform: translateY(-4px) rotate(6deg); } }
@keyframes lb-twinkle { 0%, 100% { opacity: .3; transform: scale(.8); } 50% { opacity: 1; transform: scale(1.25); } }
@media (prefers-reduced-motion: reduce) { .lb-r1, .lb-r2, .lb-r1::after, .lb-r2::after, .lb-r1::before, .lb-r1 .lb-rank { animation: none; } }
@media (max-width: 520px) { .lb-row { gap: 8px; padding: 8px 10px; } .lb-r1 { padding: 14px 12px; font-size: 1.05em; } .lb-idle { display: none; } .ava-lg { width: 52px; height: 52px; } .ava-xl { width: 88px; height: 88px; } }
.lb-r2 .lb-rank, .lb-r3 .lb-rank { font-size: 1.5em; }

/* fokus halqasi: sahifa almashganda #view ga dasturiy fokus beriladi — oq to'rtburchak chiqmasin */
#view:focus, #view:focus-visible, main:focus, main:focus-visible { outline: none; }
/* me qatori ranglari: tierlarda matn doim to'q, fon yorqin; ajratib turuvchi halqa oq+ko'k */
.lb-row.me.lb-r1, .lb-row.me.lb-r2, .lb-row.me.lb-r3, .lb-row.me.lb-top10 { outline: 3px solid var(--primary); outline-offset: 1px; }
.lb-r1 .lb-name strong { background: linear-gradient(100deg, #3b2600 35%, #a86a00 50%, #3b2600 65%); background-size: 250% 100%; -webkit-background-clip: text; background-clip: text; color: transparent; animation: lb-text 3s linear infinite; }
.lb-r1 .ava { animation: lb-halo 2s ease-in-out infinite; }
.lb-r1 { background-image: radial-gradient(circle at 12% 50%, rgba(255, 255, 255, .55), transparent 40%), linear-gradient(110deg, #ffcf3f, #fff4b8 25%, #ffb300 50%, #fff4b8 75%, #ffcf3f); background-size: 100% 100%, 300% 100%; animation: lb-flow-b 3.5s linear infinite, lb-glow 2.2s ease-in-out infinite; }
.lb-sparks { position: absolute; inset: 0; pointer-events: none; z-index: 0; } .lb-r1 > *:not(.lb-sparks) { position: relative; z-index: 1; }
.lb-sparks i { position: absolute; bottom: -8px; font-style: normal; color: #fff; text-shadow: 0 0 6px #ffb300, 0 0 12px #ff9100; opacity: 0; animation: lb-rise 3.2s ease-in infinite; font-size: 14px; }
.lb-sparks i:nth-child(1) { left: 6%; animation-delay: 0s; } .lb-sparks i:nth-child(2) { left: 18%; animation-delay: 1.1s; font-size: 10px; } .lb-sparks i:nth-child(3) { left: 31%; animation-delay: 2.1s; }
.lb-sparks i:nth-child(4) { left: 45%; animation-delay: .6s; font-size: 11px; } .lb-sparks i:nth-child(5) { left: 58%; animation-delay: 1.7s; } .lb-sparks i:nth-child(6) { left: 70%; animation-delay: .3s; font-size: 10px; }
.lb-sparks i:nth-child(7) { left: 83%; animation-delay: 2.5s; } .lb-sparks i:nth-child(8) { left: 93%; animation-delay: 1.4s; font-size: 12px; }
@keyframes lb-flow-b { to { background-position: 0 0, -300% 0; } }
@keyframes lb-text { to { background-position: -250% 0; } }
@keyframes lb-halo { 0%, 100% { box-shadow: 0 0 0 3px #fff, 0 0 0 6px #ffb300, 0 0 10px 6px rgba(255, 179, 0, .5); } 50% { box-shadow: 0 0 0 3px #fff, 0 0 0 8px #ff9100, 0 0 22px 12px rgba(255, 145, 0, .75); } }
@keyframes lb-rise { 0% { transform: translateY(0) scale(.6) rotate(0); opacity: 0; } 15% { opacity: 1; } 100% { transform: translateY(-64px) scale(1.15) rotate(180deg); opacity: 0; } }
@media (prefers-reduced-motion: reduce) { .lb-r1 .lb-name strong, .lb-r1 .ava, .lb-sparks i { animation: none; } .lb-sparks { display: none; } }
@media (max-width: 520px) {
  .lb-r1 { padding: 12px 10px; gap: 10px; font-size: 1em; margin: 4px 0 6px; }
  .lb-r1 .ava-lg { width: 44px; height: 44px; font-size: 16px; } .lb-r1 .ava { animation-name: lb-halo-s; }
  .lb-r1 .lb-rank { font-size: 1.5em; min-width: 28px; } .lb-r1 .lb-pts { font-size: 1.05em; } .lb-r1 .lb-name strong { font-size: 1.02em; }
  .lb-r1::before { right: 8px; top: 3px; font-size: 14px; }
  .lb-row { gap: 8px; } .lb-rank { min-width: 28px; }
}
@keyframes lb-halo-s { 0%, 100% { box-shadow: 0 0 0 2px #fff, 0 0 0 4px #ffb300, 0 0 8px 4px rgba(255, 179, 0, .5); } 50% { box-shadow: 0 0 0 2px #fff, 0 0 0 5px #ff9100, 0 0 14px 7px rgba(255, 145, 0, .75); } }
@media (prefers-reduced-motion: reduce) { .lb-r1 { animation: none; } }

/* ===== Notion uslubidagi blok muharriri ===== */
.bke { position: relative; border: 1px solid var(--border); border-radius: 12px; background: var(--surface); padding: 8px 8px 10px; }
.bk-quick { display: flex; flex-wrap: wrap; gap: 6px; padding: 4px 4px 8px; border-bottom: 1px dashed var(--border); margin-bottom: 6px; }
.bk-list { min-height: 120px; }
.bk { position: relative; display: flex; gap: 2px; align-items: flex-start; padding: 1px 0; border-radius: 6px; outline: none; }
.bk:focus-visible { box-shadow: 0 0 0 2px var(--primary); }
.bk-side { display: flex; gap: 0; opacity: 0; transition: opacity .12s; flex: none; margin-top: 2px; }
.bk:hover .bk-side, .bk:focus-within .bk-side { opacity: 1; }
@media (hover: none) { .bk-side { opacity: .55; } }
.bk-ico-btn { width: 24px; height: 28px; border: 0; background: transparent; color: var(--muted); border-radius: 6px; cursor: pointer; font: inherit; line-height: 1; padding: 0; }
.bk-ico-btn:hover { background: var(--surface2); color: var(--text); }
.bk-grip { cursor: grab; letter-spacing: -2px; }
.bk-body { flex: 1; min-width: 0; display: flex; gap: 8px; align-items: flex-start; }
.bk-text { flex: 1; min-width: 0; outline: none; padding: 4px 2px; min-height: 1.6em; line-height: 1.6; word-break: break-word; white-space: pre-wrap; border-radius: 4px; }
.bk-text:empty::before { content: attr(data-ph); color: var(--muted); opacity: 0; pointer-events: none; }
.bk-text:empty:focus::before, .bk[data-type="h1"] .bk-text:empty::before, .bk[data-type="h2"] .bk-text:empty::before, .bk[data-type="h3"] .bk-text:empty::before { opacity: .65; }
.bke.bk-empty .bk-text:empty::before { opacity: .65; }
.bk[data-type="h1"] .bk-text { font-size: 1.85em; font-weight: 800; line-height: 1.25; margin-top: 10px; }
.bk[data-type="h2"] .bk-text { font-size: 1.45em; font-weight: 750; line-height: 1.3; margin-top: 8px; }
.bk[data-type="h3"] .bk-text { font-size: 1.2em; font-weight: 700; margin-top: 6px; }
.bk-dot, .bk-num { flex: none; min-width: 22px; text-align: center; padding-top: 4px; line-height: 1.6; color: var(--muted); font-weight: 700; }
.bk-check { flex: none; width: 18px; height: 18px; margin: 8px 2px 0 4px; accent-color: var(--primary); }
.bk.done .bk-text:not(.bk-tbody) { text-decoration: line-through; color: var(--muted); }
.bk[data-type="quote"] .bk-body { border-left: 4px solid var(--primary); padding-left: 10px; }
.bk[data-type="quote"] .bk-text { font-style: italic; }
.bk[data-type="callout"] .bk-body { background: var(--surface2); border: 1px solid var(--border); border-radius: 10px; padding: 8px 10px; }
.bk-callico { flex: none; padding-top: 2px; }
.bk-arrow { flex: none; width: 24px; height: 28px; border: 0; background: transparent; color: var(--muted); cursor: pointer; font: inherit; border-radius: 6px; margin-top: 2px; }
.bk-arrow:hover { background: var(--surface2); }
.bk-tcol { flex: 1; min-width: 0; }
.bk[data-type="toggle"] .bk-text:not(.bk-tbody) { font-weight: 700; }
.bk-tbody { margin-left: 4px; border-left: 2px solid var(--border); padding-left: 10px !important; }
.bk.collapsed .bk-tbody { display: none; }
.bk-hr { flex: 1; border: 0; border-top: 2px solid var(--border); margin: 14px 0; }
.bk-code { flex: 1; width: 100%; min-height: 70px; font: 13px/1.5 ui-monospace, Menlo, Consolas, monospace; background: var(--surface2); color: var(--text); border: 1px solid var(--border); border-radius: 8px; padding: 10px; resize: none; }
.bk-fig { flex: 1; min-width: 0; margin: 4px 0; }
.bk-fig .media { margin: 4px 0; }
.bk-cap { font-size: .9em; color: var(--muted); outline: none; padding: 2px 4px; min-height: 1.4em; }
.bk-cap:empty::before { content: attr(data-ph); opacity: 0; }
.bk:hover .bk-cap:empty::before, .bk-cap:focus:empty::before { opacity: .7; }
.bk-loading { padding: 18px; border: 1px dashed var(--border); border-radius: 10px; color: var(--muted); text-align: center; animation: bkpulse 1.1s ease-in-out infinite; }
@keyframes bkpulse { 50% { opacity: .45; } }
.bk.dragging { opacity: .4; }
.bk.drop-before::before, .bk.drop-after::after { content: ""; position: absolute; left: 0; right: 0; height: 3px; border-radius: 3px; background: var(--primary); }
.bk.drop-before::before { top: -2px; } .bk.drop-after::after { bottom: -2px; }
.bk-list.filedrop { outline: 2px dashed var(--primary); outline-offset: 4px; border-radius: 8px; }
.bk-tail { height: 56px; cursor: text; }
.bk-help { display: block; padding: 4px 6px 0; }
.bk-menu { position: fixed; z-index: 1000; width: 260px; max-height: 320px; overflow: auto; background: var(--surface); color: var(--text); border: 1px solid var(--border); border-radius: 12px; box-shadow: 0 12px 32px rgba(0,0,0,.22); padding: 6px; display: flex; flex-direction: column; gap: 2px; }
.bk-mi { display: flex; gap: 10px; align-items: center; width: 100%; text-align: left; border: 0; background: transparent; color: inherit; font: inherit; padding: 7px 8px; border-radius: 8px; cursor: pointer; }
.bk-mi:hover, .bk-mi.on, .bk-mi:focus-visible { background: var(--surface2); outline: none; }
.bk-mi.danger { color: #c62828; }
:root[data-theme="dark"] .bk-mi.danger { color: #ff8a80; }
.bk-mi-ic { flex: none; width: 34px; height: 34px; border: 1px solid var(--border); border-radius: 8px; display: grid; place-items: center; font-weight: 700; font-size: .85em; background: var(--surface); }
.bk-mi-tx { display: flex; flex-direction: column; min-width: 0; } .bk-mi-tx small { color: var(--muted); }
.bk-bmenu { width: 190px; }
.bk-tb { position: fixed; z-index: 1001; display: flex; align-items: center; gap: 4px; flex-wrap: wrap; max-width: calc(100vw - 16px); padding: 5px; background: var(--surface); border: 1px solid var(--border); border-radius: 10px; box-shadow: 0 10px 28px rgba(0,0,0,.25); }
.bk-tb[hidden] { display: none; }
.bk-tb .rt-btn.sz { font-size: .8em; min-width: 32px; }
.uploading { pointer-events: none; }

/* o'qish ko'rinishi */
.bkv { line-height: 1.7; }
.bkv > * { margin: .35em 0; }
.bkv-h1 { font-size: 1.8em; margin-top: 1em; } .bkv-h2 { font-size: 1.45em; margin-top: .9em; } .bkv-h3 { font-size: 1.2em; margin-top: .8em; }
.bkv-list { padding-left: 1.4em; } .bkv-list li { margin: .2em 0; }
.bkv-todo { display: flex; gap: 8px; align-items: flex-start; } .bkv-todo input { margin-top: .45em; accent-color: var(--primary); } .bkv-todo .done { text-decoration: line-through; color: var(--muted); }
.bkv-quote { border-left: 4px solid var(--primary); padding: 2px 12px; margin-left: 0; font-style: italic; }
.bkv-callout { display: flex; gap: 10px; background: var(--surface2); border: 1px solid var(--border); border-radius: 10px; padding: 10px 12px; }
.bkv-toggle { border: 1px solid var(--border); border-radius: 10px; padding: 8px 12px; } .bkv-toggle summary { cursor: pointer; font-weight: 700; } .bkv-tbody { margin-top: 6px; }
.bkv-hr { border: 0; border-top: 2px solid var(--border); margin: 1.2em 0; }
.bkv-code { background: var(--surface2); border: 1px solid var(--border); border-radius: 8px; padding: 10px; overflow: auto; font: 13px/1.5 ui-monospace, Menlo, Consolas, monospace; }
.bkv-fig { margin: .8em 0; } .bkv-fig figcaption { color: var(--muted); font-size: .9em; text-align: center; }
.bkv-fig video, .bkv-fig img { width: auto; max-width: 100%; }
@media (max-width: 520px) { .bke { padding: 6px 4px 8px; } .bk-side { position: absolute; right: 0; top: -2px; z-index: 2; background: var(--surface); border-radius: 6px; } .bk-body { padding-right: 0; } .bk-menu { width: min(260px, calc(100vw - 16px)); } }
@media (prefers-reduced-motion: reduce) { .bk-loading { animation: none; } }

/* ===== Imtihon ekrani: doimiy taymer, N/20, progress bar ===== */
.exam-head { flex-direction: column; align-items: stretch; gap: 8px; }
.exam-line { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.qcount { font-size: 1.25rem; font-variant-numeric: tabular-nums; }
.pbar { height: 8px; border-radius: 99px; background: var(--surface2); overflow: hidden; border: 1px solid var(--border); }
.pbar-fill { height: 100%; width: 0; background: var(--primary); border-radius: 99px; transition: width .3s ease; }
.qnav .qn { flex: none; display: inline-grid; place-items: center; width: 34px; height: 34px; border-radius: 8px; border: 1px solid var(--border); background: var(--surface); font-size: .85rem; user-select: none; }
.qnav .qn.current { outline: 2px solid var(--primary); outline-offset: 1px; font-weight: 700; }
.qnav .qn.right { background: var(--ok-soft); border-color: var(--ok); } .qnav .qn.wrong { background: var(--bad-soft); border-color: var(--bad); }
.explain.ok { background: var(--ok-soft); border: 1px solid var(--ok); } .explain.bad { background: var(--bad-soft); border: 1px solid var(--bad); }
.opt:disabled { cursor: default; opacity: 1; }
.res-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-top: 16px; }
.res-box { border: 1px solid var(--border); border-radius: 12px; padding: 12px; text-align: center; display: flex; flex-direction: column; gap: 2px; }
.res-box b { font-size: 1.6rem; } .res-box span { font-size: .8rem; color: var(--muted); }
.res-box.ok { background: var(--ok-soft); border-color: var(--ok); } .res-box.bad { background: var(--bad-soft); border-color: var(--bad); }
.rules { padding-left: 1.2em; margin: 8px 0 14px; display: grid; gap: 4px; }
@media (max-width: 520px) { .res-grid { gap: 6px; } .res-box { padding: 8px 4px; } .res-box b { font-size: 1.3rem; } }
button.bk-num { border: 0; background: transparent; font: inherit; cursor: pointer; border-radius: 6px; }
button.bk-num:hover { background: var(--surface2); color: var(--text); }
.mini-list { display: grid; gap: 10px; margin: 8px 0; }
.mini-q { border: 1px solid var(--border); border-radius: 12px; padding: 8px 12px; background: var(--surface); }
.mini-q > summary { cursor: pointer; font-weight: 700; list-style: none; }
.mini-q > summary::-webkit-details-marker { display: none; }
.err { color: var(--bad); }

/* ---- Moliya (Founder) ---- */
.fin { font-size: 17px; }
.fin-actions { display: flex; gap: 12px; flex-wrap: wrap; margin: 4px 0 16px; }
.btn.lg { font-size: 18px; padding: 14px 22px; min-height: 52px; }
.grid.four { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-bottom: 14px; }
.stat.big .stat-v { font-size: 1.5rem; }
.stat.big .stat-l { font-size: 16px; font-weight: 600; color: var(--text); }
.sentence { font-size: 1.1rem; line-height: 1.6; }
.pos { color: var(--ok); } .neg { color: var(--bad); }
.money-input, .big-input { font-size: 22px; padding: 12px 14px; width: 100%; box-sizing: border-box; }
.big-input { font-size: 18px; }
.money-hint { color: var(--muted); font-size: 15px; min-height: 20px; margin: -4px 0 8px; }
.pick-list { display: grid; gap: 8px; margin: 10px 0; }
.pick { display: grid; text-align: left; gap: 2px; padding: 12px 14px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); cursor: pointer; font: inherit; color: inherit; }
.pick:hover, .pick:focus-visible { border-color: var(--primary, #2563eb); }
.pick-name { font-weight: 700; font-size: 1.05rem; } .pick-sub { color: var(--muted); font-size: 14px; } .pick-debt { color: var(--warn); font-weight: 600; }
.pay-sel { padding: 12px 14px; border: 1px solid var(--border); border-radius: var(--radius); margin: 10px 0; }
.pay-debt { font-weight: 700; color: var(--warn); margin-top: 4px; }
.seg { display: flex; gap: 8px; flex-wrap: wrap; }
.seg-b { padding: 12px 18px; font: inherit; border: 2px solid var(--border); border-radius: var(--radius); background: var(--surface); color: inherit; cursor: pointer; min-height: 48px; }
.seg-b.on { border-color: var(--ok); background: color-mix(in srgb, var(--ok) 12%, transparent); font-weight: 700; }
.chips { display: flex; gap: 6px; flex-wrap: wrap; margin: -4px 0 10px; }
.chip { padding: 8px 12px; border-radius: 999px; border: 1px solid var(--border); background: var(--surface); color: inherit; font: inherit; font-size: 14px; cursor: pointer; }
.hbars { display: grid; gap: 8px; }
.hb { display: grid; grid-template-columns: 110px 1fr auto; gap: 8px; align-items: center; font-size: 14px; }
.hb-t { background: color-mix(in srgb, var(--muted) 15%, transparent); border-radius: 6px; height: 14px; overflow: hidden; }
.hb-f { height: 100%; border-radius: 6px; background: var(--muted); } .hb-f.in { background: var(--ok); } .hb-f.out { background: var(--warn); }
.hb-v { font-weight: 600; white-space: nowrap; } .sp { height: 12px; }
.help { margin-top: 14px; padding: 12px 16px; border: 1px dashed var(--border); border-radius: var(--radius); } .help summary { cursor: pointer; font-weight: 600; }
.receipt { max-width: 420px; margin: 0 auto; padding: 16px; border: 1px solid var(--border); border-radius: 8px; background: #fff; color: #111; }
.rc-title { text-align: center; font-weight: 800; font-size: 1.2rem; } .rc-sub { text-align: center; color: #555; margin-bottom: 10px; }
.rc-row { display: flex; justify-content: space-between; gap: 12px; padding: 5px 0; border-bottom: 1px dotted #ccc; font-size: 15px; }
.rc-amount { text-align: center; font-size: 1.8rem; font-weight: 800; margin: 14px 0; } .rc-sign { margin-top: 22px; font-size: 14px; }
@media (max-width: 800px) { .grid.four { grid-template-columns: repeat(2, 1fr); } .hb { grid-template-columns: 80px 1fr auto; } .fin-actions .btn { flex: 1; } }
@media print { body.print-receipt > *:not(.backdrop) { display: none !important; } body.print-receipt .backdrop { position: static; background: none; } body.print-receipt .modal { box-shadow: none; border: 0; max-height: none; }
  body.print-receipt .modal-head, body.print-receipt .modal-foot { display: none !important; } }

/* ---- link bloki, yordam, popup ---- */
.bk-link { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; width: 100%; }
.bk-link-in { flex: 1 1 200px; min-width: 0; padding: 8px 10px; }
.bkv-link { text-decoration: none; }
.help-contact { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; padding: 16px; border-radius: var(--radius); background: color-mix(in srgb, var(--ok) 10%, var(--surface)); border: 1px solid var(--border); margin-bottom: 16px; font-size: 1.05rem; }
.help-meta { display: grid; grid-template-columns: max-content 1fr; gap: 6px 16px; }
.help-meta dt { color: var(--muted); } .help-meta dd { margin: 0; font-weight: 600; }
.about-text { white-space: pre-wrap; line-height: 1.6; }
.popup-body { white-space: pre-wrap; line-height: 1.6; font-size: 1.05rem; }
.popup-img { max-width: 100%; max-height: 50vh; border-radius: 8px; display: block; margin: 0 auto 12px; }
.chk-row { display: flex; gap: 16px; flex-wrap: wrap; } .chk-row label { display: flex; gap: 6px; align-items: center; }

/* ---- Imtihon profillari ---- */
.chip.on { background: var(--primary, #2563eb); color: #fff; border-color: transparent; }
.chips { display: flex; gap: 6px; flex-wrap: wrap; margin: 8px 0 12px; }
.pf-list { display: grid; gap: 12px; }
.pf-card.archived { opacity: .7; } .pf-card.published { border-left: 4px solid var(--ok); }
.pf-name { font-size: 1.1rem; } .pf-badges { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 4px; }
.pf-facts { display: flex; gap: 14px; flex-wrap: wrap; margin: 10px 0 4px; font-weight: 600; }
.pf-check { margin: 6px 0; font-size: 14px; } .pf-check.ok { color: var(--ok); } .pf-check.bad { color: var(--bad); }
.pf-actions { margin-top: 8px; }
.pf-menu { display: grid; gap: 8px; }
.pf-sum { margin-top: 10px; padding: 10px 12px; border-radius: var(--radius); background: color-mix(in srgb, var(--ok) 10%, transparent); font-weight: 600; }
.pf-sum.bad { background: color-mix(in srgb, var(--bad) 12%, transparent); color: var(--bad); }
.pf-quotas { display: grid; gap: 6px; margin: 8px 0; } .pf-q { display: flex; justify-content: space-between; gap: 10px; align-items: center; } .pf-q input { width: 90px; }
.grid.three { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
@media (max-width: 600px) { .grid.three { grid-template-columns: 1fr; } }

/* ---- O'quvchi: hero, tugmalar, tantana ---- */
.hero { border-radius: 16px; padding: 16px; margin-bottom: 14px; color: #fff; background: linear-gradient(135deg, #1b5fd6 0%, #6a3de8 60%, #c13fb5 100%); box-shadow: var(--shadow); }
.hero-top { display: flex; justify-content: space-between; gap: 12px; align-items: flex-start; }
.hero-hi { font-size: 1.25rem; font-weight: 700; line-height: 1.25; } .hero-sub { opacity: .92; font-size: 14px; margin-top: 4px; }
.hero-streak { flex: none; text-align: center; background: rgba(255,255,255,.18); border-radius: 14px; padding: 6px 12px; line-height: 1.1; } .hero-streak b { display: block; font-size: 1.5rem; } .hero-streak span { font-size: 12px; }
.hero-lvl { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin: 14px 0 6px; font-size: 13px; }
.lvl-badge { background: rgba(255,255,255,.22); padding: 3px 10px; border-radius: 99px; font-weight: 600; }
.hero-bar { height: 10px; border-radius: 99px; background: rgba(255,255,255,.25); overflow: hidden; } .hero-bar > span { display: block; height: 100%; background: #ffd84d; border-radius: 99px; transition: width .6s ease; }
.hero-bar.sm { height: 6px; margin-top: 4px; } .hero-goal { margin-top: 10px; font-size: 13px; }
.tiles { display: grid; grid-template-columns: repeat(6, 1fr); gap: 10px; margin-bottom: 16px; }
.tile { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; padding: 12px 6px; border-radius: 14px; text-decoration: none; color: var(--text); background: var(--surface); border: 1px solid var(--border); box-shadow: var(--shadow); }
.tile-i { font-size: 1.5rem; line-height: 1; } .tile-l { font-size: 13px; font-weight: 600; }
.tile:active { transform: scale(.96); }
.t1 { background: linear-gradient(160deg, #e6efff, var(--surface)); } .t2 { background: linear-gradient(160deg, #e1f5e8, var(--surface)); } .t3 { background: linear-gradient(160deg, #fff1d6, var(--surface)); }
.t4 { background: linear-gradient(160deg, #fde7e5, var(--surface)); } .t5 { background: linear-gradient(160deg, #efe6ff, var(--surface)); } .t6 { background: linear-gradient(160deg, #fff6c9, var(--surface)); }
:root[data-theme="dark"] .tile { background: var(--surface); }
.confetti { position: fixed; inset: 0; pointer-events: none; z-index: 60; overflow: hidden; }
.confetti i { position: absolute; top: -40px; font-style: normal; font-size: 1.8rem; animation: conf-fall 2.6s ease-in forwards; }
@keyframes conf-fall { to { transform: translateY(105vh) rotate(360deg); opacity: .9; } }
.verdict.ok { animation: pop .5s ease; } @keyframes pop { 0% { transform: scale(.6); } 70% { transform: scale(1.12); } 100% { transform: scale(1); } }
@media (prefers-reduced-motion: reduce) { .confetti { display: none; } .verdict.ok, .hero-bar > span { animation: none; transition: none; } }

/* ---- Mobil ixchamlashtirish (oddiy telefon ekrani: 360–414px) ---- */
@media (max-width: 640px) {
  body { font-size: 15px; }
  h1 { font-size: 1.15rem; margin-bottom: 10px; } h2 { font-size: 1rem; }
  main { padding: 10px max(10px, env(safe-area-inset-right)) 24px max(10px, env(safe-area-inset-left)); }
  .card { padding: 12px; margin-bottom: 12px; border-radius: 12px; }
  .btn { min-height: 42px; font-size: 14px; padding: 0 14px; } .btn.sm { min-height: 36px; font-size: 13px; padding: 0 10px; } .btn.lg { min-height: 46px; font-size: 15px; padding: 0 16px; }
  .stat { padding: 10px; } .stat-v { font-size: 1.15rem; } .stat-l { font-size: 12.5px; } .stat-s { font-size: 12px; }
  .stat.big .stat-v { font-size: 1.15rem; } .stat.big .stat-l { font-size: 13px; }
  .badge { font-size: 11px; padding: 1px 8px; }
  .topbar { padding-top: 4px; padding-bottom: 4px; } .topbar .btn { min-height: 38px; padding: 0 10px; } .brand { font-size: 15px; }
  .drawer-nav a { min-height: 44px; font-size: 15px; }
  td::before { font-size: 12px; } td { font-size: 13.5px; }
  .fin { font-size: 15px; } .sentence { font-size: 1rem; } .money-input { font-size: 18px; }
  .hero { padding: 13px; } .hero-hi { font-size: 1.08rem; } .hero-sub { font-size: 13px; } .hero-streak b { font-size: 1.25rem; }
  .tiles { grid-template-columns: repeat(3, 1fr); gap: 8px; } .tile { padding: 10px 4px; } .tile-i { font-size: 1.25rem; } .tile-l { font-size: 12px; }
  .qtext { font-size: 1.02rem; } .opt { padding: 12px; font-size: 15px; }
  .lb-row { font-size: 14px; }
}
@media (max-width: 380px) { .tile-l { font-size: 11.5px; } .hero-hi { font-size: 1rem; } }

.pf-more { flex: none !important; width: 44px; padding: 0 !important; }
