/* spacee. Whiteboard Lite v5 — compact math, content objects and safe link cards */
.background-controls{border:1px solid #e1e9f7;background:#f8faff;border-radius:11px;padding:8px;margin:6px 0}
.background-controls summary{cursor:pointer;color:#4b63a1;font-size:12px;font-weight:750;list-style-position:inside;padding:3px}
.bg-grid-choices{display:flex;gap:5px;margin:8px 0}
.bg-grid-choices .btn{flex:1;padding:7px 5px;font-size:12px}
.bg-grid-choices .sel,.background-controls .sel{background:#eaf0ff!important;color:#3451cb;border-color:#bacbf7!important}
.bg-actions{display:flex;gap:5px;flex-wrap:wrap}
.bg-actions .btn{font-size:11px;padding:7px}
.bg-actions #bgRemove{color:#a44250}
.insert-panel{border:1px solid #dae5f8;border-radius:13px;background:#fff;display:grid;grid-template-columns:1fr 1fr;gap:11px;padding:12px;margin:0 0 10px;box-shadow:0 3px 10px #19356b0b}
.insert-panel .insert-label{grid-column:1/-1;font-size:12px;font-weight:750;color:#4b6196}
.insert-panel form{display:flex;flex-direction:column;gap:7px;min-width:0}
.insert-panel .insert-formtitle{font-size:12px;font-weight:750;color:#273e72}
.insert-panel input[type="text"],.insert-panel input[type="url"]{border:1px solid #cdd9ee;border-radius:8px;padding:9px;min-width:0;font-size:14px;width:100%;background:#fff}
.insert-panel .checkline{display:flex;gap:6px;align-items:center;font-size:12px;color:#566a8d;line-height:1.3}
.insert-panel .checkline input{accent-color:#3c53df}
.insert-panel .image-insert{display:flex;align-items:center;gap:8px;flex-wrap:wrap}
.insert-panel .image-insert button{font-size:12px;line-height:1.3}
.insert-panel .link-entry{grid-column:1/-1}
.insert-panel .link-entry-row{display:flex;gap:7px;align-items:center}
.insert-panel .link-entry-row input{flex:1}
.insert-panel .btn{align-self:flex-start}
#objectlayer,#linklayer{position:absolute;inset:0;pointer-events:none}
#objectlayer{z-index:2}
#textlayer{z-index:3}
#linklayer{z-index:4}
#fieldlayer{z-index:5}
.move-image{position:absolute;cursor:grab;touch-action:none;border:1px solid transparent;border-radius:5px;user-select:none}
.move-image img{display:block;width:100%;height:100%;object-fit:contain;pointer-events:none;user-select:none}
.move-image.selected{border:2px dashed #4164dd;background:#dbe8ff33}
.move-image .image-resize{display:grid;place-items:center;position:absolute;right:-6px;bottom:-6px;width:24px;height:24px;background:#f1f5ff;border:1px solid #6c8be6;border-radius:6px;color:#2445ad;font-size:16px;touch-action:none;cursor:nwse-resize;pointer-events:auto;z-index:2}
.move-card{background:#f4f7ff!important;border:1px solid #b8c9e7!important;border-radius:9px!important;padding:8px 11px!important;box-shadow:0 2px 6px #29477612;cursor:grab}
.move-card.selected{outline:2px dashed #4b68e4;background:#eaf0ff!important}
.resource-card{position:absolute;display:flex;align-items:center;border:1px solid #b9c9ef;background:#f3f7ffeb;border-radius:10px;box-shadow:0 2px 7px #3252a31c;pointer-events:auto;touch-action:none;min-width:90px}
.resource-card a{display:block;padding:9px 12px;color:#304db8;text-decoration:none;font-size:14px;font-weight:650;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;width:100%}
.resource-card.selected{outline:2px dashed #4164dd}
#allowMove{font-size:12px}
@media(max-width:750px){
 .background-controls{padding:6px;margin:3px 0}
 .insert-panel{grid-template-columns:1fr;gap:9px;padding:9px}
 .insert-panel .link-entry{grid-column:1}
 .insert-panel .insert-label{grid-column:1}
 .insert-panel .link-entry-row{flex-wrap:wrap}
 .insert-panel .link-entry-row .btn{padding:8px}
 .resource-card a{font-size:11px;padding:6px}
 .background-controls summary{font-size:11px}
}

/* v6: preserve exact board proportions and intuitive editing. */
.paper{width:min(100%,1100px,calc((100dvh - 235px)*1.5625))!important;height:auto;max-height:none!important;aspect-ratio:1000/640;flex:0 1 auto}
.fullscreen .paper{width:min(100%,calc(95dvh * 1.5625))!important;max-height:none!important}
.paper canvas{width:100%;height:100%}
.tools #insert.insert-icon{font-size:24px;line-height:1;letter-spacing:0;font-weight:700;white-space:nowrap;overflow:hidden;display:grid;place-items:center}
.tools #pointer{font-size:24px;line-height:1;color:#c85059}
.tools #pointer.active{background:#fff0f1;color:#cc3448;border-color:#eaa6af}
.pointer-dot{position:absolute;width:24px;height:24px;left:50%;top:50%;transform:translate(-50%,-50%);border-radius:50%;border:3px solid #f05a63;box-shadow:0 0 0 6px #fa5e6833,0 0 18px #fa5e6870;background:#fa5e6830;z-index:10;pointer-events:none}
.pointer-dot::after{content:"";position:absolute;left:50%;top:50%;width:6px;height:6px;border-radius:50%;background:#b51229;transform:translate(-50%,-50%)}
.draw.pointer-tool{cursor:none!important}
.bg-help{font-size:11px;line-height:1.35;color:#657492;padding:0 4px;margin:7px 0 5px}
.background-controls .bg-actions{gap:6px}
.background-controls .bg-actions button{min-height:29px}
.selection-toolbar #imageSmaller,.selection-toolbar #imageLarger{white-space:nowrap;min-width:76px;border:1px solid #c7d6ef;padding:8px 11px;background:#fff}
#objectlayer .move-image{outline-offset:3px}
#objectlayer .move-image:hover{border-color:#a4b8ef;background:#eaf0ff30}
#objectlayer .move-image.selected{outline:2px dashed #4164dd;outline-offset:3px}
.insert-panel .link-entry-row{display:grid;grid-template-columns:minmax(0,1.45fr) minmax(0,1fr) auto;gap:10px;align-items:end}
.insert-panel .link-field{display:flex;flex-direction:column;gap:5px;min-width:0}
.insert-panel .link-field span{font-size:11px;font-weight:650;color:#596b8b}
.insert-panel .link-field input{min-width:0;width:100%}
.insert-panel .link-entry-row button{min-height:38px}
.insert-panel .link-info{margin:3px 0 0;color:#72809b;font-size:11px;line-height:1.35}
@media(max-width:750px){
 .paper{width:100%!important;height:auto;max-height:none!important}
 .fullscreen .paper{width:min(100%,calc(95dvh * 1.5625))!important}
 .insert-panel .link-entry-row{grid-template-columns:1fr}
 .insert-panel .link-entry-row button{justify-self:start}
 .pointer-dot{width:18px;height:18px;border-width:2px}
}

/* v7: subject-neutral header, compact image cards, and clear review/homework navigation */
.top .logo + .tag{flex-shrink:0}
.bg-scale{align-self:center;font-size:11px;font-variant-numeric:tabular-nums;font-weight:700;color:#435985;background:#edf3ff;padding:5px 7px;border-radius:7px;min-width:42px;text-align:center}
.image-size-presets{display:flex;align-items:center;gap:4px;border-left:1px solid #d4e0f4;padding-left:10px;flex-wrap:wrap}
.image-size-presets span{font-size:11px;color:#5c6e90;font-weight:650;margin-right:3px}
.selection-toolbar .image-size-presets .btn{min-width:36px;min-height:33px;padding:7px 9px;border:1px solid #c7d6ef;background:white;font-size:12px}
.selection-toolbar .image-size-presets .btn:hover{background:#eaf0ff}
.student-nav{display:flex;align-items:center;gap:9px;flex-wrap:wrap;margin:0 0 11px;border:1px solid #dae6f7;background:#f6f9ff;padding:8px 11px;border-radius:11px;color:#455d87;font-size:12px;line-height:1.4}
.student-nav #studentNavText{flex:1;min-width:150px}
.student-homework-count{font-size:11px;color:#4260b6;white-space:nowrap}
.student-nav #homeworkGo{padding:7px 10px;font-size:12px;background:#fff;color:#3558c8;border-color:#b9c9ef}
@media(max-width:750px){
 .image-size-presets{padding-left:6px}
 .student-nav{padding:7px 8px;font-size:11px;gap:6px}
 .student-nav #studentNavText{min-width:130px}
 .bg-scale{font-size:10px}
}

/* v8: drag & drop desktop images as movable cards */
.drop-image-hint{
 position:absolute;inset:12px;z-index:20;display:flex;flex-direction:column;align-items:center;justify-content:center;
 gap:8px;border:3px dashed #6989ea;border-radius:15px;background:rgba(238,244,255,.94);
 color:#304dba;text-align:center;pointer-events:none;padding:18px;box-shadow:0 6px 28px #1d3f8224;
}
.drop-image-title{font-size:18px;line-height:1.35;font-weight:750}
.drop-image-tip{font-size:12px;line-height:1.45;color:#65789f;max-width:290px}
.workspace.drop-movable-active{outline:2px solid #a2b9fb;outline-offset:-2px}
@media(max-width:750px){.drop-image-hint{inset:6px;padding:10px}.drop-image-title{font-size:14px}.drop-image-tip{font-size:11px}}

/* v9: page-level permission to draw and mobile-compatible controls */
.drawing-setting{border:1px solid #dde7f6;background:#f9fbff;border-radius:11px;padding:10px;margin:2px 0}
.drawing-toggle{display:flex;align-items:center;gap:9px;color:#273e72;font-size:12px;font-weight:750;cursor:pointer;line-height:1.4}
.drawing-toggle input{accent-color:#3c53df;width:17px;height:17px;min-width:17px;margin:0;cursor:pointer}
.drawing-setting p{color:#697995;font-size:10px;margin:6px 0 0;line-height:1.4}
.tools .tool:disabled{opacity:.28;cursor:not-allowed}
@media(max-width:750px){
 .sidebar .page-actions{align-items:stretch}
 .drawing-setting{padding:8px 10px;flex:1 1 160px;min-width:150px;margin:0}
 .drawing-setting p{margin-top:4px}
 .drawing-toggle{font-size:11px}
 .sidebar .page-actions .background-controls{flex:1 1 180px;min-width:160px}
 .editor{min-height:0}
 .workspace{min-height:0;overflow:visible}
 .tools{overflow-y:auto;max-height:min(74dvh,590px)}
}
@media(max-width:420px){
 .drawing-setting{flex:1 1 100%;min-width:0}
 .sidebar .page-actions .background-controls{min-width:0}
 .editor{min-height:220px}
 .tools{max-height:370px}
}
