/* Shared presentation for phone wallpaper and background galleries. */
:is(#wallpaperPanel,#chatBgPanel,.char-phone-panel.char-wallpaper-view){container-type:inline-size;background:#e5e5ea}
:is(#wallpaperPanel,#chatBgPanel,.char-phone-panel.char-wallpaper-view) .hana-gallery-grid{
  display:grid;grid-template-columns:repeat(2,minmax(0,1fr));
  grid-auto-rows:calc(88.8889cqw - 30.2222px);
  gap:10px;padding:12px;align-content:start;align-items:stretch;
  flex:1;min-height:0;overflow-y:auto;box-sizing:border-box;
}
.hana-gallery-grid::-webkit-scrollbar{display:none}
.hana-gallery-tile{
  width:100%;height:100%;min-width:0;box-sizing:border-box;position:relative;
  border:1px solid rgba(0,0,0,.05);border-radius:12px;overflow:hidden;
  background:#f2f2f7;box-shadow:0 1px 3px rgba(0,0,0,.1);
  cursor:pointer;transition:transform .2s,box-shadow .2s;
}
.hana-gallery-tile:active{transform:scale(.95)}
.hana-gallery-tile.selected{box-shadow:0 0 0 3px #000}
.hana-gallery-preview{width:100%;height:100%;background-size:cover;background-position:center}
.hana-gallery-label{position:absolute;bottom:0;left:0;right:0;padding:5px 0;background:rgba(0,0,0,.3);color:#fff;font-size:10px;text-align:center;pointer-events:none}
.hana-gallery-action{
  position:absolute;top:2px;right:2px;width:44px;height:44px;padding:0;
  border:0;border-radius:50%;background:transparent;color:#000;
  display:flex;align-items:center;justify-content:center;z-index:10;
  cursor:pointer;-webkit-tap-highlight-color:transparent;
}
.hana-gallery-tile.has-lock .hana-gallery-action--delete{right:46px}
.hana-gallery-action::before{content:"";position:absolute;width:30px;height:30px;border-radius:50%;background:rgba(255,255,255,.92);box-shadow:0 2px 8px rgba(0,0,0,.15)}
.hana-gallery-action svg{position:relative;z-index:1;width:16px;height:16px;fill:none;stroke:currentColor;stroke-width:1.9;stroke-linecap:round;stroke-linejoin:round}
.hana-gallery-action--lock.active{color:#fff}
.hana-gallery-action--lock.active::before{background:#111}
.hana-gallery-action--delete:hover{color:#fff}
.hana-gallery-action--delete:hover::before{background:#ff3b30}
.hana-gallery-action:active{transform:scale(.96)}
.hana-gallery-action:focus-visible{outline:2px solid #111;outline-offset:-5px}
