/* 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}
}
