/* Scoped under .mhp-topbar by _build_topbar.py — do not edit by hand;
   to update, edit style-gallery-client.html and rerun the build. */
.mhp-topbar {
    --bg: #0d1117;
    --surface: #161b22;
    --surface-2: #1c2129;
    --border: #242b36;
    --text: #e6edf3;
    --muted: #8b949e;
    --accent: #58a6ff;
    --gold: #ffb454;
    --base1: #58a6ff;
    --base2: #a371f7;
    --base3: #ffb454;
    --base4: #3fb950;
    --uniq: #8b949e;
  }
  
  
  .mhp-topbar header {
    padding: 40px 48px 28px;
    border-bottom: 1px solid var(--border);
    background: linear-gradient(180deg, #141a22 0%, #0d1117 100%);
    position: sticky; top: 0; z-index: 10;
  }
  .mhp-topbar header h1 { margin: 0 0 6px; font-size: 26px; font-weight: 700; letter-spacing: -0.01em; }
  .mhp-topbar header p { margin: 0; color: var(--muted); font-size: 13px; }
  .mhp-topbar .legend {
    display: flex; gap: 16px; flex-wrap: wrap;
    margin-top: 14px;
    font-size: 12px; color: var(--muted);
  }
  .mhp-topbar .legend span { display: inline-flex; align-items: center; gap: 6px; }
  .mhp-topbar .legend .dot { width: 8px; height: 8px; border-radius: 2px; }
  .mhp-topbar .legend .dot.b1 { background: var(--base1); }
  .mhp-topbar .legend .dot.b2 { background: var(--base2); }
  .mhp-topbar .legend .dot.b3 { background: var(--base3); }
  .mhp-topbar .legend .dot.b4 { background: var(--base4); }
  .mhp-topbar .legend .dot.u { background: var(--uniq); }
  .mhp-topbar main { padding: 32px 48px 80px; }
  .mhp-topbar section { margin-bottom: 28px; }
  .mhp-topbar section h2 {
    margin: 0 0 6px; font-size: 18px; font-weight: 700; letter-spacing: -0.01em;
  }
  .mhp-topbar section h2 .count {
    display: inline-block; margin-left: 8px; padding: 2px 8px;
    font-size: 11px; font-weight: 600; color: var(--muted);
    background: var(--surface-2); border: 1px solid var(--border); border-radius: 999px;
  }
  .mhp-topbar section > p.hint { margin: 0 0 20px; color: var(--muted); font-size: 13px; }
  .mhp-topbar .grid {
    display: grid; grid-template-columns: repeat(auto-fill, minmax(460px, 1fr));
    gap: 24px;
  }
  .mhp-topbar .card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 12px;
    overflow: hidden;
    display: flex; flex-direction: column;
    transition: transform 0.15s ease, border-color 0.15s ease;
  }
  .mhp-topbar .card:hover { transform: translateY(-2px); border-color: #3a4452; }
  .mhp-topbar .card.b1 { border-top: 3px solid var(--base1); }
  .mhp-topbar .card.b2 { border-top: 3px solid var(--base2); }
  .mhp-topbar .card.b3 { border-top: 3px solid var(--base3); }
  .mhp-topbar .card.b4 { border-top: 3px solid var(--base4); }
  .mhp-topbar .card.u { border-top: 3px solid var(--uniq);  }
  .mhp-topbar .card .head {
    display: flex; align-items: baseline; justify-content: flex-start;
    padding: 12px 16px 10px;
    background: var(--surface-2);
    border-bottom: 1px solid var(--border);
  
    min-height: 76px;
  }


  .mhp-topbar .page-header {
    padding: 24px 48px 22px;
    border-bottom: 1px solid var(--border);
    background: linear-gradient(180deg, #161d28 0%, #0d1117 100%);
    position: sticky;
    top: 0;
    z-index: 20;
    backdrop-filter: blur(8px);
  }
  .mhp-topbar .header-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 14px;
  }
  .mhp-topbar .brand {
    color: #fff;
    text-decoration: none;
    font-size: 14px;
    font-weight: 700;
    letter-spacing: .08em;
    text-transform: uppercase;
  }


  .mhp-topbar .mega-toggle {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    border: 1px solid #83d6c9;
    background: linear-gradient(130deg, #1f4fd8 0%, #0e9f9d 52%, #22d3ee 100%);
    background-size: 160% 160%;
    color: #f8fdff;
    font-size: 13px;
    font-weight: 800;
    letter-spacing: .04em;
    text-transform: uppercase;
    padding: 15px 24px;
    border-radius: 14px;
    cursor: pointer;
    overflow: hidden;
    box-shadow: 0 10px 30px rgba(14, 159, 157, .28), 0 3px 10px rgba(0, 0, 0, .26);
    transition: transform .2s ease, border-color .2s ease, box-shadow .25s ease;
    animation: megaToggleFloat 3.6s ease-in-out infinite;
  }
  .mhp-topbar .mega-toggle::before {
    content: "";
    position: absolute;
    top: 0;
    left: -140%;
    width: 120%;
    height: 100%;
    background: linear-gradient(100deg, rgba(255, 255, 255, 0) 0%, rgba(255, 255, 255, .24) 50%, rgba(255, 255, 255, 0) 100%);
    transform: skewX(-18deg);
    transition: left .75s ease;
    pointer-events: none;
  }
  .mhp-topbar .mega-toggle:hover::before, .mhp-topbar .mega-toggle:focus-visible::before {
    left: 130%;
  }
  .mhp-topbar .mega-toggle:hover, .mhp-topbar .mega-toggle:focus-visible {
    outline: none;
    border-color: #d9fff8;
    transform: translateY(-2px) scale(1.02);
    box-shadow: 0 14px 36px rgba(14, 159, 157, .38), 0 6px 16px rgba(0, 0, 0, .3);
  }
  .mhp-topbar .mega-toggle[aria-expanded="true"] {
    background: linear-gradient(130deg, #1144c1 0%, #11857f 50%, #0ea5b7 100%);
    border-color: #e6fffb;
    animation: none;
  }
  .mhp-topbar .mega-toggle__icon {
    width: 24px;
    height: 24px;
    border-radius: 999px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, .2);
    border: 1px solid rgba(255, 255, 255, .35);
    backdrop-filter: blur(2px);
    transition: transform .25s ease, background-color .2s ease;
    flex: 0 0 24px;
  }
  .mhp-topbar .mega-toggle__icon svg {
    width: 13px;
    height: 13px;
    fill: currentColor;
  }
  .mhp-topbar .mega-toggle__label {
    position: relative;
    z-index: 1;
  }
  .mhp-topbar .mega-toggle:hover .mega-toggle__icon, .mhp-topbar .mega-toggle:focus-visible .mega-toggle__icon {
    transform: rotate(8deg) scale(1.08);
    background: rgba(255, 255, 255, .28);
  }
  .mhp-topbar .mega-toggle[aria-expanded="true"] .mega-toggle__icon {
    transform: rotate(45deg) scale(1.1);
    background: rgba(255, 255, 255, .34);
  }
  /* [2026-04-22] Keyframe selectors (0%/50%/100%/from/to) must NOT be prefixed
     with .mhp-topbar — that breaks the animation silently. Fixed below. */
  @keyframes megaToggleFloat {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-2px); }
  }
  .mhp-topbar .mega-menu-panel {
    border-top: 1px solid var(--border);
    background: radial-gradient(80% 120% at 10% 0%, #1a2230 0%, #0d1117 65%);
    animation: panelIn .24s ease;
  }
  @keyframes panelIn {
    from { opacity: 0; transform: translateY(-6px); }
    to   { opacity: 1; transform: translateY(0); }
  }
  .mhp-topbar .mega-menu-panel[hidden] { display: none; }


  .mhp-topbar .page-header {
    padding: 14px 48px;
    border-bottom: 1px solid #2a3442;
    background: linear-gradient(180deg, #111925 0%, #0d1117 100%);
    position: sticky;
    top: 0;
    z-index: 20;
    backdrop-filter: blur(8px);
  }
  .mhp-topbar .header-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    margin-bottom: 0;
  }
  .mhp-topbar .brand {
    color: #f0f6fc;
    text-decoration: none;
    font-size: 13px;
    font-weight: 700;
    letter-spacing: .11em;
    text-transform: uppercase;
    opacity: .95;
  }

  .mhp-topbar .grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(360px, 1fr));
    gap: 20px;
  }
  .mhp-topbar .card {
    background: linear-gradient(180deg, #171f2b 0%, #121923 100%);
    border: 1px solid #2a3442;
    border-radius: 14px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    box-shadow: 0 12px 28px rgba(0, 0, 0, .22);
    transition: transform .2s ease, border-color .2s ease, box-shadow .25s ease;
  }
  .mhp-topbar .card:hover, .mhp-topbar .card:focus-within {
    transform: translateY(-3px);
    border-color: #4b6380;
    box-shadow: 0 14px 30px rgba(0, 0, 0, .34);
  }
  .mhp-topbar .card.b1 { border-top: 3px solid var(--base1); }
  .mhp-topbar .card.b2 { border-top: 3px solid var(--base2); }
  .mhp-topbar .card.b3 { border-top: 3px solid var(--base3); }
  .mhp-topbar .card.b4 { border-top: 3px solid var(--base4); }
  .mhp-topbar .card.u { border-top: 3px solid var(--uniq); }

  .mhp-topbar .card .head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 10px;
    padding: 14px 14px 12px;
    background: rgba(255, 255, 255, .02);
    border-bottom: 1px solid #2a3442;
  }
  .mhp-topbar .card .head > div {
    min-width: 0;
  }
  .mhp-topbar .card .num {
    font-size: 10px;
    font-weight: 700;
    color: #9aabc2;
    letter-spacing: 0.09em;
    text-transform: uppercase;
  }
  .mhp-topbar .card .title {
    font-size: 15px;
    font-weight: 700;
    color: #f3f8ff;
    line-height: 1.25;
    margin-top: 6px;
    text-transform: none;
  }
  .mhp-topbar .card .subtitle {
    font-size: 12px;
    color: #9fb0c5;
    line-height: 1.42;
    margin-top: 4px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
  }

  .mhp-topbar .card .imgwrap {
    background: #0b1018;
    aspect-ratio: 16 / 10;
    overflow: hidden;
    position: relative;
  }
  .mhp-topbar .card .imgwrap::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, rgba(11, 16, 24, 0) 45%, rgba(11, 16, 24, .28) 100%);
    opacity: 0;
    transition: opacity .22s ease;
    pointer-events: none;
  }
  .mhp-topbar .card:hover .imgwrap::after, .mhp-topbar .card:focus-within .imgwrap::after {
    opacity: 1;
  }
  .mhp-topbar .card img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform .35s ease;
  }
  .mhp-topbar .card:hover img, .mhp-topbar .card:focus-within img {
    transform: scale(1.03);
  }
  .mhp-topbar .card .meta code {
    font-family: "SF Mono", Consolas, "Courier New", monospace;
    font-size: 11px;
    color: #d3dff0;
    background: rgba(255, 255, 255, .04);
    border: 1px solid rgba(255, 255, 255, .08);
    border-radius: 6px;
    padding: 3px 6px;
    white-space: nowrap;
  }


  /* Final controls + panel tuning */
  .mhp-topbar .mega-toggle {
    font-size: 11px;
    padding: 10px 14px;
    border-radius: 11px;
    gap: 8px;
    min-height: 40px;
    letter-spacing: .03em;
    animation: megaToggleFloat 5s ease-in-out infinite;
  }
  .mhp-topbar .mega-toggle:hover, .mhp-topbar .mega-toggle:focus-visible {
    transform: translateY(-1px) scale(1.01);
  }
  .mhp-topbar .mega-toggle__icon {
    width: 20px;
    height: 20px;
    flex: 0 0 20px;
  }
  .mhp-topbar .mega-toggle__icon svg {
    width: 11px;
    height: 11px;
  }
  .mhp-topbar .mega-toggle__label {
    white-space: nowrap;
  }

  body.mega-panel-open {
    overflow: hidden;
  }
  .mhp-topbar .page-header {
    z-index: 50;
    overflow: visible;
  }
  .mhp-topbar .mega-panel-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(6, 11, 18, 0.68);
    backdrop-filter: blur(2px);
    z-index: 45;
    animation: megaBackdropIn .18s ease;
  }
  .mhp-topbar .mega-panel-backdrop[hidden] {
    display: none;
  }

  .mhp-topbar .mega-menu-panel {
    position: fixed;
    left: 50%;
    top: var(--mega-panel-top, 82px);
    transform: translateX(-50%);
    width: min(99vw, 1920px);
    border: 1px solid #33485e;
    border-radius: 0;
    background: radial-gradient(120% 150% at 50% -15%, #1d2d40 0%, #111925 46%, #0b1016 100%);
    box-shadow: 0 22px 64px rgba(0, 0, 0, 0.55);
    z-index: 46;
    animation: megaPanelDrop .24s cubic-bezier(.2, .72, .2, 1);
    overflow: hidden;
  }
  .mhp-topbar .mega-menu-panel[hidden] {
    display: none;
  }
  .mhp-topbar .mega-menu-panel #templateGallery {
    max-height: calc(100dvh - var(--mega-panel-top, 82px) - 10px);
    overflow: auto;
    padding: 16px 18px 22px;
    overscroll-behavior: contain;
    scrollbar-gutter: stable;
    scrollbar-width: thin;
    scrollbar-color: #4fc9c0 #0d1521;
  }
  .mhp-topbar .mega-menu-panel #templateGallery:focus {
    outline: none;
  }
  .mhp-topbar .mega-menu-panel #templateGallery::-webkit-scrollbar {
    width: 11px;
    height: 11px;
  }
  .mhp-topbar .mega-menu-panel #templateGallery::-webkit-scrollbar-track {
    background: linear-gradient(180deg, #0c131d 0%, #101a27 100%);
    border-left: 1px solid rgba(120, 156, 195, 0.22);
  }
  .mhp-topbar .mega-menu-panel #templateGallery::-webkit-scrollbar-thumb {
    background: linear-gradient(180deg, #57d2c8 0%, #2f7cbc 100%);
    border: 2px solid #0f1925;
    border-radius: 999px;
    min-height: 36px;
  }
  .mhp-topbar .mega-menu-panel #templateGallery::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(180deg, #6be7dc 0%, #4396d8 100%);
  }
  .mhp-topbar .gallery-grid {
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 16px;
  }

  @keyframes megaPanelDrop {
    from {
      opacity: 0;
      transform: translate(-50%, -12px) scale(0.995);
    }
    to {
      opacity: 1;
      transform: translate(-50%, 0) scale(1);
    }
  }
  @keyframes megaBackdropIn {
    from { opacity: 0; }
    to   { opacity: 1; }
  }

  @media (max-width: 1024px) {
    .mhp-topbar .mega-menu-panel {
      width: calc(100vw - 8px);
      border-radius: 0;
      top: var(--mega-panel-top, 76px);
    }
    .mhp-topbar .mega-menu-panel #templateGallery {
      max-height: calc(100dvh - var(--mega-panel-top, 76px) - 8px);
      padding: 12px 10px 16px;
    }
    .mhp-topbar .gallery-grid {
      grid-template-columns: repeat(4, minmax(0, 1fr));
      gap: 12px;
    }
  }

  @media (max-width: 720px) {
    .mhp-topbar .page-header {
      padding: 10px 12px;
    }
    .mhp-topbar .header-top {
      flex-direction: row;
      align-items: center;
      justify-content: space-between;
      flex-wrap: wrap;
      gap: 8px;
    }
    .mhp-topbar .brand {
      font-size: 11px;
      letter-spacing: .08em;
    }
    .mhp-topbar .mega-toggle {
      width: auto;
      min-height: 34px;
      padding: 8px 10px;
      gap: 6px;
      border-radius: 10px;
      font-size: 10px;
    }
    .mhp-topbar .mega-toggle__icon {
      width: 16px;
      height: 16px;
      flex-basis: 16px;
    }
    .mhp-topbar .mega-toggle__icon svg {
      width: 9px;
      height: 9px;
    }
    .mhp-topbar .mega-menu-panel {
      width: calc(100vw - 4px);
      border-radius: 0;
      top: var(--mega-panel-top, 64px);
    }
    .mhp-topbar .mega-menu-panel #templateGallery {
      max-height: calc(100dvh - var(--mega-panel-top, 64px) - 6px);
      padding: 8px 8px 12px;
    }
    .mhp-topbar .gallery-grid {
      grid-template-columns: repeat(2, minmax(0, 1fr));
      gap: 8px;
    }
    .mhp-topbar .card .head {
      min-height: 62px;
      padding: 10px 10px 8px;
    }
    .mhp-topbar .card .title {
      font-size: 13px;
      margin-top: 0;
    }
    .mhp-topbar .card .subtitle {
      font-size: 11px;
      -webkit-line-clamp: 1;
    }
  }

  @media (max-width: 460px) {
    .mhp-topbar .mega-toggle {
      padding: 7px 9px;
      font-size: 9px;
      gap: 5px;
    }
    .mhp-topbar .mega-menu-panel #templateGallery {
      padding: 8px 6px 10px;
    }
    .mhp-topbar .gallery-grid {
      grid-template-columns: 1fr;
      gap: 8px;
    }
  }
/* [2026-04-22] "View Demo" CTA under each card image — styled to match sc-btn--primary
   from the SMART Website card (indigo→violet gradient, 12px radius, 700/13px Inter, no uppercase). */
.mhp-topbar .card-cta-wrap {
  padding: 12px 14px 14px;
  background: rgba(255, 255, 255, 0.02);
  border-top: 1px solid #2a3442;
}
.mhp-topbar .card-cta {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  padding: 12px 15px;
  border: 0;
  border-radius: 12px;
  background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
  color: #fff;
  font-family: Inter, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: .2px;
  text-transform: none;
  text-decoration: none;
  cursor: pointer;
  box-shadow: 0 6px 20px rgba(99, 102, 241, .4);
  transition: transform .18s ease, box-shadow .22s ease, filter .2s ease;
}
.mhp-topbar .card-cta:hover,
.mhp-topbar .card-cta:focus-visible {
  outline: none;
  transform: translateY(-1px);
  filter: brightness(1.08);
  box-shadow: 0 10px 26px rgba(99, 102, 241, .5);
}
.mhp-topbar .card-cta:active {
  transform: translateY(0);
  filter: brightness(0.98);
}
.mhp-topbar .card-cta__arrow {
  display: inline-flex;
  align-items: center;
  transition: transform .18s ease;
}
.mhp-topbar .card-cta:hover .card-cta__arrow,
.mhp-topbar .card-cta:focus-visible .card-cta__arrow {
  transform: translateX(3px);
}

/* [2026-04-22] Re-style "View All Templates" trigger to match sc-btn--primary.
   Overrides the earlier teal/cyan + uppercase + shimmer block (kept for animation
   of float, icon rotation, and aria-expanded state). */
.mhp-topbar .mega-toggle {
  border: 0 !important;
  background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%) !important;
  background-size: auto !important;
  color: #fff !important;
  font-family: Inter, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif !important;
  font-size: 13px !important;
  font-weight: 700 !important;
  letter-spacing: .2px !important;
  text-transform: none !important;
  padding: 12px 16px !important;
  border-radius: 12px !important;
  box-shadow: 0 6px 20px rgba(99, 102, 241, .4) !important;
  min-height: 40px !important;
  gap: 8px !important;
  animation: megaToggleFloat 5s ease-in-out infinite;
}
.mhp-topbar .mega-toggle::before {
  display: none !important;   /* drop the shimmer sweep — sc-btn is flat */
}
.mhp-topbar .mega-toggle:hover,
.mhp-topbar .mega-toggle:focus-visible {
  outline: none !important;
  border: 0 !important;
  transform: translateY(-1px) scale(1.01) !important;
  filter: brightness(1.08);
  box-shadow: 0 10px 26px rgba(99, 102, 241, .5) !important;
}
.mhp-topbar .mega-toggle[aria-expanded="true"] {
  background: linear-gradient(135deg, #4f46e5 0%, #7c3aed 100%) !important;
  border: 0 !important;
  animation: none;
  filter: none;
}
.mhp-topbar .mega-toggle__icon {
  background: rgba(255, 255, 255, .18);
  border: 1px solid rgba(255, 255, 255, .28);
}

/* [2026-04-22] Adopt the sc-card energy & palette across the topbar + gallery.
   Source of truth: SMART Website card on template pages (.sc-card, .sc-btn, .sc-eyebrow, .sc-badge, .sc-stat).
   Indigo → violet → pink gradient language; #16161e surfaces; Inter typography;
   white-alpha borders; uppercase micro-labels; ambient violet glow. */
.mhp-topbar {
  --bg: #0b0b12;
  --surface: #16161e;                       /* sc-card body */
  --surface-2: rgba(255, 255, 255, 0.04);   /* sc-stat box */
  --border: rgba(255, 255, 255, 0.07);      /* sc-stat hairline */
  --text: #e9e9f2;
  --muted: rgba(255, 255, 255, 0.55);
  --sc-indigo: #6366f1;
  --sc-violet: #8b5cf6;
  --sc-fuchsia: #a855f7;
  --sc-pink: #ec4899;
  --sc-violet-text: #a78bfa;
  font-family: Inter, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

/* Topbar header — indigo-tinted dark (shadow removed per user request) */
.mhp-topbar .page-header {
  background: radial-gradient(120% 160% at 8% -10%, #1b1b28 0%, #0d0d15 70%) !important;
  border-bottom: 1px solid rgba(255, 255, 255, 0.07) !important;
  box-shadow: none !important;
}
/* [2026-04-22] Rainbow shimmer relocated from header-bottom to the mega-toggle icon circle. */
@keyframes mhpBarShimmer {
  0%   { background-position: 0% 50%; }
  100% { background-position: 200% 50%; }
}
.mhp-topbar .mega-toggle .mega-toggle__icon {
  background: linear-gradient(90deg, #6366f1, #a855f7, #ec4899, #f97316, #eab308) !important;
  background-size: 200% 100% !important;
  border: 1px solid rgba(255, 255, 255, 0.45) !important;
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.06) inset, 0 2px 6px rgba(99, 102, 241, 0.4);
  animation: mhpBarShimmer 7s linear infinite;
}
.mhp-topbar .mega-toggle .mega-toggle__icon svg {
  filter: drop-shadow(0 1px 1px rgba(0, 0, 0, 0.45));
}
.mhp-topbar .brand {
  color: rgba(255, 255, 255, 0.88);
  font-family: Inter, system-ui, sans-serif;
  font-weight: 700;
  letter-spacing: .14em;
  opacity: 1;
}

/* Mega panel + backdrop — match sc-card ambient */
.mhp-topbar .mega-panel-backdrop {
  background: rgba(8, 8, 14, 0.72);
}
.mhp-topbar .mega-menu-panel {
  background: radial-gradient(130% 140% at 50% -12%, #1b1b28 0%, #0c0c14 60%) !important;
  border: 1px solid rgba(255, 255, 255, 0.08) !important;
  box-shadow: 0 28px 70px rgba(0, 0, 0, 0.65), 0 8px 24px rgba(0, 0, 0, 0.4);
}

/* Gallery cards — sc-card surface + ambient ring, rainbow accent on top edge */
.mhp-topbar .card {
  position: relative;
  background: #16161e !important;
  border: 0 !important;
  border-top: 0 !important;
  border-radius: 16px;
  overflow: hidden;
  box-shadow:
    inset 0 0 0 1px rgba(255, 255, 255, 0.07),
    0 10px 30px rgba(0, 0, 0, 0.35);
  transition: transform .22s ease, box-shadow .25s ease;
}
.mhp-topbar .card::before {
  content: "";
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 2px;
  background: linear-gradient(90deg, #6366f1, #a855f7, #ec4899);
  opacity: .85;
  z-index: 2;
  pointer-events: none;
}
.mhp-topbar .card:hover,
.mhp-topbar .card:focus-within {
  transform: translateY(-3px);
  box-shadow:
    inset 0 0 0 1px rgba(139, 92, 246, 0.35),
    0 16px 40px rgba(99, 102, 241, 0.22),
    0 6px 18px rgba(0, 0, 0, 0.4);
}
.mhp-topbar .card .head {
  background: transparent !important;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05) !important;
}
.mhp-topbar .card .num {
  color: rgba(255, 255, 255, 0.3);
  font-family: Inter, sans-serif;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 1.5px;
  text-transform: uppercase;
}
.mhp-topbar .card .title {
  color: #e9e9f2;
  font-family: Inter, sans-serif;
  font-size: 15px;
  font-weight: 700;
  letter-spacing: -.005em;
}
.mhp-topbar .card .subtitle {
  color: rgba(255, 255, 255, 0.5);
  font-size: 12px;
}

/* CTA container border-top matches new hairline */
.mhp-topbar .card-cta-wrap {
  background: rgba(255, 255, 255, 0.02);
  border-top: 1px solid rgba(255, 255, 255, 0.06);
}

/* Scrollbar — indigo → violet to match energy */
.mhp-topbar .mega-menu-panel #templateGallery::-webkit-scrollbar-track {
  background: linear-gradient(180deg, #0c0c14 0%, #13131c 100%);
  border-left: 1px solid rgba(139, 92, 246, 0.18);
}
.mhp-topbar .mega-menu-panel #templateGallery::-webkit-scrollbar-thumb {
  background: linear-gradient(180deg, #6366f1 0%, #8b5cf6 100%);
  border: 2px solid #0f0f17;
}
.mhp-topbar .mega-menu-panel #templateGallery::-webkit-scrollbar-thumb:hover {
  background: linear-gradient(180deg, #7c7fff 0%, #a78bfa 100%);
}
.mhp-topbar .mega-menu-panel #templateGallery {
  scrollbar-color: #8b5cf6 #0f0f17;
}

/* [2026-04-22] Panel UX uplift — search, category chips, per-card chip, whole-card click. */

/* [2026-04-22] Header "Buy This Template" button — same structural style as View All Templates
   (icon circle + label), colored green to distinguish as a commerce CTA. */
.mhp-topbar .header-actions {
  display: inline-flex;
  align-items: center;
  gap: 10px;
}
.mhp-topbar .mhp-buy-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  border: 0;
  border-radius: 11px;
  background: linear-gradient(135deg, #10b981 0%, #39d98a 100%);
  color: #fff;
  font-family: Inter, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .03em;
  text-transform: uppercase;
  text-decoration: none;
  cursor: pointer;
  box-shadow: 0 6px 20px rgba(16, 185, 129, 0.4);
  transition: transform .18s ease, box-shadow .22s ease, filter .2s ease;
  min-height: 40px;
  white-space: nowrap;
}
.mhp-topbar .mhp-buy-btn:hover,
.mhp-topbar .mhp-buy-btn:focus-visible {
  outline: none;
  transform: translateY(-1px) scale(1.01);
  filter: brightness(1.08);
  box-shadow: 0 10px 26px rgba(16, 185, 129, 0.55);
}
.mhp-topbar .mhp-buy-btn:active {
  transform: translateY(0);
  filter: brightness(0.98);
}
.mhp-topbar .mhp-buy-btn__icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  flex: 0 0 20px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.2);
  border: 1px solid rgba(255, 255, 255, 0.35);
  transition: transform .25s ease, background-color .2s ease;
}
.mhp-topbar .mhp-buy-btn__icon svg {
  width: 11px;
  height: 11px;
  color: currentColor;
}
.mhp-topbar .mhp-buy-btn:hover .mhp-buy-btn__icon,
.mhp-topbar .mhp-buy-btn:focus-visible .mhp-buy-btn__icon {
  transform: rotate(-8deg) scale(1.08);
  background: rgba(255, 255, 255, 0.28);
}

/* --- Sticky filter bar at top of the gallery --- */
.mhp-topbar #templateGallery .mhp-filter-bar {
  position: sticky;
  top: -16px;                                 /* compensate for gallery padding-top */
  z-index: 5;
  margin: -16px -18px 14px;                   /* bleed to gallery edges */
  padding: 14px 18px 12px;
  background:
    linear-gradient(180deg, rgba(16, 16, 26, 0.96) 0%, rgba(12, 12, 20, 0.92) 100%);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.07);
}

/* [2026-04-22] Search UI commented out — user opted for tabs only.
.mhp-topbar .mhp-filter-search { position: relative; display: flex; align-items: center; margin-bottom: 10px; }
.mhp-topbar .mhp-search-icon   { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: rgba(255,255,255,.45); pointer-events: none; }
.mhp-topbar .mhp-search-input  { flex: 1 1 auto; width: 100%; padding: 11px 38px; border-radius: 10px; border: 1px solid rgba(255,255,255,.08); background: rgba(255,255,255,.04); color: #e9e9f2; font: 500 13px Inter, sans-serif; outline: none; }
.mhp-topbar .mhp-search-clear  { position: absolute; right: 8px; top: 50%; transform: translateY(-50%); width: 24px; height: 24px; border-radius: 999px; border: 0; background: rgba(255,255,255,.08); color: #e9e9f2; }
*/

/* --- Category chip row --- */
.mhp-topbar .mhp-chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

/* [2026-04-22] Chips: slightly larger. Colors reverted to single indigo→violet per user request;
   data-hue attributes still emitted by JS but no longer drive visual differentiation. */
.mhp-topbar .mhp-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  border-radius: 999px;
  border: 1px solid rgba(99, 102, 241, 0.4);
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.14), rgba(139, 92, 246, 0.14));
  color: #c7c8ff;
  font: 700 12px/1 Inter, system-ui, sans-serif;
  letter-spacing: .3px;
  cursor: pointer;
  transition: background-color .18s ease, color .18s ease, transform .14s ease, box-shadow .2s ease, border-color .18s ease;
}
.mhp-topbar .mhp-chip:hover {
  transform: translateY(-1px);
  border-color: rgba(139, 92, 246, 0.75);
}
.mhp-topbar .mhp-chip.is-active {
  background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
  border-color: transparent;
  color: #fff;
  box-shadow: 0 4px 14px rgba(99, 102, 241, 0.45);
}
.mhp-topbar .mhp-chip__count {
  padding: 2px 8px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.1);
  font-size: 11px;
  font-weight: 700;
}
.mhp-topbar .mhp-chip.is-active .mhp-chip__count {
  background: rgba(255, 255, 255, 0.24);
  color: #fff;
}

/* [2026-04-22] "Available in" format row — footer placement; icons in equal 5-col grid,
   centered per slot; balanced spacing + dashed separator above View Demo. */
.mhp-topbar .card .card-formats {
  width: 100%;
  padding: 4px 2px 14px;
  margin-bottom: 12px;
  border-bottom: 1px dashed rgba(255, 255, 255, 0.09);
}
.mhp-topbar .card .card-formats__label {
  display: block;
  margin: 0 0 10px 2px;
  font: 700 10px/1 Inter, system-ui, sans-serif;
  letter-spacing: 1.4px;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.48);
}
.mhp-topbar .card .card-formats__icons {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  align-items: center;
  justify-items: center;
  width: 100%;
  gap: 8px;
}
.mhp-topbar .card .card-formats__icons i {
  font-size: 22px;
  line-height: 1;
  opacity: 0.9;
  cursor: default;
  transition: opacity .15s ease, transform .15s ease, filter .15s ease;
}
.mhp-topbar .card .card-formats__icons i:hover {
  opacity: 1;
  transform: scale(1.15);
  filter: drop-shadow(0 2px 6px rgba(0, 0, 0, 0.35));
}

/* --- Per-card category chip (sits above the title) — single indigo→violet to match tabs --- */
.mhp-topbar .card .mhp-cat-chip {
  display: inline-block;
  padding: 3px 9px;
  margin-bottom: 6px;
  border-radius: 999px;
  border: 0.8px solid rgba(99, 102, 241, 0.4);
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.18), rgba(139, 92, 246, 0.18));
  color: #a78bfa;
  font: 700 10px/1.4 Inter, system-ui, sans-serif;
  letter-spacing: .6px;
  text-transform: uppercase;
  vertical-align: middle;
}

/* --- Whole-card click affordance --- */
.mhp-topbar .card { cursor: pointer; }
.mhp-topbar .card:focus-visible {
  outline: 2px solid rgba(139, 92, 246, 0.7);
  outline-offset: 3px;
}

/* --- Empty state --- */
.mhp-topbar .mhp-empty {
  margin: 16px 0 -4px;
  padding: 10px 14px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.07);
  color: rgba(255, 255, 255, 0.6);
  font: 500 12px Inter, system-ui, sans-serif;
  text-align: center;
}

/* [2026-04-22] Brand logo — matches the mh-nav__logo on metropolitanhost.com
   (Poppins 800 19px, white "Metropolitan" + green "Host"). Links to /buy. */
.mhp-topbar .brand {
  display: inline-flex !important;
  align-items: center !important;
  text-decoration: none !important;
  line-height: 1 !important;
  padding: 4px 2px !important;
  border-radius: 6px !important;
  opacity: 1 !important;
  text-transform: none !important;
  letter-spacing: normal !important;
  transition: opacity .18s ease, transform .18s ease !important;
}
.mhp-topbar .brand:hover,
.mhp-topbar .brand:focus-visible {
  outline: none !important;
  transform: translateY(-1px) !important;
  opacity: 0.92 !important;
}
.mhp-topbar .brand .brand-text {
  font-family: "Poppins", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif !important;
  font-weight: 800 !important;
  font-size: 19px !important;
  line-height: 19px !important;
  letter-spacing: -0.5px !important;
  color: #ffffff !important;
  font-style: normal !important;
  white-space: nowrap !important;
}
.mhp-topbar .brand .brand-text em {
  font-style: normal !important;
  color: #39d98a !important;
  font-weight: 800 !important;
}

/* [2026-04-22] Unified header button system (overrides the earlier scattered rules).
   Same structure, same hover/active behavior, same icon circle; only the color varies.
   • .mega-toggle        → indigo → violet  (browse)
   • .mhp-buy-btn        → emerald → lime   (commerce) */

.mhp-topbar .mega-toggle,
.mhp-topbar .mhp-buy-btn {
  --btn-c1: 99, 102, 241;
  --btn-c2: 139, 92, 246;
  position: relative !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 10px !important;
  padding: 11px 18px !important;
  /* [2026-04-22] box-sizing:border-box forced on both. <button> defaults to
     border-box, <a> defaults to content-box — without this the Buy button
     rendered 66px tall (44 min-height + 22 padding) while View All was 45.6px. */
  box-sizing: border-box !important;
  min-height: 44px !important;
  border: 0 !important;
  border-radius: 12px !important;
  background: linear-gradient(135deg, rgb(var(--btn-c1)) 0%, rgb(var(--btn-c2)) 100%) !important;
  color: #fff !important;
  font-family: Inter, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif !important;
  font-size: 11.5px !important;
  font-weight: 700 !important;
  letter-spacing: 0.08em !important;
  text-transform: uppercase !important;
  text-decoration: none !important;
  white-space: nowrap !important;
  cursor: pointer !important;
  overflow: hidden !important;
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.12) inset,
    0 0 0 1px rgba(var(--btn-c1), 0.35),
    0 8px 22px rgba(var(--btn-c1), 0.42),
    0 2px 4px rgba(0, 0, 0, 0.2) !important;
  transition: transform .22s cubic-bezier(.2,.72,.2,1),
              box-shadow .28s ease,
              filter .2s ease !important;
  animation: none !important;
}

/* Sheen sweep on hover (shared) */
.mhp-topbar .mega-toggle::before,
.mhp-topbar .mhp-buy-btn::before {
  content: "" !important;
  position: absolute !important;
  top: 0 !important;
  left: -130% !important;
  width: 90% !important;
  height: 100% !important;
  background: linear-gradient(100deg,
    rgba(255, 255, 255, 0) 0%,
    rgba(255, 255, 255, 0.26) 50%,
    rgba(255, 255, 255, 0) 100%) !important;
  transform: skewX(-18deg) !important;
  transition: left .75s ease !important;
  pointer-events: none !important;
  display: block !important;
}
.mhp-topbar .mega-toggle:hover::before,
.mhp-topbar .mega-toggle:focus-visible::before,
.mhp-topbar .mhp-buy-btn:hover::before,
.mhp-topbar .mhp-buy-btn:focus-visible::before {
  left: 130% !important;
}

/* Hover / focus / active (shared) */
.mhp-topbar .mega-toggle:hover,
.mhp-topbar .mega-toggle:focus-visible,
.mhp-topbar .mhp-buy-btn:hover,
.mhp-topbar .mhp-buy-btn:focus-visible {
  outline: none !important;
  transform: translateY(-1px) !important;
  filter: brightness(1.07);
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.16) inset,
    0 0 0 1px rgba(var(--btn-c1), 0.5),
    0 12px 30px rgba(var(--btn-c1), 0.55),
    0 4px 10px rgba(0, 0, 0, 0.28) !important;
}
.mhp-topbar .mega-toggle:active,
.mhp-topbar .mhp-buy-btn:active {
  transform: translateY(0) !important;
  filter: brightness(0.98);
}

/* Icon circle (shared) */
.mhp-topbar .mega-toggle .mega-toggle__icon,
.mhp-topbar .mhp-buy-btn .mhp-buy-btn__icon {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  width: 22px !important;
  height: 22px !important;
  flex: 0 0 22px !important;
  border-radius: 999px !important;
  background: rgba(255, 255, 255, 0.2) !important;
  border: 1px solid rgba(255, 255, 255, 0.36) !important;
  animation: none !important;
  transition: transform .28s cubic-bezier(.2,.72,.2,1), background-color .2s ease !important;
}
.mhp-topbar .mega-toggle .mega-toggle__icon svg,
.mhp-topbar .mhp-buy-btn .mhp-buy-btn__icon svg {
  width: 12px !important;
  height: 12px !important;
  fill: currentColor;
  color: #fff !important;
}
.mhp-topbar .mega-toggle:hover .mega-toggle__icon,
.mhp-topbar .mega-toggle:focus-visible .mega-toggle__icon,
.mhp-topbar .mhp-buy-btn:hover .mhp-buy-btn__icon,
.mhp-topbar .mhp-buy-btn:focus-visible .mhp-buy-btn__icon {
  transform: rotate(-8deg) scale(1.12) !important;
  background: rgba(255, 255, 255, 0.3) !important;
}

/* Expanded state for View All — slightly deeper violet, no extra movement */
.mhp-topbar .mega-toggle[aria-expanded="true"] {
  --btn-c1: 79, 70, 229;
  --btn-c2: 124, 58, 237;
}
.mhp-topbar .mega-toggle[aria-expanded="true"] .mega-toggle__icon {
  transform: rotate(45deg) scale(1.1) !important;
  background: rgba(255, 255, 255, 0.34) !important;
}

/* Color variants — only thing that differs */
.mhp-topbar .mhp-buy-btn {
  --btn-c1: 16, 185, 129;    /* emerald-500 */
  --btn-c2: 52, 211, 153;    /* emerald-400 */
}

/* === Float topbar ABOVE the host page (overrides scoped sticky/z-index) === */
.mhp-topbar .page-header {
  position: fixed !important;
  top: 0 !important;
  left: 0 !important;
  right: 0 !important;
  z-index: 2147483647 !important;  /* max int32, beats anything */
}
.mhp-topbar .mega-panel-backdrop {
  z-index: 2147483646 !important;
}
.mhp-topbar .mega-menu-panel {
  z-index: 2147483646 !important;
}
body.mhp-topbar-active {
  /* padding-top is set inline by topbar.js to match measured topbar height */
}

/* [2026-04-22] Announcement marquee — lives inside .header-top, flex:1 between the
   brand and the header-actions on desktop so it fills the middle. On mobile it wraps
   to its own row above the brand (see the wrap media query below). Renders as an
   indigo→violet→pink animated gradient pill; pauses on hover; respects
   prefers-reduced-motion. */
.mhp-topbar .mhp-promo-strip {
  position: relative;
  flex: 1 1 auto;
  min-width: 0;
  overflow: hidden;
  height: 44px;            /* matches .mega-toggle / .mhp-buy-btn min-height */
  margin: 0 14px;
  padding: 0;
  border-radius: 12px;
  background: linear-gradient(90deg, #4f46e5 0%, #7c3aed 20%, #a855f7 40%, #ec4899 60%, #f97316 80%, #f59e0b 100%);
  background-size: 250% 100%;
  animation: mhpPromoBgShift 14s linear infinite;
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.12) inset,
    0 0 0 1px rgba(255, 255, 255, 0.12),
    0 6px 18px rgba(139, 92, 246, 0.22);
  color: #fff;
  font-family: Inter, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.02em;
  line-height: 1.35;
  -webkit-user-select: none;
  user-select: none;
  cursor: default;
  display: flex;
  align-items: center;
  /* soft edge fade so items don't pop in/out abruptly */
  -webkit-mask-image: linear-gradient(90deg, transparent 0, #000 6%, #000 94%, transparent 100%);
          mask-image: linear-gradient(90deg, transparent 0, #000 6%, #000 94%, transparent 100%);
}
.mhp-topbar .mhp-promo-track {
  display: flex;
  flex-wrap: nowrap;
  width: max-content;
  will-change: transform;
  animation: mhpPromoScroll 38s linear infinite;
}
.mhp-topbar .mhp-promo-strip:hover .mhp-promo-track,
.mhp-topbar .mhp-promo-strip:focus-within .mhp-promo-track {
  animation-play-state: paused;
}
.mhp-topbar .mhp-promo-group {
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  gap: 0;
  flex: 0 0 auto;
}
.mhp-topbar .mhp-promo-item {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 0 22px;
  white-space: nowrap;
  text-shadow: 0 1px 0 rgba(0, 0, 0, 0.14);
}
.mhp-topbar .mhp-promo-spark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  font-size: 14px;
  line-height: 1;
  animation: mhpPromoPulse 2.4s ease-in-out infinite;
  filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.25));
}
.mhp-topbar .mhp-promo-sep {
  display: inline-block;
  flex: 0 0 auto;
  width: 6px;
  height: 6px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.55);
  box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.18);
}
@keyframes mhpPromoScroll {
  from { transform: translate3d(0, 0, 0); }
  to   { transform: translate3d(-50%, 0, 0); }
}
@keyframes mhpPromoBgShift {
  0%   { background-position: 0% 50%; }
  100% { background-position: 250% 50%; }
}
@keyframes mhpPromoPulse {
  0%, 100% { transform: scale(1)    rotate(0deg); }
  50%      { transform: scale(1.18) rotate(-6deg); }
}
@media (prefers-reduced-motion: reduce) {
  .mhp-topbar .mhp-promo-track,
  .mhp-topbar .mhp-promo-strip,
  .mhp-topbar .mhp-promo-spark {
    animation: none !important;
  }
  .mhp-topbar .mhp-promo-track {
    transform: translate3d(0, 0, 0);
  }
}

/* [2026-04-22] Responsive refinements — the header-top, promo strip, and buttons
   now gracefully collapse at mid and narrow widths without breaking the layout. */

/* ≤1024px: tighten header padding, slightly smaller buttons and marquee */
@media (max-width: 1024px) {
  .mhp-topbar .page-header {
    padding: 12px 20px !important;
  }
  .mhp-topbar .header-top {
    gap: 10px;
  }
  .mhp-topbar .mega-toggle,
  .mhp-topbar .mhp-buy-btn {
    padding: 10px 14px !important;
    min-height: 40px !important;
    font-size: 11px !important;
  }
  .mhp-topbar .mhp-promo-strip {
    height: 40px;          /* match the shrunk button height */
    margin: 0 10px;
    font-size: 11.5px;
  }
}

/* ≤720px (tablet/mobile): promo strip breaks to its OWN full-width row ABOVE
   the logo+buttons row. Uses CSS Grid with explicit grid-template-areas so the
   layout is deterministic regardless of DOM order / flex wrapping quirks. */
@media (max-width: 720px) {
  .mhp-topbar .page-header {
    padding: 0 !important;       /* strip is edge-to-edge; row has its own padding */
  }
  .mhp-topbar .header-top {
    display: grid !important;
    grid-template-columns: auto 1fr auto;
    grid-template-rows: auto auto;
    grid-template-areas:
      "strip strip strip"
      "brand .     actions";
    align-items: center;
    gap: 0 !important;
    row-gap: 0;
    flex-wrap: unset;
  }
  .mhp-topbar .header-top .brand {
    grid-area: brand;
    padding: 10px 0 10px 12px;
    justify-self: start;
  }
  .mhp-topbar .header-top .mhp-promo-strip {
    grid-area: strip;
    width: 100% !important;
    max-width: 100vw;
    height: 34px !important;
    margin: 0 !important;
    padding: 0;
    border-radius: 0 !important;
    box-shadow: inset 0 -1px 0 rgba(255, 255, 255, 0.1) !important;
    font-size: 11px;
    -webkit-mask-image: none;
            mask-image: none;
  }
  .mhp-topbar .header-top .header-actions {
    grid-area: actions;
    padding: 10px 12px 10px 0;
    gap: 8px;
    justify-self: end;
    margin-left: 0;
  }
  .mhp-topbar .brand .brand-text {
    font-size: 16px !important;
    line-height: 16px !important;
  }
  .mhp-topbar .mega-toggle,
  .mhp-topbar .mhp-buy-btn {
    padding: 8px 12px !important;
    min-height: 36px !important;
    font-size: 10.5px !important;
    gap: 6px !important;
    letter-spacing: 0.05em !important;
  }
  .mhp-topbar .mega-toggle .mega-toggle__icon,
  .mhp-topbar .mhp-buy-btn .mhp-buy-btn__icon {
    width: 18px !important;
    height: 18px !important;
    flex-basis: 18px !important;
  }
  .mhp-topbar .mhp-promo-item {
    padding: 0 16px;
  }
  .mhp-topbar .mhp-promo-track {
    animation-duration: 28s;
  }
}

/* ≤560px: hide button labels (icon-only), shrink brand. Prevents overflow. */
@media (max-width: 560px) {
  .mhp-topbar .mega-toggle__label,
  .mhp-topbar .mhp-buy-btn__label {
    display: none !important;
  }
  .mhp-topbar .mega-toggle,
  .mhp-topbar .mhp-buy-btn {
    padding: 8px 10px !important;
    min-height: 34px !important;
    gap: 0 !important;
  }
  .mhp-topbar .brand .brand-text {
    font-size: 14px !important;
    line-height: 14px !important;
  }
  .mhp-topbar .mhp-promo-item {
    padding: 0 14px;
    font-size: 10.5px;
  }
}

/* [2026-04-22] Mobile: category chips collapse from wrapped rows into a single
   horizontal row that swipes left/right. Saves 2-3 rows of vertical space; feels
   native on touch; keyboard scrolls with arrow keys; scroll-snap gives a tactile
   stop on each chip. Right-edge fade hints there's more off-screen. */
@media (max-width: 720px) {
  .mhp-topbar #templateGallery .mhp-filter-bar {
    /* reduce bleed so the scroll container fits edge-to-edge cleanly */
    margin: -12px -10px 10px;
    padding: 10px 0 8px;
  }
  .mhp-topbar .mhp-chip-row {
    flex-wrap: nowrap;
    overflow-x: auto;
    overflow-y: hidden;
    gap: 6px;
    padding: 2px 12px 6px;
    scroll-snap-type: x proximity;
    scroll-padding-left: 12px;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior-x: contain;
    scrollbar-width: none;              /* Firefox */
    /* right-edge fade hint that there are more chips */
    -webkit-mask-image: linear-gradient(90deg, #000 calc(100% - 28px), transparent 100%);
            mask-image: linear-gradient(90deg, #000 calc(100% - 28px), transparent 100%);
  }
  .mhp-topbar .mhp-chip-row::-webkit-scrollbar { display: none; } /* Safari/Chrome */
  .mhp-topbar .mhp-chip {
    flex: 0 0 auto;
    scroll-snap-align: start;
    padding: 6px 11px;                  /* was 8px 14px */
    font-size: 11.5px;
    gap: 6px;
  }
  .mhp-topbar .mhp-chip__count {
    padding: 1px 6px;
    font-size: 10px;
  }
}

/* ≤380px: absolute-narrow — trim brand size and strip padding */
@media (max-width: 380px) {
  .mhp-topbar .header-top .brand {
    padding-left: 10px;
  }
  .mhp-topbar .header-top .header-actions {
    padding-right: 10px;
  }
  .mhp-topbar .brand .brand-text {
    font-size: 13px !important;
  }
  .mhp-topbar .header-top .mhp-promo-strip {
    height: 30px;
    font-size: 10.5px;
  }
  .mhp-topbar .mhp-promo-spark {
    width: 14px;
    height: 14px;
    font-size: 12px;
  }
}
