/* ---------- mock exams ---------- */
.raid.examcard { background: linear-gradient(120deg, #0b3d63, #1565c0 60%, #4cc9f0); }
.pill { color: var(--text); }
.exam-top { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 14px; padding: 12px 16px; margin: -18px -24px 16px; background: rgba(13,16,48,.95); border-bottom: 2px solid var(--line); backdrop-filter: blur(6px); }
.timer { font: 700 20px var(--font); background: var(--bg); padding: 6px 12px; border-radius: 10px; min-width: 110px; text-align: center; }
.timer.low { color: var(--bad); }
.exam { display: grid; grid-template-columns: 190px 1fr; gap: 18px; align-items: start; }
.enav { position: sticky; top: 84px; background: var(--panel); border: 2px solid var(--line); border-radius: 16px; padding: 12px; max-height: calc(100vh - 110px); overflow: auto; }
.enav-s { font-size: 12px; color: var(--muted); margin: 8px 0 4px; text-transform: uppercase; letter-spacing: .5px; }
.enav-g { display: grid; grid-template-columns: repeat(5, 1fr); gap: 5px; }
.enav-g button { background: var(--bg); border-radius: 8px; padding: 6px 0; font-size: 13px; font-weight: 600; border: 2px solid transparent; }
.enav-g button.done { background: #1c6b46; }
.enav-g button.flag { border-color: var(--bad); }
.enav-g button.cur { border-color: var(--gold); }
.emain.withp { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; align-items: start; }
.passage { position: sticky; top: 84px; max-height: calc(100vh - 110px); overflow: auto; background: #fffdf5; color: #221c55; border-radius: 20px; padding: 18px 22px; font-family: 'Nunito', var(--font); font-size: 18px; line-height: 1.7; box-shadow: 0 8px 0 rgba(0,0,0,.3); }
.passage h3 { color: #5a3fd1; margin-bottom: 8px; }
.equestion { background: #fffdf5; color: #221c55; border-radius: 20px; padding: 20px 24px; box-shadow: 0 8px 0 rgba(0,0,0,.3); font-family: 'Nunito', var(--font); }
.sec-ins { background: #efeaff; border-radius: 12px; padding: 10px 14px; margin-bottom: 14px; font-size: 16px; }
.eq { margin-bottom: 18px; }
.eq-head { display: flex; justify-content: space-between; font-size: 18px; color: #5a3fd1; margin-bottom: 6px; font-family: var(--font); }
.eq-prompt { font-size: 20px; line-height: 1.55; font-weight: 600; }
.eq-prompt table, .passage table, .model table, .visual table { border-collapse: collapse; margin: 8px 0; }
.eq-prompt td, .eq-prompt th, .passage td, .passage th, .model td, .model th { border: 1px solid #b9acf0; padding: 4px 10px; color: inherit; background: none; position: static; }
.fig { margin: 10px 0; color: #221c55; }
.fig svg { max-width: 100%; height: auto; }
.opts { display: grid; gap: 10px; margin-top: 12px; }
.opt { display: flex; gap: 12px; align-items: center; text-align: left; padding: 12px 16px; border-radius: 14px; font: 700 19px 'Nunito', var(--font); background: #efeaff; color: #2a2266; border: 3px solid #d6ccff; }
.opt.on { background: #d9ccff; border-color: #5a3fd1; }
.opt .k { display: grid; place-items: center; width: 30px; height: 30px; border-radius: 8px; background: #5a3fd1; color: #fff; font-size: 15px; flex: none; }
.ans-short { display: flex; align-items: center; gap: 8px; margin-top: 12px; }
.ans-short input { font: 700 24px 'Nunito', var(--font); padding: 10px 14px; border-radius: 12px; border: 3px solid #d6ccff; width: 240px; color: #221c55; }
.ans-short .u { font: 700 22px var(--font); color: #5a3fd1; }
.equestion textarea { width: 100%; margin-top: 10px; font: 600 18px/1.5 'Nunito', var(--font); padding: 12px 14px; border-radius: 12px; border: 3px solid #d6ccff; color: #221c55; resize: vertical; }
.equestion input:focus, .equestion textarea:focus, .equestion select:focus, .passage input:focus, .passage select:focus { outline: none; border-color: #5a3fd1; }
.cloze { font-size: 19px; line-height: 2.3; margin-top: 8px; }
.blank-wrap { white-space: nowrap; }
.bn { display: inline-grid; place-items: center; min-width: 22px; height: 22px; border-radius: 6px; background: #5a3fd1; color: #fff; font-size: 12px; margin-right: 3px; vertical-align: middle; }
.blank-wrap input, .blank-wrap select { font: 700 17px 'Nunito', var(--font); padding: 3px 8px; border-radius: 8px; border: 2px solid #b9acf0; color: #221c55; background: #fff; width: 130px; }
.visual { border: 3px dashed #5a3fd1; border-radius: 16px; padding: 14px 18px; background: #fff7e0; }
.visual h1, .visual h2, .visual h3 { color: #c9184a; }
.spin { animation: bob 1s infinite ease-in-out; }
.bigscore { font: 700 84px var(--font); line-height: 1; margin: 8px 0; }
.bigscore small { font-size: 34px; color: var(--muted); }
.secbars { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 12px; max-width: 900px; margin: 16px auto 0; text-align: left; }
.secbar { background: var(--panel); border-radius: 12px; padding: 10px 14px; font-size: 15px; }
.review { max-width: 900px; margin: 0 auto; text-align: left; }
.rsec { margin: 22px 0 10px; }
.rq, .rgroup { background: #fffdf5; color: #221c55; border-radius: 16px; padding: 16px 20px; margin-bottom: 12px; border-left: 8px solid #b9acf0; font-family: 'Nunito', var(--font); }
.rgroup .rq { border: 2px solid #eee8ff; border-left-width: 8px; margin: 10px 0 0; }
.rq.ok { border-left-color: var(--good); } .rq.part { border-left-color: var(--gold); } .rq.no { border-left-color: var(--bad); } .rq.pend { border-left-color: var(--xp); }
.rq-head { display: flex; justify-content: space-between; align-items: center; color: #5a3fd1; font-family: var(--font); margin-bottom: 4px; gap: 10px; flex-wrap: wrap; }
.score { font-weight: 700; padding: 3px 10px; border-radius: 8px; }
.score.ok { background: #c9ffdf; color: #00592a; } .score.part { background: #fff1c2; color: #6b4f00; } .score.no { background: #ffd6de; color: #8a0021; }
.ans-line { display: flex; gap: 24px; flex-wrap: wrap; margin-top: 8px; font-size: 17px; }
.okc { color: #00813c; }
.mine { background: #f3f0ff; border-radius: 10px; padding: 10px 12px; margin-top: 8px; font-size: 16px; }
.aifb { background: #e6f7ff; border-radius: 10px; padding: 10px 12px; margin-top: 8px; font-size: 16px; }
.rq details, .rpass { margin-top: 8px; }
.rq summary, .rpass summary { cursor: pointer; font-weight: 700; color: #5a3fd1; }
.rpass { background: #fffdf5; color: #221c55; border-radius: 14px; padding: 12px 18px; margin-bottom: 10px; font-family: 'Nunito', var(--font); }
.model { background: #f6fff9; border-radius: 10px; padding: 10px 12px; margin-top: 6px; font-size: 16px; line-height: 1.55; }
.btab td.ok { color: #00813c; font-weight: 700; } .btab td.no { color: #c9184a; font-weight: 700; text-decoration: line-through; }
.btab th, .btab td { color: #221c55; background: none; border-bottom: 1px solid #e3dcff; position: static; }
.selfmark { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; font-size: 15px; }
.calc { position: fixed; right: 24px; bottom: 24px; z-index: 80; width: 280px; background: #1b2058; border: 3px solid var(--line); border-radius: 18px; box-shadow: 0 16px 40px rgba(0,0,0,.5); user-select: none; }
.calc-bar { display: flex; justify-content: space-between; align-items: center; padding: 8px 12px; cursor: move; font-weight: 600; touch-action: none; }
.calc-bar button { background: none; font-size: 20px; min-width: 44px; min-height: 44px; margin: -8px -8px -8px 0; border-radius: 12px; cursor: pointer; }
.calc-bar button:hover { background: rgba(255,255,255,.1); }
.calc-scr { margin: 0 12px; background: #d8f3dc; color: #102a12; border-radius: 10px; padding: 8px 12px; text-align: right; font-family: 'Courier New', monospace; }
.calc-exp { min-height: 18px; font-size: 14px; opacity: .7; overflow: hidden; white-space: nowrap; }
.calc-out { font-size: 26px; font-weight: 700; overflow: hidden; }
.calc-keys { display: grid; grid-template-columns: repeat(4, 1fr); gap: 7px; padding: 12px; }
.calc-keys button { padding: 11px 0; border-radius: 10px; background: var(--panel2); font: 700 18px var(--font); box-shadow: 0 3px 0 rgba(0,0,0,.35); }
.calc-keys button.op { background: #3a2a8a; }
.calc-keys button.eq { grid-column: span 2; background: var(--accent); color: #2a1600; }
@media (max-width: 1000px) {
  .exam { grid-template-columns: 1fr; } .enav { position: static; max-height: none; }
  .emain.withp { grid-template-columns: 1fr; } .passage { position: static; max-height: none; }
}

.pbody p[data-n] { position: relative; padding-left: 30px; }
.pbody p[data-n]::before { content: attr(data-n); position: absolute; left: 0; top: 2px; font: 700 13px var(--font); color: #fff; background: #9a8de0; border-radius: 6px; min-width: 20px; text-align: center; }

/* passages inside quick-battle questions */
.qtext .passage { position: static; max-height: none; overflow: visible; box-shadow: none; background: #f3f0ff; font-size: 18px; font-weight: 600; line-height: 1.6; padding: 12px 16px; margin: 6px 0 12px; border-radius: 14px; }
.qtext .visual { font-size: 17px; font-weight: 600; margin: 6px 0 12px; }

/* working pad */
.pad { margin-top: 16px; border: 3px solid #d6ccff; border-radius: 16px; overflow: hidden; background: #fff; }
.pad.ro { border-width: 2px; }
.pad-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; padding: 8px 10px; background: #efeaff; color: #2a2266; font-family: var(--font); }
.pad-title { font-weight: 700; margin-right: 6px; }
.pad-bar .sep { flex: 1; }
.pad-bar button { background: #fff; color: #2a2266; border: 2px solid #d6ccff; border-radius: 10px; padding: 5px 10px; font: 600 14px var(--font); }
.pad-bar button.on { border-color: #5a3fd1; background: #ddd3ff; }
.pad-bar button i { display: inline-block; width: 16px; height: 16px; border-radius: 50%; vertical-align: middle; }
.pad canvas { display: block; touch-action: none; cursor: crosshair; background-color: #fff; }
.pad { -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; touch-action: manipulation; }
.pad canvas { -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; -webkit-tap-highlight-color: transparent; }
.pad-hint { flex-basis: 100%; font-size: 13px; color: #5a3fd1; display: flex; align-items: center; gap: 8px; }
.pad-hint[hidden] { display: none; }
.pad-hint button { padding: 3px 8px; font-size: 13px; }
@media (pointer: coarse) { .pad-bar button { padding: 8px 12px; font-size: 15px; } }
.pad canvas.grid { background-image: linear-gradient(#e7e3fb 1px, transparent 1px), linear-gradient(90deg, #e7e3fb 1px, transparent 1px); }
.bpad, .rwork { margin-top: 14px; }
.bpad summary, .rwork summary { cursor: pointer; font: 700 16px var(--font); color: #5a3fd1; }
.rwork { background: #fffdf5; border-radius: 14px; padding: 10px 16px; margin: -4px 0 14px; color: #221c55; }

/* parent report */
.report { max-width: 860px; margin: 0 auto; }
.rp-sheet { background: #fff; color: #221c55; border-radius: 20px; padding: 28px 34px; font-family: 'Nunito', var(--font); font-size: 17px; line-height: 1.6; box-shadow: 0 10px 0 rgba(0,0,0,.3); }
.rp-head { display: flex; justify-content: space-between; align-items: flex-start; border-bottom: 3px solid #efeaff; padding-bottom: 12px; margin-bottom: 14px; }
.rp-head h1 { font-family: var(--font); font-size: 30px; color: #2a2266; }
.rp-kicker { font: 700 13px var(--font); letter-spacing: 1px; text-transform: uppercase; color: #5a3fd1; }
.rp-sheet h2 { font-family: var(--font); font-size: 21px; color: #5a3fd1; margin: 22px 0 8px; }
.rp-headline { font-size: 21px; font-weight: 800; color: #2a2266; }
.rp-weak { border: 2px solid #efeaff; border-left: 6px solid #ff9f1c; border-radius: 12px; padding: 12px 16px; margin-bottom: 10px; }
.rp-ev { color: #5b5687; font-size: 15px; margin: 4px 0; }
.rp-fix { background: #f0fff6; border-radius: 8px; padding: 6px 10px; margin-top: 6px; }
.rp-chip { display: inline-block; font: 700 12px var(--font); padding: 2px 8px; border-radius: 8px; background: #efeaff; color: #221c55; }
.rp-note { background: #fff7e0; border-radius: 12px; padding: 12px 16px; margin-top: 20px; }
@media print {
  body { background: #fff !important; }
  #stars, .topbar, .noprint, #toast { display: none !important; }
  #app { padding: 0; max-width: none; }
  .rp-sheet { box-shadow: none; padding: 0; }
  .rp-weak { break-inside: avoid; }
}

.pics { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin: 14px 0 6px; }
.pics figure { margin: 0; background: #fff; border: 3px solid #d6ccff; border-radius: 14px; overflow: hidden; }
.pics img { display: block; width: 100%; height: auto; cursor: zoom-in; }
.pics figcaption { text-align: center; font: 700 15px var(--font); color: #5a3fd1; padding: 6px; }
.pics img.zoom { position: fixed; inset: 5vh 5vw; width: 90vw; height: 90vh; object-fit: contain; background: rgba(13,16,48,.92); z-index: 90; border-radius: 16px; cursor: zoom-out; aspect-ratio: auto; }
@media (max-width: 800px) { .pics { grid-template-columns: 1fr; } }

/* classrooms + teacher dashboard */
.join { max-width: 620px; margin: 0 auto; text-align: center; }
.join h2 { margin-bottom: 6px; }
.join .row { justify-content: center; margin-top: 14px; }
.codebox { font: 700 32px var(--font); letter-spacing: 4px; text-transform: uppercase; text-align: center; width: min(340px, 100%); padding: 10px 14px; border-radius: 14px; border: 3px solid var(--line); background: var(--bg); color: var(--text); }
.pinbox { font: 700 34px var(--font); letter-spacing: 14px; text-align: center; width: 200px; padding: 10px; border-radius: 14px; border: 3px solid var(--line); background: var(--bg); color: var(--text); }
.pinbox.small { font-size: 22px; letter-spacing: 8px; width: 150px; }
.classchip { background: var(--panel); border: 2px solid var(--line); border-radius: 12px; padding: 6px 14px; font-weight: 600; }
.tdash .ttop { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 18px; flex-wrap: wrap; }
.tdash h2 { font-size: 28px; }
.tcode { font: 700 24px var(--font); letter-spacing: 4px; color: var(--gold); margin: 6px 0; }
.tcode.big { font-size: 34px; margin: 0; }
.ttable { width: 100%; background: var(--panel); border-radius: 14px; overflow: hidden; }
.ttable th { background: var(--panel2); }
.trow { cursor: pointer; }
.trow:hover td { background: rgba(255,255,255,.04); }
.tin { font: 600 16px var(--font); padding: 8px 12px; border-radius: 10px; border: 2px solid var(--line); background: var(--bg); color: var(--text); min-width: 240px; }
.pill.wait { background: #0b3d63; color: #b3e5fc; }

.cloudstat { font: 600 13px var(--font); padding: 5px 10px; border-radius: 10px; background: var(--bg); white-space: nowrap; }
.cloudstat.saving { color: var(--xp); }
.cloudstat.offline { color: var(--gold); }

.pics:has(figure:nth-child(4)) { grid-template-columns: 1fr 1fr; max-width: 760px; }

/* phones and tablets (20 Oct 2026): the sticky paper header matches the page gutter; question numbers become one scrolling strip */
@media (max-width: 900px) { .exam-top { margin: -14px -16px 14px; } }
@media (max-width: 1000px) {
  .enav { padding: 8px 10px; }
  .enav-s { font-size: 13px; margin: 4px 0; }
  .enav-g { display: flex; overflow-x: auto; gap: 6px; padding-bottom: 4px; -webkit-overflow-scrolling: touch; scroll-snap-type: x proximity; }
  .enav-g button { flex: 0 0 44px; height: 44px; font-size: 15px; scroll-snap-align: start; }
  .codebox { font-size: 26px; letter-spacing: 3px; }
}
@media (max-width: 640px) { .exam-top { margin: -10px -10px 12px; padding: 10px; gap: 8px; flex-wrap: wrap; } }
