/* TARAMAA · Daily Image & Videos Update card. Additive only. */
.tm-gallery-admin-card{margin-top:14px!important;padding:14px!important;border:1px solid rgba(246,191,70,.28)!important;background:linear-gradient(145deg,rgba(9,18,29,.98),rgba(7,14,23,.96))!important;box-shadow:0 12px 30px rgba(0,0,0,.16),0 0 22px rgba(246,191,70,.04)!important}
.tm-gallery-admin-head{display:flex;align-items:flex-start;justify-content:space-between;gap:12px;padding-bottom:11px;border-bottom:1px solid rgba(246,191,70,.12)}
.tm-gallery-admin-title{display:flex;gap:10px;align-items:flex-start;min-width:0}
.tm-gallery-admin-icon{width:38px;height:38px;display:grid;place-items:center;border-radius:11px;background:rgba(246,191,70,.09);border:1px solid rgba(246,191,70,.34);color:#f6bf46;font-size:18px;flex:0 0 38px}
.tm-gallery-admin-title h2{margin:0;color:#f3f7fb;font-size:15px;line-height:1.2}
.tm-gallery-admin-title p{margin:4px 0 0;color:#8294a7;font-size:8px;line-height:1.45}
.tm-gallery-admin-actions{display:flex;align-items:center;gap:6px;flex-wrap:wrap;justify-content:flex-end}
.tm-gallery-admin-btn{min-height:31px;padding:0 10px;border-radius:8px;border:1px solid rgba(246,191,70,.34);background:#111d2b;color:#e9f1f8;font:800 8px/31px Arial,sans-serif;cursor:pointer;text-decoration:none;white-space:nowrap}
.tm-gallery-admin-btn.gold{background:linear-gradient(135deg,#f6bf46,#d88d12);border-color:#f6bf46;color:#1b1204;box-shadow:0 5px 14px rgba(246,191,70,.15)}
.tm-gallery-admin-btn:hover{filter:brightness(1.08);transform:translateY(-1px)}
.tm-gallery-admin-file{display:none}
.tm-gallery-flash{margin:9px 0 0;padding:8px 10px;border-radius:8px;font-size:8px;font-weight:800}
.tm-gallery-flash.good{color:#b9f8ce;background:rgba(34,177,96,.09);border:1px solid rgba(55,209,112,.2)}
.tm-gallery-flash.bad{color:#ffc0c8;background:rgba(231,76,60,.09);border:1px solid rgba(231,76,60,.22)}
.tm-gallery-track-wrap{position:relative;margin-top:12px}
.tm-gallery-track{display:flex;gap:9px;overflow-x:auto;overflow-y:hidden;scroll-behavior:smooth;scrollbar-width:none;padding:2px 1px 5px}
.tm-gallery-track::-webkit-scrollbar{display:none}
.tm-gallery-item{flex:0 0 calc((100% - 36px)/5);min-width:0;border:1px solid rgba(246,191,70,.28);border-radius:10px;background:#0b1724;overflow:hidden;box-shadow:0 6px 18px rgba(0,0,0,.15)}
.tm-gallery-media{position:relative;height:126px;background:#160a2d;overflow:hidden}
.tm-gallery-media img,.tm-gallery-media video{display:block;width:100%;height:100%;object-fit:cover;background:#120722}
.tm-gallery-type{position:absolute;left:7px;top:7px;padding:4px 6px;border-radius:999px;background:rgba(6,12,20,.78);border:1px solid rgba(255,255,255,.15);color:#f6bf46;font-size:6.5px;font-weight:900;letter-spacing:.7px}
.tm-gallery-play{position:absolute;left:50%;top:50%;transform:translate(-50%,-50%);width:38px;height:38px;border-radius:50%;display:grid;place-items:center;padding-left:2px;background:rgba(6,11,18,.68);border:2px solid rgba(246,191,70,.86);color:#fff4c8;font-size:15px;box-shadow:0 0 18px rgba(246,191,70,.22)}
.tm-gallery-item-foot{padding:8px 8px 9px;display:flex;justify-content:space-between;gap:7px;align-items:flex-start;min-height:58px}
.tm-gallery-item-foot strong{display:block;color:#e9f1f8;font-size:8px;line-height:1.25}
.tm-gallery-item-foot small{display:block;margin-top:3px;color:#71879c;font-size:6.5px;line-height:1.25}
.tm-gallery-item-actions{display:flex;gap:4px;flex:0 0 auto}
.tm-gallery-mini-btn{width:25px;height:25px;border-radius:7px;border:1px solid rgba(151,171,191,.2);background:#132233;color:#dce8f1;cursor:pointer;font-size:10px;display:grid;place-items:center}
.tm-gallery-mini-btn:hover{border-color:#f6bf46;color:#f6bf46}
.tm-gallery-mini-btn.danger:hover{border-color:#ff6171;color:#ff98a3}
.tm-gallery-empty{padding:22px 10px;text-align:center;border:1px dashed rgba(246,191,70,.2);border-radius:10px;color:#71869b;font-size:8px}
.tm-gallery-scroll-controls{position:absolute;right:0;top:-42px;display:flex;gap:5px}
.tm-gallery-scroll-btn{width:28px;height:28px;border-radius:50%;border:1px solid rgba(246,191,70,.32);background:#0e1b2a;color:#f6bf46;cursor:pointer;font-size:18px;line-height:1}
.tm-gallery-pagination{display:flex;align-items:center;justify-content:center;gap:8px;margin-top:9px;color:#758ba0;font-size:7px}
.tm-gallery-pagination a,.tm-gallery-pagination span{min-width:25px;height:24px;padding:0 7px;border-radius:7px;border:1px solid rgba(151,171,191,.16);background:#0c1825;color:#c6d3df;text-decoration:none;display:inline-flex;align-items:center;justify-content:center;font-weight:800}
.tm-gallery-pagination .current{border-color:rgba(246,191,70,.55);background:rgba(246,191,70,.1);color:#f6bf46}
.tm-gallery-upload-note{margin-top:8px;color:#60768b;font-size:6.8px;line-height:1.4}
@media(max-width:900px){.tm-gallery-item{flex-basis:calc((100% - 18px)/3)}.tm-gallery-admin-head{flex-direction:column}.tm-gallery-admin-actions{justify-content:flex-start}.tm-gallery-scroll-controls{position:static;margin-top:8px}}
@media(max-width:620px){.tm-gallery-admin-card{padding:11px!important}.tm-gallery-item{flex-basis:220px}.tm-gallery-media{height:124px}.tm-gallery-admin-actions{width:100%}.tm-gallery-admin-btn{flex:1;min-width:0;text-align:center}.tm-gallery-scroll-controls{display:none}.tm-gallery-item-foot{min-height:54px}.tm-gallery-upload-note{font-size:6.5px}}


/* TARAMAA Gallery V2 — compact dashboard presentation only. */
.tm-gallery-admin-card{
  margin-top:10px!important;
  padding:9px 10px 10px!important;
}
.tm-gallery-admin-head{
  gap:8px;
  padding-bottom:7px;
}
.tm-gallery-admin-title{gap:7px}
.tm-gallery-admin-icon{
  width:30px;height:30px;flex-basis:30px;border-radius:8px;font-size:14px;
}
.tm-gallery-admin-title h2{font-size:12px}
.tm-gallery-admin-title p{margin-top:2px;font-size:7px;line-height:1.3}
.tm-gallery-admin-actions{gap:4px}
.tm-gallery-admin-btn{
  min-height:25px;padding:0 8px;border-radius:7px;font-size:7px;line-height:25px;
}
.tm-gallery-flash{margin:6px 0 0;padding:5px 7px;font-size:7px}
.tm-gallery-track-wrap{margin-top:7px}
.tm-gallery-track{gap:7px;padding:1px 1px 3px}
.tm-gallery-item{
  flex-basis:calc((100% - 28px)/5);
  border-radius:8px;
}
.tm-gallery-media{height:82px}
.tm-gallery-type{left:5px;top:5px;padding:3px 5px;font-size:5.5px}
.tm-gallery-play{width:28px;height:28px;font-size:11px;border-width:1.5px}
.tm-gallery-item-foot{
  padding:5px 6px 6px;min-height:38px;gap:5px;
}
.tm-gallery-item-foot strong{font-size:7px}
.tm-gallery-item-foot small{margin-top:2px;font-size:5.5px}
.tm-gallery-item-actions{gap:3px}
.tm-gallery-mini-btn{width:20px;height:20px;border-radius:6px;font-size:8px}
.tm-gallery-scroll-controls{top:-31px;gap:4px}
.tm-gallery-scroll-btn{width:23px;height:23px;font-size:15px}
.tm-gallery-pagination{margin-top:5px;gap:5px;font-size:6px}
.tm-gallery-pagination a,.tm-gallery-pagination span{min-width:21px;height:20px;padding:0 5px;border-radius:6px}
.tm-gallery-upload-note{margin-top:5px;font-size:5.8px}
@media(max-width:900px){
  .tm-gallery-item{flex-basis:calc((100% - 14px)/3)}
}
@media(max-width:620px){
  .tm-gallery-admin-card{padding:8px!important}
  .tm-gallery-item{flex-basis:190px}
  .tm-gallery-media{height:78px}
  .tm-gallery-item-foot{min-height:36px;padding:5px}
  .tm-gallery-scroll-controls{display:none}
}

/* V2 lightbox media: keep opened media visible and centered. */
.profile-gallery-lightbox-inner{overflow:hidden}
.profile-gallery-lightbox img,
.profile-gallery-lightbox video{
  display:block!important;
  visibility:visible!important;
  opacity:1!important;
  max-width:100%!important;
  max-height:100%!important;
}
.profile-gallery-lightbox-media-error{
  color:#4b18e8;font:700 14px/1.5 Arial,sans-serif;text-align:center;padding:30px;
}

/* TARAMAA Gallery V3 — very compact dashboard grid: 10 media boxes per row. */
.tm-gallery-admin-card{
  margin-top:8px!important;
  padding:7px 8px 8px!important;
}
.tm-gallery-admin-head{gap:6px;padding-bottom:5px}
.tm-gallery-admin-title{gap:6px}
.tm-gallery-admin-icon{width:26px;height:26px;flex-basis:26px;border-radius:7px;font-size:12px}
.tm-gallery-admin-title h2{font-size:11px}
.tm-gallery-admin-title p{margin-top:1px;font-size:6px;line-height:1.2}
.tm-gallery-admin-actions{gap:3px}
.tm-gallery-admin-btn{min-height:21px;padding:0 6px;border-radius:6px;font-size:6.5px;line-height:21px}
.tm-gallery-flash{margin:4px 0 0;padding:4px 6px;font-size:6px}
.tm-gallery-track-wrap{margin-top:5px}
.tm-gallery-track{gap:4px;padding:1px 1px 2px}
.tm-gallery-item{
  flex:0 0 calc((100% - 36px)/10)!important;
  border-radius:6px;
  border-width:1px;
}
.tm-gallery-media{height:56px!important}
.tm-gallery-type{left:3px;top:3px;padding:2px 3px;font-size:4.5px}
.tm-gallery-play{width:21px;height:21px;font-size:8px;border-width:1px;box-shadow:0 0 8px rgba(246,191,70,.2)}
.tm-gallery-item-foot{padding:3px 4px 4px;min-height:29px;gap:3px}
.tm-gallery-item-foot strong{font-size:5.5px;line-height:1.15}
.tm-gallery-item-foot small{margin-top:1px;font-size:4.5px;line-height:1.1}
.tm-gallery-item-actions{gap:2px}
.tm-gallery-mini-btn{width:auto;min-width:27px;height:17px;padding:0 4px;border-radius:4px;font-size:5.5px;line-height:1}
.tm-gallery-scroll-controls{top:-25px;gap:3px}
.tm-gallery-scroll-btn{width:20px;height:20px;font-size:13px}
.tm-gallery-pagination{margin-top:3px;gap:4px;font-size:5.5px}
.tm-gallery-pagination a,.tm-gallery-pagination span{min-width:18px;height:17px;padding:0 4px;border-radius:5px}
.tm-gallery-upload-note{margin-top:3px;font-size:5px;line-height:1.2}

@media(max-width:900px){
  .tm-gallery-item{flex-basis:calc((100% - 18px)/5)!important}
}
@media(max-width:620px){
  .tm-gallery-admin-card{padding:6px!important}
  .tm-gallery-admin-head{gap:5px}
  .tm-gallery-admin-title h2{font-size:10px}
  .tm-gallery-admin-title p{font-size:5.5px}
  .tm-gallery-item{flex-basis:82px!important}
  .tm-gallery-media{height:58px!important}
  .tm-gallery-item-foot{min-height:28px;padding:3px}
  .tm-gallery-item-actions{gap:2px}
  .tm-gallery-mini-btn{min-width:25px;height:16px;font-size:5px;padding:0 3px}
  .tm-gallery-admin-actions{width:auto}
  .tm-gallery-admin-btn{flex:0 0 auto}
}


/* V4 mobile admin polish — compact uploads and media boxes. */
.tm-gallery-file-input,.tm-gallery-replace-input{display:none!important;width:0!important;height:0!important;position:absolute!important;opacity:0!important;pointer-events:none!important}
@media(max-width:620px){
  .tm-gallery-admin-card{margin-top:6px!important;padding:5px!important;border-radius:10px!important}
  .tm-gallery-admin-head{display:flex!important;flex-direction:row!important;align-items:center!important;gap:5px!important;padding-bottom:4px!important}
  .tm-gallery-admin-title{gap:5px!important;flex:1 1 auto!important;min-width:0!important}
  .tm-gallery-admin-icon{width:22px!important;height:22px!important;flex-basis:22px!important;border-radius:6px!important;font-size:10px!important}
  .tm-gallery-admin-title h2{font-size:8px!important;line-height:1.15!important}
  .tm-gallery-admin-title p{font-size:4.8px!important;line-height:1.15!important;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;max-width:120px}
  .tm-gallery-admin-actions{display:grid!important;grid-template-columns:1fr 1fr!important;gap:3px!important;width:auto!important;flex:0 0 116px!important}
  .tm-gallery-admin-actions form{min-width:0!important;margin:0!important}
  .tm-gallery-admin-btn{display:block!important;width:100%!important;min-height:19px!important;height:19px!important;padding:0 4px!important;border-radius:5px!important;font-size:5.8px!important;line-height:19px!important;white-space:nowrap!important}
  .tm-gallery-flash{margin:3px 0 0!important;padding:3px 5px!important;font-size:5.5px!important}
  .tm-gallery-track-wrap{margin-top:4px!important}
  .tm-gallery-track{gap:3px!important;padding:1px 0 2px!important}
  .tm-gallery-item{flex:0 0 64px!important;border-radius:5px!important}
  .tm-gallery-media{height:48px!important}
  .tm-gallery-type{left:2px!important;top:2px!important;padding:1px 2px!important;font-size:3.7px!important}
  .tm-gallery-play{width:17px!important;height:17px!important;font-size:6px!important;border-width:1px!important}
  .tm-gallery-item-foot{padding:2px 3px!important;min-height:24px!important;gap:2px!important}
  .tm-gallery-item-foot strong{font-size:4.2px!important;line-height:1.05!important}
  .tm-gallery-item-foot small{font-size:3.7px!important;line-height:1.05!important;margin-top:1px!important;white-space:nowrap}
  .tm-gallery-item-actions{gap:1px!important}
  .tm-gallery-mini-btn{min-width:19px!important;width:auto!important;height:14px!important;padding:0 3px!important;border-radius:3px!important;font-size:4.2px!important}
  .tm-gallery-pagination{margin-top:2px!important;gap:3px!important;font-size:4.5px!important}
  .tm-gallery-pagination a,.tm-gallery-pagination span{min-width:15px!important;height:14px!important;padding:0 3px!important;border-radius:4px!important}
  .tm-gallery-upload-note{display:none!important}
  .tm-gallery-scroll-controls{display:flex!important;position:absolute!important;right:0!important;top:-20px!important;margin:0!important;gap:2px!important}
  .tm-gallery-scroll-btn{width:18px!important;height:18px!important;font-size:11px!important}
}


/* TARAMAA Gallery V5 — mobile dashboard cache refresh + compact upload controls. */
@media(max-width:620px){
  .tm-gallery-admin-card{
    width:100%!important;
    margin:5px 0 0!important;
    padding:5px!important;
    border-radius:9px!important;
  }
  .tm-gallery-admin-head{
    min-height:24px!important;
    padding:0 0 4px!important;
  }
  .tm-gallery-admin-actions{
    display:flex!important;
    align-items:center!important;
    justify-content:flex-end!important;
    gap:3px!important;
    flex:0 0 auto!important;
    width:auto!important;
  }
  .tm-gallery-admin-actions form{
    display:block!important;
    margin:0!important;
    padding:0!important;
  }
  .tm-gallery-admin-btn{
    width:auto!important;
    min-width:55px!important;
    height:19px!important;
    min-height:19px!important;
    padding:0 6px!important;
    font-size:6px!important;
    line-height:19px!important;
  }
  .tm-gallery-file-input,
  .tm-gallery-replace-input{
    display:none!important;
    width:0!important;
    height:0!important;
    opacity:0!important;
    position:absolute!important;
    pointer-events:none!important;
  }
  .tm-gallery-track-wrap{margin-top:4px!important}
  .tm-gallery-track{gap:3px!important;padding:0 0 2px!important}
  .tm-gallery-item{flex:0 0 62px!important;width:62px!important}
  .tm-gallery-media{height:47px!important}
  .tm-gallery-item-foot{padding:2px 3px!important;min-height:24px!important}
  .tm-gallery-item-foot strong{font-size:4px!important}
  .tm-gallery-item-foot small{font-size:3.5px!important}
  .tm-gallery-mini-btn{min-width:18px!important;height:13px!important;padding:0 2px!important;font-size:4px!important}
  .tm-gallery-pagination{margin-top:2px!important}
}

/* TARAMAA Gallery V5 — fullscreen-style media viewer with a narrow animated gold frame. */
.profile-gallery-lightbox{
  padding:8px!important;
  background:rgba(2,5,10,.92)!important;
  backdrop-filter:blur(4px)!important;
}
.profile-gallery-lightbox-inner{
  position:relative!important;
  width:auto!important;
  height:auto!important;
  max-width:calc(100vw - 18px)!important;
  max-height:calc(100vh - 18px)!important;
  padding:8px!important;
  display:flex!important;
  align-items:center!important;
  justify-content:center!important;
  background:#070a10!important;
  border:0!important;
  border-radius:12px!important;
  box-shadow:0 0 18px rgba(245,199,92,.22),0 16px 60px rgba(0,0,0,.55)!important;
  overflow:hidden!important;
  isolation:isolate!important;
}
.profile-gallery-lightbox-inner::before{
  content:"";
  position:absolute;
  inset:0;
  border-radius:inherit;
  padding:3px;
  background:conic-gradient(from 0deg,rgba(245,199,92,.16),#f5c75c,#fff4bf,#f5c75c,rgba(245,199,92,.12),transparent 70%,rgba(245,199,92,.16));
  -webkit-mask:linear-gradient(#000 0 0) content-box,linear-gradient(#000 0 0);
  -webkit-mask-composite:xor;
  mask-composite:exclude;
  filter:drop-shadow(0 0 7px rgba(245,199,92,.55));
  animation:tmGalleryViewerGoldSweep 3s linear infinite;
  pointer-events:none;
  z-index:5;
}
@keyframes tmGalleryViewerGoldSweep{to{transform:rotate(360deg)}}
.profile-gallery-lightbox [data-gallery-lightbox-content]{
  position:relative!important;
  z-index:2!important;
  width:auto!important;
  height:auto!important;
  max-width:calc(100vw - 34px)!important;
  max-height:calc(100vh - 34px)!important;
  display:flex!important;
  align-items:center!important;
  justify-content:center!important;
  overflow:hidden!important;
  border-radius:6px!important;
}
.profile-gallery-lightbox img,
.profile-gallery-lightbox video{
  display:block!important;
  width:auto!important;
  height:auto!important;
  max-width:calc(100vw - 34px)!important;
  max-height:calc(100vh - 34px)!important;
  object-fit:contain!important;
  border-radius:5px!important;
  box-shadow:none!important;
  background:#000!important;
}
.profile-gallery-lightbox-close,
.profile-gallery-lightbox-nav,
.profile-gallery-lightbox-counter{z-index:7!important}
.profile-gallery-lightbox-close{
  right:6px!important;
  top:6px!important;
  width:32px!important;
  height:32px!important;
  border:1px solid rgba(245,199,92,.9)!important;
  background:rgba(7,10,16,.88)!important;
  color:#fff1b0!important;
  box-shadow:0 0 10px rgba(245,199,92,.3)!important;
}
.profile-gallery-lightbox-nav{
  width:38px!important;
  height:38px!important;
  border:2px solid #f5c75c!important;
  background:rgba(7,10,16,.88)!important;
  color:#fff1b0!important;
  box-shadow:0 0 12px rgba(245,199,92,.32)!important;
}
.profile-gallery-lightbox-nav.prev{left:5px!important}
.profile-gallery-lightbox-nav.next{right:5px!important}
.profile-gallery-lightbox-counter{
  bottom:6px!important;
  background:rgba(7,10,16,.88)!important;
  color:#fff1b0!important;
  border:1px solid rgba(245,199,92,.75)!important;
}
@media(max-width:620px){
  .profile-gallery-lightbox{padding:3px!important}
  .profile-gallery-lightbox-inner{
    width:calc(100vw - 6px)!important;
    height:calc(100vh - 6px)!important;
    max-width:none!important;
    max-height:none!important;
    padding:4px!important;
    border-radius:9px!important;
  }
  .profile-gallery-lightbox-inner::before{padding:3px!important}
  .profile-gallery-lightbox [data-gallery-lightbox-content]{
    width:100%!important;
    height:100%!important;
    max-width:none!important;
    max-height:none!important;
  }
  .profile-gallery-lightbox img,
  .profile-gallery-lightbox video{
    width:100%!important;
    height:100%!important;
    max-width:none!important;
    max-height:none!important;
    object-fit:contain!important;
    border-radius:3px!important;
  }
  .profile-gallery-lightbox-close{width:29px!important;height:29px!important;right:5px!important;top:5px!important;font-size:19px!important}
  .profile-gallery-lightbox-nav{width:34px!important;height:34px!important;font-size:22px!important}
  .profile-gallery-lightbox-nav.prev{left:4px!important}
  .profile-gallery-lightbox-nav.next{right:4px!important}
  .profile-gallery-lightbox-counter{bottom:5px!important;font-size:8px!important;padding:3px 7px!important}
}


/* TARAMAA Gallery V6 — final mobile dashboard compactness + white/gold media viewer. */
@media(max-width:620px){
  /* Dashboard: remove gallery track navigation arrows; keep swipe/scroll itself. */
  .tm-gallery-admin-card .tm-gallery-scroll-controls{display:none!important}
  /* Make Replace a genuinely small text button. */
  .tm-gallery-admin-card .tm-gallery-mini-btn.tm-gallery-replace{
    min-width:28px!important;
    width:auto!important;
    height:13px!important;
    min-height:13px!important;
    padding:0 3px!important;
    border-radius:4px!important;
    font-size:4px!important;
    line-height:13px!important;
    white-space:nowrap!important;
  }
  .tm-gallery-admin-card .tm-gallery-mini-btn.danger{
    width:14px!important;
    min-width:14px!important;
    height:13px!important;
    min-height:13px!important;
    padding:0!important;
    font-size:8px!important;
  }
  .tm-gallery-admin-card .tm-gallery-item-actions{gap:2px!important}
}

/* V6 media viewer: clean white frame, fixed gold border, soft gold shadow,
   plus a moving rectangular light highlight around the inside edge. */
.profile-gallery-lightbox{
  background:rgba(10,10,16,.72)!important;
}
.profile-gallery-lightbox-inner{
  position:relative!important;
  background:#fff!important;
  border:3px solid #f5c75c!important;
  border-radius:14px!important;
  box-shadow:
    0 0 8px rgba(245,199,92,.95),
    0 0 24px rgba(245,199,92,.58),
    0 18px 55px rgba(0,0,0,.34)!important;
  padding:5px!important;
  overflow:hidden!important;
}
/* Remove the previous rotating conic border so the gold edge is always fixed. */
.profile-gallery-lightbox-inner::before{
  content:""!important;
  position:absolute!important;
  inset:4px!important;
  border:2px solid rgba(245,199,92,.38)!important;
  border-radius:9px!important;
  padding:0!important;
  background:none!important;
  -webkit-mask:none!important;
  mask:none!important;
  filter:none!important;
  animation:none!important;
  pointer-events:none!important;
  z-index:5!important;
}
/* Moving rectangular light: a bright segment travels around the inner border. */
.profile-gallery-lightbox-inner::after{
  content:""!important;
  position:absolute!important;
  inset:5px!important;
  border-radius:10px!important;
  border:2px solid transparent!important;
  background:
    linear-gradient(90deg,transparent 0%,rgba(255,255,255,0) 42%,#fff7cf 50%,rgba(255,255,255,0) 58%,transparent 100%) top/34% 2px no-repeat,
    linear-gradient(180deg,transparent 0%,rgba(255,255,255,0) 42%,#fff7cf 50%,rgba(255,255,255,0) 58%,transparent 100%) right/2px 34% no-repeat,
    linear-gradient(270deg,transparent 0%,rgba(255,255,255,0) 42%,#fff7cf 50%,rgba(255,255,255,0) 58%,transparent 100%) bottom/34% 2px no-repeat,
    linear-gradient(0deg,transparent 0%,rgba(255,255,255,0) 42%,#fff7cf 50%,rgba(255,255,255,0) 58%,transparent 100%) left/2px 34% no-repeat!important;
  background-position:-34% 0,100% -34%,134% 100%,0 134%!important;
  background-repeat:no-repeat!important;
  animation:tmGalleryRectLight 3.8s linear infinite!important;
  filter:drop-shadow(0 0 4px rgba(255,239,161,.95))!important;
  pointer-events:none!important;
  z-index:6!important;
}
@keyframes tmGalleryRectLight{
  0%{background-position:-34% 0,100% -34%,134% 100%,0 134%}
  25%{background-position:100% 0,100% -34%,134% 100%,0 134%}
  25.01%{background-position:100% -34%,100% -34%,134% 100%,0 134%}
  50%{background-position:100% 100%,100% 100%,134% 100%,0 134%}
  50.01%{background-position:100% 100%,134% 100%,134% 100%,0 134%}
  75%{background-position:0 100%,100% 100%,0 100%,0 134%}
  75.01%{background-position:0 100%,100% 100%,-34% 100%,0 134%}
  100%{background-position:0 0,100% 0,-34% 100%,0 0}
}
.profile-gallery-lightbox [data-gallery-lightbox-content]{
  width:100%!important;
  height:100%!important;
  max-width:none!important;
  max-height:none!important;
  background:#fff!important;
  border-radius:9px!important;
  overflow:hidden!important;
  position:relative!important;
  z-index:2!important;
}
.profile-gallery-lightbox img,
.profile-gallery-lightbox video{
  width:100%!important;
  height:100%!important;
  max-width:none!important;
  max-height:none!important;
  object-fit:cover!important;
  border-radius:7px!important;
  background:#fff!important;
  box-shadow:none!important;
}
.profile-gallery-lightbox-close{
  width:30px!important;height:30px!important;
  right:7px!important;top:7px!important;
  border:2px solid #f5c75c!important;
  background:#fff!important;
  color:#5b18d6!important;
  box-shadow:0 0 10px rgba(245,199,92,.55)!important;
}
.profile-gallery-lightbox-nav{
  width:34px!important;height:34px!important;
  border:2px solid #f5c75c!important;
  background:#fff!important;
  color:#5b18d6!important;
  box-shadow:0 0 12px rgba(245,199,92,.55)!important;
}
.profile-gallery-lightbox-counter{
  background:#fff!important;
  color:#5b18d6!important;
  border:1px solid #f5c75c!important;
  box-shadow:0 0 8px rgba(245,199,92,.4)!important;
}
@media(max-width:620px){
  .profile-gallery-lightbox{padding:0!important}
  .profile-gallery-lightbox-inner{
    width:calc(100vw - 8px)!important;
    height:calc(100vh - 8px)!important;
    max-width:none!important;
    max-height:none!important;
    padding:5px!important;
    border:3px solid #f5c75c!important;
    border-radius:12px!important;
  }
  .profile-gallery-lightbox-inner::before{inset:4px!important;border-radius:7px!important}
  .profile-gallery-lightbox-inner::after{inset:5px!important;border-radius:8px!important}
  .profile-gallery-lightbox [data-gallery-lightbox-content]{
    width:100%!important;height:100%!important;border-radius:7px!important;
  }
  .profile-gallery-lightbox img,
  .profile-gallery-lightbox video{
    width:100%!important;height:100%!important;object-fit:cover!important;border-radius:5px!important;
  }
}

/* TARAMAA Gallery V7 — mobile final alignment/spacing.
 * Dashboard: Replace moves to the left and becomes a tiny text control.
 * Viewer: preserve full width while reducing height, with equal top/bottom breathing room.
 */
@media(max-width:620px){
  /* Keep the dashboard gallery width exactly as-is; only compact its controls. */
  .tm-gallery-admin-card .tm-gallery-item-foot{
    justify-content:flex-start!important;
  }
  .tm-gallery-admin-card .tm-gallery-item-actions{
    order:-1!important;
    margin-right:auto!important;
    margin-left:0!important;
    gap:2px!important;
    align-items:center!important;
  }
  .tm-gallery-admin-card .tm-gallery-item-foot > div:first-child{
    margin-left:auto!important;
    min-width:0!important;
    text-align:right!important;
  }
  .tm-gallery-admin-card .tm-gallery-mini-btn.tm-gallery-replace{
    width:24px!important;
    min-width:24px!important;
    max-width:24px!important;
    height:11px!important;
    min-height:11px!important;
    max-height:11px!important;
    padding:0 2px!important;
    border-radius:3px!important;
    font-size:3.4px!important;
    line-height:11px!important;
    font-weight:800!important;
    overflow:hidden!important;
  }
  .tm-gallery-admin-card .tm-gallery-mini-btn.danger{
    width:11px!important;
    min-width:11px!important;
    max-width:11px!important;
    height:11px!important;
    min-height:11px!important;
    max-height:11px!important;
    padding:0!important;
    border-radius:3px!important;
    font-size:7px!important;
    line-height:11px!important;
  }

  /* Media viewer: same width, shorter height, centered for equal top/bottom spacing. */
  .profile-gallery-lightbox-inner{
    width:calc(100vw - 8px)!important;
    height:calc(100vh - 80px)!important;
    max-width:none!important;
    max-height:none!important;
    margin:0 auto!important;
  }
}


/* TARAMAA Gallery V8 — exact viewer geometry requested.
 * Keep the viewer wide, reduce its height, center it for equal top/bottom space,
 * use a white backdrop, fixed slim gold frame + animated rectangular light.
 */
.profile-gallery-lightbox{
  background:#fff!important;
  padding:0!important;
  backdrop-filter:none!important;
  -webkit-backdrop-filter:none!important;
  display:flex!important;
  align-items:center!important;
  justify-content:center!important;
}
.profile-gallery-lightbox-inner{
  position:relative!important;
  width:calc(100vw - 8px)!important;
  height:calc(100vh - 80px)!important;
  max-width:none!important;
  max-height:none!important;
  margin:0 auto!important;
  padding:6px!important;
  display:flex!important;
  align-items:center!important;
  justify-content:center!important;
  background:#fff!important;
  border:3px solid #f5c75c!important;
  border-radius:14px!important;
  box-shadow:0 0 7px rgba(245,199,92,.95),0 0 20px rgba(245,199,92,.72),0 0 42px rgba(245,199,92,.35)!important;
  overflow:hidden!important;
  isolation:isolate!important;
}
/* Fixed gold border underneath the travelling highlight. */
.profile-gallery-lightbox-inner::before{
  content:""!important;
  position:absolute!important;
  inset:3px!important;
  border:2px solid rgba(245,199,92,.72)!important;
  border-radius:10px!important;
  background:none!important;
  padding:0!important;
  -webkit-mask:none!important;
  mask:none!important;
  filter:drop-shadow(0 0 4px rgba(245,199,92,.7))!important;
  animation:none!important;
  pointer-events:none!important;
  z-index:5!important;
}
/* Bright rectangular light segment continuously travels around the inner edge. */
.profile-gallery-lightbox-inner::after{
  content:""!important;
  position:absolute!important;
  inset:3px!important;
  border:3px solid transparent!important;
  border-radius:10px!important;
  background:conic-gradient(from 0deg,transparent 0deg,transparent 300deg,#f5c75c 324deg,#fff9dc 340deg,#fff 349deg,#f5c75c 356deg,transparent 360deg) border-box!important;
  -webkit-mask:linear-gradient(#000 0 0) padding-box,linear-gradient(#000 0 0)!important;
  -webkit-mask-composite:xor!important;
  mask:linear-gradient(#000 0 0) padding-box,linear-gradient(#000 0 0)!important;
  mask-composite:exclude!important;
  filter:drop-shadow(0 0 5px rgba(255,239,150,.98))!important;
  animation:tmGalleryRectangularGoldLight 2.8s linear infinite!important;
  pointer-events:none!important;
  z-index:6!important;
}
@keyframes tmGalleryRectangularGoldLight{
  from{transform:rotate(0deg)}
  to{transform:rotate(360deg)}
}
.profile-gallery-lightbox [data-gallery-lightbox-content]{
  position:relative!important;
  z-index:2!important;
  width:100%!important;
  height:100%!important;
  max-width:none!important;
  max-height:none!important;
  display:flex!important;
  align-items:center!important;
  justify-content:center!important;
  overflow:hidden!important;
  background:#fff!important;
  border-radius:8px!important;
}
.profile-gallery-lightbox img,
.profile-gallery-lightbox video{
  display:block!important;
  width:100%!important;
  height:100%!important;
  max-width:none!important;
  max-height:none!important;
  object-fit:cover!important;
  border-radius:6px!important;
  background:#fff!important;
  box-shadow:none!important;
}
.profile-gallery-lightbox-close,
.profile-gallery-lightbox-nav,
.profile-gallery-lightbox-counter{z-index:8!important}
.profile-gallery-lightbox-close{
  width:30px!important;height:30px!important;
  right:7px!important;top:7px!important;
  border:2px solid #f5c75c!important;
  background:#fff!important;
  color:#5b18d6!important;
  box-shadow:0 0 10px rgba(245,199,92,.65)!important;
}
.profile-gallery-lightbox-nav{
  width:34px!important;height:34px!important;
  border:2px solid #f5c75c!important;
  background:#fff!important;
  color:#5b18d6!important;
  box-shadow:0 0 12px rgba(245,199,92,.65)!important;
}
.profile-gallery-lightbox-counter{
  background:#fff!important;
  color:#5b18d6!important;
  border:1px solid #f5c75c!important;
  box-shadow:0 0 8px rgba(245,199,92,.45)!important;
}
@media(max-width:620px){
  .profile-gallery-lightbox-inner{
    width:calc(100vw - 8px)!important;
    height:calc(100vh - 80px)!important;
    margin:0 auto!important;
    padding:5px!important;
    border:3px solid #f5c75c!important;
    border-radius:12px!important;
  }
  .profile-gallery-lightbox-inner::before{inset:3px!important;border-radius:8px!important}
  .profile-gallery-lightbox-inner::after{inset:3px!important;border-radius:8px!important}
  .profile-gallery-lightbox [data-gallery-lightbox-content]{border-radius:7px!important}
  .profile-gallery-lightbox img,
  .profile-gallery-lightbox video{
    width:100%!important;height:100%!important;object-fit:cover!important;border-radius:5px!important;
  }
}

/* V8 cache-busted dashboard Replace control remains tiny and left-aligned on mobile. */
@media(max-width:620px){
  .tm-gallery-admin-card .tm-gallery-item-foot{justify-content:flex-start!important}
  .tm-gallery-admin-card .tm-gallery-item-actions{order:-1!important;margin-right:auto!important;margin-left:0!important;gap:2px!important}
  .tm-gallery-admin-card .tm-gallery-mini-btn.tm-gallery-replace{
    width:20px!important;min-width:20px!important;max-width:20px!important;
    height:10px!important;min-height:10px!important;max-height:10px!important;
    padding:0 2px!important;border-radius:3px!important;font-size:3px!important;line-height:10px!important;
  }
}


/* TARAMAA Gallery V9 — exact viewer behavior. */
.profile-gallery-lightbox{display:none!important;background:#fff!important;padding:0!important;align-items:center!important;justify-content:center!important;overflow:hidden!important}
.profile-gallery-lightbox.is-open{display:flex!important}
.profile-gallery-lightbox-stage{position:relative!important;width:min(760px,100vw)!important;height:min(723px,calc(100vh - 192px))!important;display:flex!important;align-items:center!important;justify-content:center!important;perspective:1200px!important}
.profile-gallery-lightbox-inner{width:min(388px,calc(100vw - 24px))!important;height:min(723px,calc(100vh - 192px))!important;max-width:none!important;max-height:none!important;box-sizing:border-box!important;background:#fff!important;border:3px solid #f5c75c!important;border-radius:14px!important;box-shadow:0 0 8px rgba(245,199,92,.95),0 0 22px rgba(245,199,92,.72),0 0 46px rgba(245,199,92,.38)!important;padding:5px!important;overflow:hidden!important;z-index:4!important}
.profile-gallery-lightbox-inner::before{content:""!important;position:absolute!important;inset:3px!important;border:2px solid rgba(245,199,92,.72)!important;border-radius:10px!important;background:none!important;filter:drop-shadow(0 0 4px rgba(245,199,92,.72))!important;z-index:5!important;pointer-events:none!important}
.profile-gallery-lightbox-inner::after{content:""!important;position:absolute!important;inset:3px!important;border:3px solid transparent!important;border-radius:10px!important;background:conic-gradient(from 0deg,transparent 0deg,transparent 300deg,#f5c75c 324deg,#fff9dc 340deg,#fff 349deg,#f5c75c 356deg,transparent 360deg) border-box!important;-webkit-mask:linear-gradient(#000 0 0) padding-box,linear-gradient(#000 0 0)!important;-webkit-mask-composite:xor!important;mask:linear-gradient(#000 0 0) padding-box,linear-gradient(#000 0 0)!important;mask-composite:exclude!important;filter:drop-shadow(0 0 5px rgba(255,239,150,.98))!important;animation:tmGalleryV9Light 2.8s linear infinite!important;pointer-events:none!important;z-index:6!important}
@keyframes tmGalleryV9Light{to{transform:rotate(360deg)}}
.profile-gallery-lightbox [data-gallery-lightbox-content]{position:relative!important;z-index:2!important;width:100%!important;height:100%!important;display:flex!important;align-items:center!important;justify-content:center!important;overflow:hidden!important;background:#fff!important;border-radius:8px!important}
.profile-gallery-lightbox img.profile-gallery-lightbox-media,.profile-gallery-lightbox video.profile-gallery-lightbox-media{display:block!important;width:100%!important;height:100%!important;max-width:none!important;max-height:none!important;object-fit:cover!important;background:#fff!important;border-radius:6px!important}
.profile-gallery-lightbox-side{position:absolute!important;top:50%!important;width:118px!important;height:500px!important;transform:translateY(-50%) rotateY(0deg)!important;border:2px solid rgba(245,199,92,.8)!important;border-radius:14px!important;background:#fff!important;overflow:hidden!important;box-shadow:0 0 18px rgba(245,199,92,.45)!important;z-index:2!important;cursor:pointer!important;padding:0!important;opacity:.78!important;transition:transform .25s ease,opacity .25s ease!important}
.profile-gallery-lightbox-side:hover{opacity:1!important}
.profile-gallery-lightbox-side.side-prev{left:22px!important;transform:translateY(-50%) rotateY(18deg)!important}
.profile-gallery-lightbox-side.side-next{right:22px!important;transform:translateY(-50%) rotateY(-18deg)!important}
.profile-gallery-lightbox-side img,.profile-gallery-lightbox-side video{width:100%!important;height:100%!important;object-fit:cover!important;display:block!important}
.profile-gallery-lightbox-close,.profile-gallery-lightbox-nav,.profile-gallery-lightbox-counter{z-index:10!important}
.profile-gallery-lightbox-close{background:#fff!important;color:#5b18d6!important;border:2px solid #f5c75c!important;box-shadow:0 0 10px rgba(245,199,92,.65)!important}
.profile-gallery-lightbox-nav{background:#fff!important;color:#5b18d6!important;border:2px solid #f5c75c!important;box-shadow:0 0 12px rgba(245,199,92,.65)!important}
.profile-gallery-lightbox-counter{background:#fff!important;color:#5b18d6!important;border:1px solid #f5c75c!important;box-shadow:0 0 8px rgba(245,199,92,.45)!important}
@media(max-width:900px){.profile-gallery-lightbox-stage{width:100vw!important;height:calc(100vh - 192px)!important}.profile-gallery-lightbox-side{display:none!important}.profile-gallery-lightbox-inner{width:calc(100vw - 24px)!important;height:calc(100vh - 192px)!important}}
@media(min-width:901px){.profile-gallery-lightbox-inner{width:388px!important;height:723px!important}.profile-gallery-lightbox-stage{height:723px!important}}
/* TARAMAA Gallery V10 — fixed rectangular corner-to-corner gold shine.
 * Keeps the V9 viewer geometry and media behavior unchanged.
 * Replaces the rotating/conic border animation with a single directional
 * highlight that travels around the four straight sides and turns at corners.
 */
.profile-gallery-lightbox-inner::before{
  content:""!important;
  position:absolute!important;
  inset:3px!important;
  border:2px solid rgba(245,199,92,.72)!important;
  border-radius:10px!important;
  background:none!important;
  filter:drop-shadow(0 0 4px rgba(245,199,92,.72))!important;
  z-index:5!important;
  pointer-events:none!important;
}

.profile-gallery-lightbox-inner::after{
  content:""!important;
  position:absolute!important;
  inset:3px!important;
  border:2px solid transparent!important;
  border-radius:10px!important;
  background:
    linear-gradient(90deg,transparent 0%,rgba(255,255,255,0) 38%,#fff9dc 48%,#fff 50%,#f5c75c 54%,rgba(245,199,92,0) 64%) top / 34% 2px no-repeat,
    linear-gradient(180deg,transparent 0%,rgba(255,255,255,0) 38%,#fff9dc 48%,#fff 50%,#f5c75c 54%,rgba(245,199,92,0) 64%) right / 2px 34% no-repeat,
    linear-gradient(270deg,transparent 0%,rgba(255,255,255,0) 38%,#fff9dc 48%,#fff 50%,#f5c75c 54%,rgba(245,199,92,0) 64%) bottom / 34% 2px no-repeat,
    linear-gradient(0deg,transparent 0%,rgba(255,255,255,0) 38%,#fff9dc 48%,#fff 50%,#f5c75c 54%,rgba(245,199,92,0) 64%) left / 2px 34% no-repeat!important;
  -webkit-mask:none!important;
  mask:none!important;
  filter:drop-shadow(0 0 4px rgba(255,239,150,.98))!important;
  animation:tmGalleryCornerShine 4.8s linear infinite!important;
  pointer-events:none!important;
  z-index:6!important;
}

@keyframes tmGalleryCornerShine{
  0%{background-position:-12% 0,100% -12%,112% 100%,0 112%;}
  20%{background-position:112% 0,100% -12%,112% 100%,0 112%;}
  25%{background-position:112% 0,100% -12%,112% 100%,0 112%;}
  45%{background-position:112% 0,100% 112%,112% 100%,0 112%;}
  50%{background-position:112% 0,100% 112%,112% 100%,0 112%;}
  70%{background-position:112% 0,100% 112%,-12% 100%,0 112%;}
  75%{background-position:112% 0,100% 112%,-12% 100%,0 112%;}
  95%{background-position:112% 0,100% 112%,-12% 100%,0 -12%;}
  100%{background-position:-12% 0,100% -12%,112% 100%,0 112%;}
}
