/* =====================================================================
   Harkunim — dizayn tizimi (app.css)  v2.4
   Tashqi CDN yo'q. Shrift: Manrope (o'zimizda, assets/fonts) + tizim shrifti zaxirasi.
   Ikonkalar: assets/icons.svg (chiziqli), assets/moods.svg (rangli — icons.css).
   Yorug' (default) + tungi rejim:  <html data-theme="dark">
   Brend: zumrad → moviy-yashil gradient (--grad-brand), ikkinchi urg'u — indigo/binafsha,
   seriya va "quyosh" — iliq amber. Harakat: --ease-out / --ease-spring, 160–600ms,
   prefers-reduced-motion — hammasi o'chadi.
   ===================================================================== */

/* ---------- Shrift: Manrope Variable (200–800), font-display: swap ----------
   Manrope'da ʻ ʼ (U+02BB/02BC) va Ғ Қ Ҳ yo'q — brauzer shu belgilarni avtomatik tizim shriftidan oladi. */
@font-face {
  font-family: 'Manrope'; font-style: normal; font-weight: 200 800; font-display: swap;
  src: url(../fonts/manrope-latin-wght-normal.woff2) format('woff2-variations'), url(../fonts/manrope-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;
}
@font-face {
  font-family: 'Manrope'; font-style: normal; font-weight: 200 800; font-display: swap;
  src: url(../fonts/manrope-latin-ext-wght-normal.woff2) format('woff2-variations'), url(../fonts/manrope-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+1E00-1E9F, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: 'Manrope'; font-style: normal; font-weight: 200 800; font-display: swap;
  src: url(../fonts/manrope-cyrillic-wght-normal.woff2) format('woff2-variations'), url(../fonts/manrope-cyrillic-wght-normal.woff2) format('woff2');
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}

:root {
  /* Sirtlar */
  --bg: #f3f6f5;
  --surface: #ffffff;
  --surface-2: #eef3f1;
  --surface-3: #e3eae7;
  --text: #0f1a17;
  --text-2: #33433e;
  --muted: #5f6c68;           /* AA: oq fonda 5.2, --bg da 4.8 */
  --line: rgba(15, 42, 34, .08);
  --line-2: rgba(15, 42, 34, .14);
  /* Brend */
  --accent: #0b8466;          /* matn/ikonka uchun (oq fonda 4.7:1) */
  --accent-2: #12b886;        /* yorqin to'ldirish: halqa, ustun, belgi */
  --accent-ink: #ffffff;
  --accent-soft: rgba(18, 184, 134, .13);
  --accent-soft-2: rgba(18, 184, 134, .07);
  --grad-brand: linear-gradient(135deg, #0c9a72 0%, #0a857a 52%, #0b6c84 100%);
  --grad-btn: linear-gradient(135deg, #0b9170 0%, #0a7c7c 100%);
  --grad-hero: linear-gradient(145deg, #10a77b 0%, #0b8b7d 46%, #0b6a86 100%);
  --indigo: #5b5bd6;
  --indigo-soft: rgba(99, 102, 241, .12);
  --violet: #7c4ddb;
  --violet-soft: rgba(139, 92, 246, .12);
  --sky: #0b7fb8;
  --sky-soft: rgba(14, 165, 233, .12);
  --rose: #d6336c;
  --rose-soft: rgba(230, 73, 128, .11);
  --amber: #f59e0b;
  --amber-ink: #b45309;
  --amber-soft: rgba(245, 158, 11, .15);
  --danger: #d92d20;
  --danger-soft: rgba(217, 45, 32, .1);
  /* Fon "nur"lari (tong) */
  --glow-1: rgba(18, 184, 134, .14);
  --glow-2: rgba(251, 191, 36, .10);
  --glow-3: rgba(99, 102, 241, .07);
  /* Soyalar — qatlamli, yumshoq */
  --shadow-xs: 0 1px 2px rgba(16, 36, 30, .06);
  --shadow: 0 1px 2px rgba(16, 36, 30, .05), 0 6px 16px -6px rgba(16, 36, 30, .08), 0 18px 36px -18px rgba(16, 36, 30, .12);
  --shadow-lg: 0 10px 24px -8px rgba(16, 36, 30, .16), 0 30px 64px -20px rgba(16, 36, 30, .28);
  --shadow-brand: 0 12px 28px -10px rgba(11, 133, 122, .55), 0 4px 10px -4px rgba(11, 133, 122, .35);
  --hl: inset 0 1px 0 rgba(255, 255, 255, .7);
  /* Radius va o'lchamlar */
  --r-xs: 8px;
  --r-sm: 12px;
  --r: 16px;
  --r-lg: 22px;
  --r-xl: 28px;
  --appbar-h: 60px;
  --tabbar-h: 64px;
  --app-w: 520px;             /* mobil ustun kengligi (planshetda kengroq — pastda) */
  --side-w: 272px;
  --content-w: 1180px;
  --safe-b: env(safe-area-inset-bottom, 0px);
  --safe-t: env(safe-area-inset-top, 0px);
  /* Harakat */
  --ease-out: cubic-bezier(.22, 1, .36, 1);
  --ease-spring: cubic-bezier(.34, 1.56, .64, 1);
  --ease-soft-spring: cubic-bezier(.3, 1.22, .4, 1);
  --dur-1: .16s;
  --dur-2: .24s;
  --dur-3: .34s;
  --font: 'Manrope', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  /* Brauzerning o'z boshqaruvlari (soat tanlagich, checkbox, scrollbar, autofill) ilova rejimiga mos —
     OS rejimiga emas (<meta color-scheme> faqat OS ga qaraydi) */
  color-scheme: light;
}

/* Planshet: ustun kengroq (telefon ekranidek tor ko'rinmasin).
   --tabbar-h ga 12px qo'shiladi — tab bar pastdan ko'tarilgan "pill" (pastda), FAB/toast/ekran chekkasi shunga moslashadi */
@media (min-width: 720px) and (max-width: 1023px) { :root { --app-w: 680px; --tabbar-h: 76px; } }

html[data-theme="dark"] {
  color-scheme: dark;
  --bg: #090e0d;
  --surface: #111816;
  --surface-2: #18211e;
  --surface-3: #212c28;
  --text: #edf3f1;
  --text-2: #c3cfcb;
  --muted: #8d9e98;           /* AA: --surface da 6.5 */
  --line: rgba(255, 255, 255, .075);
  --line-2: rgba(255, 255, 255, .13);
  --accent: #34d399;
  --accent-2: #2fd19b;
  --accent-soft: rgba(52, 211, 153, .14);
  --accent-soft-2: rgba(52, 211, 153, .07);
  --indigo: #a5a8ff;
  --indigo-soft: rgba(129, 140, 248, .17);
  --violet: #c4a8ff;
  --violet-soft: rgba(167, 139, 250, .16);
  --sky: #5cc4f5;
  --sky-soft: rgba(56, 189, 248, .15);
  --rose: #ff86ac;
  --rose-soft: rgba(251, 113, 133, .15);
  --amber: #fbbf24;
  --amber-ink: #fbbf24;
  --amber-soft: rgba(251, 191, 36, .15);
  --danger: #f87171;
  --danger-soft: rgba(248, 113, 113, .14);
  --glow-1: rgba(45, 212, 160, .10);
  --glow-2: rgba(251, 191, 36, .05);
  --glow-3: rgba(129, 140, 248, .07);
  --shadow-xs: 0 1px 2px rgba(0, 0, 0, .4);
  --shadow: 0 1px 2px rgba(0, 0, 0, .35), 0 10px 28px -12px rgba(0, 0, 0, .55);
  --shadow-lg: 0 18px 48px -12px rgba(0, 0, 0, .7), 0 2px 8px rgba(0, 0, 0, .4);
  --shadow-brand: 0 12px 30px -10px rgba(16, 185, 129, .35), 0 4px 10px -4px rgba(0, 0, 0, .5);
  --hl: inset 0 1px 0 rgba(255, 255, 255, .045);
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

html, body { margin: 0; padding: 0; }
html { background: var(--bg); }

body {
  /* Yengil "tong nuri" — sahifa tepasida yashil, o'ngda iliq, chapda indigo */
  background:
    radial-gradient(900px 420px at 100% -6%, var(--glow-2), transparent 60%),
    radial-gradient(760px 420px at 0% -4%, var(--glow-1), transparent 62%),
    radial-gradient(600px 400px at 50% 110%, var(--glow-3), transparent 70%),
    var(--bg);
  background-attachment: fixed;
  color: var(--text);
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.5;
  font-feature-settings: "cv11" 1, "ss01" 1;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  overscroll-behavior-y: none;
}
::selection { background: var(--accent-soft); }

button, input, select, textarea { font-family: inherit; }

/* ---------- Ikonkalar ---------- */
.ic {
  width: 22px; height: 22px; flex: 0 0 auto;
  fill: none; stroke: currentColor; stroke-width: 1.8;
  stroke-linecap: round; stroke-linejoin: round;
}
.ic-sm { width: 18px; height: 18px; }
.ic-lg { width: 26px; height: 26px; }
.ic-xs { width: 15px; height: 15px; stroke-width: 2; }

/* ---------- Raqamlar: bir xil kenglik (statistika "sakramasin") ---------- */
.num, .stat b, .ring-center b, .ring-center em, .up-when b, .kv .v, .rank-row .no, .hero-n,
.adm-tile b, .adm-mini b, .adm-ch-sum b { font-variant-numeric: tabular-nums; }

/* ---------- Karkas ---------- */
.app {
  max-width: var(--app-w); margin: 0 auto; min-height: 100dvh;
  display: flex; flex-direction: column; position: relative;
  background: transparent;
}

.appbar {
  position: sticky; top: 0; z-index: 40;
  display: flex; align-items: center; gap: 10px;
  padding: calc(8px + var(--safe-t)) 16px 8px;
  min-height: var(--appbar-h);
  background: var(--bg);
  background: color-mix(in srgb, var(--bg) 74%, transparent);
  backdrop-filter: saturate(180%) blur(18px);
  -webkit-backdrop-filter: saturate(180%) blur(18px);
  border-bottom: 1px solid transparent;
  transition: border-color var(--dur-2) ease, box-shadow var(--dur-2) ease;
}
/* Sahifa aylantirilganda (app.js: body.scrolled) chegara va yengil soya chiqadi */
body.scrolled .appbar { border-bottom-color: var(--line); box-shadow: 0 6px 20px -16px rgba(0, 0, 0, .35); }

.avatar {
  width: 40px; height: 40px; border-radius: 50%;
  display: grid; place-items: center;
  background: var(--grad-brand);
  color: #fff; font-weight: 800; font-size: 14px; letter-spacing: .3px;
  box-shadow: 0 0 0 2px var(--surface), 0 0 0 3.5px var(--accent-soft), 0 6px 16px -6px rgba(11, 133, 122, .6);
  flex: 0 0 auto; overflow: hidden;
}
.avatar-lg { width: 56px; height: 56px; font-size: 19px; }

.hello { min-width: 0; flex: 1; }
.hello b { display: block; font-size: 15.5px; font-weight: 800; letter-spacing: -.25px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hello span { display: block; font-size: 12px; color: var(--muted); font-weight: 500; }
/* Sarlavhaning uzun/qisqa varianti (hk_title_html): tor telefonda "Salom, Ism" — ism kesilmasin */
.hello b > .t-long, .hello b > .t-short { display: inline; font: inherit; color: inherit; }
.hello b > .t-short { display: none; }
@media (max-width: 400px) {
  .hello b > .t-long { display: none; }
  .hello b > .t-short { display: inline; }
}

.iconbtn {
  width: 40px; height: 40px; border-radius: 13px; border: 1px solid var(--line);
  background: var(--surface); color: var(--text); display: grid; place-items: center;
  cursor: pointer; box-shadow: var(--shadow-xs), var(--hl);
  transition: transform var(--dur-1) var(--ease-spring), background var(--dur-1) ease, border-color var(--dur-1) ease;
}
.iconbtn:active { transform: scale(.92); }
@media (hover: hover) { .iconbtn:hover { border-color: var(--line-2); background: var(--surface-2); } }

/* ---------- Ekran ---------- */
.screen {
  flex: 1; padding: 12px 16px calc(var(--tabbar-h) + var(--safe-b) + 30px);
  min-width: 0;
}
/* Ekranga kirish: konteyner tez paydo bo'ladi, kartalar ketma-ket (stagger) ko'tariladi.
   transform faqat bolalarda — #hk-screen o'zi fixed elementlar uchun "konteyner" bo'lib qolmasin */
.screen.enter { animation: hkFade .2s ease both; }
.screen.enter > *:not(.cols):not([hidden]),
.screen.enter > .cols > .col > * { animation: hkRise .34s var(--ease-out) both; }
.screen.enter > *:nth-child(2), .screen.enter > .cols > .col > *:nth-child(1) { animation-delay: .03s; }
.screen.enter > *:nth-child(3), .screen.enter > .cols > .col > *:nth-child(2) { animation-delay: .06s; }
.screen.enter > *:nth-child(4), .screen.enter > .cols > .col > *:nth-child(3) { animation-delay: .09s; }
.screen.enter > *:nth-child(5), .screen.enter > .cols > .col > *:nth-child(4) { animation-delay: .12s; }
.screen.enter > *:nth-child(6), .screen.enter > .cols > .col > *:nth-child(5) { animation-delay: .15s; }
.screen.enter > *:nth-child(7), .screen.enter > .cols > .col > *:nth-child(6) { animation-delay: .18s; }
.screen.enter > *:nth-child(n+8), .screen.enter > .cols > .col > *:nth-child(n+7) { animation-delay: .21s; }
.screen.enter > .cols > .col + .col > * { animation-delay: .08s; }
@keyframes hkFade { from { opacity: 0; } to { opacity: 1; } }
@keyframes hkRise { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
/* learn.css ham ishlatadi */
@keyframes fadeUp { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

.h1 { font-size: 24px; font-weight: 800; letter-spacing: -.6px; line-height: 1.2; margin: 0; }
.h2 { font-size: 17px; font-weight: 800; letter-spacing: -.35px; line-height: 1.3; margin: 0; }
.sec { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin: 22px 2px 10px; }
.sec .h2 { display: flex; align-items: center; gap: 10px; min-width: 0; }
.sec a, .sec button.link {
  font-size: 13px; font-weight: 700; color: var(--accent); background: none; border: 0; cursor: pointer;
  padding: 6px 10px; margin: -6px -8px -6px 0; border-radius: 10px; white-space: nowrap;
  transition: background var(--dur-1) ease;
}
/* Faqat sichqoncha bor qurilmada: telefonda bosilgandan keyin yashil fon "yopishib" qolardi */
@media (hover: hover) { .sec a:hover, .sec button.link:hover { background: var(--accent-soft-2); } }
.muted { color: var(--muted); }
.sm { font-size: 13px; }
.xs { font-size: 11.5px; }
.bold { font-weight: 700; }
.center { text-align: center; }
.row { display: flex; align-items: center; gap: 10px; }
.between { justify-content: space-between; }
.wrap { flex-wrap: wrap; }
.g6 { gap: 6px; } .g8 { gap: 8px; } .g12 { gap: 12px; }
.grow { flex: 1; min-width: 0; }
.mt4 { margin-top: 4px; } .mt8 { margin-top: 8px; } .mt12 { margin-top: 12px; } .mt16 { margin-top: 16px; } .mt20 { margin-top: 20px; }
.nowrap { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hidden { display: none !important; }
/* [hidden] atributi doim ustun: .trow { display:flex } kabi qoidalar JS yashirgan qatorni (qidiruv natijasi va h.k.)
   qayta ko'rsatib yubormasin */
[hidden] { display: none !important; }
.rt-sched { min-width: 0; }
.rt-sched > .nowrap { min-width: 0; }
/* Reja → Tartiblar: vaqtlar va kunlar 2 qatorgacha (hafta kunlari kesilib qolmasin) */
.rt-sched { align-items: flex-start; }
.rt-sched > .ic { margin-top: 1px; flex: 0 0 auto; }
.rt-sched .rt-sched-t { min-width: 0; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
/* "Bajardim": telefonda (≤400px) 40px dumaloq belgi tugmasi — nom va jadvalga ~60px joy qoladi */
.rt-done .ic { display: none; }
@media (max-width: 400px) {
  .btn.sm.rt-done { width: 40px; height: 40px; padding: 0; border-radius: 50%; justify-content: center; }
  .rt-done .ic { display: block; }
  .rt-done .lbl { display: none; }
}

/* ---------- Sarlavha ikonkasi: rangli yumaloq kvadrat ("tile") ----------
   .h2 ichidagi BIRINCHI ikonka avtomatik tile bo'ladi. Rang: .h2.tc-indigo|tc-amber|tc-sky|tc-rose|tc-violet */
.h2 > .ic:first-child {
  width: 32px; height: 32px; padding: 7px; border-radius: 11px; flex: 0 0 auto;
  background: var(--tc-soft, var(--accent-soft)); color: var(--tc, var(--accent)); stroke-width: 2;
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--tc, var(--accent)) 12%, transparent);
}
.card .h2 > .ic:first-child, .sec .h2 > .ic:first-child { margin-right: 0; }
/* Ikonkali sarlavha to'g'ridan-to'g'ri .card ichida bo'lsa ham (Profil, Jurnal, Reyting, admin Xabar) — flex qator */
.row > .h2, .card > .row > .h2, .card > .h2:has(> .ic:first-child),
.row > .grow > .h2:has(> .ic:first-child), .h2.has-ic { display: flex; align-items: center; gap: 10px; }
@supports not selector(:has(*)) { .card > .h2 > .ic:first-child { vertical-align: middle; margin-right: 10px; } }
.tc-indigo { --tc: var(--indigo); --tc-soft: var(--indigo-soft); }
.tc-amber  { --tc: var(--amber-ink); --tc-soft: var(--amber-soft); }
.tc-sky    { --tc: var(--sky); --tc-soft: var(--sky-soft); }
.tc-rose   { --tc: var(--rose); --tc-soft: var(--rose-soft); }
.tc-violet { --tc: var(--violet); --tc-soft: var(--violet-soft); }

/* ---------- Karta ---------- */
.card {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--r-lg); padding: 16px; box-shadow: var(--shadow), var(--hl);
  position: relative;
}
html[data-theme="dark"] .card {
  background: linear-gradient(180deg, rgba(255, 255, 255, .028), rgba(255, 255, 255, 0) 120px), var(--surface);
}
.card + .card { margin-top: 12px; }
.card.tight { padding: 12px; }
.card.flat { box-shadow: var(--shadow-xs); }
a.card { transition: transform var(--dur-2) var(--ease-out), box-shadow var(--dur-2) ease, border-color var(--dur-2) ease; }
@media (hover: hover) { a.card:hover { transform: translateY(-2px); box-shadow: var(--shadow-lg); border-color: var(--line-2); } }
a.card:active { transform: scale(.985); }
/* Yaltiroq karta (ixtiyoriy) */
.card.sheen { background: linear-gradient(160deg, var(--accent-soft-2), transparent 55%), var(--surface); }

/* ---------- Progress halqa ---------- */
.ringwrap { position: relative; display: grid; place-items: center; }
.ring { transform: rotate(-90deg); overflow: visible; }
.ring circle { fill: none; stroke-linecap: round; }
.ring .track { stroke: var(--surface-2); }
.ring .bar { stroke: var(--accent-2); transition: stroke-dashoffset 1s var(--ease-out), stroke .3s ease; }
.ring .bar.full { stroke: var(--amber); }
.ring-center { position: absolute; text-align: center; line-height: 1.1; }
.ring-center b { display: inline-block; font-size: 36px; font-weight: 800; letter-spacing: -1.2px; }
.ring-center em { font-style: normal; font-size: 20px; color: var(--muted); font-weight: 700; margin-left: 2px; }
.ring-center span { display: block; font-size: 12px; color: var(--muted); margin-top: 3px; font-weight: 600; }

/* ---------- Statistika ---------- */
.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-top: 14px; }
.stat { text-align: center; padding: 11px 4px 10px; border-radius: var(--r); background: var(--surface-2); min-width: 0; }
.stat b { display: block; font-size: 19px; font-weight: 800; letter-spacing: -.4px; line-height: 1.25; }
.stat span { font-size: 11px; color: var(--muted); font-weight: 600; }
/* Karta tashqarisidagi statistika plitkalari (Jurnal) — fonga singib ketmasin */
.stats.solo .stat { background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow-xs), var(--hl); }

/* ---------- Bugun: QAHRAMON karta (brend gradient + halqa) ---------- */
.hero {
  background: var(--grad-hero) !important; color: #fff; border: 0 !important; overflow: hidden; isolation: isolate;
  box-shadow: var(--shadow-brand), inset 0 1px 0 rgba(255, 255, 255, .22) !important; padding: 16px 16px 14px;
}
/* "Tong quyoshi" nuri (o'ng tepa) va pastki moviy soya — dekor */
.hero::before, .hero::after { content: ''; position: absolute; border-radius: 50%; pointer-events: none; z-index: -1; }
.hero::before { width: 260px; height: 260px; right: -90px; top: -120px; background: radial-gradient(circle, rgba(255, 214, 120, .5), rgba(255, 214, 120, 0) 66%); }
.hero::after { width: 340px; height: 340px; left: -150px; bottom: -230px; background: radial-gradient(circle, rgba(255, 255, 255, .12), rgba(255, 255, 255, 0) 66%); }
.hero-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; flex-wrap: wrap; }
.hero-main { display: flex; align-items: center; gap: 16px; margin-top: 12px; }
.hero .ringwrap { flex: 0 0 auto; }
.hero .ring .track { stroke: rgba(255, 255, 255, .2); }
.hero .ring .bar { stroke: #fff; filter: drop-shadow(0 0 6px rgba(255, 255, 255, .45)); }
.hero .ring .bar.full { stroke: #ffd36b; filter: drop-shadow(0 0 8px rgba(255, 211, 107, .7)); }
.hero .ring-center b { color: #fff; font-size: 32px; }
.hero .ring-center em, .hero .ring-center span { color: rgba(255, 255, 255, .86); }
.hero-txt { min-width: 0; flex: 1; }
.hero-k { display: block; font-size: 11.5px; font-weight: 800; letter-spacing: .8px; text-transform: uppercase; color: rgba(255, 255, 255, .82); }
.hero-t { display: block; font-size: 19px; font-weight: 800; letter-spacing: -.4px; line-height: 1.25; margin-top: 4px; text-wrap: balance; }
.hero-s { display: block; font-size: 13px; color: rgba(255, 255, 255, .9); margin-top: 6px; font-weight: 600; }
.hero .stats { margin-top: 14px; }
.hero .stat {
  background: rgba(255, 255, 255, .14); border: 1px solid rgba(255, 255, 255, .16);
  backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
}
.hero .stat span { color: rgba(255, 255, 255, .88); }
.hero .chip, .hero .chip.amber, .hero .chip.indigo { background: rgba(255, 255, 255, .16); color: #fff; border: 1px solid rgba(255, 255, 255, .22); padding: 5px 11px; }
.hero .chip.amber { background: rgba(255, 190, 60, .3); border-color: rgba(255, 214, 120, .45); }
.hero .chip.amber .ic { color: #ffe08a; }
.hero .chip:active { transform: scale(.95); }
@media (max-width: 359px) {
  .hero-main { gap: 12px; } .hero-t { font-size: 16.5px; }
  .hero .ring { width: 108px; height: 108px; } .hero .ring-center b { font-size: 28px; } .hero .ring-center em { font-size: 17px; }
}
html[data-theme="dark"] .hero { --grad-hero: linear-gradient(145deg, #0d8f6b 0%, #0a7470 50%, #0a556e 100%); }

/* ---------- Chip ---------- */
.chip {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 5px 10px; border-radius: 999px; font-size: 12px; font-weight: 700; line-height: 1.35;
  background: var(--surface-2); color: var(--muted); white-space: nowrap;
}
.chip.accent { background: var(--accent-soft); color: var(--accent); }
.chip.indigo { background: var(--indigo-soft); color: var(--indigo); }
.chip.amber { background: var(--amber-soft); color: var(--amber-ink); }
.chip.danger { background: var(--danger-soft); color: var(--danger); }
.chip.ghost { background: transparent; border: 1px solid var(--line-2); }
button.chip { border: 0; cursor: pointer; font: inherit; font-size: 12px; font-weight: 700; transition: transform var(--dur-1) var(--ease-spring), filter var(--dur-1) ease; }
button.chip.ghost { border: 1px solid var(--line-2); }
button.chip:active { transform: scale(.94); }
@media (hover: hover) { button.chip:hover { filter: brightness(.97); } }

/* ---------- Tugma ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 12px 18px; border-radius: var(--r); border: 0; cursor: pointer;
  font: inherit; font-weight: 800; font-size: 14.5px; letter-spacing: -.1px; line-height: 1.2;
  background: var(--grad-btn); color: var(--accent-ink);
  box-shadow: 0 6px 16px -8px rgba(11, 133, 122, .7), inset 0 1px 0 rgba(255, 255, 255, .22);
  transition: transform var(--dur-1) var(--ease-spring), filter var(--dur-1) ease, box-shadow var(--dur-2) ease, background var(--dur-1) ease;
  text-decoration: none;
}
@media (hover: hover) { .btn:hover { filter: brightness(1.06) saturate(1.05); } }
.btn:active { transform: scale(.965); box-shadow: 0 2px 6px -3px rgba(11, 133, 122, .6), inset 0 1px 0 rgba(255, 255, 255, .15); }
.btn.block { width: 100%; }
/* hidden atributi .btn ning display: inline-flex idan ustun bo'lsin (JS ko'rsatadi/yashiradi) */
.btn[hidden] { display: none !important; }
.btn.ghost { background: var(--surface-2); color: var(--text); box-shadow: none; }
.btn.outline { background: var(--surface); color: var(--text); border: 1px solid var(--line-2); box-shadow: var(--shadow-xs); }
.btn.danger { background: var(--danger); color: #fff; box-shadow: 0 6px 16px -8px rgba(217, 45, 32, .6); }
html[data-theme="dark"] .btn.danger { background: #dc3b30; }
.btn.sm { padding: 9px 13px; font-size: 13.5px; border-radius: 12px; }
.btn:disabled { opacity: .55; filter: grayscale(.4); cursor: default; }
@media (hover: hover) { .btn.ghost:hover, .btn.outline:hover { filter: none; background: var(--surface-3); } }

/* ---------- Ro'yxat qatori ---------- */
.rows { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); overflow: hidden; box-shadow: var(--shadow), var(--hl); }
.rows > * + * { border-top: 1px solid var(--line); }
/* <button class="trow"> (border: 0) ham ajratgich chiziqni yo'qotmasin (Kutubxona → Yo'nalishlar) */
.rows > * + button.trow { border-top: 1px solid var(--line); }
.card .rows { box-shadow: none; }
.trow { display: flex; align-items: center; gap: 12px; padding: 13px 14px; position: relative; transition: background var(--dur-1) ease; }
.trow .t-title { font-weight: 700; font-size: 14.5px; letter-spacing: -.15px; }
.trow.done .t-title { color: var(--muted); text-decoration: line-through; text-decoration-thickness: 1.5px; }
/* Bosiladigan qatorlar — hover / bosish javobi */
a.trow, .menu-row, button.trow { color: inherit; text-decoration: none; }
@media (hover: hover) { a.trow:hover, .menu-row:not(.disabled):hover, button.trow:hover { background: var(--accent-soft-2); } }
a.trow:active, .menu-row:not(.disabled):active, button.trow:active { background: var(--surface-2); }
/* Vazifa qatori (data-hk-row) — bosilsa amallar oynasi ochiladi: kursor va hover ham shuni bildirsin */
.trow[data-hk-row] .t-main { cursor: pointer; }
@media (hover: hover) { .trow[data-hk-row]:not(.sw-open):hover .t-main { background: linear-gradient(var(--accent-soft-2), var(--accent-soft-2)), var(--surface); } }

/* ---------- Surish amallari (swipe) ---------- */
.sw { position: relative; overflow: hidden; padding: 0; display: block; }
.sw .t-main {
  display: flex; align-items: center; gap: 12px; padding: 13px 14px; width: 100%;
  background: var(--surface); position: relative; z-index: 2;
  transition: transform .22s cubic-bezier(.2, .9, .3, 1);
}
.sw-actions { position: absolute; top: 0; right: 0; bottom: 0; display: flex; z-index: 1; }
.sw-actions button {
  width: 50px; border: 0; cursor: pointer; display: grid; place-items: center;
  background: var(--surface-2); color: var(--muted);
}
.sw-actions .sw-done { background: var(--accent-2); color: #fff; }
.sw-actions .sw-tmrw { background: var(--amber); color: #fff; }
.sw-actions .sw-del { background: var(--danger); color: #fff; }
/* Surish amallari faqat surilganda ko'rinadi (aks holda qizil "o'chirish" qator chetidan bilinib turardi) */
.sw .sw-actions { visibility: hidden; }
.sw.sw-open .sw-actions { visibility: visible; }

/* Vazifa belgisi */
.chk {
  width: 26px; height: 26px; flex: 0 0 auto; border-radius: 9px;
  border: 2px solid var(--line-2); background: transparent; cursor: pointer;
  display: grid; place-items: center; color: transparent;
  transition: transform .2s var(--ease-spring), background .18s ease, border-color .18s ease, box-shadow .2s ease;
}
.chk .ic { transform: scale(.4); transition: transform .26s var(--ease-spring); stroke-width: 2.6; }
.chk.on { background: var(--accent-2); border-color: var(--accent-2); color: #fff; box-shadow: 0 4px 10px -4px rgba(18, 184, 134, .7); }
.chk.on .ic { transform: none; }
.chk:active { transform: scale(.84); }
@media (hover: hover) { button.chk:not(.on):hover { border-color: var(--accent-2); background: var(--accent-soft-2); } }

/* ---------- Segment ---------- */
.seg {
  display: flex; gap: 4px; padding: 4px; border-radius: var(--r);
  background: var(--surface-2); position: relative;
  box-shadow: inset 0 1px 2px rgba(16, 36, 30, .06);
}
.seg button {
  flex: 1; border: 0; background: transparent; color: var(--muted); cursor: pointer;
  font: inherit; font-size: 13.5px; font-weight: 700; padding: 9px 10px; border-radius: 12px; min-width: 0;
  transition: background var(--dur-2) var(--ease-out), color var(--dur-2) ease, box-shadow var(--dur-2) ease, transform var(--dur-1) var(--ease-spring);
}
.seg button:active { transform: scale(.96); }
@media (hover: hover) { .seg button:not(.on):hover { color: var(--text); } }
.seg button.on { background: var(--surface); color: var(--text); box-shadow: 0 1px 2px rgba(16, 36, 30, .08), 0 4px 12px -4px rgba(16, 36, 30, .14); }
/* Tungi rejimda faol bo'lim aniq ajralib tursin: yorqinroq sirt + chegara + brend chiziq */
html[data-theme="dark"] .seg { background: #0d1312; box-shadow: inset 0 0 0 1px var(--line); }
html[data-theme="dark"] .seg button.on {
  background: var(--surface-3); color: #fff;
  box-shadow: inset 0 0 0 1px var(--line-2), 0 4px 14px -6px rgba(0, 0, 0, .8), inset 0 -2px 0 var(--accent);
}

/* ---------- Kiritish maydoni ---------- */
.input {
  width: 100%; padding: 12px 14px; border-radius: var(--r); font: inherit; font-weight: 500;
  border: 1.5px solid var(--line-2); background: var(--surface); color: var(--text);
  outline: none; transition: border-color var(--dur-1) ease, box-shadow var(--dur-2) ease, background var(--dur-1) ease;
}
@media (hover: hover) { .input:hover:not(:focus) { border-color: color-mix(in srgb, var(--text) 22%, transparent); } }
.input:focus { border-color: var(--accent-2); box-shadow: 0 0 0 4px var(--accent-soft); }
/* background-color (shorthand emas) — aks holda select.input dagi strelka (background-image) o'chib ketardi */
html[data-theme="dark"] .input { background-color: var(--surface-2); }
/* Soat/sana tanlagich belgisi — matn rangida, yumshoq */
input[type="time"]::-webkit-calendar-picker-indicator, input[type="date"]::-webkit-calendar-picker-indicator,
input[type="datetime-local"]::-webkit-calendar-picker-indicator { opacity: .65; cursor: pointer; }
textarea.input { resize: vertical; min-height: 92px; line-height: 1.5; }
.search { position: relative; }
.search .ic { position: absolute; left: 13px; top: 50%; transform: translateY(-50%); color: var(--muted); }
.search .input { padding-left: 42px; }

/* ---------- Ustunlar (bar) ---------- */
/* margin-bottom — ostidagi kun nomlari (span, bottom:-18px) karta chetiga yopishmasin */
.bars { display: flex; align-items: flex-end; gap: 6px; height: 64px; margin-bottom: 20px; }
.bars .b { flex: 1; border-radius: 8px 8px 4px 4px; background: var(--surface-2); position: relative; transition: height .6s var(--ease-out); min-height: 6px; }
.bars .b.on { background: linear-gradient(180deg, var(--accent-2), #0b8f7f); box-shadow: 0 6px 14px -8px rgba(18, 184, 134, .8); }
.bars .b span { position: absolute; bottom: -18px; left: 0; right: 0; text-align: center; font-size: 10px; color: var(--muted); font-weight: 600; }
/* Bugun — kontur va qalin nom */
.bars .b.today { box-shadow: inset 0 0 0 2px var(--accent-2); }
.bars .b.today.on { box-shadow: 0 0 0 2px var(--surface), 0 0 0 3.5px var(--accent-2), 0 6px 14px -8px rgba(18, 184, 134, .8); }
.bars .b.today span { color: var(--accent); font-weight: 800; }
/* Ustun ustidagi son (bajarilgan ishlar) */
.bars .b em { position: absolute; top: -16px; left: 0; right: 0; text-align: center; font-style: normal; font-size: 10px; font-weight: 800; color: var(--muted); font-variant-numeric: tabular-nums; }

/* ---------- Hafta qatori ---------- */
.days { display: flex; gap: 7px; }
.day { flex: 1; text-align: center; }
.day i {
  display: grid; place-items: center; height: 42px; border-radius: 13px;
  background: var(--surface-2); font-style: normal; font-size: 12px; color: var(--muted);
  border: 1px solid transparent; font-weight: 700;
}
.day.on i { background: var(--accent-soft); color: var(--accent); border-color: var(--accent-2); }
.day.today i { box-shadow: 0 0 0 2px var(--accent-2) inset; }
.day span { display: block; font-size: 10.5px; color: var(--muted); margin-top: 5px; }

/* ---------- Gorizontal kartalar ---------- */
/* scroll-padding — birinchi karta ekran chetiga emas, 16px chekkaga "yopishadi" */
.hscroll { display: flex; gap: 10px; overflow-x: auto; padding: 2px 16px 10px; margin: 0 -16px; scrollbar-width: none; scroll-snap-type: x proximity; scroll-padding-inline: 16px; align-items: stretch; }
.hscroll::-webkit-scrollbar { display: none; }
.hscroll > * { flex: 0 0 auto; width: 214px; scroll-snap-align: start; }
.hscroll > .card + .card { margin-top: 0; }
/* Bugun → O'rganish: rangli mini kartalar */
.lc { overflow: hidden; }
.lc::after { content: ''; position: absolute; right: -44px; bottom: -48px; width: 100px; height: 100px; border-radius: 50%; background: var(--lc-soft, var(--accent-soft)); pointer-events: none; }
.lc.lc-indigo { --lc-soft: var(--indigo-soft); }
.lc > * { position: relative; z-index: 1; }
.lc .lc-ic { width: 34px; height: 34px; border-radius: 11px; display: grid; place-items: center; background: var(--lc-soft, var(--accent-soft)); color: var(--lc, var(--accent)); }
.lc.lc-indigo .lc-ic { --lc: var(--indigo); }

/* ---------- Tab bar (mobil: pastda, "shisha") ---------- */
.tabbar {
  position: fixed; bottom: 0; left: 50%; transform: translateX(-50%);
  width: 100%; max-width: var(--app-w); z-index: 50;
  display: flex; align-items: stretch;
  padding: 6px 8px calc(6px + var(--safe-b));
  background: var(--surface);
  background: color-mix(in srgb, var(--surface) 80%, transparent);
  backdrop-filter: saturate(180%) blur(20px);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  border-top: 1px solid var(--line);
  box-shadow: 0 -10px 30px -20px rgba(16, 36, 30, .3);
}
html[data-theme="dark"] .tabbar { background: color-mix(in srgb, #0d1312 82%, transparent); }
.tabbar a, .tabbar button {
  flex: 1; border: 0; background: none; cursor: pointer; color: var(--muted);
  display: flex; flex-direction: column; align-items: center; gap: 3px; position: relative;
  padding: 6px 2px 5px; border-radius: 14px; font: inherit; font-size: 10.5px; font-weight: 700;
  text-decoration: none; transition: color var(--dur-2) ease, transform var(--dur-1) var(--ease-spring);
  min-width: 0;
}
/* Faol tab: ikonka ortida "pill" — sakrab paydo bo'ladi */
.tabbar a::before {
  content: ''; position: absolute; top: 3px; left: 50%; width: 54px; height: 30px; margin-left: -27px; border-radius: 999px;
  background: var(--accent-soft); opacity: 0; transform: scale(.5, .7);
  transition: opacity var(--dur-2) ease, transform .42s var(--ease-spring);
}
.tabbar a > * { position: relative; }
.tabbar a .ic { height: 24px; margin-top: 0; transition: transform .34s var(--ease-spring); }
.tabbar .on { color: var(--accent); }
.tabbar a.on::before { opacity: 1; transform: none; }
.tabbar a.on .ic { transform: translateY(-1px); }
.tabbar a:active, .tabbar button:active { transform: scale(.92); }
.tabbar .on .ic { stroke-width: 2.2; }
.tabbar a > span { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
/* Yon menyu elementlari mobilda yashirin */
.tabbar .side-brand, .tabbar .side-user, .tabbar .side-cap { display: none; }

/* Planshet (720–1023): 680px ustun chetlari "cho'zilgan telefon" bo'lib ko'rinmasin —
   tab bar suzuvchi pill, appbar foni faqat aylantirilganda chiqadi */
@media (min-width: 720px) and (max-width: 1023px) {
  .tabbar {
    bottom: calc(12px + var(--safe-b)); width: calc(100% - 24px); max-width: calc(var(--app-w) - 24px);
    padding-bottom: 6px; border-radius: var(--r-xl); border: 1px solid var(--line);
    box-shadow: var(--shadow-lg), var(--hl);
  }
  .appbar { background: transparent; backdrop-filter: none; -webkit-backdrop-filter: none; }
  body.scrolled .appbar {
    background: color-mix(in srgb, var(--bg) 82%, transparent);
    backdrop-filter: saturate(180%) blur(18px); -webkit-backdrop-filter: saturate(180%) blur(18px);
    border-radius: 0 0 var(--r-lg) var(--r-lg);
  }
}

/* ---------- FAB ----------
   Dumaloq (56px) ↔ Reja'da to'liq kenglikdagi "Yaratish" (.wide). Geometriya faqat aniq
   qiymatlar bilan (right/width/bottom/height/radius) — shuning uchun silliq o'tadi.
   --fab-wide-w / --fab-wide-r ni app.js o'lchab qo'yadi (desktopda kontent kengligi). */
.fab {
  position: fixed; z-index: 55;
  right: var(--fab-r, calc(max(0px, (100vw - var(--app-w)) / 2) + 16px));
  bottom: calc(var(--tabbar-h) + var(--safe-b) + 16px);
  width: 56px; height: 56px; padding: 0; border-radius: 28px; border: 0; cursor: pointer;
  background: var(--grad-btn); color: #fff;
  display: flex; align-items: center; justify-content: center; overflow: hidden;
  box-shadow: var(--shadow-brand), inset 0 1px 0 rgba(255, 255, 255, .25);
  font: inherit;
  /* Qisqarish (keng → dumaloq): tezroq, sakrashsiz. Kengayish vaqtlari — .fab.wide da */
  transition:
    width .44s var(--ease-out), right .44s var(--ease-out),
    bottom .4s var(--ease-out), height .4s var(--ease-out), border-radius .4s var(--ease-out),
    transform .3s var(--ease-spring), opacity .22s ease, box-shadow .3s ease, visibility 0s;
  -webkit-tap-highlight-color: transparent;
}
.fab::after {
  /* yaltirash — kengayganda chapdan o'ngga bir marta o'tadi */
  content: ''; position: absolute; inset: 0; border-radius: inherit; pointer-events: none;
  background: linear-gradient(105deg, transparent 30%, rgba(255, 255, 255, .28) 50%, transparent 70%);
  transform: translateX(-120%);
}
.fab.wide::after { transform: translateX(120%); transition: transform .9s .22s ease; }
.fab .ic { width: 26px; height: 26px; stroke-width: 2.3; transition: transform .44s var(--ease-out), width .36s var(--ease-out), height .36s var(--ease-out); }
.fab:active { transform: scale(.92); }
.fab .fab-label {
  display: inline-block; font-weight: 800; font-size: 15px; letter-spacing: -.1px; white-space: nowrap;
  max-width: 0; opacity: 0; margin-left: 0; transform: translateX(-8px);
  transition: max-width .3s var(--ease-out), margin-left .3s var(--ease-out), opacity .1s ease, transform .2s var(--ease-out);
}
/* Yashirish: prujinasiz (avval scale 0 dan o'tib ketib, kichik "blip" bo'lib qaytardi).
   visibility — kichrayish tugagach (.26s): yashirin FAB klaviatura (Tab) va ekran o'quvchiga ko'rinmasin */
.fab.hide,
body.note-focus .fab:not(.wide), body.fab-dim .fab:not(.wide), body.fab-away .fab:not(.wide) {
  transform: scale(0); opacity: 0; pointer-events: none; visibility: hidden;
  transition:
    width .44s var(--ease-out), right .44s var(--ease-out),
    bottom .4s var(--ease-out), height .4s var(--ease-out), border-radius .4s var(--ease-out),
    transform .26s cubic-bezier(.4, 0, .7, 1), opacity .2s ease, box-shadow .3s ease, visibility 0s linear .26s;
}
/* Yuqoridagi: note-focus — tez qayd maydoni fokusda (yuborish tugmasini yopmasin), fab-away — Bugun'da pastga
   aylantirilayotganda (kontentdagi havola/"Bajardim" ustiga tushmasin; tepaga aylantirilganda qaytadi) — app.js */
/* Appbardagi "Qo'shish" — faqat desktop Bugun, kontentdan o'ngda FAB uchun joy bo'lmaganda (app.js fabMeasure: body.fab-gutter) */
.appbar .hk-add { display: none; flex: 0 0 auto; }
@media (min-width: 1024px) {
  body.fab-on:not(.fab-gutter) .appbar .hk-add { display: inline-flex; }
  body.fab-on:not(.fab-gutter) .fab:not(.wide) { transform: scale(0); opacity: 0; pointer-events: none; visibility: hidden; }
}

/* ---------- Bottom sheet ---------- */
.backdrop {
  position: fixed; inset: 0; background: rgba(5, 12, 10, .46); z-index: 90;
  opacity: 0; pointer-events: none; transition: opacity .3s ease;
  backdrop-filter: blur(3px); -webkit-backdrop-filter: blur(3px);
}
.backdrop.on { opacity: 1; pointer-events: auto; }
.sheet {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 95; margin: 0 auto; max-width: min(560px, var(--app-w));
  background: var(--surface); border-radius: var(--r-xl) var(--r-xl) 0 0;
  padding: 8px 18px calc(18px + var(--safe-b));
  transform: translateY(104%); transition: transform .3s cubic-bezier(.4, 0, .9, .6);
  box-shadow: var(--shadow-lg), inset 0 1px 0 rgba(255, 255, 255, .06); max-height: 88dvh; overflow-y: auto;
  border: 1px solid var(--line); border-bottom: 0;
}
/* Ochilishi — "prujina" (yengil sakrash), yopilishi — tez */
.sheet.on { transform: none; transition: transform .5s cubic-bezier(.2, 1.12, .32, 1); }
.sheet .handle { width: 40px; height: 5px; border-radius: 99px; background: var(--line-2); margin: 6px auto 12px; }

/* ---------- Toast ---------- */
.toastwrap {
  position: fixed; left: 0; right: 0; bottom: calc(var(--tabbar-h) + var(--safe-b) + 22px);
  z-index: 120; display: flex; flex-direction: column; align-items: center; gap: 8px;
  pointer-events: none; padding: 0 16px;
}
.toast {
  background: rgba(16, 24, 22, .94); color: #fff; border-radius: 16px; padding: 12px 16px;
  font-size: 13.5px; font-weight: 700; box-shadow: 0 14px 36px -12px rgba(0, 0, 0, .5);
  border: 1px solid rgba(255, 255, 255, .08); max-width: 100%;
  backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
  display: flex; align-items: center; gap: 8px;
  animation: toastIn .42s var(--ease-spring) both;
}
.toast.ok { background: linear-gradient(135deg, #0b9170, #0a7c7c); }
.toast.err { background: #c8281d; }
/* Ogohlantirish (saqlandi, lekin e'tibor kerak) — to'q sariq; matn oq bo'lib qoladi (AA) */
.toast.warn { background: #a14d0a; }
@keyframes toastIn { from { opacity: 0; transform: translateY(18px) scale(.94); } to { opacity: 1; transform: none; } }
.toast.out { animation: toastOut .2s ease both; }
@keyframes toastOut { to { opacity: 0; transform: translateY(10px) scale(.97); } }
/* Sheet ochiq (app.js: body.sheet-on) — toast ekran tepasida, sheet tugmalarini yopmaydi */
body.sheet-on .toastwrap { top: calc(var(--safe-t) + 12px); bottom: auto !important; }
body.sheet-on .toast { animation-name: toastInTop; }
body.sheet-on .toast.out { animation-name: toastOut; }
@keyframes toastInTop { from { opacity: 0; transform: translateY(-18px) scale(.94); } to { opacity: 1; transform: none; } }

/* ---------- Skelet ---------- */
.skel { border-radius: 12px; background: var(--surface-2); position: relative; overflow: hidden; }
.skel::after {
  content: ''; position: absolute; inset: 0;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, .65), transparent);
  transform: translateX(-100%); animation: shimmer 1.25s ease-in-out infinite;
}
html[data-theme="dark"] .skel::after { background: linear-gradient(90deg, transparent, rgba(255, 255, 255, .06), transparent); }
@keyframes shimmer { to { transform: translateX(100%); } }
.skel-line { height: 12px; margin-bottom: 9px; }
.skeleton-mode .real { display: none !important; }

/* ---------- Bo'sh holat: ikonka rangli doira ichida ---------- */
.empty { text-align: center; padding: 30px 18px 26px; color: var(--muted); }
.empty > svg.ic:first-child {
  width: 64px; height: 64px; padding: 18px; margin: 0 auto 12px; display: block; border-radius: 50%;
  color: var(--accent); stroke-width: 1.9;
  background: radial-gradient(circle at 30% 25%, var(--surface), transparent 70%), var(--accent-soft);
  box-shadow: 0 0 0 8px var(--accent-soft-2), 0 0 0 16px color-mix(in srgb, var(--accent-soft-2) 50%, transparent);
}
.empty .bold { color: var(--text); font-size: 15px; font-weight: 800; letter-spacing: -.2px; }
.empty .sm { margin-top: 4px; }

/* ---------- Oflayn banner ---------- */
.offline {
  position: fixed; top: calc(var(--safe-t)); left: 50%; transform: translate(-50%, -140%);
  z-index: 130; background: var(--danger); color: #fff; font-size: 12.5px; font-weight: 700;
  padding: 8px 14px; border-radius: 0 0 12px 12px;
  /* Yashirin holatda ekran o'quvchi ham "Internet yo'q" ni o'qimasin: visibility chiqib ketish tugagach o'chadi */
  visibility: hidden; transition: transform .25s ease, visibility 0s linear .25s;
  display: flex; align-items: center; gap: 7px;
}
.offline.on { transform: translate(-50%, 0); visibility: visible; transition: transform .25s ease, visibility 0s; }

/* ---------- Chiziqli progress ---------- */
.bar { height: 10px; border-radius: 99px; background: var(--surface-2); overflow: hidden; }
.bar i { display: block; height: 100%; width: 0; border-radius: 99px; background: linear-gradient(90deg, var(--accent-2), #0b8f7f 60%, var(--indigo)); transition: width .9s var(--ease-out); }

/* ---------- Kayfiyat tugmalari (eski emoji uslubi; .mpick ichida icons.css qayta yozadi) ---------- */
.moodbtn {
  width: 46px; height: 46px; border-radius: 14px; border: 1px solid var(--line);
  background: var(--surface); font-size: 22px; line-height: 1; cursor: pointer;
  transition: transform .12s ease, border-color .15s ease, background .15s ease;
}
.moodbtn:active { transform: scale(.92); }
.moodbtn.on { border-color: var(--accent); background: var(--accent-soft); }

/* ---------- Ustunlar (desktopda ikki ustun) ---------- */
/* Bir ustunga tushganda: 2-ustun karta bilan boshlansa ham kartalar orasidagi 12px ritm saqlansin
   (sarlavha bilan boshlansa — .sec ning 22px yuqori chekkasi bilan birlashadi) */
.cols > .col + .col { margin-top: 12px; }
.cols > .col { min-width: 0; }

/* ---------- Kalit (switch) ---------- */
.switch {
  width: 50px; height: 30px; flex: 0 0 auto; border-radius: 99px; cursor: pointer;
  background: var(--surface-3); border: 1px solid var(--line); position: relative;
  transition: background .2s ease, border-color .2s ease;
}
.switch i {
  position: absolute; top: 2px; left: 2px; width: 24px; height: 24px; border-radius: 50%;
  background: #fff; box-shadow: 0 1px 3px rgba(0, 0, 0, .22), 0 2px 6px -2px rgba(0, 0, 0, .2);
  transition: transform .3s var(--ease-spring);
}
.switch.on { background: var(--accent-2); border-color: var(--accent-2); }
.switch.on i { transform: translateX(20px); }
html[data-theme="dark"] .switch i { background: #e9ecf2; }

/* ---------- Avatar rasmi ---------- */
.avatar img { width: 100%; height: 100%; border-radius: 50%; object-fit: cover; }

/* ---------- Select ---------- */
select.input {
  appearance: none; -webkit-appearance: none;
  background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%);
  background-position: calc(100% - 19px) 52%, calc(100% - 14px) 52%;
  background-size: 5px 5px, 5px 5px;
  background-repeat: no-repeat;
  padding-right: 40px;
}

/* ---------- Nishonlar ---------- */
.badges { display: grid; grid-template-columns: repeat(4, 1fr); gap: 9px; }
.badge-t {
  aspect-ratio: 1; border-radius: var(--r); background: var(--surface-2);
  display: grid; place-items: center; text-align: center; padding: 6px;
  border: 1px solid var(--line);
}
.badge-t.on { background: linear-gradient(160deg, rgba(255, 214, 120, .35), var(--amber-soft)); border-color: rgba(245, 158, 11, .25); color: var(--amber-ink); box-shadow: 0 6px 16px -10px rgba(245, 158, 11, .8); }
.badge-t.off { opacity: .45; }
.badge-t span { font-size: 9.5px; font-weight: 700; display: block; }

/* ---------- Reyting ---------- */
.rank-row { display: flex; align-items: center; gap: 11px; padding: 10px 12px; }
.rank-row .no { width: 22px; text-align: center; font-weight: 800; font-size: 13px; color: var(--muted); }
.rank-row.me { background: var(--accent-soft); border-radius: 14px; box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--accent-2) 30%, transparent); }

/* ---------- Kartochka (flashcard) ---------- */
.fc { perspective: 1000px; height: 200px; }
.fc-in { position: relative; width: 100%; height: 100%; transition: transform .55s cubic-bezier(.3, .9, .3, 1); transform-style: preserve-3d; }
.fc.flip .fc-in { transform: rotateY(180deg); }
.fc-f, .fc-b {
  position: absolute; inset: 0; backface-visibility: hidden;
  border-radius: var(--r-lg); display: grid; place-items: center; text-align: center; padding: 20px;
  background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow);
}
.fc-b { transform: rotateY(180deg); background: linear-gradient(135deg, var(--accent-soft), var(--indigo-soft)); }

/* =====================================================================
   DESKTOP (>= 1024px): pastdagi tab bar -> chap yon menyu (logotip, faol holat, foydalanuvchi)
   Kontent (appbar + ekran) qolgan maydonda markazlashadi: --content-w
   ===================================================================== */
@media (min-width: 1024px) {
  .app { max-width: none; }

  /* Yon menyu (tab bar qayta ishlatiladi — markup bir xil qoladi) */
  .tabbar {
    left: 0; top: 0; bottom: 0;
    transform: none;
    width: var(--side-w); max-width: var(--side-w); height: 100dvh;
    flex-direction: column; align-items: stretch; justify-content: flex-start; gap: 3px;
    padding: calc(18px + var(--safe-t)) 14px 16px;
    border-top: 0; border-right: 1px solid var(--line);
    background: color-mix(in srgb, var(--surface) 72%, transparent);
    box-shadow: none; overflow-y: auto;
  }
  html[data-theme="dark"] .tabbar { background: color-mix(in srgb, #0c1211 86%, transparent); }
  .tabbar .side-brand { display: flex; align-items: center; gap: 11px; padding: 4px 10px 20px; text-decoration: none; color: var(--text); }
  .tabbar .side-cap { display: block; font-size: 11px; font-weight: 800; letter-spacing: .9px; text-transform: uppercase; color: var(--muted); padding: 4px 14px 8px; opacity: .85; }
  .tabbar a, .tabbar button {
    flex: 0 0 auto;
    flex-direction: row; justify-content: flex-start; gap: 12px;
    font-size: 14.5px; font-weight: 700; padding: 10px 12px; border-radius: 14px; color: var(--text-2);
    transition: background var(--dur-1) ease, color var(--dur-1) ease, transform var(--dur-1) var(--ease-spring);
  }
  .tabbar a::before { display: none; }
  /* Ikonka — kichik "tile" */
  .tabbar a > .ic {
    width: 34px; height: 34px; padding: 7px; border-radius: 11px; margin: 0;
    background: var(--surface-2); color: var(--muted); transform: none !important;
    transition: background var(--dur-2) ease, color var(--dur-2) ease, box-shadow var(--dur-2) ease;
  }
  .tabbar a:hover { background: var(--surface-2); color: var(--text); }
  .tabbar a:hover > .ic { color: var(--text); background: var(--surface); }
  .tabbar .on, .tabbar a.on:hover { background: var(--accent-soft); color: var(--text); }
  .tabbar a.on > .ic { background: var(--grad-btn); color: #fff; box-shadow: 0 6px 14px -6px rgba(11, 133, 122, .7); }
  .tabbar .on .ic { stroke-width: 2; }
  .tabbar a.on::after {
    content: ''; position: absolute; left: -14px; top: 10px; bottom: 10px; width: 4px; border-radius: 0 4px 4px 0;
    background: var(--accent-2);
  }
  .tabbar .side-user {
    display: flex; margin-top: auto; align-items: center; gap: 10px; padding: 10px; border-radius: 16px;
    border: 1px solid var(--line); background: var(--surface); box-shadow: var(--shadow-xs);
  }
  .tabbar .side-user .avatar { width: 36px; height: 36px; font-size: 12.5px; box-shadow: none; }
  .tabbar .side-user b { display: block; font-size: 13.5px; font-weight: 800; color: var(--text); }
  .tabbar .side-user small { display: block; font-size: 11.5px; color: var(--muted); font-weight: 600; }
  .tabbar a.side-user::after { display: none; }
  .tabbar a.side-user > .ic { width: 18px; height: 18px; padding: 0; background: none; box-shadow: none; }
  .tabbar a.side-user:hover { background: var(--surface-2); }

  /* Kontent yon menyudan keyin — qolgan maydonda markazda */
  .appbar {
    margin-left: var(--side-w);
    padding-left: calc(max(0px, (100% - var(--side-w) - var(--content-w)) / 2) + 28px);
    padding-right: calc(max(0px, (100% - var(--side-w) - var(--content-w)) / 2) + 28px);
  }
  .screen {
    margin-left: calc(var(--side-w) + max(0px, (100% - var(--side-w) - var(--content-w)) / 2));
    padding: 22px 28px 108px; /* pastda dumaloq FAB oxirgi qatorni yopmasin */
    max-width: var(--content-w);
  }
  .appbar .hello b { font-size: 17px; }

  /* --fab-r: app.js kontent ustunining o'ng chetidan o'lchaydi */
  .fab { right: var(--fab-r, 32px); bottom: 32px; }
  .toastwrap { left: var(--side-w); bottom: 26px; }
  .sheet { left: var(--side-w); right: 0; margin: 0 auto; border-radius: var(--r-xl) var(--r-xl) 0 0; }
  .offline { left: calc(50% + var(--side-w) / 2); }

  /* Ikki ustunli tarkib */
  .cols {
    display: grid;
    grid-template-columns: 1.12fr .88fr;
    gap: 20px;
    align-items: start;
  }
  .cols > .col + .col { margin-top: 0; }
  .cols > .col > .sec:first-child { margin-top: 4px; }
  .hero { padding: 20px 22px 18px; }
  .hero .hero-t { font-size: 22px; }
}

@media (min-width: 1440px) {
  .cols { grid-template-columns: 1.2fr .8fr; gap: 24px; }
}
/* Reja: o'ng xulosa ustuni faqat desktopda; ro'yxat ustuni kengroq */
.reja-side { display: none; }
@media (min-width: 1024px) {
  .reja-cols { grid-template-columns: minmax(0, 1.5fr) minmax(280px, .75fr); }
  .reja-side { display: block; }
  .reja-side > .sec:first-child { margin-top: 4px; }
}

/* ---------- Maxsus effektlar ---------- */
.celebrate { position: fixed; inset: 0; z-index: 200; display: grid; place-items: center; background: rgba(4, 10, 8, .7); opacity: 0; pointer-events: none; transition: opacity .3s ease; backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px); }
.celebrate.on { opacity: 1; pointer-events: auto; }
.celebrate .box { background: var(--surface); border-radius: var(--r-xl); padding: 26px 22px; text-align: center; max-width: 300px; animation: pop .5s var(--ease-spring) both; box-shadow: var(--shadow-lg); }
@keyframes pop { from { transform: scale(.8); opacity: 0; } to { transform: none; opacity: 1; } }
.xpfly { position: fixed; z-index: 210; font-weight: 800; color: var(--accent); pointer-events: none; animation: xpfly 1s ease-out both; text-shadow: 0 2px 10px var(--accent-soft); }
@keyframes xpfly { to { transform: translateY(-56px); opacity: 0; } }
@keyframes spin { to { transform: rotate(360deg); } }
.spin { animation: spin 1s linear infinite; }

/* =====================================================================
   QO'SHIMCHA KOMPONENTLAR (2.1)
   ===================================================================== */

/* ---------- Appbar: bo'lim ikonkasi ---------- */
.sec-ic {
  width: 40px; height: 40px; flex: 0 0 auto; border-radius: 13px;
  display: grid; place-items: center;
  background: var(--grad-btn); border: 0; color: #fff;
  box-shadow: 0 6px 14px -6px rgba(11, 133, 122, .7), inset 0 1px 0 rgba(255, 255, 255, .25);
}

/* ---------- Bildirishnoma nuqtasi ---------- */
.iconbtn { position: relative; }
.iconbtn .dot {
  position: absolute; top: 7px; right: 7px; width: 9px; height: 9px; border-radius: 50%;
  background: var(--danger); border: 2px solid var(--surface);
  animation: dotPulse 2.4s ease-in-out infinite;
}
.iconbtn .dot.off { display: none; }
@keyframes dotPulse { 0%, 100% { box-shadow: 0 0 0 0 rgba(217, 45, 32, .35); } 50% { box-shadow: 0 0 0 4px rgba(217, 45, 32, 0); } }

/* ---------- Sheet: maydonlar ---------- */
.sheet .h2 { display: flex; align-items: center; gap: 10px; padding: 0; }
.field { margin-top: 13px; }
.field > label {
  display: block; font-size: 12px; font-weight: 700; color: var(--muted);
  margin: 0 0 6px; padding: 0; line-height: 1.3;
}
.field > .input, .field > select.input { margin: 0; }
.sheet label { margin: 0; }

/* ---------- Kichik segment ---------- */
.seg.sm { padding: 3px; }
.seg.sm button { font-size: 12.5px; padding: 7px 6px; border-radius: 10px; }

/* ---------- Hafta kunlari tanlash ---------- */
.wdays { display: flex; gap: 6px; flex-wrap: wrap; }
.wdays button {
  width: 38px; height: 38px; border-radius: 12px; border: 1px solid var(--line);
  background: var(--surface-2); color: var(--muted); font: inherit; font-weight: 700; font-size: 12.5px;
  cursor: pointer; transition: transform .2s var(--ease-spring), background .15s ease, color .15s ease, border-color .15s ease;
}
.wdays button:active { transform: scale(.9); }
/* Tartib formasi: vaqt qatoridagi "✕" (app.js rtTimeRow) */
.rt-time-row > .input { flex: 1 1 auto; min-width: 0; }
.iconbtn.rt-x { color: var(--danger); }
.wdays button.on { background: var(--grad-btn); color: #fff; border-color: transparent; }

/* ---------- Tez qayd (uy sahifasi) ---------- */
.note-list { display: flex; flex-direction: column; gap: 8px; margin-top: 12px; }
.note {
  display: flex; align-items: flex-start; gap: 10px; padding: 11px 12px;
  border-radius: var(--r); background: var(--surface-2); border: 1px solid var(--line);
}
.note .n-body { flex: 1; min-width: 0; }
.note .n-text { font-size: 14px; word-break: break-word; }
.note .n-time { font-size: 11px; color: var(--muted); margin-top: 3px; }
.note .n-x { border: 0; background: transparent; color: var(--muted); cursor: pointer; padding: 2px; border-radius: 8px; }
.note .n-x:active { transform: scale(.9); }

/* quick note input row */
.quicknote { display: flex; align-items: center; gap: 8px; }
.quicknote .input { flex: 1; }
.quicknote .iconbtn { flex: 0 0 auto; width: 46px; height: 46px; border-radius: 14px; background: var(--grad-btn); color: #fff; border: 0; box-shadow: 0 6px 14px -8px rgba(11, 133, 122, .8); }

/* ---------- Sheet: sudrab yopish ---------- */
.sheet.dragging { transition: none !important; }
.sheet .handle { cursor: grab; touch-action: none; }

/* ---------- Menyu ro'yxati (tugma ko'rinishida) ---------- */
.menu-row { cursor: pointer; }
.menu-row .lead {
  width: 36px; height: 36px; flex: 0 0 auto; border-radius: 11px; display: grid; place-items: center;
  background: var(--accent-soft); color: var(--accent);
}
.menu-row.disabled { opacity: .5; cursor: not-allowed; }
.menu-row.disabled .lead { color: var(--muted); background: var(--surface-2); }
/* Ro'yxatdagi "lead" ikonkalar — ketma-ket rang (bir xil kulrang emas) */
/* Xavfli bandlar (.danger) rang aylanishiga kirmaydi — doim qizil (o'chirish "zararsiz" ko'rinmasin) */
.rows > .menu-row:not(.danger):nth-child(5n+2) .lead { background: var(--indigo-soft); color: var(--indigo); }
.rows > .menu-row:not(.danger):nth-child(5n+3) .lead { background: var(--amber-soft); color: var(--amber-ink); }
.rows > .menu-row:not(.danger):nth-child(5n+4) .lead { background: var(--sky-soft); color: var(--sky); }
.rows > .menu-row:not(.danger):nth-child(5n+5) .lead { background: var(--violet-soft); color: var(--violet); }
/* HK.menu({tone}) — aniq berilgan rang qatordagi navbatdan ustun */
.rows > .menu-row.toned:not(.danger) .lead.lead-indigo { background: var(--indigo-soft); color: var(--indigo); }
.rows > .menu-row.toned:not(.danger) .lead.lead-violet { background: var(--violet-soft); color: var(--violet); }
.rows > .menu-row.toned:not(.danger) .lead.lead-amber { background: var(--amber-soft); color: var(--amber-ink); }
.rows > .menu-row.toned:not(.danger) .lead.lead-sky { background: var(--sky-soft); color: var(--sky); }

/* ---------- Kichik statistika / versiya ---------- */
.kv { display: flex; align-items: center; justify-content: space-between; padding: 11px 0; gap: 10px; }
.kv + .kv { border-top: 1px solid var(--line); }
.kv .k { color: var(--muted); font-size: 13px; }
.kv .v { font-weight: 800; font-size: 13.5px; }
.ver { text-align: center; color: var(--muted); font-size: 11.5px; margin-top: 14px; }

/* ---------- Yordam qo'llanmalari ---------- */
.guide { display: flex; align-items: center; gap: 11px; padding: 11px 12px; border-radius: var(--r); background: var(--surface-2); border: 1px solid var(--line); cursor: pointer; transition: background var(--dur-1) ease; }
.guide:hover { background: var(--surface-3); }
.guide + .guide { margin-top: 8px; }
.guide .g-ic { width: 38px; height: 38px; border-radius: 12px; background: var(--surface); display: grid; place-items: center; color: var(--accent); flex: 0 0 auto; }

/* ---------- Reyting oynasi ---------- */
.rank-sheet .rank-row { padding: 9px 4px; }

/* ---------- Bo'sh / maslahat matni ---------- */
.inspire {
  border-radius: var(--r-lg); padding: 16px 18px; border: 1px solid var(--line);
  background: linear-gradient(135deg, var(--accent-soft), var(--indigo-soft));
}
.inspire .q { font-size: 14.5px; line-height: 1.55; }

/* ---------- Rotatsiya placeholder uchun yumshoq ---------- */
input::placeholder, textarea::placeholder { color: var(--muted); opacity: .8; }

/* =====================================================================
   2.3 — TASODIFIY BOSISHDAN HIMOYA, "YAQINDA", REJA TUGMASI, KALITLAR
   ===================================================================== */

/* ---------- Havolalar (brauzer ko'k/siyohrang rangi tungi rejimda o'qilmaydi) ---------- */
a { color: var(--accent); text-decoration: none; }

/* ---------- Klaviatura fokusi ---------- */
.btn:focus-visible, .iconbtn:focus-visible, .morebtn:focus-visible, .chk:focus-visible,
.switch:focus-visible, .chip:focus-visible, .act-item:focus-visible, .seg button:focus-visible,
.menu-row:focus-visible, .fab:focus-visible, .tabbar a:focus-visible, a.card:focus-visible, a.trow:focus-visible,
button.trow:focus-visible, .sec a:focus-visible, .sec button.link:focus-visible {
  outline: 2px solid var(--accent-2); outline-offset: 2px;
}

/* ---------- Uzun ism/email/matn kartadan chiqib ketmasin ---------- */
.grow { overflow-wrap: break-word; }
.trow > .btn, .trow > .switch, .trow > .iconbtn, .trow > .morebtn { flex: 0 0 auto; }
/* Uzun qiymatli chip (username, email) sarlavhani harfma-harf siqib qo'ymasin — chip qisqaradi (…) */
.trow > .grow { min-width: 88px; }
.trow > .chip { flex: 0 1 auto; min-width: 0; max-width: 62%; overflow: hidden; }
.chip > .nowrap { display: block; min-width: 0; }
.btn.sm { white-space: nowrap; }
.trow > .input[type="time"] { flex: 0 0 auto; width: 118px; padding-left: 10px; padding-right: 10px; }

/* ---------- "⋯" amallar tugmasi (tahrirlash/o'chirish qatorda emas, menyuda) ---------- */
.morebtn {
  width: 44px; height: 44px; flex: 0 0 auto; border-radius: 12px; border: 0; cursor: pointer;
  display: grid; place-items: center; background: transparent; color: var(--muted);
  margin: -6px -8px -6px 0; transition: background .15s ease, transform .2s var(--ease-spring), color .15s ease;
}
.morebtn:hover { background: var(--surface-2); color: var(--text); }
.morebtn:active { transform: scale(.9); background: var(--surface-2); }
/* Asosiy tugma va "⋯" orasida yetarli masofa */
.trow > .btn + .morebtn, .rt-acts .btn + .morebtn { margin-left: 4px; }

/* ---------- Amallar menyusi (bottom sheet ichida) ---------- */
.act-list { margin-top: 14px; }
.act-list + .act-list { margin-top: 16px; }
.act-item {
  width: 100%; min-height: 54px; border: 0; margin: 0; cursor: pointer;
  background: var(--surface); color: var(--text); font: inherit; text-align: left;
}
.act-item .t-title, .act-item .act-hint { display: block; }
.act-item:active { background: var(--surface-2); }
.act-item.danger .t-title, .act-item.danger .lead { color: var(--danger); }
.act-item.danger .lead { background: var(--danger-soft); }
html[data-theme="dark"] .act-list { background: var(--surface-2); }
html[data-theme="dark"] .act-item { background: var(--surface-2); }
html[data-theme="dark"] .act-item .lead { background: var(--surface); }
html[data-theme="dark"] .act-item.danger .lead { background: var(--danger-soft); }

/* Sheet ichidagi xavfli tugma — asosiylaridan ajratilgan, kontur ko'rinishida */
.btn.danger-outline { background: transparent; color: var(--danger); border: 1px solid color-mix(in srgb, var(--danger) 35%, transparent); box-shadow: none; }
.btn.danger-outline:active { background: var(--danger-soft); }
.act-sep { height: 1px; background: var(--line); margin: 18px 0 12px; }

/* ---------- Tasdiqlash oynasi (window.hkConfirm) ---------- */
.hk-cf-back {
  position: fixed; inset: 0; z-index: 140; display: flex; align-items: flex-end; justify-content: center;
  padding: 16px 16px calc(16px + var(--safe-b));
  background: rgba(5, 12, 10, .5); opacity: 0; transition: opacity .2s ease;
  backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px);
}
.hk-cf-back.on { opacity: 1; }
.hk-cf {
  width: 100%; max-width: 420px; background: var(--surface); color: var(--text);
  border: 1px solid var(--line); border-radius: var(--r-xl); padding: 20px 18px 16px;
  box-shadow: var(--shadow-lg); transform: translateY(24px) scale(.96);
  transition: transform .42s var(--ease-soft-spring);
}
.hk-cf-back.on .hk-cf { transform: none; }
.hk-cf-ic {
  width: 46px; height: 46px; border-radius: 15px; display: grid; place-items: center; margin-bottom: 12px;
  background: var(--accent-soft); color: var(--accent);
}
.hk-cf.danger .hk-cf-ic { background: var(--danger-soft); color: var(--danger); }
.hk-cf-t { font-size: 17px; font-weight: 800; letter-spacing: -.3px; overflow-wrap: break-word; }
.hk-cf-x { font-size: 14px; color: var(--muted); margin-top: 6px; line-height: 1.5; overflow-wrap: break-word; }
.hk-cf-btns { display: flex; gap: 12px; margin-top: 20px; }
.hk-cf-btns .btn { flex: 1 1 0; min-height: 48px; min-width: 0; }
@media (min-width: 560px) { .hk-cf-back { align-items: center; } }
@media (min-width: 1024px) { .hk-cf-back { padding-left: calc(var(--side-w) + 16px); } }

/* ---------- Toast: "Bekor qilish" (undo) tugmasi ---------- */
.toast.has-act { pointer-events: auto; padding: 6px 6px 6px 16px; }
.toast .t-act {
  margin-left: 8px; min-height: 36px; padding: 8px 12px; border: 0; border-radius: 10px; cursor: pointer;
  background: rgba(255, 255, 255, .18); color: #fff; font: inherit; font-size: 13px; font-weight: 800; white-space: nowrap;
}
.toast .t-act:active { transform: scale(.95); }

/* ---------- Reja: "Yaratish" — pastki qismni to'liq egallagan tugma (morf) ----------
   Dumaloq → keng: kenglik + o'ng chet + balandlik + radius bir vaqtda (prujina), yozuv ~120ms keyin
   chiqadi, "+" biroz aylanadi. Teskarisi (Reja'dan chiqish) — yozuv darhol yo'qoladi, keyin qisqaradi. */
.fab.wide {
  width: var(--fab-wide-w, calc(min(100vw, var(--app-w)) - 28px));
  right: var(--fab-wide-r, calc(max(0px, (100vw - var(--app-w)) / 2) + 14px));
  height: 54px; border-radius: 18px;
  bottom: calc(var(--tabbar-h) + var(--safe-b) + 12px);
  /* Kengayish: ~620ms. Kenglik sakrashsiz (ease-out) — "prujina" alohida, kenglikka bog'liq emas:
     fabSettle oxirida ~3px cho'zilib qaytadi (--fab-os = 1 + 3px/kenglik, app.js fabMeasure).
     Avval prujina kenglikning o'zida edi — desktopda 15px ga o'tib, yon menyu chetiga chiqardi. */
  transition:
    width .62s var(--ease-out), right .62s var(--ease-out),
    bottom .5s var(--ease-out), height .5s var(--ease-out), border-radius .5s var(--ease-out),
    transform .3s var(--ease-spring), opacity .22s ease, box-shadow .3s ease, visibility 0s;
  animation: fabSettle .7s ease-out;
}
@keyframes fabSettle {
  0%, 52% { transform: none; }
  74% { transform: scaleX(var(--fab-os, 1.006)); }
  100% { transform: none; }
}
.fab.wide .ic { width: 20px; height: 20px; transform: rotate(180deg); transition: transform .62s var(--ease-soft-spring), width .5s var(--ease-out), height .5s var(--ease-out); }
.fab.wide .fab-label {
  max-width: 160px; opacity: 1; margin-left: 10px; transform: none;
  transition: max-width .5s .1s var(--ease-out), margin-left .5s .1s var(--ease-out), opacity .32s .16s ease, transform .46s .14s var(--ease-out);
}
.fab.wide:active { transform: scale(.98); }
/* Oyna o'lchami o'zgarganda (app.js) — sakramasin */
.fab.fab-noanim, .fab.fab-noanim .ic, .fab.fab-noanim .fab-label { transition: none !important; }
.screen[data-view="reja"] { padding-bottom: calc(var(--tabbar-h) + var(--safe-b) + 30px + 66px); }
/* Bugun: dumaloq FAB (56px + 16px) oxirgi qatordagi "Bajardim"ni yopmasin */
.screen[data-view="bugun"] { padding-bottom: calc(var(--tabbar-h) + var(--safe-b) + 96px); }
body.fab-bar .toastwrap { bottom: calc(var(--tabbar-h) + var(--safe-b) + 22px + 66px); }
/* Bugun: toast dumaloq FAB ustiga tushmasin (mobil) */
@media (max-width: 1023px) { body.fab-on .toastwrap { bottom: calc(var(--tabbar-h) + var(--safe-b) + 84px); } }
@media (min-width: 1024px) {
  .fab.wide {
    right: var(--fab-wide-r, 32px); bottom: calc(24px + var(--safe-b));
    width: var(--fab-wide-w, min(calc(100vw - var(--side-w) - 56px), calc(var(--content-w) - 56px)));
  }
  .screen[data-view="reja"] { padding-bottom: 130px; }
  .screen[data-view="bugun"] { padding-bottom: 112px; }
  body.fab-bar .toastwrap { bottom: 96px; }
}

/* ---------- Bosh sahifa: "Yaqinda" ---------- */
.up-ic {
  width: 36px; height: 36px; flex: 0 0 auto; border-radius: 11px; display: grid; place-items: center;
  background: var(--indigo-soft); color: var(--indigo);
}
/* Kutilayotgan vazifa — moviy soat (yashil belgi faqat bajarilganlarda) */
.up-ic.task { background: var(--sky-soft); color: var(--sky); }
/* O'ngda faqat soat (HH:MM) — tor ustun; "Ertaga"/"Kecha" uning ustida kichik yozuv */
.up-when { flex: 0 0 auto; text-align: right; line-height: 1.2; }
.up-when b { display: block; font-size: 15px; font-weight: 800; letter-spacing: -.2px; }
.up-when .up-day { display: block; font-size: 11px; color: var(--muted); font-weight: 600; }
/* Meta qator: turi · qolgan vaqt · +2 XP */
.up-meta { display: flex; align-items: center; flex-wrap: wrap; gap: 4px 8px; margin-top: 6px; }
.up-meta .up-left { font-size: 12px; color: var(--muted); font-weight: 600; white-space: nowrap; }
.trow.up-now { background: var(--accent-soft); }
.trow.up-now .up-left { color: var(--accent); font-weight: 700; }
.trow:not(.up-now) .up-act { display: none; }
/* "Bajardim" (vaqti kelganda) — sarlavha ostida, keng tugma: tor ekranda nom siqilib qolmasin */
.up-row { flex-wrap: wrap; }
/* Sarlavha ustuni qisqaradi — vaqt bloki qator o'rtasiga tushib qolmaydi; faqat "Bajardim" yangi qatorga o'tadi */
.up-row > .grow { flex: 1 1 0; min-width: 0; }
.up-row .up-act { order: 5; flex: 1 0 calc(100% - 48px); margin-left: 48px; }
/* Desktop: keng satr o'rniga ixcham tugma soat yonida (yondagi "Bugungi tartiblar"dagi kabi) */
@media (min-width: 1024px) {
  .up-row.up-now .up-act { order: 0; flex: 0 0 auto; margin-left: 0; }
}
/* Uzun nom — 2 qatorgacha (keyin …), bir qatorda kesilib qolmasin */
.clamp2 { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; overflow-wrap: anywhere; }
/* Bo'sh holat — bitta qisqa karta (.sec sarlavha ostida) */
.card.empty-line { padding: 14px 16px; }
.up-hint { display: flex; align-items: center; gap: 6px; }

/* ---------- Appbar boshi (#hk-lead) — o'rami joy egallamaydi, ichidagi element appbar flex qatorida ---------- */
.hk-lead { display: contents; }

/* ---------- Bosiladigan qator <button class="trow"> (Kutubxona bo'limlari) ---------- */
button.trow { width: 100%; border: 0; margin: 0; background: transparent; font: inherit; color: inherit; text-align: left; cursor: pointer; }

/* ---------- Telegram rasmi yo'riqnomasi (app3.js) ---------- */
.tg-steps { margin: 0; padding-left: 20px; color: var(--text-2); }
.tg-steps li + li { margin-top: 6px; }

/* ---------- Kalit (switch) — tugma uslublarisiz, holat aria-checked bilan ham ---------- */
button.switch { padding: 0; margin: 0; -webkit-appearance: none; appearance: none; font: inherit; }
.switch[aria-checked="true"] { background: var(--accent-2); border-color: var(--accent-2); }
.switch[aria-checked="true"] i { transform: translateX(20px); }
html[data-theme="dark"] .switch:not(.on) { background: #26302d; }

/* ---------- Profil / sozlamalar ---------- */
/* Qator boshidagi ikonka — barcha ro'yxatlarda bir xil o'lcham va tekislash */
.trow > .lead {
  width: 36px; height: 36px; flex: 0 0 auto; border-radius: 11px; display: grid; place-items: center;
  background: var(--accent-soft); color: var(--accent);
}
.trow > .lead.lead-violet { background: var(--violet-soft); color: var(--violet); }
.trow > .lead.lead-indigo { background: var(--indigo-soft); color: var(--indigo); }
.trow > .lead.lead-amber { background: var(--amber-soft); color: var(--amber-ink); }
.trow > .lead.lead-sky { background: var(--sky-soft); color: var(--sky); }
.danger-row .t-title, .danger-row .lead { color: var(--danger); }
.danger-row .lead { background: var(--danger-soft) !important; }
/* Appbar: uzun ism (Men ekrani sarlavha osti) bir qatorda qolsin */
.hello span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
/* Uzun ism — ko'pi bilan 2 qator (kartani pastga surmasin) */
/* break-word (anywhere emas): ustun bitta so'zdan torayib, "Muhammadjo / n…" bo'lib bo'linmasin */
.men-name { font-size: 19px; line-height: 1.25; overflow-wrap: break-word; letter-spacing: -.3px;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.pf-name { overflow-wrap: anywhere; }
/* Profil rasmi (Profil ekrani + Men → "Profilni tahrirlash" oynasi): bosiladigan avatar + kamera nishoni */
.pf-ava-wrap { position: relative; width: 96px; height: 96px; margin: 0 auto; }
.pf-ava { width: 96px; height: 96px; font-size: 30px; border: 0; padding: 0; cursor: pointer; font-family: inherit;
          overflow: hidden; transition: transform .15s ease, filter .2s ease; }
.pf-ava:active { transform: scale(.96); }
.pf-ava img { width: 100%; height: 100%; border-radius: 50%; object-fit: cover; display: block; }
.pf-ava-badge { position: absolute; right: 0; bottom: 2px; width: 30px; height: 30px; border-radius: 50%;
                display: grid; place-items: center; background: var(--surface); color: var(--text);
                border: 2px solid var(--surface); box-shadow: 0 2px 8px rgba(0,0,0,.18); pointer-events: none; }
.pf-ava-wrap.sm { width: 64px; height: 64px; }
.pf-ava-wrap.sm .pf-ava { width: 64px; height: 64px; font-size: 22px; }
.pf-ava-wrap.sm .pf-ava-badge { width: 24px; height: 24px; right: -3px; bottom: -2px; }
.pf-ava:focus-visible { outline: 2px solid var(--accent-2); outline-offset: 3px; }
/* Kalit "ishlamaydi" holati (masalan, Telegram ulanmagan): bosiladi, lekin yoniq deb chalg'itmaydi */
.switch.dim { opacity: .5; filter: grayscale(.5); }
/* Men → Versiya: brend belgisi va so'z belgisi */
.ver-brand { display: flex; flex-direction: column; align-items: center; gap: 10px; padding: 14px 0 4px; color: var(--text); }
.ver-brand .brand-mark { width: 56px; height: 56px; border-radius: 15px; }
.ver-brand .brand-word { height: 22px; }
.ver .brand-mark { width: 18px; height: 18px; border-radius: 5px; box-shadow: none; display: inline-block; vertical-align: -4px; margin-right: 6px; }
.st-anchor { scroll-margin-top: 84px; }
/* Men: reyting chipi — tor telefonda ism ostida (ism ustuniga joy qolsin), kengroqda o'ngda */
.men-head > .grow { min-width: min(100%, 9ch); }
.men-rank { min-height: 32px; }
.men-rank-sm { display: none; margin-top: 8px; }
@media (max-width: 400px) {
  .men-rank-lg { display: none; }
  .men-rank-sm { display: inline-flex; }
}
.tap-link { display: inline-flex; align-items: center; min-height: 36px; }
.card .avatar-lg { flex: 0 0 auto; }
/* role="button" qatorlar (Men) — klaviatura fokusi */
.menu-row[role="button"]:focus-visible { outline-offset: -2px; border-radius: 12px; }

/* =====================================================================
   2.4 — BREND: logotip, kirish sahifalari uchun umumiy bloklar
   ===================================================================== */
.brand { display: inline-flex; align-items: center; gap: 10px; color: var(--text); text-decoration: none; min-width: 0; }
.brand-mark { width: 36px; height: 36px; flex: 0 0 auto; border-radius: 10px; display: block; box-shadow: 0 6px 16px -6px rgba(11, 133, 122, .6); }
/* So'z belgisi (Manrope ExtraBold yo'llari, assets/img/logo.svg#hk-word) — rang: currentColor */
.brand-word { height: 20px; width: auto; aspect-ratio: 449.5 / 78; fill: currentColor; display: block; }
.brand-sub { display: block; font-size: 11px; color: var(--muted); font-weight: 600; margin-top: 3px; white-space: nowrap; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; transition-delay: 0s !important; scroll-behavior: auto !important; }
}

/* Qidiruv maydonidagi tozalash "×" — Chromium'ning ko'k tugmasi o'rniga mavzu rangidagi belgi (ikkala rejimda) */
input[type="search"]::-webkit-search-cancel-button {
  -webkit-appearance: none; appearance: none; width: 18px; height: 18px; margin-left: 6px; cursor: pointer;
  background: var(--muted); border-radius: 50%;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M12 2a10 10 0 1 0 0 20 10 10 0 0 0 0-20Zm3.5 12.1-1.4 1.4L12 13.4l-2.1 2.1-1.4-1.4 2.1-2.1-2.1-2.1 1.4-1.4 2.1 2.1 2.1-2.1 1.4 1.4-2.1 2.1 2.1 2.1Z'/%3E%3C/svg%3E") center / contain no-repeat;
          mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M12 2a10 10 0 1 0 0 20 10 10 0 0 0 0-20Zm3.5 12.1-1.4 1.4L12 13.4l-2.1 2.1-1.4-1.4 2.1-2.1-2.1-2.1 1.4-1.4 2.1 2.1 2.1-2.1 1.4 1.4-2.1 2.1 2.1 2.1Z'/%3E%3C/svg%3E") center / contain no-repeat;
}
input[type="search"]::-webkit-search-cancel-button:hover { background: var(--text-2); }
