/* Collage templates live only in Image Library; never in the model shape browser. */
#app .lb-gallery-top-tabs{display:grid;grid-template-columns:1fr 1fr;gap:8px;padding:12px 17px 8px;border-bottom:1px solid #315065}
#app .lb-gallery-top-tabs button{min-height:42px;border-radius:9px;background:#132a3c;color:#b8d5e3;border:1px solid #37556c;font:inherit;font-weight:750;cursor:pointer}
#app .lb-gallery-top-tabs button.active{background:linear-gradient(130deg,#116279,#0a4257);border-color:#44dcf0;color:#effdff}
#app .lb-gallery-page[hidden],#app .lb-gallery-templates-pane[hidden]{display:none!important}
#app .lb-gallery-templates-pane{padding:18px 22px 26px;overflow:auto;min-height:0;max-height:70vh;color:#dfedf5}
#app .lb-collage-head{display:flex;gap:18px;align-items:center;justify-content:space-between;margin:4px 0 18px}
#app .lb-collage-head h3{font-size:18px;margin:0 0 5px}
#app .lb-collage-head p{font-size:12px;color:#acc6d8;max-width:620px;line-height:1.5;margin:0}
#app .lb-collage-head>button,#app .lb-collage-cloud-actions>button{border:1px solid #47c4db;color:#effcff;background:#135268;border-radius:9px;padding:10px 12px;min-height:39px;cursor:pointer;font-weight:700;white-space:normal}
#app .lb-collage-cloud-actions{display:flex;gap:8px;align-items:center;flex-wrap:wrap;border:1px solid #38576b;padding:10px;background:#0e2333;border-radius:10px;margin-bottom:15px}
#app .lb-collage-cloud-actions button{background:#163244;border-color:#416a80}
#app .lb-collage-cloud-actions small{flex:1 1 240px;color:#acc5d7;line-height:1.5}
#app .lb-collage-category{display:grid;grid-template-columns:auto minmax(0,340px);align-items:center;gap:12px;margin-bottom:17px}
#app .lb-collage-category label{font-weight:750;color:#b8d3e3}
#app .lb-collage-category select{height:39px;border:1px solid #47728a;border-radius:8px;background:#0c2031;color:#edfaff;padding:6px 9px}
#app .lb-gallery-templates-pane h4{font-size:13px;margin:16px 0 10px;color:#b9d9ea}
#app .lb-collage-grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:11px}
#app .lb-collage-card{min-width:0;display:flex;flex-direction:column;gap:7px;border:1px solid #375a70;border-radius:12px;background:#112d40;color:#e8faff;padding:10px;text-align:left;cursor:pointer;box-shadow:0 5px 12px #0003}
#app .lb-collage-card:hover{border-color:#54dcea;background:#184055}
#app .lb-collage-card img{display:block;width:100%;height:auto;aspect-ratio:480/208;object-fit:contain;border-radius:7px;background:#eff5f9}
#app .lb-collage-card strong{font-size:13px}
#app .lb-collage-card small{font-size:11px;color:#adcbdb;line-height:1.5;flex:1}
#app .lb-collage-card span{font-size:11px;color:#71e8f6;font-weight:750}
#app .lb-collage-storage-note{font-size:11px;color:#94b2c4;line-height:1.45;margin:6px 0 13px}
#app .lb-collage-my{grid-template-columns:repeat(2,minmax(0,1fr))}
#app .lb-collage-saved{display:flex;align-items:center;gap:8px;padding:12px;background:#10283a;border:1px solid #385c72;border-radius:9px}
#app .lb-collage-saved>div{flex:1;min-width:0}
#app .lb-collage-saved b,#app .lb-collage-saved small{display:block;overflow-wrap:anywhere}
#app .lb-collage-saved small{font-size:10px;color:#a1bdcc}
#app .lb-collage-saved button{border:1px solid #3c758b;background:#1b5268;color:#f1fdff;border-radius:7px;padding:7px;cursor:pointer}
#app .lb-collage-empty{font-size:12px;color:#9ebccc;grid-column:1/-1}
#app .lb-add-placeholder{display:flex!important;align-items:center;gap:12px;width:100%;min-height:42px;margin-top:5px;padding:7px 10px!important;border-radius:8px!important;border:1px dashed #4a9bb2!important;background:#142f40!important;color:#d8f8fe!important;font-size:12px!important;font-weight:700!important;cursor:pointer}
#app .lb-add-placeholder:hover{background:#20506a!important}
#app .lb-placeholder-icon{display:grid;place-items:center;width:38px;height:32px;background:#193e56;border-radius:5px;color:#80e8f5;font-size:19px}
#app .lb-photo-slot-overlay{position:absolute;inset:0;z-index:14;pointer-events:none;overflow:hidden}
#app .lb-photo-slot{position:absolute;display:grid;place-items:center;border:2px dashed #25b8cf;background:rgba(24,143,164,.13);border-radius:5px;pointer-events:none;transform-origin:center;box-sizing:border-box;min-width:0;min-height:0}
#app .lb-photo-slot-plus{position:relative;display:grid;place-items:center;box-sizing:border-box;pointer-events:auto;flex-shrink:0;min-width:42px;min-height:42px;width:clamp(42px,4.8vw,50px);height:clamp(42px,4.8vw,50px);padding:0;border:2px solid #4cdaee;border-radius:50%;background:#104f68;color:white;font-size:0;line-height:0;cursor:pointer;box-shadow:0 4px 14px #071821a9}
#app .lb-photo-slot-plus::before,#app .lb-photo-slot-plus::after{content:"";position:absolute;top:50%;left:50%;background:currentColor;border-radius:3px;transform:translate(-50%,-50%);pointer-events:none}
#app .lb-photo-slot-plus::before{width:24px;height:4px}
#app .lb-photo-slot-plus::after{width:4px;height:24px}
#app .lb-photo-slot-plus:hover{background:#1388a2}
.lb-slot-menu{position:fixed;z-index:16000;display:flex;flex-direction:column;gap:4px;padding:7px;min-width:180px;background:#0d2636;border:1px solid #3e9bb4;border-radius:10px;box-shadow:0 7px 25px #0009}
.lb-slot-menu button{display:block;border:none;border-radius:7px;background:transparent;color:#e5f8fd;text-align:left;min-height:38px;padding:9px 12px;cursor:pointer}
.lb-slot-menu button:hover{background:#205168}
.lb-collage-toast{position:fixed;bottom:24px;left:50%;transform:translateX(-50%);z-index:19000;max-width:min(480px,calc(100vw - 24px));padding:12px 16px;border-radius:10px;background:#102f40;color:#e1fbff;border:1px solid #3bbbd6;box-shadow:0 8px 30px #0008;text-align:center;font-size:12px}
.lb-collage-toast[hidden]{display:none!important}
#app .lb-near-tools-project{display:flex;gap:6px;align-items:center;flex-shrink:0;padding:0 7px 0 0;border-right:1px solid #426175}
#app .lb-near-tools-project button{min-height:40px;padding:8px 10px;border:1px solid #3a7287;border-radius:8px;background:#163a50;color:#e3faff;font-size:11px;font-weight:750;white-space:nowrap;cursor:pointer}
#app .lb-near-tools-project button:hover{border-color:#64d7ed;background:#1c5065}
@media(max-width:820px){#app .lb-collage-grid{grid-template-columns:repeat(2,minmax(0,1fr))}#app .lb-gallery-templates-pane{padding:12px}}
@media(max-width:520px){#app .lb-collage-grid{grid-template-columns:minmax(0,1fr)}#app .lb-collage-head{flex-direction:column;align-items:stretch}#app .lb-collage-category{grid-template-columns:1fr}#app .lb-gallery-top-tabs{padding:9px;gap:6px}#app .lb-gallery-top-tabs button{font-size:11px}#app .lb-collage-my{grid-template-columns:1fr}#app .lb-near-tools-project button{font-size:10px;padding:6px 7px}}

/* Filled photo slots keep full original imagery and offer drag-to-position. */
#app .lb-photo-filled{background:transparent;border-color:transparent;pointer-events:none}
#app .lb-photo-filled .lb-photo-position-btn{position:absolute;z-index:3;bottom:6px;left:50%;transform:translateX(-50%);pointer-events:auto;white-space:nowrap;border:1px solid #74d8e9;border-radius:7px;background:#103b55e8;color:#eafcff;font-size:11px;font-weight:700;padding:6px 10px;cursor:pointer;box-shadow:0 3px 10px #0008}
#app .lb-photo-filled:not(.lb-photo-positioning) .lb-photo-position-btn{opacity:.76}
#app .lb-photo-filled .lb-photo-position-btn:is(:hover,:focus-visible){opacity:1;background:#1b6580}
#app .lb-photo-positioning{border:2px dashed #67e2ef;background:#13759026}
#app .lb-photo-positioning .lb-photo-position-gesture{position:absolute;inset:0;z-index:2;pointer-events:auto;touch-action:none;cursor:grab;border-radius:5px}
#app .lb-photo-positioning .lb-photo-position-gesture:active{cursor:grabbing}
#app .lb-photo-positioning .lb-photo-position-btn{z-index:4;top:auto;bottom:6px}
@media(max-width:600px){#app .lb-photo-filled .lb-photo-position-btn{font-size:10px;padding:5px 7px}}

/* Layer-stack names use visible numbers; a filled placeholder has one visual
   photo child (not a second export/print layer). */
#app #layer-panel .lb-layer-slot-parent{margin-bottom:3px}
#app #layer-panel .lb-layer-slot-parent .layer-name{font-weight:750;color:#ecfcff}
#app #layer-panel .lb-layer-slot-thumb{color:#70d8e9;font-size:23px;line-height:1}
#app #layer-panel .lb-layer-photo-child{position:relative;display:flex;align-items:center;
 gap:8px;margin:0 4px 7px 22px;padding:7px 9px 7px 11px;
 border:1px solid #355c73;border-left:2px solid #43bcd2;border-radius:0 8px 8px 0;
 background:#103146;color:#d4edf8;font-size:11px;cursor:pointer;min-width:0}
#app #layer-panel .lb-layer-photo-child:hover,
#app #layer-panel .lb-layer-photo-child:focus-visible{outline:1px solid #5acbdf;background:#184259}
#app #layer-panel .lb-layer-photo-thumb{flex:0 0 42px;width:42px;height:36px;border-radius:5px;
 border:1px solid #547a8e;overflow:hidden;background:#081c2b;
 display:flex;align-items:center;justify-content:center}
#app #layer-panel .lb-layer-photo-thumb img,#app #layer-panel .lb-layer-photo-thumb canvas{display:block;max-width:100%;max-height:100%;width:100%;height:100%;
 object-fit:contain;object-position:center}
#app #layer-panel .lb-layer-photo-name{flex:1 1 auto;min-width:0;overflow:hidden;text-overflow:ellipsis;
 white-space:nowrap;font-size:12px;font-weight:650}
#app #layer-panel .lb-layer-photo-position{flex:0 0 auto;border:1px solid #497e96;border-radius:6px;
 padding:5px 7px;min-height:30px;background:#1b4a63;color:#e8faff;font-size:10px;font-weight:700;cursor:pointer}
#app #layer-panel .lb-layer-photo-position:hover{border-color:#76dbea;background:#26657b}
#app #layer-panel .lb-layer-slot-parent.hidden + .lb-layer-photo-child{opacity:.5}
@media(max-width:520px){#app #layer-panel .lb-layer-photo-child{margin-left:15px;gap:6px}
 #app #layer-panel .lb-layer-photo-thumb{flex-basis:37px;width:37px;height:33px}
 #app #layer-panel .lb-layer-photo-position{font-size:10px;padding:5px}}


/* Layer-stack mobile safety: don't place 20px eye and trash targets together.
   Keep visibility instant; distinguish the destructive control clearly. */
#app #layer-panel .layer-item > div:last-child{
  gap:9px!important;
  flex-shrink:0;
}
#app #layer-panel .layer-visibility,
#app #layer-panel .layer-delete{
  box-sizing:border-box;
  display:grid!important;
  place-items:center;
  width:36px!important;
  height:36px!important;
  min-width:36px!important;
  min-height:36px!important;
  flex:0 0 36px;
  border:1px solid #37546a!important;
  border-radius:8px!important;
  padding:0!important;
  touch-action:manipulation;
}
#app #layer-panel .layer-visibility{
  background:#153d4a!important;
  color:#75dce9!important;
}
#app #layer-panel .layer-delete{
  background:#39232c!important;
  color:#f0a7af!important;
}
#app #layer-panel .layer-visibility svg,
#app #layer-panel .layer-delete svg{
  pointer-events:none;
  width:19px;
  height:19px;
}
#app #layer-panel .layer-visibility:focus-visible,
#app #layer-panel .layer-delete:focus-visible{
  outline:2px solid #68dfea;
  outline-offset:2px;
}
#app #layer-panel .layer-add-button-empty{
  flex-direction:column;
  gap:8px;
}
#app #layer-panel .lb-layer-import-caption{
  font-weight:700;
  font-size:13px;
  letter-spacing:.01em;
  color:#c5f4fb;
}
@media(max-width:830px){
  #app #layer-panel .layer-item{
    padding:8px!important;
    gap:6px!important;
    min-height:52px;
  }
  #app #layer-panel .layer-name{
    min-width:0;
  }
  #app #layer-panel .layer-item > div:last-child{
    gap:10px!important;
  }
  #app #layer-panel .layer-visibility,
  #app #layer-panel .layer-delete{
    width:40px!important;
    height:42px!important;
    min-width:40px!important;
    min-height:42px!important;
    flex:0 0 40px;
  }
}

/* Visibility must hide the artwork, not its row in the Layers list.
   commercial.css defines a global .hidden { display:none!important }, while
   the core editor marks invisible layer rows with .layer-item.hidden.
   Override ONLY that row so its eye button remains available to restore it. */
#app #layer-panel .layer-item.hidden{
  display:flex!important;
  opacity:.5;
}
#app #layer-panel .layer-item.hidden .layer-visibility{
  opacity:1;
  color:#b7f2fc!important;
}

/* A placeholder contains multiple photos, moved with the global Move tool. */
#app .lb-photo-filled .lb-photo-slot-add-more{
 position:absolute;top:5px;right:5px;left:auto;bottom:auto;transform:none;
 min-width:33px;min-height:33px;width:33px;height:33px;
 border-width:1px;opacity:.87;z-index:3;
}
#app .lb-photo-filled .lb-photo-slot-add-more::before{width:17px;height:3px}
#app .lb-photo-filled .lb-photo-slot-add-more::after{width:3px;height:17px}
#app #layer-panel .lb-slot-add-child{
 display:inline-grid;place-items:center;flex:0 0 30px;min-width:30px;
 width:30px;height:30px;margin-left:7px;padding:0;
 border:1px solid #4b8298;border-radius:6px;
 background:#154b62;color:#c5f6ff;font-weight:800;font-size:20px;
 cursor:pointer;
}
#app #layer-panel .lb-layer-photo-child.selected{outline:2px solid #62d9ec;background:#1b5066}
#app #layer-panel .lb-layer-photo-child.photo-hidden{opacity:.5}
#app #layer-panel .lb-photo-child-actions{display:flex;gap:6px;flex:0 0 auto}
#app #layer-panel .lb-photo-child-actions button{
 display:grid;place-items:center;min-width:34px;width:34px;height:34px;
 padding:0;border:1px solid #456b7b;border-radius:7px;
 background:#164255;color:#cdf7ff;cursor:pointer;font-size:17px;
}
#app #layer-panel .lb-photo-child-actions .lb-child-delete{
 color:#ffc3c8;background:#3a2430;border-color:#794651;font-size:22px;
}
#app #layer-panel .lb-photo-child-actions button:focus-visible,
#app #layer-panel .lb-slot-add-child:focus-visible{
 outline:2px solid #75edfa;outline-offset:2px;
}
#app #properties-panel .lb-slot-inspector{display:flex;flex-direction:column;gap:12px;padding:2px}
#app #properties-panel .lb-slot-inspector h4{font-size:14px;margin:0;color:#e4fbff}
#app #properties-panel .lb-slot-inspector p,
#app #properties-panel .lb-slot-parent-note{font-size:11px;line-height:1.5;color:#b2cedb;margin:0 0 8px}
#app #properties-panel .lb-slot-inspector label{
 display:flex;flex-direction:column;gap:5px;font-size:12px;color:#d9eef7;
}
#app #properties-panel .lb-slot-inspector output{font-variant-numeric:tabular-nums;color:#82e2f2}
#app #properties-panel .lb-slot-inspector input[type=range]{width:100%;accent-color:#5bc7da;min-height:27px}
#app #properties-panel .lb-slot-actions{display:flex;gap:8px;flex-wrap:wrap}
#app #properties-panel .lb-slot-actions button{
 flex:1 1 112px;min-height:36px;border:1px solid #4b7f98;
 border-radius:7px;background:#17435d;color:#e5faff;
 font-size:11px;font-weight:650;cursor:pointer;padding:6px 8px;
}
#app #properties-panel .lb-slot-actions .lb-photo-danger{border-color:#985b66;background:#492c36}
@media(max-width:530px){#app #layer-panel .lb-photo-child-actions{gap:4px}
 #app #layer-panel .lb-photo-child-actions button{min-width:34px;width:34px;height:38px}
}
