/* Оқушы бағалау (bagalau.js) — в духе «Тәрбие бөлімі»: серый фон, белые
   карточки, без прозрачности. Цвет — только у выбранного балла. */
:root {
  --bg-bg: #f2f2f7;
  --bg-fill: rgba(118, 118, 128, .12);
  --bg-sep: rgba(60, 60, 67, .12);
  --bg-shadow: 0 1px 2px rgba(0, 0, 0, .04), 0 8px 24px -12px rgba(16, 22, 19, .10);
}
body:has(.bg) .content { background: var(--bg-bg); }
main.bg { max-width: 980px; padding-bottom: 32px; }

.bg-title { padding: 6px 2px 10px; }
.bg-title h1 { margin: 0; font-size: clamp(28px, 4.2vw, 34px); line-height: 1.08; font-weight: 750; letter-spacing: -.025em; }
.bg-title p { margin: 4px 0 0; font-size: 15px; color: var(--ink-2); }

.bg-bar { display: flex; flex-direction: column; gap: 10px; margin-bottom: 14px; }
.bg-select {
  align-self: flex-start; min-height: 36px; padding: 0 12px; border: 0; border-radius: 10px; background: var(--surface);
  box-shadow: var(--bg-shadow); font: inherit; font-size: 14px; font-weight: 600; color: var(--ink);
}
.bg-chips { display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; padding: 2px; }
.bg-chips button {
  flex: 0 0 auto; display: flex; flex-direction: column; align-items: center; min-height: 36px; padding: 6px 14px; border: 0; border-radius: 999px;
  background: var(--surface); box-shadow: var(--bg-shadow); font: inherit; font-size: 14px; font-weight: 650; color: var(--ink-2); cursor: pointer;
}
.bg-chips button small { font-size: 11px; font-weight: 500; color: var(--ink-3); }
.bg-chips button.mine { color: var(--green-dark); }
.bg-chips button[aria-selected="true"] { background: var(--ink); color: #fff; }
.bg-chips button[aria-selected="true"] small { color: rgba(255, 255, 255, .7); }

.bg-card { padding: 18px 20px; border-radius: 22px; background: var(--surface); box-shadow: var(--bg-shadow); }
.bg-card header h2 { display: flex; align-items: center; gap: 8px; margin: 0; font-size: 20px; font-weight: 750; letter-spacing: -.015em; }
.bg-card header p { margin: 2px 0 8px; font-size: 13px; color: var(--ink-3); }
.bg-tag { padding: 2px 8px; border-radius: 999px; font-style: normal; font-size: 11.5px; font-weight: 650; color: var(--green-dark); background: var(--ok-bg); }
.bg-empty { padding: 24px; text-align: center; color: var(--ink-3); }

.bg-list { list-style: none; margin: 0; padding: 0; }
.bg-list li + li { border-top: .5px solid var(--bg-sep); }
.bg-list button {
  display: flex; align-items: center; gap: 12px; width: 100%; padding: 10px 4px; border: 0; background: none; text-align: left;
  font: inherit; color: var(--ink); cursor: pointer; border-radius: 12px;
}
.bg-list button:hover { background: var(--bg-bg); }
.bg-name { flex: 1 1 auto; min-width: 0; font-size: 15px; font-weight: 600; }
.bg-name small { display: block; font-size: 12.5px; font-weight: 500; color: var(--ink-3); }
.bg-go { flex: 0 0 auto; font-size: 13.5px; font-weight: 650; color: var(--green-dark); }
.bg-ring {
  flex: 0 0 auto; display: grid; place-items: center; width: 38px; height: 38px; border-radius: 50%;
  background: conic-gradient(var(--green) calc(var(--v) * 1%), var(--bg-fill) 0);
}
.bg-ring b { display: grid; place-items: center; width: 30px; height: 30px; border-radius: 50%; background: var(--surface); font-size: 12px; font-weight: 750; font-variant-numeric: tabular-nums; }

/* Лист ученика */
.bg-sheet {
  width: min(760px, 100vw); max-height: min(90vh, 980px); padding: 0; border: 0; border-radius: 24px;
  background: var(--bg-bg); color: var(--ink); box-shadow: 0 30px 80px -20px rgba(0, 0, 0, .35);
}
.bg-sheet::backdrop { background: rgba(0, 0, 0, .3); }
#bgSheetBody { display: flex; flex-direction: column; gap: 12px; padding: 18px 20px 0; }
.bg-sheet-h { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.bg-sheet-h span { font-size: 12.5px; color: var(--ink-3); }
.bg-sheet-h h2 { margin: 2px 0 0; font-size: 24px; font-weight: 750; letter-spacing: -.02em; }
.bg-x { flex: 0 0 auto; width: 30px; height: 30px; border: 0; border-radius: 50%; background: var(--bg-fill); color: var(--ink-2); font-size: 20px; line-height: 1; cursor: pointer; }

.bg-secs { display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; }
.bg-secs button {
  flex: 0 0 auto; display: flex; align-items: baseline; gap: 6px; min-height: 34px; padding: 0 12px; border: 0; border-radius: 10px;
  background: var(--surface); font: inherit; font-size: 13.5px; font-weight: 650; color: var(--ink-2); cursor: pointer;
}
.bg-secs button small { font-size: 11.5px; font-weight: 600; color: var(--ink-3); font-variant-numeric: tabular-nums; }
.bg-secs button.done small { color: var(--green-dark); }
.bg-secs button[aria-selected="true"] { background: var(--ink); color: #fff; }
.bg-secs button[aria-selected="true"] small { color: rgba(255, 255, 255, .7); }

.bg-qs { margin: 0; padding: 0 0 0 0; list-style: none; counter-reset: q; display: flex; flex-direction: column; gap: 10px; }
.bg-q { padding: 14px 16px; border-radius: 18px; background: var(--surface); }
.bg-q > p:first-child { margin: 0 0 10px; font-size: 15px; font-weight: 600; line-height: 1.35; }
.bg-scale { display: grid; grid-template-columns: repeat(8, minmax(0, 1fr)); gap: 4px; }
.bg-scale button {
  min-height: 40px; border: 0; border-radius: 10px; background: var(--bg-bg); font: inherit; font-size: 15px; font-weight: 700;
  color: var(--ink-2); cursor: pointer; font-variant-numeric: tabular-nums;
}
/* Полосы 1-2 / 3-4 / 5-6 / 7-8 — едва заметный зазор между парами. */
.bg-scale button.b1:nth-child(2), .bg-scale button.b2:nth-child(4), .bg-scale button.b3:nth-child(6) { margin-right: 4px; }
.bg-scale button:hover { box-shadow: inset 0 0 0 1.5px rgba(16, 22, 19, .2); }
.bg-scale button[aria-checked="true"] { background: var(--green); color: #fff; box-shadow: none; }
.bg-scale button:active { transform: scale(.95); }
.bg-band { margin: 8px 0 0; font-size: 13px; line-height: 1.4; color: var(--ink-2); }
.bg-band.muted { color: var(--ink-3); }

.bg-foot {
  position: sticky; bottom: 0; z-index: 2; display: flex; align-items: center; gap: 10px; margin: 0 -20px; padding: 12px 20px;
  background: var(--surface); box-shadow: 0 -1px 0 var(--bg-sep);
}
.bg-foot span { flex: 1 1 auto; font-size: 13px; color: var(--ink-3); font-variant-numeric: tabular-nums; }
.bg-foot span b { color: #8a5a00; font-weight: 650; }
.bg-btn { min-height: 38px; padding: 0 16px; border: 0; border-radius: 10px; background: var(--green); color: #fff; font: inherit; font-size: 14px; font-weight: 700; cursor: pointer; }
.bg-btn.ghost { background: var(--bg-bg); color: var(--ink); }
.bg-btn:disabled { opacity: .5; cursor: default; }
.bg-btn:active:not(:disabled) { transform: scale(.97); }

.bg-toast {
  position: fixed; left: 50%; bottom: 28px; z-index: 120; transform: translateX(-50%); max-width: min(520px, calc(100vw - 32px));
  padding: 10px 16px; border-radius: 14px; background: #1c1c1e; color: #fff; font-size: 13.5px; font-weight: 600; transition: opacity .4s;
}
.bg-toast.bad { background: #b3261e; }
.bg-toast.out { opacity: 0; }

@media (max-width: 600px) {
  .bg-card { padding: 14px; border-radius: 18px; }
  .bg-sheet { width: 100vw; max-width: 100vw; margin: auto 0 0; border-radius: 24px 24px 0 0; max-height: 94vh; }
  #bgSheetBody { padding: 16px 16px 0; }
  .bg-foot { margin: 0 -16px; padding: 10px 16px calc(10px + env(safe-area-inset-bottom)); }
  .bg-scale button { min-height: 44px; }
  .bg-scale button.b1:nth-child(2), .bg-scale button.b2:nth-child(4), .bg-scale button.b3:nth-child(6) { margin-right: 0; }
  .bg-go { display: none; }
}
@media (prefers-reduced-motion: reduce) { .bg-scale button:active, .bg-btn:active { transform: none; } }
.bg-foot .bg-btn { flex: 0 0 auto; white-space: nowrap; }
.bg-foot .bg-btn.ghost { max-width: 46vw; overflow: hidden; text-overflow: ellipsis; }
