/* «Bolalik» dizayn tili — docs/superpowers/specs/2026-10-14-bolalik-dizayn-tili-design.md §3.
   Rang faqat shu faylda. Komponentga hex yozilmaydi (test buni tekshiradi).
   Faol holat — har doim --accent. Bo'lim va blok tusi — `[data-tint]` orqali
   `--t-soft` / `--t-ink` / `--t-strong` (§6). Tus klinik ma'no bildirmaydi. */

/* Kontrast qiymatlari o'lchangan, taxmin qilinmagan (WCAG 2.1): matn 4.5:1,
   bosiladigan chegara va grafika 3:1. `tools/test-next-yangi-foundation.mjs`
   har to'plamda har rolni --canvas, --surface va --surface-sunken ustida
   hisoblab ko'radi. Qiymat izohlari --canvas ga nisbatan. */
:root[data-lesson-theme="light"], [data-theme="light"], :root {
  color-scheme: light;
  --canvas: #f3f6f4;            /* yalpiz-oq sahifa foni */
  --surface: #ffffff;           /* varaq, karta */
  --surface-sunken: #eef1f6;    /* chip, ikonka tugmasi, kbd */
  --canvas-raised: #eef1f6;     /* yengil to'ldirish (badge, holat pill) — botiq yuza bilan bir xil */
  --text-primary: #1e2340;      /* 14.1:1 */
  --text-body: #343956;         /* 10.3:1 */
  --text-secondary: #535877;    /* 6.4:1 */
  --text-tertiary: #646987;     /* 4.9:1 — eng och matn */
  --border-subtle: #e2e6ee;
  --border-strong: #868ca6;     /* 3.1:1 — bosiladigan chegara */
  --accent: #1a7044;            /* 5.6:1 — logodagi yashil */
  --accent-muted: #3a5f86;      /* 6.1:1 */
  --text-on-accent: #ffffff;    /* 6.1:1 */
  --accent-soft: #ddf3e5;       /* accent ustida 5.2:1 */
  --button: #1e2340;
  --text-on-button: #ffffff;
  --success: #1d7348;
  --warning: #8a5800;
  --izla-strong: #f8d257;
  --izla-soft: #fcefc7;
  --izla-halo: rgba(214, 160, 20, .35);
  --danger: #b3372a;
  --info: #2a5bd0;
  --success-soft: #e3f5ea;
  --danger-soft: #fdecea;
  /* Ogohlantirish yuzasi (Telegram kirishidagi «avval ro'yxatdan
     o'tganmisiz?» eslatmasi). Matn --text-primary/--text-body da qoladi —
     16.8:1 / 13.8:1; --warning chegara va belgi uchun, 4.7:1. */
  --warning-soft: #fef3e4;
  /* Telegram (kabinetdagi «Telegram'ni ulash», 2026-09-30). Brend ko'ki
     #2aabee oq matn bilan 2.6:1 — o'tmaydi; #167bb8 4.6:1. Tugma foni,
     ramka va belgi doirasi; ustidagi matn --text-on-telegram. Fondan 4.6:1,
     --telegram-soft ustida 4.1:1; matn --telegram-soft ustida 16.5:1 / 13.6:1. */
  --telegram: #167bb8;
  --text-on-telegram: #ffffff;
  --telegram-soft: #eaf4fb;
  /* Bo'lim tuslari (§3.2): soft — fon, ink — fon ustidagi matn (≥6.8:1),
     strong — progress va grafika (--surface ustida ≥3.4:1). */
  --tint-shaftoli-soft: #ffe4d7; --tint-shaftoli-ink: #7a3216; --tint-shaftoli-strong: #d9663a;
  --tint-osmon-soft: #dde9ff;    --tint-osmon-ink: #173b6e;    --tint-osmon-strong: #3f74e0;
  --tint-sariyog-soft: #ffedb8;  --tint-sariyog-ink: #664900;  --tint-sariyog-strong: #b07f00;
  --tint-yalpiz-soft: #d9f2e0;   --tint-yalpiz-ink: #165c33;   --tint-yalpiz-strong: #2a9456;
  --tint-lavanda-soft: #ece2ff;  --tint-lavanda-ink: #4f2d8c;  --tint-lavanda-strong: #8460d8;
  --tint-atirgul-soft: #ffe0ea;  --tint-atirgul-ink: #85234a;  --tint-atirgul-strong: #d24f7e;
  --tint-feruza-soft: #d4f1ee;   --tint-feruza-ink: #0f5953;   --tint-feruza-strong: #1f9a8e;
  --tint-qum-soft: #ede6da;      --tint-qum-ink: #5c4627;      --tint-qum-strong: #9c7848;
  /* Faollik xaritasi (kabinet) — accent'dan besh bosqich. */
  --heat-0: #eef1f6; --heat-1: #c9ebd5; --heat-2: #8fd3a8; --heat-3: #3fa86b; --heat-4: #1a7044;
  /* Grafik kategoriyalari — validatordan o'tgan tartib, aylanmaydi. */
  --chart-1: #0a7fae;
  --chart-2: #eb6834;
  --chart-3: #4a3aa7;
  --chart-4: #c98500;   /* #eda100 yalpiz fonda 1.99:1 edi — sepiya va qorong'idagi qiymat, 2.8:1 */
  --chart-5: #e87ba4;
  --focus-ring: #2a5bd0;        /* aksentdan boshqa rang: yashil tugmada ko'rinsin */
  --shadow-float: 0 14px 34px rgba(30, 35, 64, .28);
  --shadow-raised: 0 1px 2px rgba(30, 35, 64, .05), 0 8px 24px rgba(30, 35, 64, .06);
  --shadow-raised-hover: 0 2px 4px rgba(30, 35, 64, .06), 0 14px 32px rgba(30, 35, 64, .10);
  --card-border: transparent;   /* qorong'ida karta chegarasi (§3.7) */
  --backdrop: rgba(30, 35, 64, .36);
  --image-opacity: 1;
  --decor-opacity: .22;         /* hero bezagi (§3.7.3) */
  /* Asbob suratlari va mavzu chizmalari oq fonda ishlangan: plita har temada oq. */
  --plate: #ffffff;
  --panel-veil: rgba(255, 255, 255, .88);
  --brand-mark: url(/brand/pediatriccare/pediatriccare-belgi-rangli.svg);
}

/* Temaga bog'liq bo'lmagan tokenlar: shakl, o'lcham, shrift. */
:root {
  --radius-xs: 8px;
  --radius-control: 16px;
  --radius-card: 24px;
  --radius-panel: 32px;
  --radius-hero: 40px;
  --radius-pill: 999px;
  --space-1: 4px; --space-2: 8px; --space-3: 12px; --space-4: 16px; --space-5: 24px;
  --space-6: 32px; --space-7: 48px; --space-8: 64px; --space-9: 96px;
  --content-width: 1180px;
  --reading-width: 680px;
  --sheet-width: 840px;
  --search-width: 720px;
  --header-height: 84px;
  --bottom-nav-height: 64px;
  --font-sans: Onest, "Segoe UI", system-ui, -apple-system, sans-serif;
  --font-mono: "IBM Plex Mono", ui-monospace, Consolas, "Courier New", monospace;

  /* Ko'chish davri aliaslari. Eski sahifalar shu nomlarni ishlatadi; var()
     orqali har temada o'zi yechiladi. */
  --surface-structural: var(--surface);   /* panel va toolbar — endi oq varaq */
  --surface-muted: var(--surface-sunken);
  --surface-interactive: var(--surface);
  --surface-hover: var(--surface-sunken);
  --surface-selected: var(--accent-soft);
  --surface-raised: var(--surface);
  --accent-strong: var(--accent);
  --accent-secondary: var(--accent);
  --shadow-card: var(--shadow-raised);
}

[data-theme="dark"], :root[data-lesson-theme="dark"] {
  color-scheme: dark;
  --canvas: #11131c;            /* siyohrang-ko'k, sof qora emas */
  --surface: #191c28;
  --surface-sunken: #232738;
  --canvas-raised: #232738;
  --text-primary: #f1f2f8;      /* 16.6:1 */
  --text-body: #d3d6e4;         /* 12.8:1 */
  --text-secondary: #a9aec4;    /* 8.4:1 */
  --text-tertiary: #9095ad;     /* 6.3:1 */
  --border-subtle: #2a2e40;
  --border-strong: #6e7591;     /* 4.1:1 */
  --accent: #5fd39a;            /* 9.9:1 */
  --accent-muted: #9db8d6;      /* 9.1:1 */
  --text-on-accent: #0c1a13;    /* 9.6:1 */
  --accent-soft: #173a2a;       /* accent ustida 6.7:1 */
  --button: #f1f2f8;
  --text-on-button: #11131c;
  --success: #62cf95;
  --warning: #e6b04c;
  --izla-strong: #6e5612;
  --izla-soft: #342c14;
  --izla-halo: rgba(236, 186, 64, .38);
  --danger: #f08a80;
  --info: #8fb0ff;
  --success-soft: #14301f;
  --danger-soft: #3a1d1d;
  --warning-soft: #33260f;     /* matn 13.2:1 / 10.1:1, --warning 6.9:1 */
  --telegram: #167bb8;         /* oq matn 4.6:1, fondan 4.1:1 */
  --text-on-telegram: #ffffff;
  --telegram-soft: #0f2433;    /* matn 14.2:1 / 10.9:1, --telegram 3.5:1 */
  /* Qorong'ida pastel to'qlashadi, ink och bo'ladi (§3.7.2). */
  --tint-shaftoli-soft: #3a251d; --tint-shaftoli-ink: #ffc2a6; --tint-shaftoli-strong: #f0875a;
  --tint-osmon-soft: #1d2a47;    --tint-osmon-ink: #b3cbff;    --tint-osmon-strong: #6e9bff;
  --tint-sariyog-soft: #382e15;  --tint-sariyog-ink: #ffdb7a;  --tint-sariyog-strong: #e0b23a;
  --tint-yalpiz-soft: #173326;   --tint-yalpiz-ink: #9de3b7;   --tint-yalpiz-strong: #4fc27f;
  --tint-lavanda-soft: #2b2346;  --tint-lavanda-ink: #cfbbff;  --tint-lavanda-strong: #a487f0;
  --tint-atirgul-soft: #3b1e2a;  --tint-atirgul-ink: #ffb5cc;  --tint-atirgul-strong: #ec7fa4;
  --tint-feruza-soft: #14332f;   --tint-feruza-ink: #93e1d8;   --tint-feruza-strong: #3fc2b4;
  --tint-qum-soft: #31281d;      --tint-qum-ink: #e5d2b2;      --tint-qum-strong: #c2a274;
  --heat-0: #232738; --heat-1: #1d4532; --heat-2: #24724a; --heat-3: #3fa86b; --heat-4: #5fd39a;
  /* Qora fonda palitra to'qroq — `--accent` seriya sifatida juda och (validator rad etdi). */
  --chart-1: #3987e5;
  --chart-2: #d95926;
  --chart-3: #9085e9;
  --chart-4: #c98500;
  --chart-5: #d55181;
  --focus-ring: #8fb0ff;
  --shadow-float: 0 14px 34px rgba(0, 0, 0, .55);
  /* Qorong'ida soya fondan ajratmaydi — chuqurlik --surface ning ochroq
     bo'lishidan va 1px chegaradan keladi (§3.7.1). */
  --shadow-raised: 0 1px 2px rgba(0, 0, 0, .5), 0 8px 24px rgba(0, 0, 0, .35);
  --shadow-raised-hover: 0 2px 4px rgba(0, 0, 0, .55), 0 14px 32px rgba(0, 0, 0, .42);
  --card-border: #2a2e40;
  --backdrop: rgba(0, 0, 0, .62);
  --image-opacity: .9;
  --decor-opacity: .12;
  --plate: #ffffff;
  --panel-veil: rgba(25, 28, 40, .86);
  /* To'q yashil qora fonda 2.6:1 — tungi variantda kichik barg ochroq. */
  --brand-mark: url(/brand/pediatriccare/pediatriccare-belgi-tungi.svg);
}

/* O'qish fonlari — sayt temasidan mustaqil to'plamlar (§3.3).
   Kitob o'quvchisida subtree'ga (`data-reader-theme`), mavzu sahifasida
   `<html>` ga (`data-lesson-theme`) tushadi. Har to'plam TO'LIQ yoziladi —
   yozilmagan rol sayt temasidan sizib chiqadi. */
[data-reader-theme="sepia"], [data-lesson-theme="sepia"] {
  color-scheme: light;
  --canvas: #f3ead6;
  --surface: #fbf5e8;
  --surface-sunken: #ebe1ca;
  --canvas-raised: #ebe1ca;
  --text-primary: #43321c;
  --text-body: #4f3d26;
  --text-secondary: #6d5738;  /* 5.7:1 */
  --text-tertiary: #725c3f;   /* 5.3:1 — sunken ustida ham 4.5 dan o'tadi */
  --border-subtle: #e0d3b4;
  --border-strong: #917c50;   /* 3.4:1 */
  --accent: #82540f;          /* 5.4:1; accent-soft ustida 4.6:1 */
  --accent-muted: #4a6076;
  --text-on-accent: #fbf5e8;
  --accent-soft: #efe3c6;
  --button: #43321c;
  --text-on-button: #fbf5e8;
  --success: #44692a;
  --warning: #8c5108;
  --izla-strong: #ecc253;
  --izla-soft: #e9d49c;
  --izla-halo: rgba(160, 108, 14, .35);
  --danger: #a8403c;
  --info: #42607f;
  --success-soft: #e9ead2;
  --danger-soft: #f5e0d4;
  --warning-soft: #faf0dd;     /* matn 10.9:1 / 9.2:1, --warning 4.4:1 (faqat chegara) */
  --telegram: #167bb8;         /* oq matn 4.6:1, fondan 3.9:1 */
  --text-on-telegram: #ffffff;
  --telegram-soft: #e3ebe6;    /* matn 10.1:1 / 8.5:1, --telegram 3.8:1 */
  --tint-shaftoli-soft: #f3d9c6; --tint-shaftoli-ink: #6e2f12; --tint-shaftoli-strong: #c2603a;
  --tint-osmon-soft: #d8e0ea;    --tint-osmon-ink: #23415f;    --tint-osmon-strong: #4f6f96;
  --tint-sariyog-soft: #f1e1b0;  --tint-sariyog-ink: #5e4400;  --tint-sariyog-strong: #9a7200;
  --tint-yalpiz-soft: #d9e6cc;   --tint-yalpiz-ink: #2f5320;   --tint-yalpiz-strong: #5a8636;
  --tint-lavanda-soft: #e3daea;  --tint-lavanda-ink: #4a2f70;  --tint-lavanda-strong: #7e5fb0;
  --tint-atirgul-soft: #f0d5d6;  --tint-atirgul-ink: #7a2a3a;  --tint-atirgul-strong: #b4566a;
  --tint-feruza-soft: #d2e5df;   --tint-feruza-ink: #1d5149;   --tint-feruza-strong: #3a8579;
  --tint-qum-soft: #e6d9bf;      --tint-qum-ink: #55401f;      --tint-qum-strong: #8e6c3c;
  --heat-0: #ebe1ca; --heat-1: #dccb9f; --heat-2: #c4a463; --heat-3: #a37a2c; --heat-4: #82540f;
  --chart-1: #0a7fae;
  --chart-2: #eb6834;
  --chart-3: #4a3aa7;
  --chart-4: #c98500;   /* qog'oz fonda sariq to'qroq: 2.6:1, validator PASS */
  --chart-5: #e87ba4;
  --focus-ring: #82540f;
  --shadow-float: 0 14px 34px rgba(84, 60, 20, .22);
  --shadow-raised: 0 1px 2px rgba(84, 60, 20, .07), 0 8px 24px rgba(84, 60, 20, .08);
  --shadow-raised-hover: 0 2px 4px rgba(84, 60, 20, .09), 0 14px 32px rgba(84, 60, 20, .12);
  --card-border: transparent;
  --backdrop: rgba(67, 50, 28, .32);
  --panel-veil: rgba(251, 245, 232, .88);
  --image-opacity: 1;
  --decor-opacity: .2;
  --plate: #ffffff;
}

/* Tungi ko'k — kechqurun o'qish uchun. Qoradan yumshoqroq: fon ko'kimtir,
   matn sof oq emas, shuning uchun uzoq o'qishda ko'z qamashmaydi. */
[data-reader-theme="navy"], [data-lesson-theme="navy"] {
  color-scheme: dark;
  --canvas: #0f1b2d;
  --surface: #15243a;
  --surface-sunken: #1c2e48;
  --canvas-raised: #1c2e48;
  --text-primary: #edf2f8;      /* 15.4:1 */
  --text-body: #d0d9e4;         /* 12.1:1 */
  --text-secondary: #a8b6c8;    /* 8.4:1 */
  --text-tertiary: #93a3b8;     /* 6.6:1 */
  --border-subtle: #223350;
  --border-strong: #6a84a3;     /* 4.3:1 */
  --accent: #6ccaf2;            /* 9.4:1 */
  --accent-muted: #8fb0c8;      /* 7.6:1 */
  --text-on-accent: #0f1b2d;
  --accent-soft: #15354f;
  --button: #edf2f8;
  --text-on-button: #0f1b2d;
  --success: #6fcf9a;
  --warning: #e5b04a;
  --izla-strong: #665412;
  --izla-soft: #2e3322;
  --izla-halo: rgba(236, 186, 64, .36);
  --danger: #f28b8b;
  --info: #6ccaf2;
  --success-soft: #12302b;
  --danger-soft: #3a2130;
  --warning-soft: #302a1f;     /* matn 12.6:1 / 10.0:1, --warning 7.2:1 */
  --telegram: #167bb8;         /* oq matn 4.6:1, fondan 3.8:1 */
  --text-on-telegram: #ffffff;
  --telegram-soft: #0c2640;    /* matn 13.7:1 / 10.8:1, --telegram 3.3:1 */
  --tint-shaftoli-soft: #3a2a2e; --tint-shaftoli-ink: #ffc2a6; --tint-shaftoli-strong: #f0875a;
  --tint-osmon-soft: #1c3355;    --tint-osmon-ink: #b3cbff;    --tint-osmon-strong: #6e9bff;
  --tint-sariyog-soft: #33321f;  --tint-sariyog-ink: #ffdb7a;  --tint-sariyog-strong: #e0b23a;
  --tint-yalpiz-soft: #17383a;   --tint-yalpiz-ink: #9de3b7;   --tint-yalpiz-strong: #4fc27f;
  --tint-lavanda-soft: #2a2c55;  --tint-lavanda-ink: #cfbbff;  --tint-lavanda-strong: #a487f0;
  --tint-atirgul-soft: #3a2440;  --tint-atirgul-ink: #ffb5cc;  --tint-atirgul-strong: #ec7fa4;
  --tint-feruza-soft: #113a42;   --tint-feruza-ink: #93e1d8;   --tint-feruza-strong: #3fc2b4;
  --tint-qum-soft: #2f2e33;      --tint-qum-ink: #e5d2b2;      --tint-qum-strong: #c2a274;
  --heat-0: #1c2e48; --heat-1: #1b4a63; --heat-2: #2a7aa0; --heat-3: #45a6d2; --heat-4: #6ccaf2;
  --chart-1: #3987e5;
  --chart-2: #d95926;
  --chart-3: #9085e9;
  --chart-4: #c98500;
  --chart-5: #d55181;
  --focus-ring: #6ccaf2;
  --shadow-float: 0 14px 34px rgba(2, 8, 18, .55);
  --shadow-raised: 0 1px 2px rgba(2, 8, 18, .5), 0 8px 24px rgba(2, 8, 18, .35);
  --shadow-raised-hover: 0 2px 4px rgba(2, 8, 18, .55), 0 14px 32px rgba(2, 8, 18, .42);
  --card-border: #223350;
  --backdrop: rgba(2, 8, 18, .6);
  --image-opacity: .9;
  --decor-opacity: .12;
  --plate: #ffffff;
  --panel-veil: rgba(21, 36, 58, .86);
}

/* Tus ulagichi (§6): komponent faqat --t-soft / --t-ink / --t-strong ni
   ishlatadi, qaysi tus ekanini `data-tint` atributi aytadi. */
[data-tint="shaftoli"] { --t-soft: var(--tint-shaftoli-soft); --t-ink: var(--tint-shaftoli-ink); --t-strong: var(--tint-shaftoli-strong); }
[data-tint="osmon"]    { --t-soft: var(--tint-osmon-soft);    --t-ink: var(--tint-osmon-ink);    --t-strong: var(--tint-osmon-strong); }
[data-tint="sariyog"]  { --t-soft: var(--tint-sariyog-soft);  --t-ink: var(--tint-sariyog-ink);  --t-strong: var(--tint-sariyog-strong); }
[data-tint="yalpiz"]   { --t-soft: var(--tint-yalpiz-soft);   --t-ink: var(--tint-yalpiz-ink);   --t-strong: var(--tint-yalpiz-strong); }
[data-tint="lavanda"]  { --t-soft: var(--tint-lavanda-soft);  --t-ink: var(--tint-lavanda-ink);  --t-strong: var(--tint-lavanda-strong); }
[data-tint="atirgul"]  { --t-soft: var(--tint-atirgul-soft);  --t-ink: var(--tint-atirgul-ink);  --t-strong: var(--tint-atirgul-strong); }
[data-tint="feruza"]   { --t-soft: var(--tint-feruza-soft);   --t-ink: var(--tint-feruza-ink);   --t-strong: var(--tint-feruza-strong); }
[data-tint="qum"]      { --t-soft: var(--tint-qum-soft);      --t-ink: var(--tint-qum-ink);      --t-strong: var(--tint-qum-strong); }

* { box-sizing: border-box; }
/* Scrollbar joyi doim ajratilgan: sahifadan sahifaga o'tganda header
   scrollbar bor-yo'qligiga qarab 8 px sakramaydi (spec 2026-10-14 §8.7). */
html { background: var(--canvas); scrollbar-gutter: stable; }
body {
  margin: 0;
  min-width: 320px;
  color: var(--text-primary);
  background: var(--canvas);
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
button, input, select, textarea { font: inherit; color: inherit; }
a { color: inherit; }
img { max-width: 100%; height: auto; opacity: var(--image-opacity); }
::selection { background: var(--accent-soft); }
.mono { font-family: var(--font-mono); font-variant-numeric: tabular-nums; }

@media (max-width: 900px) {
  :root { --header-height: 56px; }
}

/* Til chaqnashi. Sahifa HTML da o'zbekcha matn bilan keladi; saqlangan til
   ru yoki en bo'lsa `<head>` dagi kichik skript `data-i18n-pending` qo'yadi
   va tarjima qilinadigan satrlar chizilmaydi. Bayroqni `shell.js` tarjimadan
   keyin oladi — o'quvchi o'zbekchasini umuman ko'rmaydi. Joy `visibility`
   bilan saqlanadi, shuning uchun sahifa sakramaydi. */
html[data-i18n-pending] [data-i18n] { visibility: hidden; }

/* Statik ro'yxat (tools/build-yangi-seo.mjs, spec 2026-09-21 §3.3). JS
   ishlaydigan brauzerda u birinchi bo'yoqdan yashirin: `mavzular.js` uni
   skelet bilan almashtiradi va `rise` bilan ko'taradi — bugungidek. JSsiz
   brauzer va qidiruv robotida `data-js` yo'q, ro'yxat ko'rinadi. JS moduli
   kelmasa (tarmoq) 2,5 s dan keyin CSS o'zi ochadi; JS kelgan bo'lsa
   `data-prerendered` olib tashlangan — qoida ishlamaydi. */
html[data-js] [data-prerendered] > li { opacity: 0; transform: translateY(14px); animation: seo-zaxira 0s linear 2.5s forwards; }
@keyframes seo-zaxira { to { opacity: 1; transform: none; } }
