:root{--navy:#122a54;--navy2:#1b3a74;--bg:#eef3f8;--card:#fff;--ink:#15233f;--muted:#6d7890;--line:#d9e1ec;--accent:#5964e5;--accent2:#eef0ff;--good:#1b8755;--goodbg:#eaf8f0;--warn:#9a6515;--warnbg:#fff6e6;--bad:#b33a42;--badbg:#fff0f1}*{box-sizing:border-box}body{margin:0;font-family:Inter,system-ui,-apple-system,Segoe UI,Roboto,Arial,sans-serif;background:var(--bg);color:var(--ink)}button,input,select{font:inherit}.hidden{display:none!important}.topbar{height:78px;background:linear-gradient(90deg,var(--navy),var(--navy2));color:#fff;display:flex;align-items:center;justify-content:space-between;padding:0 24px;gap:16px}.brand{font-weight:950;letter-spacing:.08em;font-size:25px}.subbrand{opacity:.82;font-size:13px;margin-top:3px}.userbox{display:flex;align-items:center;gap:10px}.badge{padding:8px 12px;border-radius:999px;background:rgba(255,255,255,.12);font-weight:800;font-size:13px}.ghost{border:1px solid rgba(255,255,255,.25);background:transparent;color:#fff;border-radius:12px;padding:10px 14px;cursor:pointer}.shell{display:grid;grid-template-columns:220px 1fr;min-height:calc(100vh - 78px)}.side{background:#fff;border-right:1px solid var(--line);padding:16px}.navbtn{width:100%;border:0;background:transparent;text-align:left;padding:13px 14px;border-radius:13px;color:#53617b;font-weight:800;cursor:pointer;margin-bottom:6px}.navbtn.active{background:var(--accent2);color:#4653d4}.main{padding:18px;min-width:0}.view{display:none}.view.active{display:block}.pagehead{display:flex;justify-content:space-between;align-items:flex-start;gap:16px;margin-bottom:14px}.pagehead h1{margin:0;font-size:28px}.pagehead p{margin:5px 0 0;color:var(--muted)}.grid2{display:grid;grid-template-columns:1fr 1fr;gap:14px}.grid3{display:grid;grid-template-columns:repeat(3,1fr);gap:14px}.card{background:var(--card);border:1px solid var(--line);border-radius:18px;padding:16px;box-shadow:0 4px 14px rgba(20,40,80,.04);min-width:0}.card h2,.card h3{margin:0 0 10px}.kicker{font-size:12px;letter-spacing:.08em;text-transform:uppercase;font-weight:900;color:#5964db;margin-bottom:8px}.drop{border:2px dashed #c5cfdf;border-radius:16px;padding:22px;text-align:center;background:#fbfcfe;position:relative}.drop input{position:absolute;inset:0;opacity:0;cursor:pointer}.drop strong{display:block;margin-bottom:4px}.message{margin-top:10px;padding:11px 13px;border-radius:12px;background:#f5f7fb;color:#60708b}.message.good{background:var(--goodbg);color:var(--good)}.message.bad{background:var(--badbg);color:var(--bad)}.message.warn{background:var(--warnbg);color:var(--warn)}.btn{border:0;border-radius:12px;padding:11px 15px;font-weight:900;cursor:pointer}.btn.primary{background:var(--accent);color:#fff}.btn.secondary{background:#eef2f7;color:#263a5d;border:1px solid #d6deea}.btn.danger{background:#fff0f1;color:#a72f38;border:1px solid #f2c9cc}.btn:disabled{opacity:.45;cursor:not-allowed}.actions{display:flex;gap:9px;flex-wrap:wrap;margin-top:12px}.tablewrap{overflow:auto;max-height:290px;border:1px solid var(--line);border-radius:14px}.table{width:100%;border-collapse:collapse;font-size:13px}.table th,.table td{padding:10px 12px;border-bottom:1px solid #e8edf4;text-align:left;white-space:nowrap}.table th{position:sticky;top:0;background:#f7f9fc;color:#61708a;font-size:11px;text-transform:uppercase;letter-spacing:.05em}.kpis{display:grid;grid-template-columns:repeat(4,1fr);gap:10px}.kpi{background:#f8faff;border:1px solid var(--line);border-radius:14px;padding:12px}.kpi span{display:block;color:var(--muted);font-size:12px}.kpi strong{font-size:23px}.list{display:grid;gap:9px}.listitem{border:1px solid var(--line);border-radius:14px;padding:12px;display:flex;justify-content:space-between;align-items:center;gap:12px;background:#fff}.listitem small{color:var(--muted)}.tag{font-size:11px;padding:6px 8px;border-radius:999px;background:#eef2f7;font-weight:900}.tag.good{background:var(--goodbg);color:var(--good)}.authwrap{min-height:100vh;background:linear-gradient(135deg,#0f2750,#244783);display:grid;place-items:center;padding:20px}.authcard{width:min(920px,100%);background:#fff;border-radius:26px;overflow:hidden;display:grid;grid-template-columns:1fr 1.1fr;box-shadow:0 30px 90px rgba(0,0,0,.28)}.authhero{background:linear-gradient(150deg,#182d5a,#5662e2);color:#fff;padding:34px;display:flex;flex-direction:column;justify-content:space-between}.authhero h1{font-size:44px;margin:0}.authhero p{opacity:.85;line-height:1.5}.authpanel{padding:30px}.tabs{display:flex;gap:8px;margin-bottom:18px}.tab{border:0;border-radius:999px;padding:9px 13px;background:#edf1f7;color:#53617b;font-weight:900;cursor:pointer}.tab.active{background:#e9e9ff;color:#4a55d2}.form{display:grid;gap:11px}.field label{display:block;font-size:12px;font-weight:900;color:#5e6d87;margin-bottom:5px}.field input,.field select{width:100%;border:1px solid #cfd8e6;border-radius:12px;padding:11px 12px;outline:none}.field input:focus,.field select:focus{border-color:#6571e6;box-shadow:0 0 0 3px rgba(89,100,229,.12)}.authnote{font-size:12px;color:var(--muted);line-height:1.45}.sequence{display:flex;gap:6px;flex-wrap:wrap}.seq{padding:6px 8px;border-radius:999px;background:#eef2f7;font-size:11px;font-weight:900}.seq.guided{background:#eeeaff;color:#5652ca}.row{display:flex;gap:10px;align-items:center}.grow{flex:1}.statusline{display:flex;align-items:center;gap:8px}.dot{width:9px;height:9px;border-radius:50%;background:#c2cad7}.dot.good{background:#35a66b}.overlay{position:fixed;inset:0;background:rgba(7,19,44,.6);display:grid;place-items:center;padding:20px;z-index:20}.modal{width:min(620px,100%);background:#fff;border-radius:20px;padding:22px}.modal h2{margin-top:0}@media(max-width:900px){.shell{grid-template-columns:1fr}.side{display:flex;gap:7px;overflow:auto;border-right:0;border-bottom:1px solid var(--line)}.navbtn{width:auto;white-space:nowrap;margin:0}.grid2,.grid3{grid-template-columns:1fr}.authcard{grid-template-columns:1fr}.authhero{display:none}.kpis{grid-template-columns:1fr 1fr}}@media(max-width:600px){.topbar{height:auto;padding:14px}.shell{min-height:calc(100vh - 70px)}.main{padding:12px}.pagehead{flex-direction:column}.kpis{grid-template-columns:1fr 1fr}.authpanel{padding:22px}.tablewrap{max-height:360px}}

.assignment-row{gap:14px}.assignment-actions{display:flex;align-items:center;gap:8px;flex-wrap:wrap;justify-content:flex-end}.btn.small{padding:8px 11px;font-size:12px;text-decoration:none}.teach-link{background:#eef0ff;color:#4855df;border:1px solid #d8dcff}

/* Cloud v9 lesson workflow */
.lesson-actions{display:flex;align-items:center;gap:7px;flex-wrap:wrap;justify-content:flex-end}.lesson-actions .btn{white-space:nowrap}.tag.draft{background:#fff6e6;color:#9a6515}.tag.archived{background:#eef2f7;color:#68778f}.lesson-editor{scroll-margin-top:90px}.lesson-editor-head{display:flex;align-items:flex-start;justify-content:space-between;gap:16px}.lesson-editor-head h2{margin-bottom:4px}.editor-sub,.editor-help{color:var(--muted);line-height:1.45;margin:4px 0 12px}.lesson-editor-grid{display:grid;grid-template-columns:minmax(230px,.38fr) minmax(0,1fr);gap:18px;margin-top:8px}.editor-item-list{max-height:520px;overflow:auto}.editor-item-btn{width:100%;text-align:left;border:1px solid var(--line);border-radius:12px;background:#fff;padding:10px 11px;color:var(--ink);cursor:pointer;display:flex;justify-content:space-between;gap:10px;align-items:center}.editor-item-btn.active{border-color:#727be8;background:#f1f2ff}.editor-item-btn .mini-kind{font-size:10px;font-weight:900;color:var(--muted);text-transform:uppercase}.crop-toolbar{display:flex;justify-content:space-between;gap:12px;align-items:flex-start}.crop-stage{position:relative;overflow:hidden;border:1px solid var(--line);border-radius:14px;background:#f7f9fc;min-height:130px;display:grid;place-items:start center}.crop-stage img{width:100%;height:auto;display:block}.crop-shade{position:absolute;left:0;right:0;bottom:0;background:rgba(25,38,70,.52);pointer-events:none}.crop-line{position:absolute;left:0;right:0;height:4px;background:#645de8;box-shadow:0 0 0 1px rgba(255,255,255,.65);pointer-events:none}.crop-controls{margin-top:12px;display:grid;gap:7px}.crop-controls label{font-size:13px;color:#52627d}.crop-controls input{width:100%;accent-color:#5964e5}.assignment-actions .unpublish-btn{background:#fff6e6;color:#8a5d18;border:1px solid #efd9ad}.assignment-actions .republish-btn{background:#eaf8f0;color:#176b44;border:1px solid #c4ead5}
@media(max-width:900px){.lesson-editor-grid{grid-template-columns:1fr}.lesson-editor-head{flex-direction:column}.editor-item-list{max-height:260px}}


/* v10.1 lesson editor modal for tablet reliability */
body.lesson-editor-open{overflow:hidden}
.lesson-editor:not(.hidden){position:fixed;inset:18px;z-index:60;overflow:auto;max-height:calc(100vh - 36px);box-shadow:0 24px 70px rgba(8,18,40,.28)}
.lesson-editor:not(.hidden)::before{content:"";position:fixed;inset:0;background:rgba(9,20,44,.5);z-index:-1}
@media(max-width:900px){.lesson-editor:not(.hidden){inset:10px;max-height:calc(100vh - 20px)}}

/* v10.3 — responsive lesson cards + visual hotspot editor */
html,body{max-width:100%;overflow-x:hidden}
#view-lessons,.grid2,.list,.listitem{min-width:0}
.lesson-row{display:grid;grid-template-columns:minmax(0,1fr) auto;align-items:center;width:100%}
.lesson-info{min-width:0;overflow:hidden}
.lesson-info strong{display:block;min-width:0;overflow-wrap:anywhere}
.lesson-meta{display:flex;gap:5px;align-items:baseline;min-width:0;max-width:100%}
.lesson-file{display:block;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;max-width:100%}
.lesson-actions{min-width:max-content}
.crop-stage{touch-action:none;user-select:none;-webkit-user-select:none}
.editor-hotspot-layer{position:absolute;inset:0;z-index:4;pointer-events:auto;touch-action:none;cursor:crosshair}
.editor-hotspot-box{position:absolute;border:3px dashed #5964e5;background:rgba(89,100,229,.10);border-radius:7px;pointer-events:none;display:flex;align-items:flex-start;justify-content:flex-start}
.editor-hotspot-box span{transform:translateY(-100%);margin-top:-3px;background:#4f58d5;color:#fff;border-radius:7px 7px 0 0;padding:3px 7px;font-size:11px;font-weight:900;white-space:nowrap}
.editor-hotspot-box.selected{border-style:solid;background:rgba(89,100,229,.17)}
.editor-hotspot-box.drawing{border-color:#1b8755;background:rgba(27,135,85,.12)}
.hotspot-editor-panel{margin-top:14px;border:1px solid var(--line);border-radius:14px;padding:13px;background:#fbfcfe}
.hotspot-toolbar{display:flex;gap:8px;flex-wrap:wrap}
.hotspot-tool{border:1px solid #cfd8e6;background:#fff;color:#21375c;border-radius:11px;padding:8px 11px;font-weight:900;cursor:pointer;display:flex;gap:6px;align-items:center}
.hotspot-tool.active{border-color:#5964e5;background:#eef0ff;color:#4653d4;box-shadow:0 0 0 2px rgba(89,100,229,.10)}
.hotspot-tool.saved::after{content:'✓';color:#1b8755;font-weight:950}
.hotspot-status{margin-top:9px;padding:9px 11px;border-radius:10px;background:#f2f5fa;color:#5c6c84;font-size:13px;line-height:1.35}
.compact-actions{margin-top:8px}
@media(max-width:900px){
  .lesson-row{grid-template-columns:1fr;gap:10px}
  .lesson-actions{justify-content:flex-start;min-width:0;width:100%}
  .lesson-file{white-space:normal;display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical}
  .lesson-editor-grid{grid-template-columns:1fr}
}

/* v10.12 exercise hotspot visibility control */
.hotspot-visibility-row{display:flex;align-items:center;justify-content:space-between;gap:14px;margin:10px 0;padding:11px 12px;border:1px solid var(--line);border-radius:12px;background:#f8faff}
.hotspot-visibility-row>div{min-width:0}.hotspot-visibility-row strong{display:block;color:var(--ink);font-size:13px}.hotspot-visibility-row span{display:block;color:var(--muted);font-size:12px;line-height:1.35;margin-top:3px}.hotspot-visibility-row select{flex:0 0 min(220px,42%);border:1px solid #ccd6e5;border-radius:10px;padding:9px 10px;background:#fff;color:var(--ink);font-weight:800}
@media(max-width:700px){.hotspot-visibility-row{align-items:stretch;flex-direction:column}.hotspot-visibility-row select{width:100%;flex:auto}}


/* v10.13 — editor hotspot label safety + stronger instruction contrast */
.lesson-editor:not(.hidden){background:#fff;color:var(--ink)}
.lesson-editor .editor-sub{
  color:#3b4b66;
  font-weight:600;
  opacity:1;
}
.lesson-editor .editor-help{
  color:#263a5d;
  background:#f8faff;
  border:1px solid #d7e0ee;
  border-left:5px solid #5964e5;
  border-radius:12px;
  padding:10px 12px;
  line-height:1.5;
  font-weight:550;
  opacity:1;
}
.lesson-editor .editor-help strong{color:#172b50;font-weight:900}
.lesson-editor .crop-controls label{color:#334863;font-weight:700}
.lesson-editor .hotspot-status{color:#334863;background:#f5f8fc;border:1px solid #dde5f0;font-weight:650}
.lesson-editor .hotspot-visibility-row span{color:#42546f;font-weight:600}
.lesson-editor #editorMsg.message{color:#40516c;background:#f6f8fc;border:1px solid #dde5ef}
.lesson-editor #editorMsg.message.good{color:var(--good);background:var(--goodbg);border-color:#bfe6d1}
.lesson-editor #editorMsg.message.bad{color:var(--bad);background:var(--badbg);border-color:#f0c9cd}
.lesson-editor #editorMsg.message.warn{color:var(--warn);background:var(--warnbg);border-color:#efd9ad}

.editor-hotspot-box{overflow:visible}
.editor-hotspot-box span{
  position:absolute;
  left:-3px;
  top:-4px;
  transform:translateY(-100%);
  margin:0;
  max-width:min(230px,70vw);
  overflow:hidden;
  text-overflow:ellipsis;
  background:#4653d4;
  color:#fff;
  border:2px solid rgba(255,255,255,.92);
  border-radius:7px;
  padding:3px 7px;
  font-size:11px;
  line-height:1.15;
  font-weight:950;
  white-space:nowrap;
  box-shadow:0 2px 7px rgba(18,42,84,.24);
  z-index:2;
}
.editor-hotspot-box.label-below span{
  top:calc(100% + 4px);
  transform:none;
}
.editor-hotspot-box.label-align-right span{
  left:auto;
  right:-3px;
}
@media(max-width:700px){
  .lesson-editor .editor-help{font-size:14px;padding:9px 10px}
  .editor-hotspot-box span{font-size:10px;max-width:180px}
}


/* v10.16 — unobstructed hotspot editor */
.editor-hotspot-box span{display:none!important}
.editor-hotspot-box{
  background:rgba(89,100,229,.045);
  border-width:2px;
  border-color:rgba(75,88,210,.72);
}
.editor-hotspot-box.selected{
  border:3px solid #4f5de0;
  background:rgba(89,100,229,.075);
  box-shadow:0 0 0 3px rgba(89,100,229,.13);
  z-index:3;
}
.editor-hotspot-box.drawing{
  border:3px solid #17875a;
  background:rgba(23,135,90,.08);
  box-shadow:0 0 0 3px rgba(23,135,90,.11);
}
.lesson-editor .hotspot-toolbar{position:relative;z-index:2}
.lesson-editor .hotspot-tool.active{box-shadow:0 0 0 3px rgba(89,100,229,.14)}
.lesson-editor .hotspot-status strong{color:#172b50}
