/* Easy Padhai Maths Intelligence v1.72.76 */
.ep-math-intelligence{margin:18px 0 4px;border:1px solid #cfe0fb;border-radius:18px;background:linear-gradient(145deg,#fff,#f5f8ff);box-shadow:0 10px 26px rgba(29,78,216,.08);overflow:hidden;color:#102a4c}
.ep-math-intelligence__head{display:flex;align-items:center;justify-content:space-between;gap:16px;padding:16px 18px;background:linear-gradient(90deg,#eef5ff,#f8f2ff)}
.ep-math-intelligence__head>div{display:flex;flex-direction:column;gap:3px;min-width:0}
.ep-math-intelligence__head span{font-size:11px;font-weight:800;letter-spacing:.08em;color:#395a93}
.ep-math-intelligence__head strong{font-size:16px;line-height:1.35;color:#112f5c}
.ep-math-intelligence button,.ep-math-intelligence__head button{appearance:none;border:1px solid #c7d8f5;border-radius:12px;background:#fff;color:#103567;font-weight:750;line-height:1.2;padding:10px 14px;cursor:pointer;transition:transform .16s ease,box-shadow .16s ease,border-color .16s ease;background-color .16s ease;white-space:normal}
.ep-math-intelligence button:hover,.ep-math-intelligence button:focus-visible{transform:translateY(-1px);border-color:#6d8eff;box-shadow:0 7px 16px rgba(55,92,190,.13);outline:none}
.ep-math-intelligence button.is-primary,.ep-math-intelligence__head button{border-color:transparent;background:linear-gradient(100deg,#3198ff,#744cff);color:#fff}
.ep-math-intelligence__body{padding:16px 18px 18px;border-top:1px solid #dbe7fa}
.ep-math-intelligence__body[hidden],.ep-math-intel-panel[hidden]{display:none!important}
.ep-math-intelligence__actions{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:10px;margin-bottom:14px}
.ep-math-intelligence__actions button{min-height:48px;text-align:center}
.ep-math-intel-panel{padding:16px;border:1px solid #d7e3f7;border-radius:15px;background:#fff;margin-top:12px}
.ep-math-intel-panel__title{display:flex;flex-direction:column;gap:4px;margin-bottom:12px}
.ep-math-intel-panel__title strong{font-size:16px;color:#103464}
.ep-math-intel-panel__title span{font-size:13px;color:#5d6f89;line-height:1.45}
.ep-math-intel-panel textarea{display:block;width:100%;min-height:124px;resize:vertical;border:1px solid #cddcf2;border-radius:12px;padding:12px 13px;background:#fbfdff;color:#132f53;font:inherit;box-sizing:border-box}
.ep-math-intel-panel textarea:focus{border-color:#6688ff;box-shadow:0 0 0 3px rgba(102,136,255,.12);outline:none}
.ep-math-intel-upload{display:flex;align-items:center;justify-content:space-between;gap:12px;margin:12px 0;padding:11px 13px;border:1px dashed #8eabe0;border-radius:12px;background:#f7faff;color:#264c7b;font-weight:700;cursor:pointer}
.ep-math-intel-upload input{max-width:48%}
.ep-math-intel-panel [data-ep-intel-work-preview]{display:block;max-width:100%;max-height:360px;object-fit:contain;margin:10px auto;border:1px solid #d5e1f3;border-radius:12px;background:#f3f6fb}
.ep-math-intel-panel [data-ep-intel-work-preview][hidden]{display:none!important}
.ep-math-intel-inline-actions{display:flex;flex-wrap:wrap;gap:10px;margin:12px 0}
.ep-math-intel-result{margin-top:10px}
.ep-intel-loading,.ep-intel-error,.ep-intel-empty{padding:13px 14px;border-radius:12px;font-weight:650;line-height:1.45}
.ep-intel-loading{background:#eef6ff;color:#20528b}
.ep-intel-error{background:#fff0f0;color:#a12828;border:1px solid #ffd0d0}
.ep-intel-empty{background:#f7f8fb;color:#65748a;border:1px dashed #c9d4e5}
.ep-mistake-report{border:1px solid #d6e3f5;border-left:5px solid #f2a400;border-radius:14px;background:#fbfdff;overflow:hidden}
.ep-mistake-report.is-correct{border-left-color:#22aa67}
.ep-mistake-report.is-wrong{border-left-color:#df4752}
.ep-mistake-report.is-partial{border-left-color:#f2a400}
.ep-mistake-report header{display:flex;flex-direction:column;gap:5px;padding:14px 15px;background:#f4f8ff;border-bottom:1px solid #dbe6f5}
.ep-mistake-report header span{font-size:11px;font-weight:850;letter-spacing:.06em;color:#526d95;text-transform:uppercase}
.ep-mistake-report header strong{font-size:15px;color:#173962}
.ep-mistake-report>div{padding:12px 15px;border-bottom:1px solid #edf1f8}
.ep-mistake-report>div:last-of-type{border-bottom:0}
.ep-mistake-report b{display:block;margin-bottom:4px;color:#14385f}
.ep-mistake-report p{margin:0;color:#425b77;line-height:1.55}
.ep-mistake-report pre{white-space:pre-wrap;overflow-wrap:anywhere;margin:6px 0 0;padding:11px;border-radius:10px;background:#f1f5fb;color:#17324f;font-family:ui-monospace,SFMono-Regular,Consolas,monospace}
.ep-mistake-report code{display:inline-block;padding:6px 9px;border-radius:8px;background:#edf3ff;color:#234e8a;overflow-wrap:anywhere}
.ep-mistake-report>button{margin:12px 15px}
.ep-concept-refresher{background:#fff9e8!important;border:1px solid #f6df9f!important;border-radius:10px;margin:10px 12px}
.ep-adaptive-card,.ep-formula-card,.ep-progress-report{padding:15px;border:1px solid #d5e2f5;border-radius:14px;background:linear-gradient(145deg,#fff,#f8fbff)}
.ep-adaptive-card>span,.ep-formula-card>span{display:inline-block;margin-bottom:5px;font-size:11px;font-weight:850;color:#577099;text-transform:uppercase;letter-spacing:.05em}
.ep-adaptive-card h4,.ep-formula-card h4,.ep-progress-report h4{margin:4px 0 9px;color:#143966;font-size:17px;line-height:1.42}
.ep-adaptive-card p,.ep-adaptive-card small{display:block;color:#536981;line-height:1.5}
.ep-adaptive-card button{margin-top:12px}
.ep-formula-card pre{white-space:pre-wrap;overflow-wrap:anywhere;background:#eef4fc;border-radius:10px;padding:10px}
.ep-formula-ratings{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:8px;margin-top:12px}
.ep-progress-stats{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:10px;margin-bottom:14px}
.ep-progress-stats>div{padding:13px 10px;text-align:center;border:1px solid #d9e5f6;border-radius:12px;background:#fff}
.ep-progress-stats b{display:block;font-size:22px;color:#164c8c;overflow-wrap:anywhere}
.ep-progress-stats span{display:block;margin-top:3px;font-size:11px;color:#6b7f98}
.ep-progress-report ul,.ep-progress-report ol{padding-left:21px;color:#3d5673;line-height:1.55}
.ep-progress-report>button{margin-top:8px}
.ep-math-visual-host{margin:13px 0;padding:14px;border:1px solid #d4e2f5;border-radius:14px;background:#fbfdff;overflow:hidden}
.ep-math-visual-host[hidden]{display:none!important}
.ep-math-visual-host>strong{display:block;margin-bottom:9px;color:#173c6b}
.ep-math-visual-host svg{display:block;width:100%;height:auto;max-height:420px;border:1px solid #e0e9f6;border-radius:10px;background:#fff}
.ep-math-visual-host svg .axis{stroke:#476384;stroke-width:2}
.ep-math-visual-host svg .grid{stroke:#dfe7f2;stroke-width:1}
.ep-math-visual-host svg .plot{stroke:#315fe9;stroke-width:4;fill:none}
.ep-math-visual-host svg .shape{fill:rgba(79,111,255,.12);stroke:#4168db;stroke-width:4}
.ep-math-visual-host svg .label{fill:#183a63;font-size:18px;font-weight:700}
.ep-math-visual-host svg .right-angle{fill:none;stroke:#ef7c28;stroke-width:4}
.ep-exam-pattern-map{margin:12px 0;padding:12px 14px;border-radius:12px;border:1px solid #f0d79d;background:#fff9e8;color:#5a4516}
.ep-exam-pattern-map strong{display:block;margin-bottom:4px;color:#684e0e}
/* Four selectors fit evenly after Board/Exam was added. */
.ep-math-teacher-workspace .ep-math-controls{grid-template-columns:repeat(4,minmax(0,1fr))!important}
/* Camera loading/ready treatment; keeps the live frame visible on the first click. */
.ep-math-camera-box{position:relative;min-height:280px;background:#101827;border-radius:16px;overflow:hidden}
.ep-math-camera-box video,.ep-math-camera-box img{display:block;width:100%;height:100%;min-height:280px;max-height:520px;object-fit:cover;background:#101827}
.ep-math-camera-box video[hidden],.ep-math-camera-box img[hidden]{display:none!important}
.ep-math-camera-box video.is-camera-loading{opacity:.35}
.ep-math-camera-box video.is-camera-loading:after{content:""}
.ep-math-camera-box video.is-camera-ready{opacity:1}
@media (max-width:900px){
  .ep-math-intelligence__actions{grid-template-columns:repeat(2,minmax(0,1fr))}
  .ep-math-teacher-workspace .ep-math-controls{grid-template-columns:repeat(2,minmax(0,1fr))!important}
}
@media (max-width:600px){
  .ep-math-intelligence{border-radius:14px}
  .ep-math-intelligence__head{align-items:stretch;flex-direction:column;padding:14px}
  .ep-math-intelligence__head button{width:100%}
  .ep-math-intelligence__body{padding:12px}
  .ep-math-intelligence__actions{grid-template-columns:repeat(2,minmax(0,1fr));gap:8px}
  .ep-math-intelligence__actions button{font-size:12px;padding:10px 7px;min-height:54px}
  .ep-math-intel-panel{padding:12px}
  .ep-math-intel-upload{align-items:flex-start;flex-direction:column}
  .ep-math-intel-upload input{max-width:100%;width:100%}
  .ep-math-intel-inline-actions{display:grid;grid-template-columns:1fr}
  .ep-formula-ratings{grid-template-columns:repeat(2,minmax(0,1fr))}
  .ep-progress-stats{grid-template-columns:1fr}
  .ep-math-teacher-workspace .ep-math-controls{grid-template-columns:1fr!important}
  .ep-math-camera-box,.ep-math-camera-box video,.ep-math-camera-box img{min-height:240px}
}
.ep-math-exam-map{margin:12px 0;padding:12px 14px;border:1px solid #f0d79d;border-radius:12px;background:#fff9e8;color:#5a4516;line-height:1.45}
.ep-math-exam-map strong{margin-right:5px;color:#684e0e}
.ep-math-exam-map span,.ep-math-exam-map small{display:block;margin-top:4px;color:#6b572a}
.ep-math-visual-host svg .point{fill:#744cff;stroke:#fff;stroke-width:2}
.ep-math-visual-host svg .measure{stroke:#ef7c28;stroke-width:3}

/* v1.72.76 handwriting red-pen checking and guaranteed board diagrams */
.ep-handwriting-check-preview{position:relative;display:block;width:100%;margin-top:12px;border-radius:14px;overflow:hidden;background:#eef3fa}
.ep-handwriting-check-preview>[data-ep-intel-work-preview]{display:block;width:100%;max-height:540px;object-fit:contain;margin:0!important;border-radius:14px}
.ep-handwriting-red-pen{position:absolute;inset:0;pointer-events:none;z-index:3}
.ep-handwriting-red-pen[hidden]{display:none!important}
.ep-handwriting-red-pen span{position:absolute;left:5%;right:5%;top:var(--ep-wrong-line-top,50%);height:10%;min-height:36px;transform:translateY(-50%);border:3px solid #e62938;border-radius:12px;background:rgba(230,41,56,.08);box-shadow:0 0 0 4px rgba(255,255,255,.7),0 8px 22px rgba(160,20,30,.18)}
.ep-handwriting-red-pen span:after{content:"";position:absolute;left:7%;right:7%;bottom:-8px;height:4px;background:#e62938;border-radius:999px;transform:rotate(-1deg)}
.ep-handwriting-red-pen strong{position:absolute;left:7%;top:calc(var(--ep-wrong-line-top,50%) + 6%);max-width:86%;padding:7px 10px;border-radius:9px;background:#d91f30;color:#fff;font-size:12px;line-height:1.35;box-shadow:0 5px 15px rgba(120,10,20,.22)}
.ep-handwriting-red-pen i{position:absolute;right:5%;top:calc(var(--ep-wrong-line-top,50%) - 8%);font-size:30px;color:#d91f30;filter:drop-shadow(0 2px 1px #fff);transform:rotate(-18deg)}
.ep-handwriting-red-pen.is-marked span{animation:epRedPenMark .5s ease both}
@keyframes epRedPenMark{from{opacity:0;transform:translateY(-50%) scaleX(.2);transform-origin:left}to{opacity:1;transform:translateY(-50%) scaleX(1)}}
.ep-math-board-auto-visual{position:relative;border:2px solid #d4e0ff!important;background:linear-gradient(145deg,#fff,#f5f8ff)!important}
.ep-auto-diagram-badge{display:inline-flex;align-items:center;margin:0 8px 8px 0;padding:4px 8px;border-radius:999px;background:#5b54ec;color:#fff;font-size:10px;font-weight:900;letter-spacing:.06em}
@media(max-width:600px){.ep-handwriting-red-pen strong{font-size:10px;left:4%;max-width:92%}.ep-handwriting-red-pen i{font-size:24px}.ep-handwriting-red-pen span{left:3%;right:3%}}
