/* Sterling Smart Reader v2.5.0 — desktop + mobile + Android-safe */
.smart-reader{position:sticky;top:86px;z-index:45;margin:16px 0 18px;padding:15px;border:1px solid #cfdced;border-radius:20px;background:rgba(255,255,255,.98);backdrop-filter:blur(14px);box-shadow:0 16px 38px rgba(14,51,105,.14)}
.smart-reader-head{display:flex;align-items:center;justify-content:space-between;gap:12px;margin-bottom:11px}.smart-reader-brand{display:flex;align-items:center;gap:9px;min-width:0}.smart-reader-icon{display:grid;place-items:center;flex:0 0 38px;width:38px;height:38px;border-radius:12px;background:linear-gradient(135deg,#0d3978,#1f6fd4);color:#fff;font-size:18px}.smart-reader-title{min-width:0}.smart-reader-title strong{display:block;color:#0b2f68;font-size:13px;letter-spacing:.25px}.smart-reader-title small{display:block;margin-top:2px;color:#687792;font-size:10px}.smart-reader-state{flex:0 0 auto;padding:6px 9px;border-radius:999px;background:#eef4ff;color:#1d5db7;font-size:9px;font-weight:900;letter-spacing:.5px;text-transform:uppercase}
.smart-reader-controls{display:grid;grid-template-columns:repeat(5,minmax(0,1fr));gap:7px}.smart-reader-controls button{display:flex;align-items:center;justify-content:center;gap:6px;min-height:44px;border:1px solid #d2deed;border-radius:12px;background:#f8faff;color:#163664;font-weight:850;cursor:pointer;transition:transform .15s ease,box-shadow .15s ease,background .15s ease}.smart-reader-controls button:hover{transform:translateY(-1px);box-shadow:0 8px 18px rgba(18,62,124,.08)}.smart-reader-controls button.reader-primary{background:linear-gradient(135deg,#0d3978,#1e69ca);color:#fff;border-color:transparent}.smart-reader-controls button.reader-danger{color:#9b2f2f;background:#fff8f8}.smart-reader-controls .reader-icon{font-size:16px}.smart-reader-controls .reader-label{font-size:11px}
.smart-reader-tools{display:flex;align-items:center;gap:10px;margin-top:10px}.smart-reader-speed{display:flex;align-items:center;gap:8px;margin-left:auto}.smart-reader-speed label{font-size:10px;font-weight:850;color:#6b7890}.smart-reader-speed select{height:36px;border:1px solid #d2deed;border-radius:10px;background:#fff;color:#18375f;padding:0 30px 0 10px;font-weight:800}.smart-reader-progress{height:6px;margin-top:11px;border-radius:999px;background:#e9eff8;overflow:hidden}.smart-reader-progress>span{display:block;width:0;height:100%;border-radius:999px;background:linear-gradient(90deg,#155ab6,#e9aa26);transition:width .2s ease}.smart-reader-focus{margin-top:11px;padding:13px 14px;border-radius:14px;background:linear-gradient(135deg,#f7faff,#fff9e7);border-left:4px solid #e9aa26;color:#243d64;font-size:15px;line-height:1.6;min-height:50px}.smart-reader-foot{display:flex;align-items:center;justify-content:space-between;gap:10px;margin-top:6px;color:#78869b;font-size:10px}.smart-reader-unsupported{margin-top:10px;padding:10px;border-radius:10px;background:#fff6e0;color:#735500;font-size:11px}
.lesson-content .reader-active-block{background:linear-gradient(90deg,#fff0a8,#fff8d5)!important;box-shadow:0 0 0 4px rgba(246,198,67,.20)!important;border-radius:8px!important;transition:background .18s ease,box-shadow .18s ease;scroll-margin-top:210px}.lesson-content{scroll-behavior:smooth}
@media(max-width:760px){.smart-reader{top:72px;margin:10px 0 14px;padding:11px;border-radius:16px;box-shadow:0 12px 28px rgba(14,51,105,.13)}.smart-reader-head{margin-bottom:9px}.smart-reader-icon{width:34px;height:34px;flex-basis:34px}.smart-reader-title strong{font-size:12px}.smart-reader-title small{font-size:9px}.smart-reader-state{font-size:8px;padding:5px 7px}.smart-reader-controls{gap:5px}.smart-reader-controls button{min-height:46px;padding:5px 2px;flex-direction:column;gap:1px;border-radius:10px}.smart-reader-controls .reader-icon{font-size:16px}.smart-reader-controls .reader-label{font-size:8px}.smart-reader-tools{margin-top:8px}.smart-reader-speed{width:100%;justify-content:flex-end}.smart-reader-focus{font-size:14px;line-height:1.5;padding:11px 12px;max-height:88px;overflow:auto}.lesson-content .reader-active-block{scroll-margin-top:230px}}
@media(max-width:390px){.smart-reader-title small{display:none}.smart-reader-controls .reader-label{font-size:7.5px}.smart-reader-state{max-width:74px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}}

.reader-spoken-word{background:#ffd85a;color:#10284d;border-radius:5px;padding:1px 3px;box-shadow:0 0 0 2px rgba(233,170,38,.15)}

@media(max-width:760px){
  .smart-reader{top:66px;padding:10px;border-radius:15px}
  .smart-reader-controls{grid-template-columns:repeat(5,minmax(0,1fr))}
  .smart-reader-controls button{min-height:50px;touch-action:manipulation}
  .smart-reader-controls button.reader-primary{transform:scale(1.02)}
  .smart-reader-progress{height:7px}
  .smart-reader-focus{min-height:58px;max-height:105px;font-size:14px}
  .smart-reader-foot{font-size:9px}
}


/* Public/Special Lesson only: compact on phone browsers.
   Normal Student Portal / Android Day lessons keep their existing reader layout. */
@media (max-width:760px){
  .public-lesson-page .smart-reader{position:relative!important;top:auto!important;z-index:1!important;margin:8px 0 10px!important;padding:8px!important;border-radius:13px!important;box-shadow:0 5px 14px rgba(14,51,105,.08)!important;backdrop-filter:none!important}
  .public-lesson-page .smart-reader-head{margin-bottom:6px!important;gap:7px!important}
  .public-lesson-page .smart-reader-icon{width:28px!important;height:28px!important;flex-basis:28px!important;border-radius:9px!important;font-size:14px!important}
  .public-lesson-page .smart-reader-title strong{font-size:11px!important;line-height:1.2!important}
  .public-lesson-page .smart-reader-title small{display:none!important}
  .public-lesson-page .smart-reader-state{padding:4px 6px!important;font-size:7px!important}
  .public-lesson-page .smart-reader-controls{gap:4px!important}
  .public-lesson-page .smart-reader-controls button{min-height:38px!important;padding:3px 1px!important;border-radius:9px!important}
  .public-lesson-page .smart-reader-controls .reader-icon{font-size:14px!important}
  .public-lesson-page .smart-reader-controls .reader-label{font-size:7px!important}
  .public-lesson-page .smart-reader-tools{margin-top:5px!important}
  .public-lesson-page .smart-reader-speed{width:auto!important}
  .public-lesson-page .smart-reader-speed label{display:none!important}
  .public-lesson-page .smart-reader-speed select{height:30px!important;padding:0 25px 0 8px!important;font-size:11px!important}
  .public-lesson-page .smart-reader-progress{height:4px!important;margin-top:6px!important}
  .public-lesson-page .smart-reader-focus{margin-top:6px!important;min-height:0!important;max-height:52px!important;padding:7px 9px!important;font-size:12px!important;line-height:1.35!important}
  .public-lesson-page .smart-reader-foot{margin-top:3px!important;font-size:8px!important}
  .public-lesson-page .lesson-content .reader-active-block{scroll-margin-top:90px!important}
  .public-lesson-page .reader-unsupported-mode{padding:7px 9px!important}
  .public-lesson-page .reader-unsupported-mode .smart-reader-controls,
  .public-lesson-page .reader-unsupported-mode .smart-reader-tools,
  .public-lesson-page .reader-unsupported-mode .smart-reader-progress,
  .public-lesson-page .reader-unsupported-mode .smart-reader-focus,
  .public-lesson-page .reader-unsupported-mode .smart-reader-foot{display:none!important}
  .public-lesson-page .reader-unsupported-mode .smart-reader-head{margin:0!important}
  .public-lesson-page .reader-unsupported-mode .smart-reader-unsupported{margin:5px 0 0!important;padding:6px 8px!important;border-radius:8px!important;font-size:10px!important;line-height:1.35!important}
}

/* Sterling AI Teacher v2.7.0 */
.sterling-ai-teacher-card{display:grid;grid-template-columns:minmax(220px,42%) 1fr;gap:18px;align-items:center;margin:18px 0;padding:14px;background:linear-gradient(135deg,#071b55,#123a87);border-radius:22px;box-shadow:0 14px 34px rgba(7,27,85,.16);overflow:hidden;color:#fff}.sterling-ai-teacher-media{border-radius:16px;overflow:hidden;background:#eef4ff;aspect-ratio:16/10}.sterling-ai-teacher-media img{width:100%;height:100%;display:block;object-fit:cover;object-position:25% center}.sterling-ai-teacher-copy{min-width:0}.sterling-ai-teacher-copy strong{display:block;font-size:clamp(18px,2.2vw,28px);line-height:1.15;margin:7px 0 4px}.sterling-ai-teacher-copy small{display:block;color:#dbe9ff;font-weight:750}.sterling-ai-teacher-copy p{margin:12px 0 0;padding:10px 12px;border-radius:12px;background:rgba(255,255,255,.1);color:#fff;line-height:1.5}.sterling-ai-live{display:inline-block;padding:5px 9px;border-radius:999px;background:#fff;color:#123a87;font-size:10px;font-weight:900;letter-spacing:.7px}@media(max-width:700px){.sterling-ai-teacher-card{grid-template-columns:112px 1fr;gap:11px;padding:10px;border-radius:17px;margin:12px 0}.sterling-ai-teacher-media{aspect-ratio:4/5}.sterling-ai-teacher-media img{object-position:25% center}.sterling-ai-teacher-copy strong{font-size:16px}.sterling-ai-teacher-copy small{font-size:11px}.sterling-ai-teacher-copy p{font-size:11px;padding:7px 8px;margin-top:7px}}

/* Sterling Compact Smart Reader v2.8.0
   Keeps all reader functions while giving lesson content maximum screen space. */
.reader-page .smart-reader{
  display:grid;
  grid-template-columns:minmax(220px,1.15fr) minmax(430px,2.5fr) auto;
  align-items:center;
  gap:8px 12px;
  padding:9px 11px;
  margin:10px 0 12px;
  border-radius:15px;
  top:76px;
  box-shadow:0 8px 22px rgba(14,51,105,.10);
}
.reader-page .smart-reader-head{margin:0;gap:7px;min-width:0}
.reader-page .smart-reader-icon{width:31px;height:31px;flex-basis:31px;border-radius:9px;font-size:14px}
.reader-page .smart-reader-title strong{font-size:11px;line-height:1.2;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.reader-page .smart-reader-title small{display:none}
.reader-page .smart-reader-state{padding:4px 6px;font-size:7px}
.reader-page .smart-reader-controls{gap:5px}
.reader-page .smart-reader-controls button{min-height:36px;padding:3px 5px;border-radius:9px;gap:4px}
.reader-page .smart-reader-controls .reader-icon{font-size:13px}
.reader-page .smart-reader-controls .reader-label{font-size:9px}
.reader-page .smart-reader-tools{margin:0;min-width:76px}
.reader-page .smart-reader-speed{margin:0;gap:4px}
.reader-page .smart-reader-speed label{display:none}
.reader-page .smart-reader-speed select{height:34px;min-width:72px;padding:0 23px 0 8px;border-radius:9px;font-size:11px}
/* The lesson itself already receives the live yellow reading highlight, so the
   duplicate sentence preview/progress/footer are unnecessary in compact mode. */
.reader-page .smart-reader-progress,
.reader-page .smart-reader-focus,
.reader-page .smart-reader-foot{display:none!important}
.reader-page .lesson-content .reader-active-block{scroll-margin-top:150px}

@media(max-width:900px){
  .reader-page .smart-reader{grid-template-columns:1fr auto;gap:6px 8px}
  .reader-page .smart-reader-head{grid-column:1/2}
  .reader-page .smart-reader-tools{grid-column:2/3;grid-row:1}
  .reader-page .smart-reader-controls{grid-column:1/-1}
}
@media(max-width:760px){
  .reader-page .smart-reader{
    top:64px;
    padding:7px 8px;
    margin:7px 0 9px;
    border-radius:13px;
    gap:5px 6px;
    box-shadow:0 6px 16px rgba(14,51,105,.10);
  }
  .reader-page .smart-reader-head{min-height:27px}
  .reader-page .smart-reader-icon{width:27px;height:27px;flex-basis:27px;font-size:12px}
  .reader-page .smart-reader-title strong{font-size:10px}
  .reader-page .smart-reader-state{font-size:6.5px;padding:3px 5px}
  .reader-page .smart-reader-speed select{height:29px;min-width:62px;font-size:10px}
  .reader-page .smart-reader-controls{gap:3px}
  .reader-page .smart-reader-controls button{min-height:36px!important;padding:2px 1px!important;flex-direction:row!important;gap:2px;border-radius:8px}
  .reader-page .smart-reader-controls .reader-icon{font-size:12px}
  .reader-page .smart-reader-controls .reader-label{font-size:7px}
  .reader-page .lesson-content .reader-active-block{scroll-margin-top:135px}
}
@media(max-width:390px){
  .reader-page .smart-reader-title strong{max-width:170px}
  .reader-page .smart-reader-controls .reader-label{display:none}
  .reader-page .smart-reader-controls button{min-height:34px!important}
  .reader-page .smart-reader-controls .reader-icon{font-size:15px}
}
