/* Studiya PM — ko'k-oq, tungi va kunduzgi mavzu */
:root,
[data-theme="light"] {
  --bg: #F2F4F8;
  --card: #FFFFFF;
  --card-2: #F3F5F9;
  --line: #E3E7EE;
  --line-2: #C9D0DC;
  --text: #0D1320;
  --text-2: #4A5465;
  --text-3: #8A93A3;
  --accent: #2F6BFF;
  --accent-text: #2459E6;
  --accent-soft: rgba(47, 107, 255, .1);
  --grad: linear-gradient(90deg, #4FC3F7 0%, #2F6BFF 100%);
  --ok: #16A34A;
  --ok-soft: rgba(22, 163, 74, .11);
  --warn: #D97706;
  --warn-soft: rgba(217, 119, 6, .12);
  --bad: #E5484D;
  --bad-soft: rgba(229, 72, 77, .11);
  --shadow: 0 1px 2px rgba(16, 24, 40, .04), 0 10px 28px -18px rgba(16, 24, 40, .22);
  --overlay: rgba(9, 13, 22, .42);
  --glass: rgba(255, 255, 255, .86);
  color-scheme: light;
}
[data-theme="dark"] {
  --bg: #0B0D12;
  --card: #16181E;
  --card-2: #1F2229;
  --line: #262A33;
  --line-2: #3A404C;
  --text: #F2F4F8;
  --text-2: #B3BAC6;
  --text-3: #7A8191;
  --accent: #3D86FF;
  --accent-text: #78ABFF;
  --accent-soft: rgba(61, 134, 255, .16);
  --grad: linear-gradient(90deg, #5AC8FA 0%, #3D7BFF 100%);
  --ok: #34C759;
  --ok-soft: rgba(52, 199, 89, .14);
  --warn: #FFB020;
  --warn-soft: rgba(255, 176, 32, .14);
  --bad: #FF5D62;
  --bad-soft: rgba(255, 93, 98, .14);
  --shadow: none;
  --overlay: rgba(0, 0, 0, .62);
  --glass: rgba(24, 26, 32, .88);
  color-scheme: dark;
}
:root {
  --safe-b: max(env(safe-area-inset-bottom, 0px), var(--tg-safe-area-inset-bottom, 0px));
  --ease: cubic-bezier(.2, .8, .2, 1);
  --spring: cubic-bezier(.3, 1.45, .5, 1);
  --r: 24px;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; height: 100%; background: var(--bg); color: var(--text); }
body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  font-feature-settings: 'cv11', 'ss01';
  -webkit-font-smoothing: antialiased;
  overflow: hidden;
  overscroll-behavior: none;
  transition: background-color .3s, color .3s;
}
button { font: inherit; color: inherit; cursor: pointer; }
h1, h2, h3, p { margin: 0; }
small { display: block; }
.hidden { display: none !important; }
.grow { flex: 1; min-width: 0; }
.muted { color: var(--text-3); font-weight: 500; font-size: 13px; line-height: 1.45; }
.ic { width: 20px; height: 20px; flex: none; transition: transform .25s var(--spring); }
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--pc, var(--accent)); flex: none; }

/* ---------- karkas ---------- */
#main {
  position: fixed; inset: 0;
  overflow-y: auto; overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
  padding: 12px 16px calc(108px + var(--safe-b));
}
body.in-view #main { padding-bottom: calc(32px + var(--safe-b)); }
.screen { max-width: 640px; margin: 0 auto; }
.screen > * + * { margin-top: 14px; }
.screen.enter { animation: enter .4s var(--ease); }
@keyframes enter { from { opacity: 0; transform: translateY(10px); } }
.boot { height: 70vh; display: grid; place-items: center; }
.spinner { width: 32px; height: 32px; border-radius: 50%; border: 3px solid var(--line); border-top-color: var(--accent); animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

.brand-row { display: flex; align-items: center; justify-content: space-between; padding: 6px 0 4px; }
.brand { display: flex; align-items: center; gap: 8px; font-size: 21px; font-weight: 700; letter-spacing: -.6px; }
.brand svg { width: 30px; height: 30px; color: var(--text); }
.pill {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 8px 14px; border-radius: 999px; border: 1px solid var(--line);
  background: transparent; color: var(--text-2); font-size: 14px; font-weight: 500;
  transition: border-color .2s, color .2s;
}
.pill .ic { width: 16px; height: 16px; }
.page-head { padding-top: 6px; }
h1 { font-size: 30px; font-weight: 700; letter-spacing: -.8px; line-height: 1.15; margin-top: 4px; }
h2 { font-size: 17px; font-weight: 700; letter-spacing: -.3px; }
h3 { font-size: 16px; font-weight: 700; letter-spacing: -.2px; }
.eyebrow { display: flex; align-items: center; gap: 6px; font-size: 12.5px; font-weight: 600; color: var(--text-3); text-transform: uppercase; letter-spacing: .09em; }
.block-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 12px; }
.section-title { font-size: 12.5px; font-weight: 600; color: var(--text-3); text-transform: uppercase; letter-spacing: .09em; padding: 10px 4px 0; }
.link { border: 0; background: none; color: var(--accent-text); font-weight: 600; font-size: 14px; padding: 4px 0; }
.foot { text-align: center; color: var(--text-3); font-size: 13px; padding: 8px 0; }

/* ---------- pastki menyu ---------- */
#tabbar {
  position: fixed; left: 12px; right: 12px; bottom: calc(10px + var(--safe-b));
  max-width: 560px; margin: 0 auto; height: 66px; padding: 6px;
  display: grid; grid-template-columns: repeat(5, 1fr);
  background: var(--glass);
  -webkit-backdrop-filter: blur(20px) saturate(1.4); backdrop-filter: blur(20px) saturate(1.4);
  border: 1px solid var(--line); border-radius: 24px;
  box-shadow: var(--shadow);
  z-index: 20;
  transition: transform .35s var(--ease), background-color .3s;
}
#tabbar .ind {
  position: absolute; top: 6px; bottom: 6px; left: 6px;
  width: calc((100% - 12px) / 5); border-radius: 18px;
  background: var(--accent-soft);
  transform: translateX(calc(var(--i, 0) * 100%));
  transition: transform .45s var(--spring);
}
#tabbar button {
  position: relative; z-index: 1; border: 0; background: none; padding: 0;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px;
  font-weight: 600; font-size: 10.5px; color: var(--text-3); transition: color .2s;
}
#tabbar button.on { color: var(--accent-text); }
#tabbar button.on .ic { transform: translateY(-1px) scale(1.1); }
body.in-view #tabbar { transform: translateY(calc(100% + 30px)); }

#fab {
  position: fixed; right: max(18px, calc(50% - 302px)); bottom: calc(90px + var(--safe-b));
  width: 56px; height: 56px; border-radius: 20px; border: 0; z-index: 21;
  display: grid; place-items: center; color: #fff;
  background: var(--accent);
  box-shadow: 0 14px 28px -12px rgba(47, 107, 255, .8);
  animation: fab-in .5s var(--spring);
}
#fab[hidden] { display: none; }
#fab .ic { width: 26px; height: 26px; }
#fab:active { transform: scale(.92) rotate(90deg); }
@keyframes fab-in { from { transform: scale(0) rotate(-90deg); } }

/* ---------- kartochkalar ---------- */
.card {
  background: var(--card); border-radius: var(--r); padding: 22px;
  box-shadow: var(--shadow);
  transition: background-color .3s;
}
:where(button, .vcard, .mini, .row, .proj, .pp-row, .bcol):active { transform: scale(.98); }
:where(.vcard, .mini, .row, .proj, .pp-row) { transition: transform .15s; cursor: pointer; }

/* asosiy kartochka: kod → nom → katta raqam → gradient chiziq → 2 ustun */
.big-card .eyebrow { margin-bottom: 8px; }
.big-card .title { font-size: 25px; font-weight: 700; letter-spacing: -.6px; line-height: 1.22; margin: 0; }
.big { font-size: 58px; font-weight: 700; letter-spacing: -2.5px; line-height: 1; margin: 18px 0; font-variant-numeric: tabular-nums; }
.big span.u { font-size: 20px; font-weight: 500; letter-spacing: 0; color: var(--text-2); margin-left: 2px; }
.big.md { font-size: 40px; letter-spacing: -1.5px; margin: 6px 0 14px; }
.gbar { height: 12px; border-radius: 6px; background: var(--card-2); overflow: hidden; }
.gbar i { display: block; height: 100%; border-radius: 6px; background: var(--grad); transition: width 1.1s var(--ease); }
.gbar.sm { height: 6px; border-radius: 3px; }
.gbar.sm i { border-radius: 3px; }
.meta2 { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 14px; margin-top: 20px; }
.meta2 small { color: var(--text-3); font-size: 13.5px; font-weight: 500; margin-bottom: 4px; }
.meta2 b { display: block; font-size: 17px; font-weight: 600; letter-spacing: -.2px; }
.meta2 .chip { margin-top: 6px; }
.meta2.sm { margin-top: 14px; }
.meta2.sm b { font-size: 14.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.meta2.sm small { font-size: 12px; margin-bottom: 2px; }
.meta2.sm .chip { margin-top: 0; }

.stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.stat { background: var(--card); border-radius: 20px; padding: 14px; box-shadow: var(--shadow); }
.stat b { display: block; font-size: 24px; font-weight: 700; letter-spacing: -.6px; }
.stat small { color: var(--text-3); font-weight: 500; font-size: 12px; margin-top: 2px; }
.stat.bad b { color: var(--bad); }

/* ---------- chiplar ---------- */
.chip { display: inline-flex; align-items: center; gap: 5px; padding: 5px 10px; border-radius: 999px; font-size: 12px; font-weight: 600; white-space: nowrap; flex: none; }
.chip .ic { width: 13px; height: 13px; }
.chip.calm, .chip.soon { background: var(--accent-soft); color: var(--accent-text); }
.chip.warn { background: var(--warn-soft); color: var(--warn); }
.chip.late { background: var(--bad-soft); color: var(--bad); }
.chip.ok { background: var(--accent); color: #fff; }
.chip.okg { background: var(--ok-soft); color: var(--ok); }
.chip.gray { background: var(--card-2); color: var(--text-2); }
.chip.warn .ic, .chip.late .ic { animation: tick 1.6s ease-in-out infinite; }
@keyframes tick { 50% { transform: rotate(18deg); } }
.tag { display: inline-flex; align-items: center; font-size: 13px; font-weight: 500; padding: 4px 11px; border-radius: 9px; background: var(--accent-soft); color: var(--accent-text); white-space: nowrap; }
.tag.sm { font-size: 11px; padding: 3px 8px; border-radius: 7px; text-transform: uppercase; letter-spacing: .04em; font-weight: 600; }

/* ---------- xush kelibsiz ---------- */
.welcome .big-card { text-align: center; padding: 34px 22px; }
.welcome .logo { width: 72px; height: 72px; margin: 0 auto 16px; border-radius: 24px; display: grid; place-items: center; font-size: 34px; background: var(--accent-soft); animation: bob 3s ease-in-out infinite; }
@keyframes bob { 50% { transform: translateY(-6px) rotate(-4deg); } }
.welcome p { color: var(--text-2); margin-top: 8px; line-height: 1.5; }
.steps { display: grid; grid-template-columns: minmax(0, 1fr); gap: 10px; }
.step { display: flex; gap: 14px; align-items: center; background: var(--card); padding: 16px; border-radius: 20px; box-shadow: var(--shadow); font-size: 14.5px; line-height: 1.45; color: var(--text-2); animation: enter .5s var(--ease) both; }
.step:nth-child(2) { animation-delay: .08s; }
.step:nth-child(3) { animation-delay: .16s; }
.step b { width: 34px; height: 34px; border-radius: 12px; flex: none; display: grid; place-items: center; background: var(--accent); color: #fff; }
.welcome .btn + .btn { margin-top: 10px; }

/* ---------- ro'yxat qatorlari ---------- */
.list { display: grid; grid-template-columns: minmax(0, 1fr); }
.row { display: flex; align-items: center; gap: 12px; padding: 12px 0; }
.row + .row { border-top: 1px solid var(--line); }
.row:first-child { padding-top: 2px; }
.row:last-child { padding-bottom: 0; }
.row .grow b { display: block; font-size: 15px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.row .grow small { color: var(--text-3); font-size: 13px; margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.row-sub { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: 4px; }
.row-sub small { margin-top: 0 !important; min-width: 0; }
.datebox { width: 46px; height: 48px; border-radius: 14px; flex: none; display: grid; place-content: center; text-align: center; background: var(--card-2); position: relative; overflow: hidden; }
.datebox::before { content: ''; position: absolute; left: 0; top: 0; bottom: 0; width: 3px; background: var(--pc); }
.datebox b { font-size: 18px; line-height: 1; }
.datebox small { font-size: 11px; font-weight: 600; color: var(--text-3); text-transform: uppercase; margin-top: 2px; }

.hscroll { display: flex; gap: 12px; overflow-x: auto; scroll-snap-type: x mandatory; margin: 0 -16px; padding: 2px 16px 10px; scrollbar-width: none; }
.hscroll::-webkit-scrollbar { display: none; }
.mini { flex: 0 0 min(70%, 260px); scroll-snap-align: start; padding: 18px; }
.mini-t { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; font-size: 16px; font-weight: 600; line-height: 1.3; min-height: 42px; margin-top: 6px; }
.mini .big { font-size: 34px; letter-spacing: -1.2px; margin: 12px 0 10px; }
.mini .big span.u { font-size: 15px; }

.empty { text-align: center; padding: 26px 16px; color: var(--text-3); font-size: 14.5px; }
.empty .em { font-size: 32px; display: block; margin-bottom: 8px; }

/* ---------- videolar ro'yxati ---------- */
.segbar { display: flex; gap: 4px; background: var(--card); border-radius: 18px; padding: 4px; box-shadow: var(--shadow); }
.segbar button { flex: 1; border: 0; background: none; padding: 11px 6px; border-radius: 14px; font-weight: 600; font-size: 14px; color: var(--text-2); transition: background .25s, color .25s; }
.segbar button i { font-style: normal; opacity: .55; margin-left: 4px; }
.segbar button.on { background: var(--accent); color: #fff; }
.chips-row { display: flex; gap: 8px; overflow-x: auto; margin: 0 -16px; padding: 2px 16px 4px; scrollbar-width: none; }
.chips-row::-webkit-scrollbar { display: none; }
.fchip { display: inline-flex; align-items: center; gap: 8px; flex: none; border: 1px solid var(--line); background: transparent; border-radius: 999px; padding: 8px 14px; font-weight: 500; font-size: 13.5px; color: var(--text-2); transition: .2s; }
.fchip.on { border-color: var(--accent); color: var(--accent-text); background: var(--accent-soft); }
.vlist { display: grid; grid-template-columns: minmax(0, 1fr); gap: 12px; }
.vcard { animation: enter .45s var(--ease) both; animation-delay: calc(var(--n, 0) * 45ms); }
.vc-top { display: flex; align-items: center; gap: 8px; }
.vc-amt { margin-left: auto; display: flex; align-items: baseline; gap: 5px; }
.vc-amt b { font-size: 17px; font-weight: 700; }
.vc-amt b.fin { color: var(--accent-text); }
.vc-amt small { font-size: 11px; color: var(--text-3); }
.vcard h3 { margin: 8px 0 14px; font-size: 19px; line-height: 1.3; letter-spacing: -.4px; }
.vc-prog { display: flex; align-items: center; gap: 12px; }
.vc-prog .pct { font-size: 15px; font-weight: 700; min-width: 42px; font-variant-numeric: tabular-nums; }
.vc-prog .gbar { flex: 1; }
.kdots { display: inline-flex; gap: 3px; margin-right: 4px; align-self: center; }
.kdots i { width: 7px; height: 7px; border-radius: 50%; background: var(--line-2); }
.kdots i.ok { background: var(--accent); }
.kdots i.part { background: #7FB0FF; }
.kdots i.fail { background: var(--bad); }
.kdots i.wait { background: transparent; box-shadow: inset 0 0 0 1.5px var(--line-2); }

/* ---------- video sahifasi ---------- */
.detail-top { display: flex; justify-content: space-between; align-items: center; padding-top: 4px; }
.icon-btn {
  width: 44px; height: 44px; border-radius: 15px; border: 1px solid var(--line); flex: none;
  display: grid; place-items: center; background: var(--card); color: var(--text);
}
.icon-btn.primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.icon-btn.sm { width: 30px; height: 30px; border-radius: 10px; border: 0; background: var(--card); color: var(--text-3); }
.icon-btn.sm .ic { width: 15px; height: 15px; }

/* vertikal jarayon chizig'i: doirachani bosish — tasdiqlash yoki bekor qilish */
.tl { padding: 6px 0 2px; }
.tl-item { position: relative; display: grid; grid-template-columns: 26px minmax(0, 1fr); column-gap: 16px; padding-bottom: 24px; }
.tl-item:last-child { padding-bottom: 0; }
.tl-item::before { content: ''; position: absolute; left: 12px; top: 30px; bottom: 4px; width: 2px; border-radius: 1px; background: var(--line); transition: background .4s; }
.tl-item.lk::before { background: var(--accent); }
.tl-item:last-child::before { display: none; }
.tl-dot {
  position: relative; width: 26px; height: 26px; border-radius: 50%; padding: 0;
  display: grid; place-items: center; border: 2px solid var(--line-2); background: transparent; color: transparent;
  transition: background .25s, border-color .25s, color .25s, box-shadow .25s;
}
.tl-dot::after { content: ''; position: absolute; inset: -11px; border-radius: 50%; } /* katta bosish maydoni */
.tl-dot .ic { width: 15px; height: 15px; stroke-width: 3; }
.tl-item.done .tl-dot { background: var(--accent); border-color: var(--accent); color: #fff; }
.tl-item.cur .tl-dot { border-color: var(--accent); box-shadow: 0 0 0 5px var(--accent-soft); animation: ring 2.4s ease-in-out infinite; }
@keyframes ring { 50% { box-shadow: 0 0 0 8px transparent; } }
.tl-item.just .tl-dot { animation: pop .5s var(--spring); }
@keyframes pop { 0% { transform: scale(.55); } 60% { transform: scale(1.22); } 100% { transform: scale(1); } }
.tl-label { font-size: 18px; font-weight: 500; line-height: 26px; letter-spacing: -.2px; transition: color .25s; }
.tl-item:not(.done):not(.cur) .tl-label { color: var(--text-2); }
.tl-tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.tl-time { border: 0; background: none; padding: 0; margin-top: 4px; display: inline-flex; align-items: center; gap: 5px; color: var(--text-3); font-size: 13px; }
.tl-time .ic { width: 13px; height: 13px; }

.kseg { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; }
.kseg > div { height: 12px; border-radius: 6px; background: var(--card-2); overflow: hidden; }
.kseg > div.fail { background: var(--bad-soft); }
.kseg i { display: block; height: 100%; border-radius: 6px; background: var(--grad); transition: width 1s var(--ease); }
.kseg .wait i { opacity: .4; }
.kseg-l { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; margin-top: 10px; }
.kseg-l div { font-size: 12.5px; color: var(--text-3); }
.kseg-l b { display: block; color: var(--text); font-size: 15px; font-weight: 600; margin-top: 2px; }
.kseg-l .fail b { color: var(--bad); }

.dl-row { display: flex; align-items: center; gap: 12px; padding: 12px 0; }
.dl-row + .dl-row { border-top: 1px solid var(--line); }
.dl-ic { width: 38px; height: 38px; border-radius: 13px; display: grid; place-items: center; background: var(--card-2); color: var(--text-2); flex: none; }
.dl-ic.done { background: var(--accent); color: #fff; }
.dl-row b { display: block; font-size: 15px; font-weight: 600; }
.dl-row small { color: var(--text-3); font-size: 13px; margin-top: 2px; }
.delay-row, .sux-row { display: flex; align-items: center; gap: 10px; padding: 12px 14px; border-radius: 16px; background: var(--card-2); margin-top: 8px; }
.delay-row b, .sux-row b { display: block; font-size: 14px; font-weight: 600; }
.delay-row small, .sux-row small { color: var(--text-3); font-size: 12.5px; margin-top: 2px; }
.delay-row > .ic { color: var(--accent-text); }
.sux-row.exempt { opacity: .65; }
.sux-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--accent); flex: none; }
.sux-row.exempt .sux-dot { background: transparent; box-shadow: inset 0 0 0 2px var(--line-2); }

.kblock .kb-head { display: flex; align-items: center; gap: 12px; margin-bottom: 12px; }
.kb-amt { min-width: 62px; padding: 9px 10px; border-radius: 14px; text-align: center; font-weight: 700; font-size: 18px; color: #fff; background: var(--accent); flex: none; }
.kblock.part .kb-amt { background: #6E9DFF; }
.kblock.fail .kb-amt { background: var(--bad); }
.kblock.wait .kb-amt { background: var(--accent-soft); color: var(--accent-text); }
.kb-head h3 { font-size: 17px; line-height: 1.25; margin-top: 3px; }
.cond { display: flex; align-items: flex-start; gap: 12px; padding: 11px 10px; margin: 0 -10px; border-radius: 14px; cursor: pointer; transition: background .2s; }
.cond:active { background: var(--card-2); }
.cond-ic { width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; flex: none; margin-top: 1px; }
.cond-ic .ic { width: 14px; height: 14px; stroke-width: 2.6; }
.cond.ok .cond-ic { background: var(--accent); color: #fff; }
.cond.fail .cond-ic { background: var(--bad-soft); color: var(--bad); }
.cond.wait .cond-ic { background: var(--card-2); color: var(--text-3); }
.cond b { display: block; font-size: 15px; font-weight: 600; line-height: 1.35; }
.cond small { color: var(--text-3); font-size: 12.5px; margin-top: 2px; }
.note { font-size: 13px; color: var(--text-3); line-height: 1.5; margin-top: 12px; padding: 12px 14px; border-radius: 14px; background: var(--card-2); }
.tiers { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin-top: 12px; }
.tier { padding: 10px 6px; border-radius: 14px; text-align: center; background: var(--card-2); transition: .35s var(--spring); }
.tier b { display: block; font-size: 17px; color: var(--text-2); }
.tier small { font-size: 11.5px; color: var(--text-3); }
.tier.on { background: var(--accent); transform: scale(1.04); }
.tier.on b, .tier.on small { color: #fff; }
.sux-top { display: flex; align-items: center; gap: 14px; }
.sux-n { text-align: center; flex: none; width: 70px; }
.sux-n b { display: block; font-size: 40px; font-weight: 700; line-height: 1; letter-spacing: -1px; }
.sux-n small { font-size: 11.5px; color: var(--text-3); margin-top: 2px; }
.sux-top .tiers { flex: 1; margin-top: 0; }
.kblock .btn { margin-top: 12px; }

/* ---------- rivojlanish ---------- */
.st-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
.st-cell { background: var(--card); border-radius: 18px; padding: 12px 6px; box-shadow: var(--shadow); text-align: center; }
.st-cell b { display: block; font-size: 22px; font-weight: 700; }
.st-cell small { font-size: 11.5px; color: var(--text-3); margin-top: 2px; }
.st-cell i { display: block; width: 8px; height: 8px; border-radius: 50%; margin: 0 auto 6px; background: var(--c); }
.status { display: inline-flex; align-items: center; gap: 6px; padding: 6px 11px; border-radius: 999px; font-size: 12.5px; font-weight: 600; white-space: nowrap; flex: none; }
.status::before { content: ''; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.status.ahead { background: var(--accent-soft); color: var(--accent-text); }
.status.ontrack { background: var(--card-2); color: var(--text-2); }
.status.behind { background: var(--warn-soft); color: var(--warn); }
.status.late { background: var(--bad-soft); color: var(--bad); }
.status.late::before { animation: blink 1.4s ease-in-out infinite; }
.status.idle, .status.done { background: var(--card-2); color: var(--text-3); }
@keyframes blink { 50% { opacity: .25; } }
.pp { animation: enter .45s var(--ease) both; animation-delay: calc(var(--n, 0) * 60ms); }
.pp-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
.pp-head h2 { font-size: 22px; letter-spacing: -.5px; margin-top: 6px; }
.pp-rows { margin-top: 18px; border-top: 1px solid var(--line); }
.pp-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px 12px; align-items: center; padding: 13px 0; }
.pp-row + .pp-row { border-top: 1px solid var(--line); }
.pp-row b { font-size: 14.5px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pp-row .gbar { grid-column: 1 / -1; }
.gbar.behind i { background: linear-gradient(90deg, #FFC75A, var(--warn)); }
.gbar.late i { background: linear-gradient(90deg, #FF9A9D, var(--bad)); }
.pace-legend { font-size: 12.5px; color: var(--text-3); line-height: 1.55; padding: 0 4px; }

/* ---------- gonorar ---------- */
.month-sw { display: flex; align-items: center; justify-content: space-between; background: var(--card); border-radius: 20px; padding: 6px; box-shadow: var(--shadow); }
.month-sw b { font-size: 16px; font-weight: 600; }
.month-sw button { width: 42px; height: 42px; border-radius: 14px; border: 0; background: var(--card-2); color: var(--text); display: grid; place-items: center; }
.bars { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 8px; height: 170px; }
.bcol { display: flex; flex-direction: column; align-items: center; gap: 6px; height: 100%; border: 0; background: none; padding: 0; }
.bval { font-size: 11px; font-weight: 600; color: var(--text-3); min-height: 14px; }
.btrack { position: relative; flex: 1; width: 100%; max-width: 38px; border-radius: 12px; background: var(--card-2); overflow: hidden; transition: box-shadow .25s; }
.btrack i { position: absolute; left: 0; right: 0; bottom: 0; border-radius: 12px; transition: height 1s var(--ease); }
.btrack .pend { background: var(--accent-soft); }
.btrack .conf { background: linear-gradient(180deg, #5AC8FA, var(--accent)); }
.bcol small { font-size: 12px; font-weight: 600; color: var(--text-3); text-transform: capitalize; }
.bcol.on .btrack { box-shadow: 0 0 0 2px var(--card), 0 0 0 4px var(--accent); }
.bcol.on small, .bcol.on .bval { color: var(--accent-text); }
.chart-legend { display: flex; gap: 16px; margin-top: 14px; font-size: 12.5px; color: var(--text-3); }
.chart-legend span { display: inline-flex; align-items: center; gap: 6px; }
.chart-legend i { width: 12px; height: 12px; border-radius: 4px; }
.pe-head { display: flex; align-items: center; gap: 10px; }
.pe-head b.grow { font-size: 17px; font-weight: 700; }
.pe-total { font-size: 21px; font-weight: 700; color: var(--accent-text); }
.bonus { margin-top: 14px; padding: 11px 14px; border-radius: 14px; font-size: 13.5px; font-weight: 500; }
.bonus.ok { background: var(--accent); color: #fff; }
.bonus.wait { background: var(--accent-soft); color: var(--accent-text); }
.bonus.fail { background: var(--bad-soft); color: var(--bad); }
.pe-list { margin-top: 8px; }
.pe-row { display: flex; align-items: center; gap: 10px; padding: 12px 0; cursor: pointer; }
.pe-row + .pe-row { border-top: 1px solid var(--line); }
.pe-row b { font-size: 14.5px; font-weight: 600; }
.pe-row .grow b { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pe-row .grow small { color: var(--text-3); font-size: 12.5px; margin-top: 2px; }
.pe-row > b.dim { color: var(--text-3); }
.paid-row { display: flex; align-items: center; justify-content: space-between; margin-top: 8px; padding-top: 14px; border-top: 1px dashed var(--line); font-weight: 600; font-size: 14.5px; }
.paid-row small { color: var(--text-3); font-weight: 400; font-size: 12.5px; margin-top: 2px; }
.toggle { position: relative; width: 50px; height: 30px; border-radius: 15px; border: 0; background: var(--line-2); transition: background .25s; flex: none; padding: 0; }
.toggle::after { content: ''; position: absolute; top: 3px; left: 3px; width: 24px; height: 24px; border-radius: 50%; background: #fff; box-shadow: 0 2px 6px rgba(0, 0, 0, .25); transition: transform .35s var(--spring); }
.toggle.on { background: var(--accent); }
.toggle.on::after { transform: translateX(20px); }

/* ---------- loyihalar va sozlamalar ---------- */
.plist { display: grid; grid-template-columns: minmax(0, 1fr); gap: 10px; }
.proj { display: flex; align-items: center; gap: 14px; padding: 18px; }
.proj-ic { width: 48px; height: 48px; border-radius: 16px; flex: none; display: grid; place-items: center; font-weight: 700; font-size: 13px; letter-spacing: .04em; color: #fff; background: var(--pc); }
.proj b { display: block; font-size: 16px; font-weight: 600; }
.proj small { color: var(--text-3); font-size: 13px; margin-top: 3px; }
.proj-stats { text-align: center; min-width: 38px; }
.proj-stats b { font-size: 18px; }
.proj-stats small { font-size: 11px; margin-top: 0; }
.srow { display: flex; align-items: center; gap: 12px; }
.srow > .ic { color: var(--accent-text); }
.srow b { display: block; font-size: 15px; font-weight: 600; }
.srow small { color: var(--text-3); font-size: 12.5px; margin-top: 2px; }
.btn-row { display: flex; gap: 8px; margin-top: 14px; }
.btn-row .btn { flex: 1; }

/* ---------- tugmalar va forma ---------- */
.btn {
  width: 100%; display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  border: 0; border-radius: 16px; padding: 15px 18px;
  font-weight: 600; font-size: 15.5px; color: #fff; background: var(--accent);
  transition: transform .15s, filter .2s;
}
.btn.ghost { background: var(--accent-soft); color: var(--accent-text); }
.btn.line { background: transparent; color: var(--text-2); border: 1px solid var(--line); }
.btn.danger { background: var(--bad-soft); color: var(--bad); }
.btn.sm { padding: 12px; font-size: 14px; border-radius: 14px; }
.btn .ic { width: 18px; height: 18px; }
.field { display: block; margin-bottom: 16px; }
.field > span { display: block; margin-bottom: 8px; font-size: 12px; font-weight: 600; color: var(--text-3); text-transform: uppercase; letter-spacing: .08em; }
input, select, textarea {
  width: 100%; font: 500 16px 'Inter', sans-serif; color: var(--text);
  padding: 13px 14px; border-radius: 14px; border: 1px solid var(--line);
  background: var(--card-2); outline: none; min-height: 50px;
  transition: border-color .2s, box-shadow .2s;
  -webkit-appearance: none; appearance: none;
}
input:focus, textarea:focus { border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft); }
textarea { resize: none; line-height: 1.5; }
.row2 { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 10px; }
.seg { display: flex; gap: 4px; padding: 4px; border-radius: 15px; background: var(--card-2); }
.seg.wrap { flex-wrap: wrap; }
.seg label { flex: 1; }
.seg.wrap label { flex: 1 0 28%; }
.seg input { display: none; }
.seg span { display: block; text-align: center; padding: 10px 6px; border-radius: 11px; font-weight: 600; font-size: 13.5px; color: var(--text-2); transition: .2s; cursor: pointer; white-space: nowrap; }
.seg input:checked + span { background: var(--card); color: var(--accent-text); box-shadow: 0 2px 8px -4px rgba(0, 0, 0, .3); }
[data-theme="dark"] .seg input:checked + span { background: var(--line-2); color: #fff; }
.picks { display: flex; flex-wrap: wrap; gap: 8px; }
.pick input, .opt input, .swatches input { display: none; }
.pick span { display: inline-flex; align-items: center; gap: 8px; padding: 9px 14px; border-radius: 999px; border: 1px solid var(--line); font-weight: 500; font-size: 14px; cursor: pointer; transition: .2s; }
.pick i { width: 9px; height: 9px; border-radius: 50%; background: var(--pc); }
.pick input:checked + span { background: var(--accent); border-color: var(--accent); color: #fff; }
.pick input:checked + span i { background: #fff; }
.opts { display: grid; grid-template-columns: minmax(0, 1fr); gap: 8px; }
.opt span { display: block; padding: 13px 14px; border-radius: 15px; border: 1px solid var(--line); cursor: pointer; transition: .2s; }
.opt b { display: block; font-size: 14.5px; font-weight: 600; }
.opt small { color: var(--text-3); font-size: 12.5px; margin-top: 3px; line-height: 1.4; }
.opt input:checked + span { border-color: var(--accent); background: var(--accent-soft); }
.opt-btn { display: block; width: 100%; text-align: left; padding: 13px 14px; border-radius: 15px; border: 1px solid var(--line); background: transparent; margin-bottom: 8px; }
.opt-btn b { display: block; font-size: 14.5px; font-weight: 600; }
.opt-btn small { color: var(--text-3); font-size: 12.5px; margin-top: 2px; }
.opt-btn.on { border-color: var(--accent); background: var(--accent-soft); }
.swatches { display: flex; flex-wrap: wrap; gap: 12px; }
.swatches i { display: block; width: 36px; height: 36px; border-radius: 50%; background: var(--c); border: 3px solid var(--card); box-shadow: 0 0 0 2px transparent; transition: .25s var(--spring); cursor: pointer; }
.swatches input:checked + i { box-shadow: 0 0 0 2px var(--c); transform: scale(1.12); }
.check { display: flex; gap: 10px; align-items: center; font-size: 14px; color: var(--text-2); margin-bottom: 16px; }
.check input { width: 22px; height: 22px; min-height: 0; padding: 0; flex: none; -webkit-appearance: checkbox; appearance: auto; accent-color: var(--accent); }
.dl-preview { background: var(--card-2); border-radius: 16px; padding: 14px; margin-bottom: 16px; }
.dl-preview .lbl { font-size: 12px; font-weight: 600; color: var(--accent-text); text-transform: uppercase; letter-spacing: .08em; margin-bottom: 6px; }
.dl-preview div.r { display: flex; justify-content: space-between; padding: 5px 0; font-size: 14px; color: var(--text-2); }
.dl-preview div.r b { color: var(--text); font-weight: 600; }

/* ---------- pastdan chiquvchi oyna ---------- */
#sheet { position: fixed; inset: 0; z-index: 50; pointer-events: none; }
#sheet .backdrop { position: absolute; inset: 0; background: var(--overlay); opacity: 0; transition: opacity .3s; }
#sheet .panel {
  position: absolute; left: 0; right: 0; bottom: 0; max-width: 640px; margin: 0 auto;
  max-height: 90vh; overflow-y: auto; overscroll-behavior: contain;
  background: var(--card); border-radius: 28px 28px 0 0;
  padding: 10px 20px calc(22px + var(--safe-b));
  transform: translateY(105%); transition: transform .4s var(--ease);
}
#sheet.open { pointer-events: auto; }
#sheet.open .backdrop { opacity: 1; }
#sheet.open .panel { transform: none; }
.grabber { width: 40px; height: 5px; border-radius: 3px; background: var(--line-2); margin: 0 auto 18px; }
.panel h3 { font-size: 22px; letter-spacing: -.5px; margin-bottom: 6px; }
.panel h3 + .muted { margin-bottom: 18px; }
.panel h3 + form, .panel h3 + .opt-btn { margin-top: 16px; }
.panel > .btn { margin-top: 10px; }

/* ---------- toast va effektlar ---------- */
#toast {
  position: fixed; left: 50%; bottom: calc(92px + var(--safe-b)); z-index: 60;
  display: flex; align-items: center; gap: 14px; max-width: calc(100% - 32px);
  padding: 13px 16px; border-radius: 16px; background: #1B1E25; color: #fff;
  font-weight: 500; font-size: 14px; box-shadow: 0 16px 30px -12px rgba(0, 0, 0, .5);
  border: 1px solid rgba(255, 255, 255, .06);
  opacity: 0; transform: translate(-50%, 20px) scale(.96); pointer-events: none;
  transition: opacity .3s, transform .35s var(--spring);
}
#toast.show { opacity: 1; transform: translate(-50%, 0); pointer-events: auto; }
#toast button { border: 0; background: none; color: #7FB0FF; font-weight: 600; padding: 0; white-space: nowrap; }
body.in-view #toast { bottom: calc(24px + var(--safe-b)); }
#fx { position: fixed; inset: 0; width: 100%; height: 100%; pointer-events: none; z-index: 70; }

@media (min-width: 640px) { #main { padding-top: 24px; } }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}
