.phstory-root{
  width:100%;
  overflow:hidden;
}

/* Section spacing (no footer gap) */
.phstory-section{
  padding:56px 0 20px;
}

/* ===== STORY ROW ===== */
.phstory-row{
  display:flex;
  gap:18px;
  overflow-x:auto;
  padding:20px 0;
}
.phstory-row::-webkit-scrollbar{ display:none; }

/* 6 cards on desktop */
.phstory-card{
  flex:0 0 calc((100% - 90px)/6);
  cursor:pointer;
}

@media(max-width:1199px){
  .phstory-card{
    flex:0 0 calc((100% - 36px)/3);
  }
}

@media(max-width:991px){
  .phstory-section{
    padding:44px 0 16px;
  }
  .phstory-card{
    flex:0 0 calc((100% - 18px)/2);
  }
}

@media(max-width:576px){
  .phstory-section{
    padding:32px 0 12px;
  }
  .phstory-row{
    gap:12px;
    padding:14px 0;
  }
  .phstory-card{
    flex:0 0 78%;
  }
}

/* 9:16 ratio */
.phstory-card-inner{
  width:100%;
  aspect-ratio:9/16;
  border-radius:20px;
  overflow:hidden;
  background:#000;
  box-shadow:0 10px 24px rgba(14,32,70,.14);
  transition:transform .24s ease, box-shadow .24s ease;
}

.phstory-card-inner img{
  width:100%;
  height:100%;
  object-fit:cover;
  transition:transform .26s ease;
}

.phstory-card:hover .phstory-card-inner{
  transform:translateY(-4px);
  box-shadow:0 22px 44px rgba(14,32,70,.22);
}

.phstory-card:hover .phstory-card-inner img{
  transform:scale(1.03);
}

/* ===== VIEWER ===== */
.phstory-viewer{
  position:fixed;
  inset:0;
  background:rgba(0,0,0,.72);
  backdrop-filter:blur(2px);
  -webkit-backdrop-filter:blur(2px);
  display:none;
  align-items:center;
  justify-content:center;
  padding:16px;
  z-index:2147483647;
}
.phstory-viewer.phstory-active{
  display:flex;
}

body.phstory-open .lccwf-wrap,
body.phstory-open #pihintOpen,
body.phstory-open .x9qfco_wrap,
body.phstory-open #x9qfco_widget_root,
body.phstory-open .pihint-ctpanel-openbtn,
body.phstory-open .pihint-ctpanel-overlay,
body.phstory-open .pihint-ctpanel-container,
body.phstory-open .navbar{
  opacity:0 !important;
  visibility:hidden !important;
  pointer-events:none !important;
}

.phstory-frame{
  width:min(94vw,430px);
  height:min(92svh,780px);
  max-height:calc(100dvh - 24px);
  position:relative;
  box-shadow:0 20px 60px rgba(0,0,0,.45);
}

@media(min-width:577px) and (max-width:991px){
  .phstory-frame{
    width:min(72vw,430px);
    height:min(90svh,760px);
  }
}

@media(max-width:576px){
  .phstory-viewer{
    align-items:stretch;
    padding:calc(8px + env(safe-area-inset-top)) 8px calc(8px + env(safe-area-inset-bottom));
    background:rgba(0,0,0,.92);
    backdrop-filter:none;
    -webkit-backdrop-filter:none;
  }
  .phstory-frame{
    width:calc(100vw - 16px);
    height:calc(100dvh - env(safe-area-inset-top) - env(safe-area-inset-bottom) - 16px);
    max-width:none;
    max-height:none;
    box-shadow:none;
    margin:auto;
  }
}

.phstory-content{
  width:100%;
  height:100%;
  background:#000;
  border-radius:20px;
  overflow:hidden;
  position:relative;
}

@media(max-width:576px){
  .phstory-content{
    border-radius:16px;
    border:1px solid rgba(255,255,255,.22);
    box-shadow:0 22px 48px rgba(0,0,0,.45);
  }
}

.phstory-media{
  width:100%;
  height:100%;
  object-fit:cover;
  object-position:center;
  background:#000;
}

@media(max-width:576px){
  .phstory-media{
    object-fit:cover;
  }
}

/* Progress */
.phstory-progress{
  position:absolute;
  top:24px;
  left:12px;
  right:12px;
  height:4px;
  background:rgba(255,255,255,.3);
}
.phstory-progress-fill{
  height:100%;
  width:0%;
  background:#fff;
}

/* Controls */
.phstory-controls{
  position:absolute;
  top:46px;
  left:15px;
  right:15px;
  display:flex;
  justify-content:space-between;
  color:#fff;
  font-size:20px;
  z-index:5;
}

@media(max-width:576px){
  .phstory-progress{
    top:calc(24px + env(safe-area-inset-top));
  }
  .phstory-controls{
    top:calc(52px + env(safe-area-inset-top));
  }
}

.phstory-controls [data-phstory-audio]{
  cursor:pointer;
  user-select:none;
}

.phstory-close-btn{
  width:34px;
  height:34px;
  border-radius:50%;
  display:grid;
  place-items:center;
  position:relative;
  overflow:hidden;
  background:rgba(255,255,255,.16);
  border:1px solid rgba(255,255,255,.35);
  box-shadow:0 8px 20px rgba(0,0,0,.28);
  font-size:18px;
  line-height:1;
  cursor:pointer;
  -webkit-tap-highlight-color:transparent;
  transition:transform .2s ease, background .2s ease;
}

.phstory-close-btn:hover{
  transform:scale(1.06);
  background:rgba(255,255,255,.24);
}

.phstory-close-btn:active,
.phstory-close-btn.phstory-pressed{
  transform:scale(0.92);
  background:rgba(255,255,255,.3);
}

.phstory-close-btn::after{
  content:"";
  position:absolute;
  inset:0;
  border-radius:50%;
  background:radial-gradient(circle, rgba(255,255,255,.45) 0%, rgba(255,255,255,0) 65%);
  opacity:0;
  transform:scale(0.2);
  transition:opacity .2s ease, transform .2s ease;
  pointer-events:none;
}

.phstory-close-btn:active::after,
.phstory-close-btn.phstory-pressed::after{
  opacity:1;
  transform:scale(1);
}

.phstory-name{
  position:absolute;
  top:94px;
  left:15px;
  color:#fff;
  font-weight:600;
  z-index:6;
  max-width:calc(100% - 74px);
  text-shadow:0 2px 8px rgba(0,0,0,.45);
}

@media(max-width:576px){
  .phstory-name{
    top:calc(100px + env(safe-area-inset-top));
  }
}

.phstory-cta{
  position:absolute;
  bottom:calc(18px + env(safe-area-inset-bottom));
  left:50%;
  transform:translateX(-50%);
  display:inline-flex;
  align-items:center;
  justify-content:center;
  background:#fff;
  color:#000;
  padding:10px 24px;
  border-radius:30px;
  text-decoration:none;
  font-size:15px;
  font-weight:600;
  z-index:15;
  pointer-events:auto;
  cursor:pointer;
  white-space:nowrap;
  max-width:calc(100% - 28px);
  transition:transform .22s ease, box-shadow .22s ease, background-color .22s ease;
}

.phstory-cta:hover{
  transform:translateX(-50%) translateY(-2px);
  background:#f8fbff;
  box-shadow:0 12px 26px rgba(10,26,63,.28);
  text-decoration:none !important;
}

.phstory-cta:focus,
.phstory-cta:focus-visible,
.phstory-cta:active,
.phstory-cta:visited{
  text-decoration:none !important;
  outline:none;
}

.phstory-cta::before,
.phstory-cta::after{
  content:none !important;
}

/* Tap zones */
.phstory-tap{
  position:absolute;
  top:0;
  bottom:0;
  width:50%;
  z-index:4;
}
.phstory-left{ left:0; }
.phstory-right{ right:0; }
.phstory-subtext{
  text-align:center;
  max-width:700px;
  margin:0 auto 30px auto;
  font-size:16px;
  line-height:1.6;
}
