/* Fenton Button Designer: three-column workspace and contextual editor. */
#previewWorkspace{grid-column:2;grid-row:2;min-width:0;display:flex;flex-direction:column;gap:12px}
#previewWorkspace>.previewPanel{position:static;min-width:0;width:100%;display:flex;flex-direction:column;align-items:stretch;padding:12px 14px}
#previewWorkspace>.previewPanel>h2{order:-2;font-size:14px;margin:0 0 6px}
#previewWorkspace>.previewPanel>.canvasWrap{order:-1;width:min(100%,535px,max(140px,calc(100svh - 235px)));padding:8px;margin:0 auto 7px}
#previewWorkspace>.previewPanel #editorCanvas{width:100%;max-width:none;height:auto}
#previewWorkspace>.previewPanel .studio-toolbar{margin:5px 0 8px}
#previewWorkspace>.previewPanel #historyFeedback:empty{display:none}
#previewWorkspace>.previewPanel .studio-canvas-hint{margin:6px 0 9px}
#propertiesPanel{min-width:0;padding:14px;position:static}
#propertiesPanel>h2{margin:0 0 12px;font-size:16px}
.properties-section{border-top:1px solid #e5eaf0;padding-top:12px;margin-top:12px}
.properties-section>h3{font-size:13px;color:#26384f;margin:0 0 8px}
.properties-help{font-size:11px;line-height:1.35;color:#64748b;margin:0 0 8px}
#propertiesPanel .quick-panel{margin:0;min-height:0;padding:11px;border-radius:10px}
#propertiesPanel .quick-panel h3{font-size:13px;margin:0 0 7px}
#propertiesPanel .quick-panel .quick-actions{gap:5px}
#propertiesPanel .quick-panel .quick-actions button{padding:8px 9px;min-height:36px}
#propertiesPanel .quick-panel input:not([type="checkbox"]),#propertiesPanel .quick-panel select{min-height:38px}
.properties-text-layers{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:6px}
.properties-text-layers button{background:#f7f9fc;border:1px solid #d8e0e9;color:#30435a;font:650 12px inherit;font-family:inherit;font-size:12px;border-radius:8px;min-height:36px;cursor:pointer}
.properties-text-layers button[aria-pressed="true"]{background:#fff1e3;border-color:#f58220;color:#73410b}
.properties-text-layers button:focus-visible{outline:3px solid #317fc7;outline-offset:2px}
#propertiesPanel .studio-layers{margin:10px 0 0;border-top:1px solid #edf0f5;padding-top:10px}
#propertiesPanel .studio-layers p{margin:4px 0 8px}
#propertiesPanel .studio-layer-list{max-height:220px;overflow:auto}
#propertiesPanel .design-warnings{margin:5px 0 8px}
.properties-check-status{font-size:12px;line-height:1.4;margin:5px 0;color:#305b46}
.properties-check-status[data-attention="true"]{color:#925a16;font-weight:700}
/* All save/export and print actions are intentionally confined to the Print tab. */
#printPrimaryActions{margin:0 0 16px;padding:0 0 14px;border-bottom:1px solid #e5eaf0}
#printPrimaryActions>h3{font-size:14px;color:#26384f;margin:0 0 10px}
#printStudioAction>#openPrintStudio{width:100%;margin:0 0 4px;min-height:46px}
#printStudioAction>.hint{font-size:12px;line-height:1.45;margin:4px 0 12px}
#printSaveMenu{border:1px solid #d9e2ec;border-radius:10px;margin:10px 0 0;background:#fff}
#printSaveMenu>summary{padding:12px;cursor:pointer;color:#31445e;font-weight:750}
#printSaveMenu .top-tools{display:grid;grid-template-columns:1fr;gap:7px;padding:10px}
#printSaveMenu .top-tools .btn{width:100%;text-align:center;justify-content:center;min-height:40px}
#printSaveMenu:focus-within,#printSaveMenu>summary:focus-visible{outline:2px solid #317fc7;outline-offset:2px}
/* When students choose Logos, the searchable gallery leads immediately. */
body[data-editor-tab="logos"] #logosTools .studio-logo-library{
 margin-top:0;padding-top:0;border-top:0;
}
#logosTools .studio-logo-library,#printPrimaryActions{scroll-margin-top:75px}
#propertiesPanel input,#propertiesPanel select{max-width:100%}
@media(min-width:1120px){
 .app{grid-template-columns:minmax(255px,320px) minmax(315px,1fr) minmax(265px,310px);column-gap:14px}
 .editor-tabs{grid-column:1/-1}
 #previewWorkspace{display:contents}
 #previewWorkspace>.previewPanel{grid-column:2;grid-row:2;position:sticky;top:70px}
 #propertiesPanel{grid-column:3;grid-row:2;align-self:start;position:sticky;top:70px;max-height:calc(100svh - 80px);overflow:auto;overscroll-behavior:contain}
}
/* The original mobile rule gives .previewPanel order:1. In this wrapper,
   explicitly keep the canvas ahead of the new properties panel. */
@media(max-width:1119px){
 #previewWorkspace>.previewPanel{order:-1}
 #previewWorkspace>#propertiesPanel{order:0}
}
@media(min-width:701px) and (max-width:1119px){
 #previewWorkspace{grid-column:2;grid-row:2;align-self:start}
 #propertiesPanel{width:100%}
}
@media(max-width:700px){
 .app>.editor-tabs{order:-2}
 .app>#previewWorkspace{order:-1;width:100%;gap:10px}
 #previewWorkspace>.previewPanel{padding:9px 10px;margin-bottom:0}
 #previewWorkspace>.previewPanel>.canvasWrap{padding:6px;width:min(100%,max(150px,calc(100svh - 235px)))}
 #propertiesPanel{width:100%;padding:12px;margin-bottom:10px}
 .app>section#designTools,.app>aside#sideTools{order:2}
}

/* Responsive editor: only the preview and two actions occupy the narrow layout.
   A single existing Properties & Layers panel becomes an on-demand drawer. */
.properties-panel-heading{display:flex;align-items:center;justify-content:space-between;gap:8px}
#propertiesPanel .properties-panel-heading h2{margin:0 0 12px;font-size:16px}
.mobile-properties-actions,#propertiesClose{display:none}
#propertiesBackdrop[hidden]{display:none!important}
@media(max-width:1119px){
 #previewWorkspace>.mobile-properties-actions{
  display:flex;order:0;gap:8px;width:100%;margin:0;align-items:stretch;
 }
 .mobile-properties-actions button{
  display:flex;align-items:center;justify-content:center;gap:6px;flex:1;
  font-family:inherit;font-size:13px;font-weight:750;min-width:0;min-height:46px;
  padding:10px 8px;color:#233a55;cursor:pointer;background:#fff;
  border:1px solid #bdcce0;border-radius:11px;
 }
 .mobile-properties-actions button[aria-expanded="true"]{
  background:#fff2e3;border-color:#f58220;color:#64340c;
 }
 .mobile-properties-actions button:focus-visible,#propertiesClose:focus-visible{
  outline:3px solid #317fc7;outline-offset:2px;
 }
 .mobile-properties-actions button span[aria-hidden="true"]{font-size:18px}
 #propertiesBackdrop:not([hidden]){
  position:fixed;inset:0;display:block;background:#1018279c;z-index:39;
 }
 #previewWorkspace>#propertiesPanel{
  order:1;display:flex;flex-direction:column;gap:0;position:fixed;
  z-index:40;width:min(440px,92vw);height:100svh;max-height:100svh;
  top:0;right:0;left:auto;bottom:0;overflow-y:auto;overscroll-behavior:contain;
  padding:14px 16px 24px;border-radius:16px 0 0 16px;
  box-shadow:-14px 0 44px #10182745;
  transform:translateX(105%);visibility:hidden;pointer-events:none;
  transition:transform .18s ease;
 }
 #previewWorkspace>#propertiesPanel[data-drawer-open="true"]{
  transform:translateX(0);visibility:visible;pointer-events:auto;
 }
 #propertiesPanel .properties-panel-heading{
  position:sticky;top:-14px;z-index:2;margin:-14px -16px 0;padding:14px 16px 10px;
  background:#fff;border-bottom:1px solid #e4eaf1;
 }
 #propertiesPanel .properties-panel-heading h2{margin:0;font-size:16px}
 #propertiesClose{
  display:block;flex:0 0 44px;height:44px;min-width:44px;padding:0;
  border:1px solid #c9d4e1;background:#f4f7fb;border-radius:10px;
  font-size:18px;color:#253c56;cursor:pointer;
 }
 #propertiesPanel[data-mobile-view="edit"] #propertiesLayers{display:none}
 #propertiesPanel[data-mobile-view="layers"] #propertiesEditor,
 #propertiesPanel[data-mobile-view="layers"] #propertiesChecks{display:none}
 body.properties-drawer-open{overflow:hidden}
}
@media(max-width:700px){
 #previewWorkspace>.mobile-properties-actions{padding:0 2px 4px}
 #previewWorkspace>#propertiesPanel{
  top:auto;right:0;left:0;bottom:0;width:100%;height:auto;
  max-height:min(70svh,650px);min-height:180px;
  border-radius:18px 18px 0 0;padding:14px 14px 24px;
  box-shadow:0 -12px 36px #10182742;transform:translateY(105%);
  padding-bottom:calc(20px + env(safe-area-inset-bottom,0px));
 }
 #previewWorkspace>#propertiesPanel[data-drawer-open="true"]{transform:translateY(0)}
 #propertiesPanel .properties-panel-heading{
  top:-14px;margin:-14px -14px 0;padding:14px 14px 10px;
 }
}
@media(prefers-reduced-motion:reduce){
 #previewWorkspace>#propertiesPanel{transition:none}
}
