/* O'quvchi sahifalari: portal, kirish, test yechish, natija */
* { box-sizing: border-box; margin: 0; padding: 0; }
[hidden] { display: none !important; }
html, body { height: 100%; }
body { font-family: 'Segoe UI', Arial, sans-serif; }
button { font-family: inherit; }

/* Formulalar va bezaklar (matn.js) */
.mformula .katex { font-size: 1.15em; }
.mformula-xato { font-family: "Cambria Math", "Times New Roman", serif; }
mark.mbezak { background: #fde047; color: #111827; padding: 0 3px; border-radius: 3px; }
.opt-text u, .q-text u { text-decoration-thickness: 2px; text-underline-offset: 3px; }

/* ═══ Portal, kirish, natija (yorug' fon) ═══════════════════════════ */
body.yorug { background: #f3f0e8; color: #1e2620; min-height: 100%; }
.oraliq { max-width: 960px; margin: 0 auto; padding: 40px 20px 56px; }
.tor { max-width: 560px; }
.sarlavha { text-align: center; margin-bottom: 28px; }
.sarlavha .belgi { width: 64px; height: 64px; border-radius: 18px; background: #1d3b2c; color: #c9a24a; display: inline-grid;
  place-items: center; margin-bottom: 14px; }
.sarlavha h1 { font-size: 26px; font-weight: 700; }
.sarlavha p { color: #667060; margin-top: 4px; }
.ogohlantirish { background: #f7e3e0; border: 1px solid #e9c3bd; color: #7d241e; border-radius: 10px; padding: 12px 16px;
  margin-bottom: 16px; font-size: 14.5px; }
.kartalar { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 16px; }
.karta { background: #fffdf8; border: 1px solid #ddd5c4; border-radius: 14px; padding: 20px; }
.karta h2 { font-size: 18px; margin-bottom: 8px; }
.chiplar { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 14px; }
.chip { font-size: 12.5px; background: #ece6d8; color: #48524a; border-radius: 99px; padding: 3px 10px; }
.guruh-tugmalar { display: flex; flex-wrap: wrap; gap: 8px; }
.guruh-tugma { display: inline-block; text-decoration: none; background: #1d3b2c; color: #f6efdc; font-weight: 600;
  font-size: 14px; border-radius: 9px; padding: 8px 14px; border: 2px solid transparent; cursor: pointer; }
.guruh-tugma:hover { background: #2a5440; }
.guruh-tugma.tanlangan { background: #c9a24a; color: #1e2620; }
.bosh-holat { text-align: center; color: #667060; padding: 48px 0; }
.malumot { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin: 16px 0 22px; }
.malumot div { background: #f6f2e8; border-radius: 10px; padding: 10px; text-align: center; }
.malumot small { display: block; font-size: 11.5px; color: #667060; text-transform: uppercase; letter-spacing: .05em; }
.malumot b { font-size: 15px; }
.bosqich { font-size: 13px; font-weight: 700; color: #3b443d; text-transform: uppercase; letter-spacing: .04em; margin: 18px 0 8px; }
select, .maydon { width: 100%; padding: 12px 14px; border: 1px solid #ddd5c4; border-radius: 10px; font: 16px 'Segoe UI', Arial, sans-serif;
  background: #fff; color: #1e2620; }
select:focus, .maydon:focus, .guruh-tugma:focus-visible, .asosiy-tugma:focus-visible { outline: 3px solid #c9a24a; outline-offset: 2px; }
.asosiy-tugma { display: block; width: 100%; margin-top: 20px; border: none; border-radius: 10px; padding: 14px; background: #1d3b2c;
  color: #f6efdc; font-size: 16px; font-weight: 700; cursor: pointer; text-align: center; text-decoration: none; }
.asosiy-tugma:hover { background: #2a5440; }
.orqaga { display: block; text-align: center; margin-top: 18px; color: #667060; font-size: 14px; }

/* Natija */
.natija-bosh { text-align: center; }
.ball-doira { width: 132px; height: 132px; border-radius: 50%; border: 5px solid; display: grid; place-content: center;
  margin: 0 auto 14px; }
.ball-doira b { font-size: 30px; line-height: 1; }
.ball-doira small { font-size: 12px; color: #667060; margin-top: 3px; }
.yaxshi { color: #1f6b45; border-color: #1f6b45; background: #e2efe6; }
.ortacha { color: #8a610c; border-color: #c9a24a; background: #f6ecd0; }
.past { color: #a8322a; border-color: #a8322a; background: #f7e3e0; }
.matn-yaxshi { color: #1f6b45; }
.matn-ortacha { color: #8a610c; }
.matn-past { color: #a8322a; }
.ism { font-size: 20px; font-weight: 700; }
.izoh { color: #667060; font-size: 14px; margin-top: 4px; }
.foiz { font-size: 36px; font-weight: 800; margin-top: 12px; }
.baho-matn { margin-top: 8px; font-size: 16px; }
.blok-qator { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 14px 0;
  border-bottom: 1px solid #ebe5d8; }
.blok-qator:last-of-type { border-bottom: none; }
.blok-nomi { font-weight: 600; }
.blok-tafsilot { font-size: 13px; color: #667060; margin-top: 3px; }
.sert-belgi { display: inline-block; font-size: 12px; font-weight: 700; background: #f6ecd0; color: #8a610c; border-radius: 99px;
  padding: 2px 9px; margin-top: 4px; }
.blok-ball { text-align: right; flex-shrink: 0; }
.blok-ball b { font-size: 20px; }
.blok-ball small { display: block; font-size: 12px; color: #667060; }
.jami-qator { display: flex; justify-content: space-between; padding-top: 14px; margin-top: 6px; border-top: 2px solid #ddd5c4;
  font-weight: 700; font-size: 17px; }
.bekor-xabar { background: #f7e3e0; border: 1px solid #e9c3bd; border-radius: 14px; padding: 16px; text-align: center;
  color: #7d241e; margin-bottom: 16px; }
.bekor-xabar b { display: block; font-size: 16px; }
.blok-sarlavha { font-size: 13px; font-weight: 700; color: #667060; text-transform: uppercase; letter-spacing: .06em; margin-bottom: 6px; }
.oraliq .karta + .karta { margin-top: 16px; }

@media (max-width: 600px) { .malumot { grid-template-columns: repeat(2, 1fr); } }

/* ═══ Test yechish (qorong'i fon — eski tizimdagidek) ═════════════════ */
body.ishlash {
  --bg: #0b1120; --surface: #131c2e; --surface2: #1a2540; --line: rgba(148,163,184,0.14);
  --text: #e5e7eb; --muted: #94a3b8; --faint: #64748b;
  --accent: #3b82f6; --accent-soft: rgba(59,130,246,0.16);
  --ok: #22c55e; --warn: #f59e0b; --danger: #ef4444;
  --b1: #60a5fa; --b2: #a78bfa; --b3: #2dd4bf;
  background: var(--bg); color: var(--text); display: flex; flex-direction: column; overflow: hidden;
}
.hdr { flex-shrink: 0; height: 64px; background: var(--surface); border-bottom: 1px solid var(--line); display: flex; align-items: center;
  gap: 16px; padding: 0 20px; }
.hdr-exam { min-width: 0; flex: 1; }
.hdr-exam h1 { font-size: 15px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hdr-exam p { font-size: 12px; color: var(--muted); margin-top: 2px; }
.hdr-mid { display: flex; align-items: center; gap: 10px; }
.pill { display: flex; align-items: center; gap: 8px; background: var(--surface2); border: 1px solid var(--line); border-radius: 999px; padding: 7px 16px; }
.pill-lbl { font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: 0.06em; }
.timer-val { font-size: 20px; font-weight: 800; font-variant-numeric: tabular-nums; letter-spacing: 0.02em; }
.timer.kam .timer-val { color: var(--warn); }
.timer.juda-kam .timer-val { color: var(--danger); }
.timer.juda-kam { border-color: rgba(239,68,68,0.5); animation: puls 1.2s ease-in-out infinite; }
@keyframes puls { 50% { box-shadow: 0 0 0 4px rgba(239,68,68,0.15); } }
.done-val { font-size: 16px; font-weight: 700; font-variant-numeric: tabular-nums; }
.done-val small { font-size: 13px; color: var(--muted); font-weight: 500; }
.hdr-actions { flex: 1; display: flex; justify-content: flex-end; gap: 8px; }
.btn { border: none; border-radius: 9px; padding: 10px 18px; font-size: 14px; font-weight: 600; cursor: pointer; display: inline-flex;
  align-items: center; gap: 7px; transition: background .15s, border-color .15s, color .15s; }
.btn-cancel { background: transparent; color: #fca5a5; border: 1.5px solid rgba(239,68,68,0.45); }
.btn-cancel:hover { background: rgba(239,68,68,0.14); color: #fff; }
.btn-finish { background: #16a34a; color: #fff; }
.btn-finish:hover { background: #15803d; }
.time-track { flex-shrink: 0; height: 3px; background: rgba(148,163,184,0.12); }
.time-bar { height: 100%; width: 100%; background: var(--accent); transition: width 1s linear, background .5s; }
.time-bar.kam { background: var(--warn); }
.time-bar.juda-kam { background: var(--danger); }

.layout { flex: 1; min-height: 0; display: grid; grid-template-columns: minmax(0,1fr) 340px; gap: 20px; padding: 20px; max-width: 1440px;
  width: 100%; margin: 0 auto; }
.col-main { min-height: 0; display: flex; }
.col-side { min-height: 0; display: flex; flex-direction: column; gap: 12px; overflow-y: auto; padding-right: 2px; }
.col-side::-webkit-scrollbar { width: 6px; }
.col-side::-webkit-scrollbar-thumb { background: rgba(148,163,184,0.25); border-radius: 3px; }

.q-card { flex: 1; min-height: 0; background: var(--surface); border: 1px solid var(--line); border-radius: 16px; display: flex;
  flex-direction: column; overflow: hidden; }
.q-top { display: flex; align-items: center; gap: 10px; padding: 14px 24px; border-bottom: 1px solid var(--line); }
.blok-chip { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; font-weight: 600; padding: 5px 12px; border-radius: 999px;
  background: rgba(96,165,250,0.12); color: var(--b1); }
.blok-chip[data-blok="2-blok"] { background: rgba(167,139,250,0.13); color: var(--b2); }
.blok-chip[data-blok="3-blok"] { background: rgba(45,212,191,0.12); color: var(--b3); }
.q-counter { margin-left: auto; font-size: 13px; color: var(--muted); }
.q-counter b { color: var(--text); font-size: 15px; }
.q-scroll { flex: 1; min-height: 0; overflow-y: auto; padding: 26px 28px 8px; }
.q-text { font-size: 18px; font-weight: 400; line-height: 1.65; color: #e2e8f0; }
.q-text b, .opt-text b { font-weight: 800; color: #fff; }
.q-image { display: block; max-width: 100%; max-height: 300px; border-radius: 10px; margin-top: 14px; background: #fff; }
.opt-img { display: block; max-width: 100%; max-height: 160px; border-radius: 8px; margin-top: 6px; background: #fff; }

.opts { display: grid; gap: 10px; margin-top: 22px; padding-bottom: 16px; }
.opt { display: flex; align-items: center; gap: 14px; padding: 13px 16px; border-radius: 12px; border: 1.5px solid var(--line);
  background: rgba(255,255,255,0.02); cursor: pointer; transition: border-color .15s, background .15s; user-select: none; }
.opt:hover { border-color: rgba(96,165,250,0.6); background: rgba(96,165,250,0.06); }
.opt.selected { border-color: var(--accent); background: var(--accent-soft); }
.opt.locked { cursor: default; }
.opt.locked:not(.selected) { opacity: 0.4; }
.opt.locked:hover { border-color: var(--line); background: rgba(255,255,255,0.02); }
.opt.locked.selected:hover { border-color: var(--accent); background: var(--accent-soft); }
.opt-key { width: 34px; height: 34px; border-radius: 50%; flex-shrink: 0; display: flex; align-items: center; justify-content: center;
  font-size: 14px; font-weight: 700; background: rgba(148,163,184,0.12); color: var(--muted); transition: background .15s, color .15s; }
.opt.selected .opt-key { background: var(--accent); color: #fff; }
.opt-text { font-size: 15px; line-height: 1.5; color: #e2e8f0; flex: 1; }
.opt-check { opacity: 0; color: var(--accent); font-weight: 800; font-size: 16px; }
.opt.selected .opt-check { opacity: 1; }

.q-actions { display: flex; align-items: center; gap: 10px; padding: 14px 24px; border-top: 1px solid var(--line); background: rgba(0,0,0,0.12); }
.q-hint { font-size: 12px; color: var(--faint); }
.q-hint kbd { font-family: inherit; font-size: 11px; border: 1px solid var(--line); border-bottom-width: 2px; border-radius: 5px; padding: 1px 6px; color: var(--muted); }
.q-actions .sp { flex: 1; }
.btn-skip { background: transparent; color: var(--muted); border: 1px solid var(--line); }
.btn-skip:hover { background: rgba(148,163,184,0.1); color: var(--text); }
.btn-next { background: var(--accent); color: #fff; padding: 11px 22px; }
.btn-next:hover { background: #2563eb; }
.btn-next:disabled { background: #273449; color: #5b6b83; cursor: not-allowed; }

.finish-card { flex: 1; background: var(--surface); border: 1px solid var(--line); border-radius: 16px; display: flex; flex-direction: column;
  align-items: center; justify-content: center; text-align: center; padding: 40px; }
.finish-card .ic { width: 76px; height: 76px; border-radius: 50%; background: rgba(34,197,94,0.14); color: var(--ok); display: flex;
  align-items: center; justify-content: center; font-size: 38px; margin-bottom: 18px; }
.finish-card h2 { font-size: 22px; margin-bottom: 8px; }
.finish-card p { color: var(--muted); font-size: 14px; line-height: 1.6; }
.finish-card p + p { margin-top: 6px; }
.finish-card .yashil { color: #4ade80; }

.panel { background: var(--surface); border: 1px solid var(--line); border-radius: 16px; padding: 16px; }
.student { display: flex; gap: 16px; align-items: center; padding: 14px 16px; }
.ava { width: 64px; height: 64px; border-radius: 16px; flex-shrink: 0; background: linear-gradient(135deg, #1e3a8a, #3b82f6); display: flex;
  align-items: center; justify-content: center; font-size: 24px; font-weight: 700; color: #fff; letter-spacing: 0.04em; }
.st-name { font-size: 16px; font-weight: 700; line-height: 1.35; word-break: break-word; }
.st-meta { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.tag { font-size: 11.5px; padding: 3px 9px; border-radius: 999px; background: var(--surface2); color: var(--muted); border: 1px solid var(--line); }
.tag.g { color: #93c5fd; background: rgba(59,130,246,0.12); border-color: transparent; }

.nav-head { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: 10px; }
.nav-head h3 { font-size: 13px; font-weight: 700; }
.nav-head span { font-size: 12px; color: var(--muted); }
.prog { height: 6px; border-radius: 3px; background: rgba(148,163,184,0.14); overflow: hidden; margin-bottom: 14px; }
.prog i { display: block; height: 100%; width: 0; background: linear-gradient(90deg, #2563eb, #60a5fa); border-radius: 3px; transition: width .3s; }
.nav-group { margin-bottom: 10px; }
.nav-label { font-size: 10.5px; font-weight: 700; color: var(--faint); text-transform: uppercase; letter-spacing: 0.06em; margin-bottom: 5px; }
.nav-nums { display: grid; grid-template-columns: repeat(10, minmax(0,1fr)); gap: 4px; }
.num { width: 100%; aspect-ratio: 1; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 11px;
  font-weight: 600; padding: 0; background: rgba(148,163,184,0.08); color: var(--muted); border: 1.5px solid rgba(148,163,184,0.18);
  cursor: pointer; transition: all .12s; }
.num:hover { border-color: var(--b1); color: #fff; }
.num.tanlangan { border-color: var(--accent); color: #93c5fd; }
.num.qulf { background: #1d4ed8; border-color: #1d4ed8; color: #fff; cursor: not-allowed; }
.num.qulf:hover { border-color: #1d4ed8; }
.num.joriy { background: var(--warn); border-color: var(--warn); color: #111827; box-shadow: 0 0 0 3px rgba(245,158,11,0.25); cursor: default; }
.num.tuz { outline: 2px solid #f59e0b; outline-offset: 1px; }
.legend { display: flex; flex-wrap: wrap; gap: 6px 14px; margin-top: 6px; padding-top: 12px; border-top: 1px solid var(--line); font-size: 11px; color: var(--muted); }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.legend i { width: 11px; height: 11px; border-radius: 50%; display: inline-block; border: 1.5px solid rgba(148,163,184,0.25); background: rgba(148,163,184,0.08); }
.legend i.qulf { background: #1d4ed8; border-color: #1d4ed8; }
.legend i.joriy { background: var(--warn); border-color: var(--warn); }
.legend i.tuz { outline: 2px solid #f59e0b; outline-offset: 1px; }

.modal-bg { position: fixed; inset: 0; background: rgba(2,6,23,0.78); display: none; align-items: center; justify-content: center; z-index: 1000; padding: 16px; }
.modal-bg.show { display: flex; }
.modal { background: var(--surface); border: 1px solid var(--line); border-radius: 16px; max-width: 420px; width: 100%; padding: 28px 26px 22px;
  text-align: center; box-shadow: 0 24px 64px rgba(0,0,0,0.55); }
.modal-icon { font-size: 40px; margin-bottom: 10px; }
.modal h3 { font-size: 18px; font-weight: 700; margin-bottom: 8px; }
.modal p { font-size: 14px; color: var(--muted); line-height: 1.55; margin-bottom: 22px; }
.modal-parol { width: 100%; padding: 12px 14px; border-radius: 10px; border: 1.5px solid var(--line); background: var(--bg); color: #fff;
  font-size: 15px; font-family: inherit; margin: -8px 0 8px; text-align: center; letter-spacing: 0.1em; }
.modal-parol:focus { outline: none; border-color: var(--danger); }
.modal-xato { color: #fca5a5; font-size: 13px; min-height: 18px; margin-bottom: 12px; }
.modal-btns { display: flex; gap: 10px; }
.modal-btns button { flex: 1; padding: 12px; border-radius: 10px; font-size: 14px; font-weight: 600; cursor: pointer; border: none; color: #fff; }
.modal-no { background: rgba(148,163,184,0.12) !important; color: var(--text) !important; border: 1px solid var(--line) !important; }
.modal-no:hover { background: rgba(148,163,184,0.2) !important; }
.modal-ok.yashil { background: #16a34a; }
.modal-ok.sariq { background: #d97706; }
.modal-ok.qizil { background: #dc2626; }
.modal-ok:disabled { opacity: .6; cursor: default; }

.sync-holat { align-self: center; font-size: 12px; font-weight: 600; color: #fca5a5; background: rgba(220,38,38,0.14);
  border: 1px solid rgba(220,38,38,0.4); border-radius: 999px; padding: 5px 12px; white-space: nowrap; }

/* Savol tuzatildi */
.tuz-banner { display: flex; align-items: center; gap: 8px; margin-bottom: 14px; padding: 10px 14px; border-radius: 10px;
  background: rgba(245,158,11,0.14); border: 1px solid rgba(245,158,11,0.45); color: #fcd34d; font-size: 14px; font-weight: 600; }
.tuz-toast { position: fixed; top: 78px; left: 50%; transform: translateX(-50%); z-index: 900; max-width: 560px; width: calc(100% - 32px);
  background: #78350f; color: #fef3c7; border: 1px solid #f59e0b; border-radius: 12px; padding: 14px 18px; font-size: 15px; line-height: 1.5;
  box-shadow: 0 18px 40px rgba(0,0,0,0.5); cursor: pointer; }

/* Maslahat xabari */
.maslahat { position: fixed; left: 44px; bottom: 96px; z-index: 900; max-width: 440px; display: flex; gap: 12px; align-items: flex-start;
  background: #1e293b; color: #e2e8f0; border: 1px solid rgba(245,158,11,0.35); border-left: 4px solid #f59e0b; border-radius: 14px;
  padding: 14px 14px 14px 16px; font-size: 14.5px; line-height: 1.5; box-shadow: 0 16px 40px -10px rgba(0,0,0,0.6);
  opacity: 0; transform: translateY(16px); transition: opacity .35s ease, transform .35s ease; pointer-events: none; }
.maslahat.korin { opacity: 1; transform: none; pointer-events: auto; }
.maslahat p { flex: 1; margin: 0; white-space: pre-line; }
.maslahat button { flex: none; width: 26px; height: 26px; border: none; border-radius: 8px; background: rgba(148,163,184,0.15);
  color: #94a3b8; font-size: 16px; line-height: 1; cursor: pointer; }
.maslahat button:hover { background: rgba(148,163,184,0.3); color: #fff; }

@media (max-width: 1100px) {
  body.ishlash { overflow: auto; }
  .layout { grid-template-columns: 1fr; height: auto; }
  .col-main { min-height: 70vh; }
  .hdr { height: auto; flex-wrap: wrap; padding: 10px 16px; }
  .hdr-actions { flex: none; margin-left: auto; }
}
.bolim-sarlavha { font-size: 15px; text-transform: uppercase; letter-spacing: .08em; color: #667060; margin: 26px 0 12px; }
.bolim-sarlavha:first-of-type { margin-top: 6px; }
