:root{
  --mhpc-box:#0c8446;
  --mhpc-text:#ffffff;
  --mhpc-muted:rgba(255,255,255,.82);
  --mhpc-line:rgba(255,255,255,.22);
  --mhpc-shadow:0 12px 34px rgba(0,0,0,.22);
  --mhpc-progress:#ffd200;
}

/* ===== Layout ===== */
.mhpc-wrap{width:100%}

/* Toolbar */
.mhpc-toolbar{
  display:flex;
  gap:12px;
  align-items:center;
  justify-content:space-between;
  margin:0 0 14px;
  flex-wrap:wrap;
}
.mhpc-chips{display:flex; gap:10px; flex-wrap:wrap;}
.mhpc-chip{
  border:1px solid rgba(255,255,255,.35);
  background:rgba(255,255,255,.12);
  color:var(--mhpc-text);
  padding:8px 12px;
  border-radius:999px;
  font-weight:800;
  cursor:pointer;
  transition: transform .12s ease, background .2s ease, border-color .2s ease, box-shadow .2s ease;
}
.mhpc-chip:hover{
  transform: translateY(-1px);
  background:rgba(255,255,255,.18);
  box-shadow: 0 10px 24px rgba(0,0,0,.18);
}
.mhpc-chip.is-active{
  border-color: rgba(255,255,255,.75);
  background: rgba(255,255,255,.22);
}

.mhpc-search{margin-left:auto}
.mhpc-search-input{
  border:1px solid rgba(255,255,255,.35);
  background:rgba(255,255,255,.12);
  color:var(--mhpc-text);
  border-radius:12px;
  padding:10px 12px;
  min-width:240px;
  outline:none;
}
.mhpc-search-input::placeholder{color:rgba(255,255,255,.68)}
@media (max-width:520px){ .mhpc-search-input{min-width:100%} }

/* Skeleton */
.mhpc-skeleton{
  display:none;
  border-radius:18px;
  overflow:hidden;
  height:220px;
  background: linear-gradient(90deg, rgba(255,255,255,.10), rgba(255,255,255,.18), rgba(255,255,255,.10));
  background-size: 200% 100%;
  animation: mhpcShimmer 1.05s linear infinite;
  margin-bottom:14px;
}
@keyframes mhpcShimmer{ 0%{background-position:200% 0} 100%{background-position:-200% 0} }
.mhpc-wrap.is-loading .mhpc-skeleton{display:block}
.mhpc-wrap.is-loading .mhpc-track{opacity:.25; filter: blur(.6px); pointer-events:none}

/* Track grid */
.mhpc-track{display:grid; gap:18px}
.mhpc-wrap[data-layout="grid"] .mhpc-track,
.mhpc-wrap[data-layout="auto"] .mhpc-track{
  grid-template-columns: repeat(var(--mhpc-cols, 3), minmax(0, 1fr));
}
.mhpc-wrap[data-cols="1"]{--mhpc-cols:1}
.mhpc-wrap[data-cols="2"]{--mhpc-cols:2}
.mhpc-wrap[data-cols="3"]{--mhpc-cols:3}
.mhpc-wrap[data-cols="4"]{--mhpc-cols:4}

/* ===== Cards ===== */
@keyframes mhpcFadeUp{ 0%{opacity:0; transform: translateY(14px) scale(.985)} 100%{opacity:1; transform: translateY(0) scale(1)} }
.mhpc-card{
  position:relative;
  border-radius:18px;
  overflow:hidden;
  background:var(--mhpc-box);
  color:var(--mhpc-text);
  box-shadow:var(--mhpc-shadow);
  transform: translateY(0);
  transition: transform .25s ease, box-shadow .25s ease, filter .25s ease;
  will-change: transform;
}
.mhpc-card::before{
  content:"";
  position:absolute;
  inset:-2px;
  background:
    radial-gradient(140px 140px at 18% 10%, rgba(255,255,255,.18), transparent 60%),
    radial-gradient(220px 220px at 88% 15%, rgba(255,255,255,.12), transparent 62%),
    linear-gradient(135deg, rgba(255,255,255,.10), rgba(0,0,0,0));
  opacity:.88;
  pointer-events:none;
}
.mhpc-card::after{
  content:"";
  position:absolute;
  left:-30%;
  top:-40%;
  width:70%;
  height:180%;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,.18), transparent);
  transform: rotate(18deg) translateX(-120%);
  opacity:0;
  pointer-events:none;
}
.mhpc-card.mhpc-inview{ animation: mhpcFadeUp .55s cubic-bezier(.2,.9,.2,1) both; }
.mhpc-card.mhpc-inview::after{ opacity:.22; animation: mhpcSweep 2.8s ease-in-out infinite; }
@keyframes mhpcSweep{ 0%{transform: rotate(18deg) translateX(-120%)} 60%{transform: rotate(18deg) translateX(160%)} 100%{transform: rotate(18deg) translateX(160%)} }

.mhpc-card:hover{
  transform: translateY(-5px);
  box-shadow: 0 18px 48px rgba(0,0,0,.26);
  filter: saturate(1.03);
}

.mhpc-thumb{ height:170px; background-size:cover; background-position:center; filter: contrast(1.02) saturate(1.02); }
.mhpc-thumb--empty{ background: linear-gradient(135deg, rgba(255,255,255,.12), rgba(0,0,0,0)); }

.mhpc-body{ padding:16px 16px 18px; position:relative; z-index:1; }

.mhpc-badge{
  display:inline-block;
  font-size:12px;
  padding:6px 10px;
  border-radius:999px;
  margin-bottom:10px;
  border:1px solid rgba(255,255,255,.28);
  background:rgba(255,255,255,.12);
  color:#fff;
}
.mhpc-badge.is-completed{ background: rgba(255,210,0,.16); border-color: rgba(255,210,0,.55); }
.mhpc-badge.is-ongoing{ background: rgba(255,255,255,.14); border-color: rgba(255,255,255,.32); }
.mhpc-badge.is-paused{ background: rgba(0,0,0,.14); border-color: rgba(0,0,0,.22); }

.mhpc-title{ font-size:18px; line-height:1.25; margin:0 0 14px; color:#fff; }

.mhpc-actions{ margin:0 0 14px; }
.mhpc-btn{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  padding:10px 12px;
  border-radius:12px;
  text-decoration:none;
  font-weight:900;
  background:rgba(255,255,255,.14);
  border:1px solid rgba(255,255,255,.36);
  color:#fff;
  transition: background .2s ease, transform .12s ease;
}
.mhpc-btn:hover{ background:rgba(255,255,255,.20); transform: translateY(-1px); border-color:#ffd200; color:#ffd200; }
.mhpc-btn--disabled{ opacity:.55; cursor:not-allowed; }

.mhpc-progress-top{
  display:flex;
  justify-content:space-between;
  font-size:12px;
  color:var(--mhpc-muted);
  margin-bottom:8px;
}
.mhpc-bar{
  width:100%;
  height:10px;
  background:rgba(255,255,255,.26);
  border-radius:999px;
  overflow:hidden;
}
.mhpc-bar-fill{
  height:100%;
  width:0%;
  border-radius:999px;
  background: linear-gradient(90deg, var(--mhpc-progress), rgba(255,255,255,.70));
  transition: width 1.15s cubic-bezier(.2,.9,.2,1);
  position:relative;
}
.mhpc-bar-fill::after{
  content:"";
  position:absolute;
  inset:0;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,.35), transparent);
  transform: translateX(-120%);
  animation: mhpcBarShine 1.6s ease-in-out infinite;
  opacity:.9;
}
@keyframes mhpcBarShine{ 0%{transform: translateX(-120%)} 65%{transform: translateX(120%)} 100%{transform: translateX(120%)} }

/* Mobile scroll-snap carousel */
@media (max-width:900px){
  .mhpc-wrap[data-layout="auto"] .mhpc-track,
  .mhpc-wrap[data-layout="scroll"] .mhpc-track{
    display:flex;
    gap:14px;
    overflow:auto;
    padding-bottom:8px;
    scroll-snap-type:x mandatory;
    -webkit-overflow-scrolling: touch;
  }
  .mhpc-card{min-width:82%; scroll-snap-align:start;}
}
@media (max-width:520px){
  .mhpc-card{min-width:92%}
  .mhpc-thumb{height:150px}
}

.mhpc-empty{opacity:.8; color:#fff;}
.mhpc-empty-filter{
  margin-top:12px;
  padding:12px 14px;
  border-radius:12px;
  border:1px solid rgba(255,255,255,.28);
  background:rgba(255,255,255,.10);
  color:rgba(255,255,255,.85);
}

/* ===== Lightbox Modal ===== */
.mhpc-modal{ position:fixed; inset:0; display:none; z-index:999999; }
.mhpc-modal.is-open{display:block}
.mhpc-modal-backdrop{
  position:absolute; inset:0;
  background: rgba(0,0,0,.62);
  backdrop-filter: blur(2px);
}
.mhpc-modal-panel{
  position:absolute;
  left:50%; top:50%;
  transform: translate(-50%, -50%) scale(.98);
  width: min(920px, calc(100% - 28px));
  max-height: calc(100% - 28px);
  overflow:auto;
  border-radius:18px;
  background: var(--mhpc-box);
  color:#fff;
  border:1px solid rgba(255,255,255,.28);
  box-shadow: 0 30px 80px rgba(0,0,0,.55);
  opacity:0;
  transition: opacity .18s ease, transform .18s ease;
}
.mhpc-modal.is-open .mhpc-modal-panel{ opacity:1; transform: translate(-50%, -50%) scale(1); }
.mhpc-modal-close{
  position:sticky;
  top:0;
  margin-left:auto;
  display:flex;
  align-items:center;
  justify-content:center;
  width:44px;height:44px;
  border-radius:12px;
  border:1px solid rgba(255,255,255,.32);
  background: rgba(255,255,255,.14);
  color:#fff;
  font-size:22px;
  cursor:pointer;
  float:right;
  margin:12px 12px 0 0;
}
.mhpc-modal-head{ padding:10px 18px 14px; border-bottom:1px solid rgba(255,255,255,.16); }
.mhpc-modal-badge{
  display:inline-block;
  font-size:12px;
  padding:6px 10px;
  border-radius:999px;
  margin-bottom:10px;
  border:1px solid rgba(255,255,255,.28);
  background:rgba(255,255,255,.12);
}
.mhpc-modal-title{ margin:0 0 10px; font-size:22px; line-height:1.25; color:#ffffff; font-weight:900; }
.mhpc-modal-meta{
  display:flex; gap:12px; justify-content:space-between; flex-wrap:wrap;
  color: rgba(255,255,255,.82);
  font-size:12px;
  margin-bottom:10px;
}
.mhpc-modal-bar{
  width:100%;
  height:10px;
  background:rgba(255,255,255,.26);
  border-radius:999px;
  overflow:hidden;
}
.mhpc-modal-bar-fill{
  height:100%;
  width:0%;
  border-radius:999px;
  background: linear-gradient(90deg, var(--mhpc-progress), rgba(255,255,255,.70));
  transition: width 1.05s cubic-bezier(.2,.9,.2,1);
  position:relative;
}
.mhpc-modal-body{ padding:16px 18px 18px; }
.mhpc-modal-body img.mhpc-modal-img{
  width:100%;
  height:auto;
  border-radius:14px;
  margin-bottom:14px;
  border:1px solid rgba(255,255,255,.16);
}
.mhpc-modal-rich{ color: rgba(255,255,255,.92); }
.mhpc-modal-rich p{margin:0 0 12px}
.mhpc-modal-rich a{color:#fff; text-decoration:underline}
.mhpc-modal-foot{ padding:0 18px 18px; }
.mhpc-modal-link{
  display:inline-flex; align-items:center; justify-content:center;
  padding:10px 12px; border-radius:12px; text-decoration:none; font-weight:900;
  background:rgba(255,255,255,.14); border:1px solid rgba(255,255,255,.36); color:#fff;
}

/* Mobile: bottom sheet feel */
@media (max-width:700px){
  .mhpc-modal-panel{
    left:50%;
    top:auto;
    bottom:12px;
    transform: translate(-50%, 0) scale(.98);
    width: calc(100% - 24px);
    max-height: calc(100% - 24px);
  }
  .mhpc-modal.is-open .mhpc-modal-panel{ transform: translate(-50%, 0) scale(1); }
}


/* ===== Gallery Slider (Modal Top) ===== */
.mhpc-gal{
  position:relative;
  padding:14px 18px 6px;
}
.mhpc-gal-viewport{
  overflow:hidden;
  border-radius:14px;
  border:1px solid rgba(255,255,255,.16);
  background: rgba(255,255,255,.08);
}
.mhpc-gal-track{
  display:flex;
  transition: transform .35s ease;
  will-change: transform;
}
.mhpc-gal-slide{min-width:100%}
.mhpc-gal-slide img{
  width:100%;
  height:auto;
  display:block;
}
.mhpc-gal-nav{
  position:absolute;
  top:50%;
  transform: translateY(-50%);
  width:44px; height:44px;
  border-radius:12px;
  border:1px solid rgba(255,255,255,.32);
  background: rgba(0,0,0,.18);
  color:#fff;
  font-size:28px;
  line-height:1;
  display:flex;
  align-items:center;
  justify-content:center;
  cursor:pointer;
  z-index:2;
}
.mhpc-gal-prev{left:22px}
.mhpc-gal-next{right:22px}
.mhpc-gal-nav:hover{
  border-color:#ffd200;
  color:#ffd200;
  background: rgba(0,0,0,.24);
}
.mhpc-gal-nav:disabled{opacity:.45; cursor:not-allowed}

.mhpc-gal-dots{
  display:flex;
  gap:8px;
  justify-content:center;
  padding:10px 0 0;
}
.mhpc-gal-dot{
  width:8px; height:8px;
  border-radius:999px;
  background: rgba(255,255,255,.35);
}
.mhpc-gal-dot.is-active{
  background: #ffd200;
  box-shadow: 0 0 0 4px rgba(255,210,0,.18);
}
@media (max-width:700px){
  .mhpc-gal{padding:12px 14px 4px}
  .mhpc-gal-prev{left:14px}
  .mhpc-gal-next{right:14px}
}

/* ===== Mobile: force vertical stack (no horizontal carousel) ===== */
@media (max-width: 900px){
  .mhpc-wrap[data-layout="auto"] .mhpc-track,
  .mhpc-wrap[data-layout="scroll"] .mhpc-track{
    display:grid !important;
    grid-template-columns: 1fr !important;
    overflow: visible !important;
    scroll-snap-type: none !important;
    -webkit-overflow-scrolling: auto !important;
    padding-bottom: 0 !important;
  }
  .mhpc-wrap[data-layout="auto"] .mhpc-card,
  .mhpc-wrap[data-layout="scroll"] .mhpc-card{
    min-width: 0 !important;
    scroll-snap-align: unset !important;
  }
}


/* ===== Top utility bar ===== */
.mhpc-topbar{display:flex;align-items:center;justify-content:space-between;gap:18px;margin:0 0 16px;padding:0}
.mhpc-topbar-left,.mhpc-topbar-right{display:flex;align-items:center;gap:12px;flex-wrap:wrap}
.mhpc-feedback-btn{display:inline-flex;align-items:center;justify-content:center;min-height:42px;padding:8px 16px;border-radius:10px;background:#f5f5f5;color:#0c8446;text-decoration:none;font-weight:900;box-shadow:0 10px 24px rgba(0,0,0,.12)}
.mhpc-feedback-btn:hover{color:#0c8446;transform:translateY(-1px)}
.mhpc-social{display:inline-flex;width:42px;height:42px;align-items:center;justify-content:center;text-decoration:none;border-radius:999px;transition:transform .15s ease, filter .2s ease}
.mhpc-social svg{width:42px;height:42px;display:block}
.mhpc-social:hover{transform:translateY(-2px) scale(1.04);filter:saturate(1.08)}
.mhpc-chips-wrap{display:flex;align-items:center;gap:14px;flex-wrap:wrap}
.mhpc-filter-label{color:#ffffff;font-size:14px;font-weight:800;letter-spacing:.04em;opacity:.95}
.mhpc-toolbar{align-items:center;justify-content:flex-start;gap:18px;margin:0 0 18px}
.mhpc-toolbar .mhpc-search{margin-left:auto}
.mhpc-thumb{position:relative;overflow:hidden}
.mhpc-thumb-completed{position:absolute;top:8px;left:50%;transform:translateX(-50%);display:inline-flex;align-items:center;justify-content:center;min-width:88px;height:24px;padding:0 10px;border-radius:999px;background:#ffd200;color:#0c8446;font-size:11px;font-weight:900;line-height:1;letter-spacing:.04em;box-shadow:0 8px 18px rgba(0,0,0,.18);z-index:2}
@media (max-width:900px){.mhpc-topbar{flex-direction:row;align-items:center;justify-content:space-between;gap:12px;margin-bottom:14px}.mhpc-topbar-left{flex:1 1 auto}.mhpc-topbar-right{flex:0 0 auto}.mhpc-feedback-btn{min-height:40px;padding:8px 14px;font-size:14px}.mhpc-social,.mhpc-social svg{width:38px;height:38px}.mhpc-toolbar{margin-bottom:16px}.mhpc-chips-wrap{row-gap:10px}}
@media (max-width:520px){.mhpc-topbar{gap:10px}.mhpc-feedback-btn{font-size:13px;padding:8px 12px}.mhpc-thumb-completed{top:7px;min-width:82px;height:22px;font-size:10px}}


/* ===== v1.7.1 fixes ===== */
.mhpc-thumb-completed{
  left:auto !important;
  right:10px !important;
  transform:none !important;
  top:10px !important;
}

.mhpc-topbar{
  margin:0 0 28px !important;
}

.mhpc-toolbar{
  margin:0 0 22px !important;
}

@media (max-width: 900px){
  .mhpc-topbar{
    margin-bottom:22px !important;
  }
  .mhpc-toolbar{
    margin-bottom:18px !important;
  }
}

@media (max-width: 520px){
  .mhpc-thumb-completed{
    right:8px !important;
    top:8px !important;
  }
}


/* ===== v1.9 pro motion + performance ===== */
.mhpc-card{
  transform-style: preserve-3d;
  backface-visibility: hidden;
}
.mhpc-card .mhpc-thumb,
.mhpc-card .mhpc-body{
  transition: transform .22s ease, filter .22s ease;
}
.mhpc-card.mhpc-parallax-active .mhpc-thumb{
  transform: translate3d(var(--mhpc-tilt-x,0px), var(--mhpc-tilt-y,0px), 0) scale(1.02);
}
.mhpc-card.mhpc-parallax-active .mhpc-body{
  transform: translate3d(calc(var(--mhpc-tilt-x,0px) * -0.35), calc(var(--mhpc-tilt-y,0px) * -0.35), 0);
}
.mhpc-card.mhpc-parallax-active{
  box-shadow: 0 22px 54px rgba(0,0,0,.28);
}

/* smoother number */
.mhpc-progress-val,
.mhpc-modal-progress-val{
  font-variant-numeric: tabular-nums;
  letter-spacing: .02em;
}

/* image perf */
.mhpc-thumb{
  background-repeat:no-repeat;
  image-rendering:auto;
}

/* Reduce heavy motion for users/devices that prefer it */
@media (prefers-reduced-motion: reduce){
  .mhpc-card,
  .mhpc-card .mhpc-thumb,
  .mhpc-card .mhpc-body,
  .mhpc-bar-fill,
  .mhpc-modal-bar-fill,
  .mhpc-card::after{
    transition:none !important;
    animation:none !important;
  }
}
