/* Shaxmat — «O'rganish» bo'limining yuklanadigan qismi (1 Dec 2026): xatolar ustida mashq, jumboqlar, mavzular, yangi qadamlar.
   Darslarning asosiy ko'rinishi index.html da. --tn: learn.js shu fayl kelganini shundan biladi. */
:root { --tn: 1; }

/* ---------- umumiy */
.tn-spin { flex: none; display: inline-block; box-sizing: border-box; width: 20px; height: 20px; border-radius: 50%; border: 2.5px solid rgba(166, 140, 255, .28); border-top-color: var(--acc2); animation: lnspin .8s linear infinite; }
.lnbk { width: 44px; height: 44px; }
.lnfb.wait { background: rgba(124, 92, 255, .1); border: 1px solid rgba(124, 92, 255, .28); color: #d9d1fb; }
.lnfb .tn-spin { margin-top: 0; }
.tn-row { align-items: center; background: rgba(26, 21, 48, .82); border: 1px solid rgba(166, 140, 255, .14); color: var(--muted); }
.tn-row > span { flex: 1; min-width: 0; }
.tn-fold { flex: none; display: inline-flex; align-items: center; justify-content: center; width: 44px; height: 44px; margin: -7px -8px -7px 0; padding: 0; border: 0; background: none; color: var(--muted); }
.tn-fold .ic { transition: transform .18s; }
.tn-fold[aria-expanded="true"] .ic { transform: rotate(90deg); }
.lnchh[data-f] { cursor: pointer; } .lnchh:hover .tn-fold { color: var(--fg); }

/* ---------- bosh ekran bo'limlari */
.tn-s { display: flex; flex-direction: column; gap: 12px; min-width: 0; }
.tn-sh { display: flex; align-items: center; gap: 12px; min-height: 30px; }
.tn-sh h3, .tn-ch { flex: 1; min-width: 0; margin: 0; font-size: 19px; font-weight: 800; letter-spacing: -.005em; }
.tn-ch { flex: none; margin: 6px 0 -6px; }
.tn-all { flex: none; display: inline-flex; align-items: center; gap: 7px; min-height: 44px; margin: -7px 0 -3px; padding: 0 13px; font-size: 13.5px; background: rgba(124, 92, 255, .12); border-color: rgba(166, 140, 255, .22); color: var(--acc2); }
.tn-all .ic { width: 17px; height: 17px; }
.tn-cs { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 270px), 1fr)); gap: 10px; }
.tn-c { display: flex; align-items: center; gap: 13px; width: 100%; min-width: 0; min-height: 72px; padding: 11px 12px 11px 14px; border-radius: 18px; background: rgba(26, 21, 48, .82); border-color: rgba(166, 140, 255, .12); text-align: left; font-weight: 600; }
.tn-c:hover, .tn-t:hover { border-color: var(--line2); background: rgba(34, 27, 62, .9); }
.tn-c > .ic { flex: none; width: 18px; height: 18px; color: var(--dim); }
.tn-c > em { flex: none; max-width: 96px; color: var(--muted); font-size: 12.5px; font-style: normal; font-weight: 700; line-height: 1.25; text-align: right; }
.tn-c[data-q="mist"], .tn-c[data-q="mix"] { border-color: rgba(143, 114, 255, .55); background: linear-gradient(150deg, rgba(124, 92, 255, .24), rgba(124, 92, 255, .06) 70%), #1a1433; }
.tn-cm { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.tn-cm b { color: #fff; font-size: 15.5px; line-height: 1.25; overflow-wrap: anywhere; }
.tn-cm small { color: var(--muted); font-size: 13px; font-weight: 500; line-height: 1.35; }
.tn-ti { flex: none; display: flex; align-items: center; justify-content: center; width: 46px; height: 46px; border-radius: 14px; background: rgba(124, 92, 255, .16); color: var(--acc2); }
.tn-ti > .ic { width: 25px; height: 25px; }
.tn-ti > .pcv { width: 38px; height: 38px; }
.tn-ti > b { font-size: 18px; font-weight: 800; letter-spacing: -.02em; }
.ok > .tn-ti { background: rgba(52, 211, 153, .14); color: var(--green); }
.ok > .tn-ti .ic { stroke-width: 2.6; }

/* panellar */
.tn-p { display: flex; flex-direction: column; gap: 14px; padding: 16px; border-radius: 20px; background: rgba(26, 21, 48, .82); border: 1px solid rgba(166, 140, 255, .14); }
.tn-p p { margin: 0; color: #cfc8ea; font-size: 14.5px; line-height: 1.45; }
.tn-p > button { display: inline-flex; align-items: center; justify-content: center; gap: 10px; min-height: 50px; font-size: 15.5px; }
.tn-em > b { font-size: 16.5px; }
.tn-em ol { display: grid; gap: 10px; margin: 0; padding: 0; list-style: none; counter-reset: n; }
.tn-em li { position: relative; display: flex; align-items: center; min-height: 28px; padding-left: 40px; color: #cfc8ea; font-size: 14.5px; line-height: 1.4; counter-increment: n; }
.tn-em li::before { content: counter(n); position: absolute; left: 0; top: 0; width: 28px; height: 28px; display: flex; align-items: center; justify-content: center; border-radius: 9px; background: rgba(124, 92, 255, .2); color: var(--acc2); font-size: 14px; font-weight: 800; }
.tn-hd { flex-direction: row; align-items: center; }
.tn-hd p { flex: 1; min-width: 0; color: #ebe7fb; font-size: 15px; }
.tn-dl { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); gap: 8px; width: 100%; margin: 0; }
.tn-dl > div { display: flex; flex-direction: column; justify-content: flex-start; gap: 2px; min-width: 0; padding: 9px 6px 8px; border-radius: 14px; background: rgba(255, 255, 255, .05); text-align: center; }
.tn-dl dd { order: -1; margin: 0; color: #fff; font-size: 21px; font-weight: 800; line-height: 1.15; font-variant-numeric: tabular-nums; }
.tn-dl dt { color: var(--muted); font-size: 12px; font-weight: 600; line-height: 1.25; overflow-wrap: anywhere; }
.tn-tc { display: flex; flex-wrap: wrap; gap: 8px; }
.tn-tc > small { width: 100%; color: var(--muted); font-size: 13px; font-weight: 600; }
.tn-tc button { display: inline-flex; align-items: center; gap: 8px; min-height: 44px; padding: 8px 10px 8px 13px; font-size: 13.5px; text-align: left; background: rgba(255, 255, 255, .05); border-color: rgba(166, 140, 255, .16); }
.tn-tc em { min-width: 22px; padding: 2px 6px; border-radius: 99px; background: rgba(124, 92, 255, .24); color: #d6ccff; font-size: 12px; font-style: normal; text-align: center; }
.tn-cr { margin: 0; color: var(--dim); font-size: 12px; font-weight: 500; line-height: 1.4; }
.tn-s > .tn-cr, .lnv > .tn-cr, .tn-pn > .tn-cr { text-align: center; }

/* mavzular */
.tn-g { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 148px), 1fr)); gap: 10px; }
.tn-t { display: flex; flex-direction: column; align-items: flex-start; gap: 4px; min-width: 0; padding: 13px 13px 14px; border-radius: 18px; background: rgba(26, 21, 48, .82); border-color: rgba(166, 140, 255, .12); text-align: left; font-weight: 600; }
.tn-t .tn-ti { width: 42px; height: 42px; margin-bottom: 5px; }
.tn-t > b { max-width: 100%; color: #fff; font-size: 14.5px; line-height: 1.25; overflow-wrap: anywhere; }
.tn-t > small { color: var(--muted); font-size: 12.5px; font-weight: 500; line-height: 1.3; }
.tn-l3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 4px; width: 100%; margin-top: auto; padding-top: 7px; }
.tn-l3 i { --p: 0%; height: 5px; border-radius: 99px; background: linear-gradient(90deg, var(--green) var(--p), rgba(255, 255, 255, .1) 0); }
.tn-bar { width: 100%; height: 6px; border-radius: 99px; background: rgba(255, 255, 255, .1); overflow: hidden; }
.tn-bar i { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--green), #8ff0c9); transition: width .3s; }
.tn-cm .tn-bar { margin-top: 5px; }
.tn-ls { grid-template-columns: minmax(0, 1fr); }
@media (min-width: 780px) and (max-width: 979px) { .tn-ls { grid-template-columns: repeat(3, minmax(0, 1fr)); } } /* 980 dan yon panellar bor: ustun tor */

/* ---------- mashq ekrani */
.tn-sg { display: flex; gap: 5px; padding: 7px 0; }
.tn-sg i { flex: 1; min-width: 0; height: 6px; border-radius: 99px; background: rgba(255, 255, 255, .11); transition: background-color .2s; }
.tn-sg .ok { background: var(--green); } .tn-sg .no { background: var(--red); } .tn-sg .sk { background: var(--muted); } .tn-sg .rm { opacity: .4; }
.tn-sg .c { box-shadow: 0 0 0 2px rgba(166, 140, 255, .5); } .tn-sg .c:not(.ok, .no, .sk, .rm) { background: var(--acc2); }
#lnSes > .tn-bar { margin: 7px 0; }
.lnchip.tn-cat { padding-left: 10px; background: color-mix(in srgb, var(--c) 18%, transparent); color: var(--c); }
.lnchip.tn-cat::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: currentColor; }
.lnmeta .lnchip:not(:has(svg)):not(.tn-cat), .tn-ths .lnchip { padding-left: 11px; }
.tn-pn { display: flex; flex-direction: column; gap: 10px; } .tn-pn:empty { display: none; }
.tn-pn:has(> .tn-row) { display: block; }
.lnl:has(#lnOv:not([hidden])) .tn-pn { display: none; } /* yakuniy karta ochiq: ostida ishlaydigan tugma qolmasin */
.tn-x { display: flex; flex-direction: column; gap: 10px; padding: 14px; border-radius: 18px; background: rgba(26, 21, 48, .82); border: 1px solid rgba(166, 140, 255, .14); animation: rvfade .2s; }
.tn-xr { display: flex; flex-direction: column; align-items: flex-start; gap: 4px; padding-left: 12px; border-left: 3px solid rgba(166, 140, 255, .3); }
.tn-xr.no { border-color: var(--red); } .tn-xr.ok { border-color: var(--green); }
.tn-xr b { color: #fff; font-size: 14.5px; line-height: 1.35; }
.tn-xr p { margin: 0; color: #cfc8ea; font-size: 14px; line-height: 1.45; }
.tn-xr .lnk { min-height: 44px; margin: -8px 0 -10px; font-size: 13.5px; }
.tn-ths { display: flex; flex-wrap: wrap; gap: 6px; }
.tn-nt { display: flex; align-items: center; gap: 9px; margin: 0; color: var(--muted); font-size: 13.5px; font-weight: 600; line-height: 1.35; }
.tn-nt .ic { flex: none; width: 18px; height: 18px; color: var(--acc2); }
.tn-rm { align-self: center; min-height: 44px; color: var(--muted); font-size: 13px; }
.tn-un { display: flex; align-items: center; gap: 12px; padding: 8px 8px 8px 14px; border-radius: 16px; background: var(--panel2); border: 1px solid var(--line2); font-size: 14px; font-weight: 600; animation: rvfade .2s; }
.tn-un > span { flex: 1; min-width: 0; }
.tn-un button { flex: none; display: inline-flex; align-items: center; gap: 8px; min-height: 44px; }
.tn-ml { display: flex; flex-wrap: wrap; align-items: center; gap: 4px; max-height: 148px; overflow-y: auto; padding: 8px; border-radius: 16px; background: rgba(26, 21, 48, .82); border: 1px solid rgba(166, 140, 255, .14); }
.tn-ml i { padding-left: 5px; color: var(--dim); font-size: 13px; font-style: normal; font-weight: 700; }
.tn-ml button { min-width: 44px; min-height: 44px; padding: 4px 9px; border-color: transparent; border-radius: 10px; background: none; color: #cfc8ea; font-size: 14.5px; }
.tn-ml button:hover { background: rgba(255, 255, 255, .06); }
.tn-ml button.on { background: rgba(124, 92, 255, .26); color: #fff; }
.lnb:focus { outline: none; } .lnb:focus-visible { outline: 3px solid var(--acc2); outline-offset: 3px; }

/* mashq yakuni: raqamlar sig'ishi uchun karta ixchamroq */
.lnovc:has(.tn-dl), .lnovc:has(button:nth-of-type(3)) { gap: 8px; padding: 15px 15px 14px; }
.lnovc:has(.tn-dl) .lnovi, .lnovc:has(button:nth-of-type(3)) .lnovi { width: 46px; height: 46px; }
.lnovc:has(.tn-dl) .lnovi .ic, .lnovc:has(button:nth-of-type(3)) .lnovi .ic { width: 25px; height: 25px; }
.lnovc:has(.tn-dl) h3, .lnovc:has(button:nth-of-type(3)) h3 { margin: 0; font-size: 19px; }
.lnovc:has(.tn-dl) p, .lnovc:has(button:nth-of-type(3)) p { margin: 0; font-size: 13.5px; }
.lnovc:has(.tn-dl) button, .lnovc:has(button:nth-of-type(3)) button { min-height: 46px; }

@media (max-width: 559px) { .tn-g6 > :nth-child(n + 5) { display: none; } } /* bosh ekranda telefonda 4 ta mavzu */

/* ---------- past bo'yli ekran (telefon yotiq): taxta chapda butun ko'rinadi, matn va tugmalar o'ngda */
@media (max-width: 979px) and (max-height: 520px) and (orientation: landscape) {
  .lnl { display: grid; grid-template-columns: min(calc(100vh - 20px), 52vw) minmax(0, 1fr); grid-template-columns: min(calc(100dvh - 20px), 52vw) minmax(0, 1fr); grid-template-rows: auto auto auto 1fr; gap: 10px 16px; align-items: start; }
  .lnl > .lnh { grid-area: 1 / 2; } .lnl > .lnseg, .lnl > #lnSes { grid-area: 2 / 2; }
  .lnl .lnbody { display: contents; }
  .lnl .lnbw { grid-area: 1 / 1 / span 4; position: sticky; top: 10px; }
  .lnl .lntx { grid-area: 3 / 2; padding: 12px 14px; } .lnl .lnctl { grid-area: 4 / 2; }
}

@media (prefers-reduced-motion: reduce) {
  .tn-spin { animation-duration: 2.4s; }
  .tn-x, .tn-un { animation: none; } .tn-fold .ic, .tn-bar i, .tn-sg i { transition: none; }
}
