/* ════════════════════════════════════════════════════════════
   Zal kundaligi — dizayn tizimi
   Ranglar vazifasiga qarab:
     --accent  brend (Matrix qizil-to'q sariq): asosiy tugma, tanlangan, urg'u
     --ok/--warn/--bad/--info  holat: muvaffaqiyat, ogohlantirish, xato, ma'lumot
     --h1…--h4  yuk darajasi: kam → o'rtacha → maqsad → ko'p (qizil, sariq, yashil, ko'k)
   Telegram ichida fon va matn rangi foydalanuvchining Telegram mavzusidan olinadi (app.js).
   ════════════════════════════════════════════════════════════ */
:root {
  --bg: #0b0c0f;
  --surface: #15171c;
  --text: #f4f5f7;
  --muted: #98a0ae;
  --surface2: color-mix(in srgb, var(--text) 8%, var(--surface));
  --line: color-mix(in srgb, var(--text) 11%, transparent);

  --accent: #ff4d2e;
  --accent-ink: #ffffff;
  --accent-soft: color-mix(in srgb, var(--accent) 16%, transparent);
  --accent-grad: linear-gradient(135deg, #ff5a36, #d9301a);

  --ok: #34c759;
  --warn: #ffb02e;
  --bad: #ff5a5f;
  --info: #3b9cff;
  --gold: #ffc53d;

  --photo-bg: #f3f4f6;             /* Matrix rasmlarining o'z foni */

  /* tana xaritasi */
  --body: color-mix(in srgb, var(--text) 9%, var(--surface));
  --muscle: color-mix(in srgb, var(--text) 17%, var(--surface));
  --seam: var(--surface);
  --h1: #ff5a5f;                   /* kam */
  --h2: #ffb02e;                   /* o'rtacha */
  --h3: #34c759;                   /* maqsad */
  --h4: #3b9cff;                   /* ko'p */
  --hl1: var(--accent);            /* jihoz rasmida: asosiy mushak */
  --hl2: color-mix(in srgb, var(--accent) 42%, var(--muscle)); /* yordamchi mushak */

  --sab: max(env(safe-area-inset-bottom, 0px), var(--tg-safe-area-inset-bottom, 0px));
  --sat: max(env(safe-area-inset-top, 0px), var(--tg-safe-area-inset-top, 0px));
  --radius: 20px;
  --shadow: none;
  color-scheme: dark;
}

:root[data-theme="light"] {
  --bg: #f1f2f5;
  --surface: #ffffff;
  --text: #101216;
  --muted: #667085;
  --accent: #e5391b;
  --accent-grad: linear-gradient(135deg, #ef4a29, #c92a12);
  --ok: #1fa84a;
  --warn: #e08a00;
  --bad: #e5484d;
  --info: #1d7be8;
  --gold: #d99a00;
  --h1: #ef4b52;
  --h2: #f5a524;
  --h3: #2fb457;
  --h4: #2f86ee;
  --shadow: 0 1px 2px rgba(16, 18, 22, .05), 0 6px 20px rgba(16, 18, 22, .05);
  color-scheme: light;
}

/* ── Asos ──────────────────────────────────────────────── */
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; min-height: 100%; background: var(--bg); color: var(--text); }
body {
  font: 15px/1.4 -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  overscroll-behavior-y: none;
  font-variant-numeric: lining-nums;
}
button { font: inherit; color: inherit; border: 0; background: none; padding: 0; cursor: pointer; text-align: inherit; }
input, select, textarea { font: inherit; color: inherit; }
img { display: block; }
h1, h2, h3, p { margin: 0; }
.num { font-variant-numeric: tabular-nums; }
.muted { color: var(--muted); }
.ic { flex: none; }

#app { min-height: 100vh; }
.view {
  max-width: 560px; margin: 0 auto; width: 100%;
  padding: calc(var(--sat) + 18px) 16px calc(100px + var(--sab));
  animation: fade .2s ease-out;
}
.noanim .view { animation: none; }
@keyframes fade { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

/* ── Pastki menyu ──────────────────────────────────────── */
#tabbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 20;
  display: flex; justify-content: center;
  background: var(--surface);
  background: color-mix(in srgb, var(--surface) 86%, transparent);
  -webkit-backdrop-filter: blur(18px) saturate(1.4); backdrop-filter: blur(18px) saturate(1.4);
  border-top: 1px solid var(--line);
  padding: 6px 10px calc(6px + var(--sab));
}
#tabbar[hidden] { display: none; }
#tabbar .tabs { display: flex; width: 100%; max-width: 560px; gap: 4px; }
.tab { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 3px; padding: 5px 0 4px; font-size: 11px; font-weight: 600; color: var(--muted); border-radius: 14px; transition: color .15s; }
.tab i { display: flex; align-items: center; justify-content: center; width: 54px; height: 30px; border-radius: 15px; transition: background .2s; }
.tab.on { color: var(--accent); }
.tab.on i { background: var(--accent-soft); }

/* ── Umumiy komponentlar ───────────────────────────────── */
.card { background: var(--surface); border-radius: var(--radius); padding: 16px; margin-bottom: 12px; box-shadow: var(--shadow); }
:root:not([data-theme="light"]) .card { border: 1px solid var(--line); }
.card.flat { padding: 0; overflow: hidden; }
.sec { display: flex; align-items: center; justify-content: space-between; margin: 24px 2px 10px; }
.sec h2 { font-size: 18px; font-weight: 800; letter-spacing: -.02em; }
.sec .link { color: var(--accent); font-size: 14px; font-weight: 700; }
.page-title { font-size: 30px; font-weight: 800; letter-spacing: -.03em; line-height: 1.1; }
.page-sub { color: var(--muted); margin-top: 4px; }
.row { display: flex; align-items: center; gap: 10px; }
.row.between { justify-content: space-between; }
.grow { flex: 1; min-width: 0; }
.ellipsis { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.eyebrow { font-size: 12px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 52px; padding: 0 22px; border-radius: 16px; text-align: center;
  background: var(--accent); color: var(--accent-ink); font-weight: 800; font-size: 16px; letter-spacing: -.01em;
  transition: transform .08s, opacity .15s, filter .15s;
}
.btn:active { transform: scale(.975); filter: brightness(.94); }
.btn[disabled] { opacity: .4; pointer-events: none; }
.btn.block { width: 100%; }
.btn.ghost { background: var(--surface2); color: var(--text); }
.btn.soft { background: var(--accent-soft); color: var(--accent); }
.btn.danger { background: color-mix(in srgb, var(--bad) 14%, transparent); color: var(--bad); }
.btn.sm { height: 38px; padding: 0 15px; font-size: 14px; border-radius: 12px; }
.iconbtn { width: 40px; height: 40px; border-radius: 13px; display: inline-flex; align-items: center; justify-content: center; background: var(--surface2); color: var(--text); flex: none; }
.iconbtn.glass { background: rgba(20, 22, 26, .72); color: #fff; -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px); }
.iconbtn.glass.on { color: var(--gold); }

.seg { display: flex; background: var(--surface2); border-radius: 14px; padding: 3px; gap: 2px; }
.seg button { flex: 1; padding: 8px 8px; border-radius: 11px; font-size: 13px; font-weight: 700; color: var(--muted); text-align: center; white-space: nowrap; }
.seg button.on { background: var(--surface); color: var(--text); box-shadow: 0 1px 3px rgba(0, 0, 0, .18); }

.hscroll { display: flex; gap: 8px; overflow-x: auto; padding: 2px 16px; margin: 0 -16px; scrollbar-width: none; }
.hscroll::-webkit-scrollbar { display: none; }
.chip { display: inline-flex; align-items: center; gap: 6px; flex: none; padding: 8px 14px; border-radius: 999px; background: var(--surface); color: var(--muted); font-size: 13.5px; font-weight: 700; border: 1px solid var(--line); white-space: nowrap; }
.chip.on { background: var(--accent); color: var(--accent-ink); border-color: transparent; }
.chip.static { background: var(--surface2); border-color: transparent; }
.chip.hl { background: var(--accent-soft); color: var(--accent); border-color: transparent; }
.chip.xs { padding: 3px 10px; font-size: 12px; }
.chip .n { font-size: 11.5px; opacity: .7; font-weight: 700; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }

.field { display: block; margin-bottom: 14px; }
.field > span { display: block; font-size: 13px; color: var(--muted); font-weight: 700; margin: 0 2px 6px; }
.input, .select {
  width: 100%; height: 50px; padding: 0 15px; border-radius: 15px; border: 1.5px solid transparent;
  background: var(--surface2); outline: none; font-size: 16px;
}
.input:focus, .select:focus { border-color: var(--accent); }
.search { position: relative; }
.search .ic { position: absolute; left: 15px; top: 15px; color: var(--muted); }
.search .input { padding-left: 44px; }

.empty { text-align: center; padding: 32px 14px; color: var(--muted); }
.empty b { display: block; color: var(--text); font-size: 17px; margin-bottom: 4px; }

.stat-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.stat { background: var(--surface); border-radius: 18px; padding: 13px 12px; box-shadow: var(--shadow); }
:root:not([data-theme="light"]) .stat { border: 1px solid var(--line); }
.stat .v { font-size: 24px; font-weight: 800; letter-spacing: -.03em; white-space: nowrap; line-height: 1.1; }
.stat .l { font-size: 12.5px; color: var(--muted); margin-top: 3px; font-weight: 600; }
.stat .d { font-size: 11.5px; margin-top: 6px; color: var(--muted); }
.up { color: var(--ok); } .down { color: var(--bad); }

/* ── Bosh sahifa ───────────────────────────────────────── */
.head { display: flex; align-items: flex-start; justify-content: space-between; margin-bottom: 16px; gap: 12px; }
.streak { display: inline-flex; align-items: center; gap: 6px; padding: 8px 13px; border-radius: 999px; background: var(--accent-soft); color: var(--accent); font-weight: 800; flex: none; }
.week { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; margin-bottom: 16px; }
.wd { display: flex; flex-direction: column; align-items: center; gap: 6px; font-size: 11.5px; color: var(--muted); font-weight: 700; }
.wd i { width: 100%; max-width: 44px; aspect-ratio: 1; border-radius: 14px; display: flex; align-items: center; justify-content: center; font-style: normal; font-size: 14.5px; font-weight: 800; background: var(--surface); color: var(--text); box-shadow: var(--shadow); }
:root:not([data-theme="light"]) .wd i { border: 1px solid var(--line); }
.wd.done i { background: var(--accent); color: var(--accent-ink); border-color: transparent; }
.wd.today i { box-shadow: 0 0 0 2px var(--bg), 0 0 0 4px var(--accent); }
.wd.future i { color: var(--muted); background: transparent; border: 1px dashed var(--line); box-shadow: none; }

.today-hero { position: relative; overflow: hidden; border-radius: 24px; padding: 20px; margin-bottom: 12px; color: #fff; background: var(--accent-grad); }
.today-hero::after { content: ""; position: absolute; right: -40px; top: -50px; width: 190px; height: 190px; border-radius: 50%; background: rgba(255, 255, 255, .1); pointer-events: none; }
.today-hero .eyebrow { color: rgba(255, 255, 255, .78); }
.today-hero h3 { font-size: 22px; font-weight: 800; letter-spacing: -.02em; margin: 6px 0 14px; position: relative; }
.today-hero .nums { display: flex; gap: 22px; position: relative; }
.today-hero .nums b { display: block; font-size: 28px; font-weight: 800; letter-spacing: -.03em; line-height: 1.05; }
.today-hero .nums span { font-size: 12px; color: rgba(255, 255, 255, .78); font-weight: 600; }
.today-hero .btn { background: #fff; color: #c92a12; position: relative; }
.today-hero p { color: rgba(255, 255, 255, .85); margin-bottom: 16px; position: relative; }

.ex { display: flex; gap: 12px; padding: 12px 0; border-top: 1px solid var(--line); width: 100%; text-align: left; align-items: center; }
.ex:first-of-type { border-top: 0; padding-top: 0; }
.ex .t { width: 76px; height: 57px; border-radius: 12px; overflow: hidden; flex: none; background: var(--photo-bg); }
.ex .t img { width: 100%; height: 100%; object-fit: contain; }
.ex .t svg, .ex .t .ph { width: 100%; height: 100%; background: var(--surface2); }
.ex .n { font-weight: 750; font-size: 15px; }
.sets { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 6px; }
.set-chip { padding: 3px 9px; border-radius: 8px; background: var(--surface2); font-size: 13px; font-weight: 700; }
.set-chip.pr { background: color-mix(in srgb, var(--gold) 20%, transparent); color: var(--gold); }
.today-foot { display: flex; gap: 16px; padding-top: 12px; margin-top: 4px; border-top: 1px solid var(--line); font-size: 13px; color: var(--muted); flex-wrap: wrap; }
.today-foot b { color: var(--text); }

.shortcuts { display: flex; gap: 10px; overflow-x: auto; padding: 2px 16px 6px; margin: 0 -16px; scrollbar-width: none; }
.shortcuts::-webkit-scrollbar { display: none; }
.shortcut { flex: none; width: 136px; background: var(--surface); border-radius: 18px; overflow: hidden; box-shadow: var(--shadow); text-align: left; }
:root:not([data-theme="light"]) .shortcut { border: 1px solid var(--line); }
.shortcut .im { aspect-ratio: 4/3; background: var(--photo-bg); }
.shortcut .im img { width: 100%; height: 100%; object-fit: contain; }
.shortcut .im svg, .shortcut .im .ph { width: 100%; height: 100%; background: var(--surface2); }
.shortcut b { display: block; padding: 8px 10px 2px; font-size: 13px; line-height: 1.2; height: 34px; overflow: hidden; }
.shortcut span { display: block; padding: 0 10px 9px; font-size: 11.5px; color: var(--muted); }

.focus-row { display: flex; gap: 8px; }
.focus { flex: 1; background: var(--surface); border-radius: 18px; padding: 10px; text-align: left; box-shadow: var(--shadow); min-width: 0; }
:root:not([data-theme="light"]) .focus { border: 1px solid var(--line); }
.focus .th { aspect-ratio: 4/3; border-radius: 11px; overflow: hidden; background: var(--surface2); margin-bottom: 9px; }
.focus .th svg { width: 100%; height: 100%; display: block; }
.focus b { display: block; font-size: 14px; }
.focus span { font-size: 12px; color: var(--bad); font-weight: 700; }

.pr-row { display: flex; align-items: center; gap: 12px; width: 100%; text-align: left; padding: 11px 0; border-top: 1px solid var(--line); }
.pr-row:first-child { border-top: 0; padding-top: 0; }
.pr-ic { width: 40px; height: 40px; border-radius: 13px; background: color-mix(in srgb, var(--gold) 16%, transparent); color: var(--gold); display: flex; align-items: center; justify-content: center; flex: none; }

/* ── Jihozlar ──────────────────────────────────────────── */
.grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
.eq-card { position: relative; display: block; text-align: left; background: var(--surface); border-radius: 18px; overflow: hidden; width: 100%; box-shadow: var(--shadow); }
:root:not([data-theme="light"]) .eq-card { border: 1px solid var(--line); }
.eq-img { position: relative; aspect-ratio: 4/3; background: var(--photo-bg); display: block; width: 100%; }
.eq-img img { width: 100%; height: 100%; object-fit: contain; display: block; }
.eq-img svg { width: 100%; height: 100%; display: block; background: var(--surface2); }
.eq-badge { position: absolute; left: 8px; top: 8px; padding: 3px 8px; border-radius: 999px; background: #15171c; color: #fff; font-size: 10.5px; font-weight: 800; letter-spacing: .05em; text-transform: uppercase; }
.eq-fav { position: absolute; right: 6px; top: 6px; width: 32px; height: 32px; border-radius: 50%; background: rgba(20, 22, 26, .6); color: #fff; display: flex; align-items: center; justify-content: center; -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); }
.eq-fav.on { color: var(--gold); }
.eq-cam { position: absolute; right: 8px; bottom: 8px; width: 26px; height: 26px; border-radius: 50%; background: rgba(20, 22, 26, .55); color: #fff; display: flex; align-items: center; justify-content: center; }
.eq-body { padding: 10px 12px 13px; display: block; width: 100%; }
.eq-name { font-weight: 750; font-size: 14px; line-height: 1.25; min-height: 35px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.eq-sub { font-size: 12px; color: var(--muted); margin-top: 3px; }
.eq-last { font-size: 12.5px; margin-top: 7px; color: var(--accent); font-weight: 700; }
.eq-last.none { color: var(--muted); font-weight: 500; }
.fab { position: fixed; right: 16px; bottom: calc(86px + var(--sab)); z-index: 15; height: 52px; padding: 0 20px 0 16px; border-radius: 26px; box-shadow: 0 10px 28px rgba(0, 0, 0, .4); }
.sticky-filters { position: sticky; top: 0; z-index: 5; background: var(--bg); padding: 6px 16px 8px; margin: 0 -16px; }
.filter-label { font-size: 11.5px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); margin: 10px 0 6px; }
.ph { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; background: var(--surface2); color: var(--muted); font-size: 12px; font-weight: 700; }
.ph .ic { width: 38px; height: 38px; background: transparent; }
.ex .t .ph .ic, .shortcut .im .ph .ic { width: 26px; height: 26px; }
.ex .t .ph span { display: none; }

/* ── Jihoz sahifasi ────────────────────────────────────── */
.hero { position: relative; aspect-ratio: 4/3; border-radius: 24px; overflow: hidden; background: var(--photo-bg); margin-bottom: 14px; box-shadow: var(--shadow); }
.hero > img { width: 100%; height: 100%; object-fit: contain; display: block; }
.hero > svg, .hero > .ph { width: 100%; height: 100%; display: block; background: var(--surface2); }
.hero .top { position: absolute; left: 10px; right: 10px; top: 10px; display: flex; justify-content: space-between; z-index: 2; }
.title-block h1 { font-size: 26px; font-weight: 800; letter-spacing: -.03em; line-height: 1.12; }
.title-block p { color: var(--muted); margin-top: 4px; font-size: 14px; }
.title-block { margin-bottom: 12px; }

.log-title { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.log-title b { font-size: 17px; font-weight: 800; }
.hint { display: flex; align-items: center; gap: 10px; padding: 11px 12px; border-radius: 14px; background: var(--accent-soft); font-size: 13.5px; margin-bottom: 14px; }
.hint .ic { color: var(--accent); }
.hint b { color: var(--accent); }
.steps { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 14px; }
.steps.one { grid-template-columns: 1fr; }
.step-l { font-size: 12.5px; color: var(--muted); font-weight: 700; margin: 0 2px 6px; }
.stepper { display: flex; align-items: center; background: var(--surface2); border-radius: 16px; overflow: hidden; }
.stepper button { width: 46px; height: 58px; display: flex; align-items: center; justify-content: center; color: var(--accent); flex: none; }
.stepper button:active { background: var(--accent-soft); }
.stepper input { flex: 1; min-width: 0; width: 100%; height: 58px; text-align: center; background: transparent; border: 0; outline: 0; font-size: 24px; font-weight: 800; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.live { display: flex; align-items: center; justify-content: space-between; padding: 10px 14px; border-radius: 14px; background: var(--surface2); margin-bottom: 14px; font-size: 13.5px; }
.live b { font-size: 17px; font-weight: 800; }
.today-set { display: flex; align-items: center; gap: 12px; padding: 10px 0; border-top: 1px solid var(--line); }
.today-set:first-of-type { border-top: 0; }
.today-set .no { width: 28px; height: 28px; border-radius: 50%; background: var(--surface2); display: flex; align-items: center; justify-content: center; font-size: 12px; font-weight: 800; color: var(--muted); }
.today-set .v { font-weight: 750; font-size: 16px; }
.today-set .del { color: var(--muted); width: 36px; height: 36px; display: flex; align-items: center; justify-content: center; border-radius: 11px; }
.records { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.rec { background: var(--surface); border-radius: 16px; padding: 12px 10px; box-shadow: var(--shadow); }
:root:not([data-theme="light"]) .rec { border: 1px solid var(--line); }
.rec .v { font-size: 18px; font-weight: 800; letter-spacing: -.02em; white-space: nowrap; }
.rec .l { font-size: 11.5px; color: var(--muted); margin-top: 2px; font-weight: 600; }
.rec .d { font-size: 11px; color: var(--muted); margin-top: 4px; }
.hist { padding: 13px 0; border-top: 1px solid var(--line); }
.hist:first-of-type { border-top: 0; }
.delta { font-size: 12.5px; font-weight: 800; }

/* ── Grafik ────────────────────────────────────────────── */
.chart { width: 100%; height: auto; display: block; touch-action: pan-y; }
.chart text { fill: var(--muted); font-size: 10px; font-family: inherit; }
.chart .grid-l { stroke: var(--line); stroke-width: 1; stroke-dasharray: 3 4; }
.chart .ln { fill: none; stroke: var(--accent); stroke-width: 2.8; stroke-linecap: round; stroke-linejoin: round; }
.chart .dot { fill: var(--surface); stroke: var(--accent); stroke-width: 2.4; }
.chart .dot.sel { fill: var(--accent); }
.chart .val { fill: var(--text); font-size: 11px; font-weight: 800; }
.chart-info { min-height: 38px; margin: 8px 2px 0; font-size: 13.5px; }
.chart-info b { font-size: 16px; }
.trend { display: flex; gap: 8px; align-items: baseline; flex-wrap: wrap; }
.trend .big { font-size: 26px; font-weight: 800; letter-spacing: -.03em; }
.spark { width: 84px; height: 32px; flex: none; }
.spark path { fill: none; stroke: var(--accent); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

/* ── Haqiqiydek tana rasmi (bodyreal.js) ───────────────── */
.rfig { width: 100%; height: auto; display: block; cursor: pointer; touch-action: manipulation; }
/* Tana kichik rasmi: Matrix fotosidan farqli — kadrni to'ldiradi va mavzu fonida turadi */
img.bt { width: 100%; height: 100%; object-fit: cover !important; background: var(--surface2); display: block; }
.m-hero { aspect-ratio: 16/10; background: var(--surface2); }
.m-row { display: flex; align-items: center; gap: 12px; width: 100%; text-align: left; padding: 10px 0; border-top: 1px solid var(--line); }
.m-row:first-child { border-top: 0; }
.m-th { width: 56px; height: 42px; border-radius: 10px; object-fit: cover; background: var(--surface2); flex: none; }
.mini-eq { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin-bottom: 12px; }
.mini-eq button { text-align: left; min-width: 0; }
.mini-eq .im { display: block; aspect-ratio: 4/3; border-radius: 10px; overflow: hidden; background: var(--photo-bg); }
.mini-eq .im img { width: 100%; height: 100%; object-fit: contain; }
.mini-eq .im svg, .mini-eq .im .ph { width: 100%; height: 100%; }
.mini-eq .im .ph span { display: none; }
.mini-eq b { display: block; font-size: 11px; line-height: 1.2; margin-top: 5px; max-height: 2.4em; overflow: hidden; font-weight: 700; }

/* Trenajer sahifasi: ishlaydigan mushaklar (3D rasm + nomlari) */
.work { display: flex; gap: 12px; align-items: center; margin-bottom: 14px; }
.work-fig { width: 112px; height: 84px; border-radius: 14px; overflow: hidden; flex: none; background: var(--surface2); }
.work-fig svg { width: 100%; height: 100%; display: block; }

/* Haftalik hajm ustunlari */
.wk { position: relative; display: grid; grid-template-columns: repeat(8, 1fr); gap: 6px; height: 170px; padding-top: 8px; }
.wk-col { display: flex; flex-direction: column; align-items: center; justify-content: flex-end; min-width: 0; }
.wk-bar { flex: 1; width: 100%; display: flex; align-items: flex-end; background: var(--surface2); border-radius: 8px; overflow: hidden; }
.wk-bar i { display: block; width: 100%; border-radius: 8px 8px 0 0; }
.wk-col b { font-size: 12px; font-weight: 800; margin-top: 5px; line-height: 1; }
.wk-col span { font-size: 10px; color: var(--muted); margin-top: 3px; line-height: 1; }
.wk-col.cur b { color: var(--accent); }
.wk-target { position: absolute; left: 0; right: 0; border-top: 1.5px dashed var(--muted); opacity: .7; pointer-events: none; z-index: 1; }
.wk-target span { position: absolute; right: 0; top: -15px; font-size: 10px; font-weight: 700; color: var(--muted); background: var(--surface); padding: 0 3px; }

/* ── Tana xaritasi ─────────────────────────────────────── */
.figs { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.fig { width: 100%; height: auto; display: block; max-height: 360px; }
/* Bu qoidalar .fig ichida emas — <use> orqali chizilgan kichik rasmlar ham ularni olishi kerak */
.b { fill: var(--body); }
.m { stroke: var(--seam); stroke-width: 1.1; stroke-linejoin: round; transition: fill .2s; }
.m.sel { stroke: var(--text); stroke-width: 1.9; }
.fig.interactive .m { cursor: pointer; }
.fig-cap { text-align: center; font-size: 12px; color: var(--muted); font-weight: 700; margin-top: 2px; }
.legend { display: flex; align-items: center; justify-content: center; gap: 12px; flex-wrap: wrap; margin-top: 12px; font-size: 12px; color: var(--muted); font-weight: 600; }
.legend i { display: inline-block; width: 12px; height: 12px; border-radius: 4px; vertical-align: -2px; margin-right: 5px; }
.bar-row { display: flex; align-items: center; gap: 10px; padding: 9px 0; width: 100%; text-align: left; }
.bar-row .nm { width: 88px; font-size: 14px; font-weight: 700; flex: none; }
.bar { flex: 1; height: 10px; border-radius: 6px; background: var(--surface2); overflow: hidden; position: relative; }
.bar i { display: block; height: 100%; border-radius: 6px; }
.bar-row .v { width: 48px; text-align: right; font-size: 13px; color: var(--muted); font-weight: 700; flex: none; }
.cal { display: grid; grid-auto-flow: column; grid-template-rows: repeat(7, 1fr); gap: 4px; }
.cal i { aspect-ratio: 1; border-radius: 5px; background: var(--surface2); display: block; }
.cal i.t { outline: 2px solid var(--accent); outline-offset: 1px; }
.mdetail { margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--line); }
.status { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; font-weight: 800; }
.status i { width: 9px; height: 9px; border-radius: 50%; }

/* ── Profil ────────────────────────────────────────────── */
.avatar { width: 68px; height: 68px; border-radius: 50%; background: var(--accent-soft); color: var(--accent); display: flex; align-items: center; justify-content: center; font-size: 26px; font-weight: 800; overflow: hidden; flex: none; }
.avatar img { width: 100%; height: 100%; object-fit: cover; }
.kv { display: flex; justify-content: space-between; padding: 11px 0; border-top: 1px solid var(--line); font-size: 14px; }
.kv:first-child { border-top: 0; }
.kv span:first-child { color: var(--muted); }

/* ── Onboarding ────────────────────────────────────────── */
.center-screen { min-height: 100vh; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; padding: 24px; max-width: 420px; margin: 0 auto; }
.logo { width: 88px; height: 88px; border-radius: 28px; background: var(--accent-grad); color: #fff; display: flex; align-items: center; justify-content: center; margin-bottom: 24px; box-shadow: 0 14px 40px color-mix(in srgb, var(--accent) 38%, transparent); }
.center-screen h1 { font-size: 27px; font-weight: 800; letter-spacing: -.03em; margin-bottom: 8px; }
.center-screen p { color: var(--muted); margin-bottom: 22px; }
.spinner { width: 34px; height: 34px; border-radius: 50%; border: 3px solid var(--line); border-top-color: var(--accent); animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ── Toast, sheet, taymer ──────────────────────────────── */
#toast-root { position: fixed; left: 0; right: 0; top: calc(var(--sat) + 12px); z-index: 60; display: flex; flex-direction: column; align-items: center; gap: 8px; pointer-events: none; }
.toast { max-width: calc(100% - 32px); padding: 12px 17px; border-radius: 16px; background: #1f2229; color: #fff; font-weight: 700; box-shadow: 0 10px 30px rgba(0, 0, 0, .35); animation: pop .22s ease-out; display: flex; align-items: center; gap: 8px; }
.toast.err { background: var(--bad); }
.toast.pr { background: var(--gold); color: #2b1d00; font-weight: 800; }
.toast.out { opacity: 0; transform: translateY(-8px); transition: .25s; }
@keyframes pop { from { opacity: 0; transform: translateY(-10px) scale(.96); } to { opacity: 1; transform: none; } }

.sheet-bd { position: fixed; inset: 0; z-index: 40; background: rgba(0, 0, 0, .55); animation: fadein .18s; display: flex; align-items: flex-end; justify-content: center; }
.sheet { width: 100%; max-width: 560px; max-height: 90vh; overflow-y: auto; background: var(--bg); border-radius: 26px 26px 0 0; padding: 8px 16px calc(20px + var(--sab)); animation: slide .24s cubic-bezier(.2, .8, .2, 1); }
.sheet .grab { width: 40px; height: 4px; border-radius: 2px; background: var(--line); margin: 4px auto 14px; }
.sheet h2 { font-size: 21px; font-weight: 800; letter-spacing: -.02em; margin-bottom: 14px; }
@keyframes fadein { from { opacity: 0; } to { opacity: 1; } }
@keyframes slide { from { transform: translateY(40px); opacity: .4; } to { transform: none; opacity: 1; } }

#timer-root { position: fixed; left: 0; right: 0; bottom: calc(70px + var(--sab) + 10px); z-index: 18; display: flex; justify-content: center; pointer-events: none; }
.timer { pointer-events: auto; position: relative; overflow: hidden; display: flex; align-items: center; gap: 10px; padding: 8px 8px 8px 14px; border-radius: 999px; background: var(--surface); color: var(--text); box-shadow: 0 10px 30px rgba(0, 0, 0, .4); border: 1px solid var(--line); animation: pop .2s; }
.timer .fill { position: absolute; left: 0; top: 0; bottom: 0; background: var(--accent-soft); transition: width .25s linear; }
.timer > * { position: relative; }
.timer .t { font-size: 18px; font-weight: 800; min-width: 48px; text-align: center; }
.timer .tb { height: 32px; padding: 0 11px; border-radius: 16px; background: var(--surface2); font-size: 13px; font-weight: 800; display: inline-flex; align-items: center; }
.timer.done { background: var(--accent); color: var(--accent-ink); border-color: transparent; }
