/* Davlat ilovalari uslubi: oq kartalar, kulrang fon, ko'k aksent, katta bosiladigan maydonlar. */
:root {
  --bg: #eef0f3;
  --card: #ffffff;
  --text: #111418;
  --muted: #667085;
  --line: #e4e7ec;
  --primary: #1a4fd6;
  --primary-press: #1641b3;
  --tile: #e6edfc;
  --ok: #12805c;
  --ok-bg: #e5f5ee;
  --bad: #c62828;
  --bad-bg: #fdecec;
  --warn-bg: #fff6e0;
  --radius: 18px;
  --radius-sm: 12px;
  --shadow: 0 1px 2px rgba(16, 24, 40, 0.04);
  --tabbar-h: 68px;
  --safe-b: env(safe-area-inset-bottom, 0px);
  color-scheme: light;
}
html.dark {
  --bg: #0f1115;
  --card: #1a1d23;
  --text: #eef0f3;
  --muted: #98a2b3;
  --line: #2a2f37;
  --primary: #5b8cff;
  --primary-press: #4a78e6;
  --tile: #1f2a44;
  --ok: #4ecb94;
  --ok-bg: #12352a;
  --bad: #ff7b7b;
  --bad-bg: #3a1a1c;
  --warn-bg: #3a3218;
  --shadow: none;
  color-scheme: dark;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; background: var(--bg); color: var(--text); }
body {
  font-family: -apple-system, BlinkMacSystemFont, "Roboto", "Segoe UI", "Helvetica Neue", Arial, sans-serif;
  font-size: 16px; line-height: 1.45; -webkit-font-smoothing: antialiased;
  min-height: 100vh; min-height: 100dvh;
}
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
input, textarea { font: inherit; color: var(--text); }
a { color: var(--primary); text-decoration: none; }
svg.i { width: 24px; height: 24px; flex: none; stroke: currentColor; fill: none; stroke-width: 1.8;
  stroke-linecap: round; stroke-linejoin: round; }

#app { max-width: 560px; margin: 0 auto; padding-bottom: calc(var(--tabbar-h) + var(--safe-b) + 24px); }
#app.no-tabbar { padding-bottom: calc(24px + var(--safe-b)); }

/* ---------- Bosh sahifa sarlavhasi ---------- */
.profile-head { display: flex; align-items: center; gap: 14px; padding: 16px 16px 14px;
  background: var(--card); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 5; }
.avatar { width: 56px; height: 56px; border-radius: 50%; flex: none; overflow: hidden; display: grid;
  place-items: center; background: var(--tile); color: var(--primary); font-weight: 700; font-size: 20px;
  border: 2px solid var(--line); }
.avatar img { width: 100%; height: 100%; object-fit: cover; }
.avatar.lg { width: 88px; height: 88px; font-size: 32px; }
.profile-head .name { font-size: 20px; font-weight: 700; line-height: 1.2; }
.profile-head .sub { color: var(--muted); font-size: 14px; margin-top: 2px; }

.section-title { font-size: 22px; font-weight: 700; margin: 18px 16px 12px; }

/* ---------- Bo'limlar to'ri ---------- */
.grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; padding: 0 16px; }
.tile-card { background: var(--card); border-radius: var(--radius); padding: 14px; min-height: 168px;
  display: flex; flex-direction: column; text-align: left; box-shadow: var(--shadow); position: relative;
  transition: transform .12s ease; }
.tile-card:active { transform: scale(.98); }
.tile-card .ico { width: 52px; height: 52px; border-radius: 14px; background: var(--tile); color: var(--primary);
  display: grid; place-items: center; }
.tile-card .ico svg.i { width: 26px; height: 26px; }
.tile-card .t { margin-top: auto; padding-top: 18px; font-size: 18px; font-weight: 700; line-height: 1.2; }
.tile-card .d { color: var(--muted); font-size: 14px; margin-top: 4px; line-height: 1.3; }
.tile-card.soon { opacity: .62; }
.badge { position: absolute; top: 14px; right: 12px; font-size: 11px; font-weight: 600; padding: 3px 8px;
  border-radius: 999px; background: var(--bg); color: var(--muted); }
.note { color: var(--muted); font-size: 13px; text-align: center; padding: 18px 24px 4px; }

/* ---------- Ichki sahifalar ---------- */
.page-head { display: flex; align-items: center; gap: 6px; padding: 10px 8px 10px 4px; background: var(--card);
  border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 5; min-height: 56px; }
.page-head .back { width: 44px; height: 44px; display: grid; place-items: center; border-radius: 12px; color: var(--primary); }
.page-head .back:active { background: var(--tile); }
.page-head .ttl { font-size: 19px; font-weight: 700; line-height: 1.2; }
.page-head .sub { color: var(--muted); font-size: 13px; }
.page-head .grow { flex: 1; min-width: 0; padding-left: 6px; }
.page-head.top { padding-left: 12px; }
.page-head .right { color: var(--muted); font-size: 14px; padding-right: 8px; font-weight: 600; }

.wrap { padding: 12px 16px; }
.card { background: var(--card); border-radius: var(--radius); padding: 16px; box-shadow: var(--shadow); }
.card + .card { margin-top: 12px; }
.muted { color: var(--muted); }
.small { font-size: 14px; }

.list { background: var(--card); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); }
.row { display: flex; align-items: center; gap: 12px; width: 100%; padding: 14px 16px; text-align: left;
  border-bottom: 1px solid var(--line); min-height: 60px; }
.row:last-child { border-bottom: 0; }
.row:active { background: var(--bg); }
.row .ico { width: 44px; height: 44px; border-radius: 12px; background: var(--tile); color: var(--primary);
  display: grid; place-items: center; flex: none; }
.row .body { flex: 1; min-width: 0; }
.row .t { font-weight: 600; line-height: 1.3; }
.row .d { color: var(--muted); font-size: 14px; margin-top: 2px; }
.row .chev { color: var(--muted); }
.row .num { font-weight: 700; color: var(--primary); min-width: 64px; font-size: 15px; }
.group-label { font-size: 13px; color: var(--muted); font-weight: 600; padding: 14px 16px 6px; text-transform: none; }
.clamp2 { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }

.field { display: flex; align-items: center; gap: 10px; background: var(--card); border-radius: 14px; padding: 0 14px;
  border: 1.5px solid var(--line); min-height: 50px; }
.field:focus-within { border-color: var(--primary); }
.field input { flex: 1; border: 0; outline: 0; background: transparent; padding: 12px 0; font-size: 16px; min-width: 0; }
.field svg.i { color: var(--muted); width: 20px; height: 20px; }

.btn { display: flex; align-items: center; justify-content: center; gap: 8px; width: 100%; min-height: 52px;
  border-radius: 14px; font-weight: 600; font-size: 16px; padding: 0 16px; }
.btn.primary { background: var(--primary); color: #fff; }
.btn.primary:active { background: var(--primary-press); }
.btn.ghost { background: var(--tile); color: var(--primary); }
.btn.text { color: var(--muted); min-height: 44px; font-weight: 500; font-size: 15px; }
.btn[disabled] { opacity: .5; }
.btn svg.i { width: 20px; height: 20px; }
.stack { display: grid; gap: 10px; margin-top: 14px; }

.chip { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 600; padding: 4px 10px;
  border-radius: 999px; background: var(--tile); color: var(--primary); }

/* ---------- Statistika ---------- */
.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.stat { background: var(--card); border-radius: var(--radius-sm); padding: 14px 10px; text-align: center; box-shadow: var(--shadow); }
.stat .v { font-size: 24px; font-weight: 700; color: var(--primary); }
.stat .l { font-size: 12px; color: var(--muted); margin-top: 2px; }
.meter { height: 8px; border-radius: 999px; background: var(--bg); overflow: hidden; margin-top: 10px; }
.meter > div { height: 100%; background: var(--primary); border-radius: 999px; }

/* ---------- Test ---------- */
.q-text { font-size: 18px; font-weight: 600; line-height: 1.4; margin-top: 10px; }
.opts { display: grid; gap: 10px; margin-top: 16px; }
.opt { display: flex; gap: 12px; align-items: flex-start; text-align: left; background: var(--card); border: 1.5px solid var(--line);
  border-radius: 14px; padding: 14px; min-height: 56px; box-shadow: var(--shadow); transition: border-color .15s, background .15s; }
.opt .k { width: 28px; height: 28px; border-radius: 50%; background: var(--bg); display: grid; place-items: center;
  font-weight: 700; font-size: 14px; flex: none; color: var(--muted); }
.opt.ok { border-color: var(--ok); background: var(--ok-bg); }
.opt.ok .k { background: var(--ok); color: #fff; }
.opt.bad { border-color: var(--bad); background: var(--bad-bg); }
.opt.bad .k { background: var(--bad); color: #fff; }
.opt[disabled] { cursor: default; }
.explain { margin-top: 14px; border-left: 4px solid var(--primary); }
.explain.good { border-left-color: var(--ok); }
.explain.wrong { border-left-color: var(--bad); }
.explain .h { font-weight: 700; margin-bottom: 6px; }
.src { display: flex; align-items: center; gap: 8px; margin-top: 12px; font-weight: 600; font-size: 15px; color: var(--primary); }
.src svg.i { width: 18px; height: 18px; }

/* ---------- Modda matni ---------- */
.art-num { font-size: 26px; font-weight: 800; margin-top: 6px; }
.art-title { font-size: 18px; font-weight: 600; margin-top: 4px; line-height: 1.35; }
.art-text { white-space: pre-wrap; word-wrap: break-word; line-height: 1.6; font-size: 16px; margin-top: 14px; }
.crumb { color: var(--muted); font-size: 13px; margin-top: 6px; }

/* ---------- AI yurist suhbati ---------- */
.chat { padding: 12px 12px calc(96px + var(--safe-b)); display: flex; flex-direction: column; gap: 10px; }
.msg { max-width: 92%; padding: 12px 14px; border-radius: 18px; white-space: pre-wrap; word-wrap: break-word; line-height: 1.5; font-size: 15.5px; }
.msg.me { align-self: flex-end; background: var(--primary); color: #fff; border-bottom-right-radius: 6px; }
.msg.ai { align-self: flex-start; background: var(--card); border-bottom-left-radius: 6px; box-shadow: var(--shadow); }
.msg.ai a { word-break: break-all; }
.msg.err { background: var(--bad-bg); color: var(--bad); }
.msg.note { align-self: center; max-width: 100%; background: var(--tile); box-shadow: none; font-size: 14px; text-align: center; padding: 9px 14px; }
.help-link { align-self: flex-start; background: none; border: 0; padding: 2px 6px; color: var(--muted); font-size: 13px; text-decoration: underline;
  text-underline-offset: 3px; text-align: left; }
.help-link:disabled { opacity: .5; }
.typing { display: flex; align-items: center; gap: 10px; color: var(--muted); }
.dots { display: inline-flex; gap: 4px; }
.dots i { width: 7px; height: 7px; border-radius: 50%; background: var(--primary); opacity: .3; animation: blink 1.2s infinite; }
.dots i:nth-child(2) { animation-delay: .2s; } .dots i:nth-child(3) { animation-delay: .4s; }
@keyframes blink { 0%, 80%, 100% { opacity: .25; } 40% { opacity: 1; } }
.empty { text-align: center; padding: 28px 16px 8px; }
.empty .big { width: 72px; height: 72px; border-radius: 22px; background: var(--tile); color: var(--primary);
  display: grid; place-items: center; margin: 0 auto 14px; }
.empty .big svg.i { width: 34px; height: 34px; }
.empty h3 { margin: 0 0 6px; font-size: 20px; }
.examples { display: grid; gap: 8px; margin-top: 16px; text-align: left; }
.example { background: var(--card); border-radius: 14px; padding: 12px 14px; font-size: 15px; border: 1px solid var(--line); text-align: left; }
.example:active { background: var(--tile); }

.composer { position: fixed; left: 0; right: 0; bottom: 0; z-index: 10; background: var(--card); border-top: 1px solid var(--line);
  padding: 10px 12px calc(10px + var(--safe-b)); }
.composer .in { max-width: 560px; margin: 0 auto; display: flex; gap: 8px; align-items: flex-end; }
.composer textarea { flex: 1; resize: none; border: 1.5px solid var(--line); border-radius: 22px; padding: 11px 16px;
  background: var(--bg); outline: 0; max-height: 140px; min-height: 46px; font-size: 16px; line-height: 1.4; }
.composer textarea:focus { border-color: var(--primary); }
.composer .send { width: 46px; height: 46px; border-radius: 50%; background: var(--primary); color: #fff; display: grid; place-items: center; flex: none; }
.composer .send[disabled] { opacity: .4; }
.composer .send svg.i { width: 20px; height: 20px; }

/* ---------- Pastki menyu ---------- */
.tabbar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 10; background: var(--card); border-top: 1px solid var(--line);
  display: flex; justify-content: space-around; padding: 6px 8px calc(6px + var(--safe-b)); }
.tabbar.hidden { display: none; }
.tab { flex: 1; max-width: 140px; display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 6px 4px;
  border-radius: 16px; color: var(--text); font-size: 13px; font-weight: 500; }
.tab.active { background: var(--tile); color: var(--primary); font-weight: 600; }

.fab { position: fixed; right: max(16px, calc(50vw - 280px + 16px)); bottom: calc(var(--tabbar-h) + var(--safe-b) + 16px);
  width: 64px; height: 64px; border-radius: 50%; background: var(--primary); color: #fff; display: grid; place-items: center;
  box-shadow: 0 8px 20px rgba(26, 79, 214, .35); z-index: 11; }
.fab.hidden { display: none; }
.fab svg.i { width: 30px; height: 30px; }

.toast { position: fixed; left: 50%; bottom: calc(var(--tabbar-h) + var(--safe-b) + 24px); transform: translateX(-50%) translateY(20px);
  background: #1f2329; color: #fff; padding: 10px 16px; border-radius: 12px; font-size: 14px; opacity: 0; pointer-events: none;
  transition: opacity .2s, transform .2s; z-index: 20; max-width: calc(100% - 32px); text-align: center; }
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

.skeleton { background: linear-gradient(90deg, var(--line) 25%, var(--bg) 50%, var(--line) 75%); background-size: 200% 100%;
  animation: sk 1.2s infinite; border-radius: 10px; }
@keyframes sk { to { background-position: -200% 0; } }
.center { text-align: center; padding: 40px 16px; color: var(--muted); }
.warn { background: var(--warn-bg); border-radius: 14px; padding: 12px 14px; font-size: 14px; }

/* ---------- Suhbatlar ---------- */
.icon-btn { width: 42px; height: 42px; border-radius: 12px; display: grid; place-items: center; color: var(--primary); flex: none; }
.icon-btn:active { background: var(--tile); }
.icon-btn svg.i { width: 22px; height: 22px; }
.row.conv { padding: 0; gap: 0; }
.row.conv .conv-open { display: flex; align-items: center; gap: 12px; flex: 1; min-width: 0; padding: 14px 4px 14px 16px; text-align: left; }
.row.conv .icon-btn { color: var(--muted); margin-right: 6px; }
.row.conv:active { background: transparent; }
.row.conv .conv-open:active { background: var(--bg); }
.recent-head { display: flex; justify-content: space-between; align-items: center; margin: 22px 2px 8px; font-weight: 700; }
.recent-head button { color: var(--primary); font-weight: 600; font-size: 14px; }
.clamp1 { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ---------- Kalkulyator ---------- */
.lbl { display: block; font-weight: 600; font-size: 15px; margin-bottom: 8px; }
.field.money input { font-size: 20px; font-weight: 600; }
.seg { display: flex; gap: 6px; background: var(--bg); padding: 4px; border-radius: 14px; margin-top: 12px; }
.seg button { flex: 1; min-height: 42px; border-radius: 11px; font-weight: 600; font-size: 15px; color: var(--muted); }
.seg button.on { background: var(--card); color: var(--primary); box-shadow: 0 1px 3px rgba(16, 24, 40, .12); }
.seg.kids { margin-top: 0; }
.hint { color: var(--muted); font-size: 13px; margin-top: 8px; }
.card.result { margin-top: 12px; text-align: center; background: var(--primary); color: #fff; }
.card.result .muted { color: rgba(255, 255, 255, .8); }
.big-sum { font-size: 32px; font-weight: 800; margin: 4px 0; letter-spacing: -0.5px; }
.kv { display: flex; justify-content: space-between; gap: 12px; padding: 9px 0; border-bottom: 1px solid var(--line); font-size: 15px; }
.kv:last-child { border-bottom: 0; }
.kv span { color: var(--muted); }
.kv b { text-align: right; white-space: nowrap; }


/* ---------------- Hujjat tuzish ---------------- */
.big-action { display: flex; gap: 14px; align-items: flex-start; width: 100%; text-align: left; background: var(--card);
  border-radius: var(--radius); padding: 18px 16px; box-shadow: var(--shadow); margin-bottom: 12px; }
.big-action:active { transform: scale(.99); }
.big-action .ico { width: 52px; height: 52px; border-radius: 16px; background: var(--primary); color: #fff; display: grid; place-items: center; flex: none; }
.big-action .ico svg.i { width: 26px; height: 26px; }
.big-action .t { display: block; font-weight: 700; font-size: 17px; }
.big-action .d { display: block; color: var(--muted); font-size: 14px; margin-top: 4px; line-height: 1.4; }
.tarea { width: 100%; border: 1.5px solid var(--line); border-radius: 14px; padding: 12px 14px; background: var(--card);
  font-size: 16px; line-height: 1.45; resize: vertical; outline: 0; }
.tarea:focus { border-color: var(--primary); }
.chips-wrap { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { padding: 9px 14px; border-radius: 999px; background: var(--card); border: 1px solid var(--line); font-size: 14px; font-weight: 500; text-align: left; }
.chip.on { background: var(--primary); border-color: var(--primary); color: #fff; }
.thumbs { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-top: 14px; }
.thumb { position: relative; aspect-ratio: 3 / 4; border-radius: 12px; overflow: hidden; background: var(--bg); display: grid; place-items: center; }
.thumb img { width: 100%; height: 100%; object-fit: cover; }
.thumb .pdf { font-weight: 800; color: var(--bad); font-size: 18px; }
.thumb button { position: absolute; top: 6px; right: 6px; width: 28px; height: 28px; border-radius: 50%; background: rgba(0,0,0,.55); color: #fff; display: grid; place-items: center; }
.thumb button svg.i { width: 16px; height: 16px; }
.thumb.add { border: 2px dashed var(--line); color: var(--primary); cursor: pointer; display: flex; flex-direction: column; gap: 6px; font-size: 13px; font-weight: 600; text-align: center; padding: 6px; }
.thumb.add svg.i { width: 28px; height: 28px; }
.q-item { display: block; margin-bottom: 14px; }
.q-item > span { display: block; font-size: 15px; font-weight: 500; margin-bottom: 6px; }
.working { text-align: center; padding: 32px 18px; }
.claims { margin: 0; padding-left: 20px; }
.claims li { margin: 4px 0; }
.analysis .kv b { white-space: normal; }
.answer-text { white-space: pre-wrap; line-height: 1.55; font-size: 15px; word-wrap: break-word; }
.answer-text.small { font-size: 13px; color: var(--muted); }
details.card summary { font-weight: 600; cursor: pointer; }
details.card .card { box-shadow: none; padding: 12px 0 0; }
.doc-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-bottom: 12px; }
.doc-actions .btn { min-height: 46px; font-size: 15px; }
.doc-actions .btn:first-child { grid-column: 1 / -1; }
.paper { background: #fff; color: #111; border-radius: 6px; padding: 26px 20px 30px; box-shadow: 0 1px 3px rgba(0,0,0,.12), 0 8px 24px rgba(0,0,0,.06);
  font-family: "Times New Roman", Times, serif; font-size: 15px; line-height: 1.5; margin-bottom: 12px; }
.paper .p-head { margin-left: 38%; font-size: 14px; }
.paper .p-head .gap { height: 8px; }
.paper .p-title { text-align: center; margin: 22px 0 14px; }
.paper .p-title .main { font-weight: 700; letter-spacing: .5px; }
.paper .p-body p { margin: 0 0 8px; text-indent: 28px; text-align: justify; }
.paper .p-body p.ask { text-align: center; text-indent: 0; font-weight: 700; margin: 14px 0 8px; }
.paper .p-att { margin-top: 14px; font-size: 14px; }
.paper .p-sign { margin-top: 18px; }
@media (max-width: 380px) { .paper .p-head { margin-left: 20%; } }

/* Til tanlash */
.lang-pick { padding-top: 10vh; text-align: center; display: flex; flex-direction: column; gap: 12px; max-width: 420px; margin: 0 auto; }
.lang-pick .lp-logo svg { height: 54px; width: auto; color: var(--primary); }
.lang-pick h2 { font-size: 18px; margin: 18px 0 8px; line-height: 1.4; }
.lang-pick .btn { min-height: 56px; font-size: 17px; justify-content: flex-start; padding: 0 20px; }
.lang-seg { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; background: var(--bg); padding: 4px; border-radius: 14px; }
.lang-seg button { min-height: 42px; border-radius: 11px; font-weight: 600; font-size: 15px; color: var(--muted); }
.lang-seg button.on { background: var(--card); color: var(--primary); box-shadow: 0 1px 3px rgba(0,0,0,.08); }

/* ---------------- Student bo'limi ---------------- */
.st-themes { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-top: 12px; }
.st-theme { text-align: center; border-radius: 12px; padding: 4px 4px 7px; border: 2px solid var(--line); background: var(--card); min-width: 0; }
.st-theme img { display: block; width: 100%; aspect-ratio: 16 / 9; border-radius: 7px; object-fit: cover; background: var(--bg); }
.st-theme img + img { margin-top: 3px; border: 1px solid var(--line); }
.st-theme .nm { display: block; font-weight: 600; font-size: 13px; margin-top: 6px; }
.st-theme.on { border-color: var(--primary); background: var(--tile); }
.st-theme.on .nm { color: var(--primary); font-weight: 700; }
.st-about { font-size: 14px; margin: 16px 0 8px; color: var(--muted); }
.st-about b { color: var(--text); margin-right: 8px; }
.chip .k { font-size: 12px; opacity: .65; margin-left: 2px; }
.st-preview { display: flex; gap: 10px; overflow-x: auto; margin: 0 -16px; padding: 0 16px 4px; scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch; scrollbar-width: none; }
.st-preview::-webkit-scrollbar { display: none; }
.st-preview img { flex: none; width: 88%; aspect-ratio: 16 / 9; border-radius: 10px; border: 1px solid var(--line); background: var(--bg);
  scroll-snap-align: center; }
.st-drop { display: flex; align-items: center; gap: 12px; margin-top: 12px; padding: 16px 14px; border: 2px dashed var(--line); border-radius: 14px;
  color: var(--primary); font-weight: 600; font-size: 15px; cursor: pointer; }
.st-drop svg.i { width: 26px; height: 26px; flex: none; }
.st-drop span { min-width: 0; overflow-wrap: anywhere; }
.st-drop.has { border-style: solid; border-color: var(--primary); color: var(--text); }
.st-drop.has svg.i { color: var(--primary); }
.st-shot { display: block; width: 100%; max-height: 260px; object-fit: contain; border-radius: 10px; margin-top: 12px; background: var(--bg); }
.st-outline { margin: 0; padding-left: 22px; }
.st-outline li { margin: 7px 0; line-height: 1.35; }
.st-outline .k { display: inline-block; font-size: 11px; font-weight: 700; color: var(--primary); background: var(--tile); border-radius: 6px;
  padding: 2px 7px; margin-right: 7px; vertical-align: 1px; }
.st-table { overflow-x: auto; margin: 0 -16px; padding: 0 16px; -webkit-overflow-scrolling: touch; }
.st-table table { border-collapse: collapse; font-size: 13px; min-width: 100%; }
.st-table th, .st-table td { padding: 7px 10px; border-bottom: 1px solid var(--line); text-align: left; white-space: nowrap; max-width: 240px;
  overflow: hidden; text-overflow: ellipsis; }
.st-table th { font-weight: 700; color: var(--muted); font-size: 12px; border-bottom-width: 2px; }
.st-table th.by { color: var(--primary); }
.st-table td.num { text-align: right; font-variant-numeric: tabular-nums; }
.st-table tbody tr:last-child td { border-bottom: 0; }

/* Kodekslar: lex.uz'dan qidirish tugmasi */
.lex-go { display: flex; align-items: center; gap: 10px; width: 100%; margin-top: 10px; padding: 13px 14px; border: 0; border-radius: 14px;
  background: var(--tile); color: var(--primary); font: inherit; font-weight: 600; text-align: left; cursor: pointer; }
.lex-go span { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lex-go svg { width: 18px; height: 18px; flex: none; }
.lex-go:active { opacity: .8; }
.lex-more .t { color: var(--primary); }

/* ---------------- Balans ---------------- */
.bal-card { display: flex; align-items: center; gap: 14px; width: 100%; margin-top: 12px; border: 0; text-align: left; cursor: pointer; color: inherit; font: inherit; }
.bal-card .ico { width: 44px; height: 44px; border-radius: 14px; background: var(--tile); color: var(--primary); display: grid; place-items: center; flex: none; }
.bal-card .ico svg.i { width: 24px; height: 24px; }
.bal-card .body { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.bal-card .l { color: var(--muted); font-size: 13px; }
.bal-card .v { font-size: 22px; font-weight: 700; font-variant-numeric: tabular-nums; }
.bal-card .go { display: inline-flex; align-items: center; gap: 2px; color: var(--primary); font-weight: 600; font-size: 14px; white-space: nowrap; }
.bal-card .go svg.i { width: 18px; height: 18px; }
.bal-hero { text-align: center; padding: 22px 16px; }
.bal-hero .l { color: var(--muted); font-size: 14px; }
.bal-hero .v { font-size: 34px; font-weight: 800; letter-spacing: -0.5px; margin-top: 2px; font-variant-numeric: tabular-nums; }
.bal-hero .s { color: var(--muted); font-size: 13px; margin-top: 8px; display: flex; align-items: center; justify-content: center; gap: 6px; }
.bal-hero .s svg.i { width: 16px; height: 16px; }
.steps { margin: 0; padding: 0; list-style: none; counter-reset: st; }
.steps > li { counter-increment: st; position: relative; padding: 0 0 18px 38px; }
.steps > li:last-child { padding-bottom: 4px; }
.steps > li::before { content: counter(st); position: absolute; left: 0; top: -2px; width: 26px; height: 26px; border-radius: 50%;
  background: var(--tile); color: var(--primary); font-weight: 700; font-size: 14px; display: grid; place-items: center; }
.steps > li > span { display: block; font-weight: 600; line-height: 1.4; }
.pay-card { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 10px; padding: 14px;
  border-radius: 14px; background: var(--primary); color: #fff; }
.pay-card > div { min-width: 0; }
.pay-card .num { font-size: clamp(15px, 4.4vw, 20px); font-weight: 700; letter-spacing: 1px; font-variant-numeric: tabular-nums; white-space: nowrap; }
.pay-card .holder { font-size: 13px; opacity: .85; margin-top: 2px; text-transform: uppercase; letter-spacing: .4px; }
.pay-card .copy-btn { width: 44px; height: 44px; flex: none; border: 0; border-radius: 12px; background: rgba(255,255,255,.18); color: #fff;
  display: grid; place-items: center; cursor: pointer; }
.pay-card .copy-btn svg.i { width: 20px; height: 20px; }
.pay-card .copy-btn:active { background: rgba(255,255,255,.3); }
.receipt-drop { margin-top: 10px; }
.receipt-drop img { width: 56px; height: 56px; object-fit: cover; border-radius: 10px; flex: none; }
.list-card { padding: 4px 16px; }
.tx-wrap { border-top: 1px solid var(--line); padding: 12px 0; }
.tx-wrap:first-child { border-top: 0; }
.tx-wrap .tx { padding: 0; border: 0; }
.tx { display: flex; align-items: center; gap: 12px; padding: 12px 0; border-top: 1px solid var(--line); }
.tx:first-child { border-top: 0; }
.rf-state { margin-top: 6px; }
.rf-link { margin-top: 6px; border: 0; background: none; padding: 4px 0; color: var(--primary); font: inherit; font-size: 13px; font-weight: 600;
  display: inline-flex; align-items: center; gap: 2px; cursor: pointer; }
.rf-link svg.i { width: 15px; height: 15px; }
.rf-form { margin-top: 8px; display: grid; gap: 8px; justify-items: start; }
.rf-form .tarea { width: 100%; }
.tx .body { flex: 1; min-width: 0; }
.tx .t { font-weight: 600; }
.tx .d { color: var(--muted); font-size: 13px; margin-top: 2px; }
.tx .amt { text-align: right; font-weight: 700; white-space: nowrap; font-variant-numeric: tabular-nums; display: flex; flex-direction: column; align-items: flex-end; gap: 3px; }
.plus { color: var(--ok); }
.minus { color: var(--text); }
.pill { display: inline-block; font-size: 12px; font-weight: 600; padding: 3px 9px; border-radius: 999px; background: var(--tile); color: var(--primary); white-space: nowrap; }
.pill.ok { background: var(--ok-bg); color: var(--ok); }
.pill.bad { background: var(--bad-bg); color: var(--bad); }
.pill.wait { background: var(--warn-bg); color: #8a5a00; }
:root.dark .pill.wait { color: #f0c560; }
.price-row { display: flex; align-items: center; gap: 8px; padding: 10px 0; border-top: 1px solid var(--line); }
.price-row:first-child { border-top: 0; padding-top: 2px; }
.price-row > span:first-child { flex: 1; min-width: 0; }
.price-row b { white-space: nowrap; font-variant-numeric: tabular-nums; }
.prices .hint { margin-top: 8px; }
.price-tag { display: inline-block; margin-top: 8px; font-size: 13px; font-weight: 600; color: var(--primary); background: var(--tile); padding: 3px 10px; border-radius: 999px; }
.terms summary { font-weight: 600; cursor: pointer; }
.terms-text { white-space: pre-wrap; line-height: 1.55; font-size: 14px; margin-top: 10px; color: var(--muted); }
.pay-act { margin-top: 10px; }
.pay-act .btn { display: inline-flex; width: auto; }
.btn.sm { min-height: 38px; width: auto; padding: 0 12px; font-size: 14px; border-radius: 10px; }
.btn.sm svg.i { width: 17px; height: 17px; }
.tx .amt.free { color: var(--ok); font-weight: 600; font-size: 14px; }
