/* JHenMedia unified shell — loaded by WHMCS client area hook.
   Keep in sync with src/lib/navigation.ts, Header.tsx, and Footer.tsx */

:root {
  --jhm-ink: #ffffff;
  --jhm-ink-soft: #f5f7f8;
  --jhm-line: #e3e6ea;
  --jhm-fg: #363636;
  --jhm-heading: #1f2a33;
  --jhm-muted: #6b7280;
  --jhm-brand: #2768b3;
  --jhm-brand-strong: #1f568f;
  --jhm-brand-tint: #e9f1fa;
  --jhm-surface: #ffffff;
}

html.jhm-dark,
html.portal-dark.jhm-has-unified-nav,
html.portal-dark.jhm-has-unified-footer {
  color-scheme: dark;
  --jhm-ink: #0c1117;
  --jhm-ink-soft: #0f1419;
  --jhm-surface: #161d27;
  --jhm-line: #2a3544;
  --jhm-fg: #c9d4df;
  --jhm-heading: #eef2f6;
  --jhm-muted: #8b9cb0;
  --jhm-brand-strong: #5a9de0;
  --jhm-brand-tint: color-mix(in srgb, var(--jhm-brand) 18%, transparent);
}

body.jhm-has-unified-nav {
  padding-top: 0;
}

/* ── WHMCS Twenty-One (+ child themes based on it) ──
   Parent markup: header#header.header, footer#footer.footer, nav.master-breadcrumb
   https://github.com/WHMCS/templates-twenty-one */

body.jhm-whmcs-twenty-one.primary-bg-color {
  background-color: var(--jhm-ink-soft);
}

/* Nav is injected inside #header via {$headeroutput} — hide WHMCS chrome, keep .jhm-nav */
html.jhm-has-unified-nav #header.header,
html.jhm-has-unified-nav header#header.header,
body.jhm-has-unified-nav.jhm-whmcs-twenty-one #header.header,
body.jhm-has-unified-nav.jhm-whmcs-twenty-one header#header.header {
  display: block !important;
  background: transparent !important;
  border: 0 !important;
  padding: 0 !important;
  margin: 0 !important;
  box-shadow: none !important;
}

html.jhm-has-unified-nav #header.header > *:not(.jhm-nav),
html.jhm-has-unified-nav header#header.header > *:not(.jhm-nav),
body.jhm-has-unified-nav #header.header > *:not(.jhm-nav),
body.jhm-has-unified-nav header#header.header > *:not(.jhm-nav) {
  display: none !important;
}

body.jhm-has-unified-nav.jhm-whmcs-twenty-one footer.footer#footer,
body.jhm-has-unified-nav.jhm-whmcs-twenty-one footer#footer.footer,
html.jhm-has-unified-nav footer.footer#footer,
html.jhm-has-unified-nav footer#footer.footer,
body.jhm-has-unified-footer.jhm-whmcs-twenty-one footer.footer#footer,
body.jhm-has-unified-footer.jhm-whmcs-twenty-one footer#footer.footer,
html.jhm-has-unified-footer footer.footer#footer,
html.jhm-has-unified-footer footer#footer.footer {
  display: none !important;
}

body.jhm-has-unified-nav.jhm-whmcs-twenty-one .master-breadcrumb,
body.jhm-has-unified-nav.jhm-whmcs-twenty-one nav.master-breadcrumb,
body.jhm-has-unified-nav .master-breadcrumb,
body.jhm-has-unified-nav .breadcrumb-nav,
body.jhm-has-unified-nav ol.breadcrumb {
  display: none !important;
}

body.jhm-has-unified-nav.jhm-whmcs-twenty-one #main-body {
  padding-bottom: 0;
}

body.jhm-has-unified-nav.jhm-whmcs-twenty-one .btn-return-to-admin {
  z-index: 9998;
}

/* Fallback selectors for other WHMCS themes */
body.jhm-has-unified-nav > header:not(.jhm-nav):not(#header),
body.jhm-has-unified-nav .main-navbar-wrapper {
  display: none !important;
}

body.jhm-has-unified-nav .main-footer,
body.jhm-has-unified-nav #frmPayment .footer,
body.jhm-has-unified-nav section#footer,
body.jhm-has-unified-footer .main-footer,
body.jhm-has-unified-footer #frmPayment .footer,
body.jhm-has-unified-footer section#footer {
  display: none !important;
}

.jhm-nav {
  position: sticky;
  top: 0;
  z-index: 9999;
  border-bottom: 1px solid var(--jhm-line);
  background: color-mix(in srgb, var(--jhm-ink) 80%, transparent);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  font-family: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

.jhm-nav a,
.jhm-nav a:hover,
.jhm-nav a:focus,
.jhm-nav a:active,
.jhm-nav button {
  text-decoration: none !important;
}

/* Twenty-One theme underlines links inside #header on hover */
#header .jhm-nav a,
#header .jhm-nav a:hover,
#header .jhm-nav a:focus {
  text-decoration: none !important;
}

.jhm-nav__inner {
  max-width: 72rem;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  height: 3.5rem;
  padding: 0 1rem;
}

@media (min-width: 640px) {
  .jhm-nav__inner {
    height: 4rem;
    padding: 0 1.25rem;
  }
}

.jhm-nav__logo {
  display: flex;
  align-items: center;
  gap: 0.625rem;
  text-decoration: none !important;
  color: var(--jhm-heading);
  font-weight: 700;
  font-size: 1.125rem;
  letter-spacing: -0.02em;
}

.jhm-nav__logo:hover,
.jhm-nav__logo:focus {
  color: var(--jhm-heading);
  text-decoration: none !important;
}

.jhm-nav__logo img {
  width: 2.25rem;
  height: 2.25rem;
  object-fit: contain;
}

.jhm-nav__logo span em {
  font-style: normal;
  color: var(--jhm-brand);
}

.jhm-nav__links {
  display: none;
  align-items: center;
  gap: 1.5rem;
}

@media (min-width: 768px) {
  .jhm-nav__links {
    display: flex;
  }
}

.jhm-nav__links a {
  font-size: 0.875rem;
  color: var(--jhm-muted);
  text-decoration: none !important;
  transition: color 0.18s ease;
}

.jhm-nav__links a:hover,
.jhm-nav__links a:focus {
  color: var(--jhm-fg);
  text-decoration: none !important;
}

.jhm-nav__actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.jhm-nav__icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.5rem;
  height: 2.5rem;
  border: 1px solid var(--jhm-line);
  border-radius: 5px;
  background: var(--jhm-surface);
  color: var(--jhm-muted);
  text-decoration: none;
  position: relative;
  transition: border-color 0.18s ease, color 0.18s ease;
}

.jhm-nav__icon-btn:hover {
  border-color: var(--jhm-brand);
  color: var(--jhm-brand-strong);
}

.jhm-nav__cart-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.5rem;
  height: 2.5rem;
  border: 1px solid var(--jhm-line);
  border-radius: 5px;
  background: var(--jhm-surface);
  color: var(--jhm-muted);
  text-decoration: none;
  position: relative;
  transition: border-color 0.18s ease, color 0.18s ease;
}

.jhm-nav__cart-btn:hover {
  border-color: var(--jhm-brand);
  color: var(--jhm-brand-strong);
}

.jhm-nav__cart-count {
  position: absolute;
  top: -0.25rem;
  right: -0.25rem;
  min-width: 1.25rem;
  height: 1.25rem;
  padding: 0 0.25rem;
  border-radius: 9999px;
  background: var(--jhm-brand);
  color: #fff;
  font-size: 0.625rem;
  font-weight: 700;
  line-height: 1.25rem;
  text-align: center;
}

.jhm-nav__members {
  display: none;
  align-items: stretch;
  height: 2.5rem;
  overflow: hidden;
  border: 1px solid var(--jhm-line);
  border-radius: 5px;
  color: var(--jhm-muted);
  text-decoration: none !important;
  transition:
    border-color 0.3s ease,
    color 0.3s ease;
}

.jhm-nav__members-icon {
  display: flex;
  flex-shrink: 0;
  align-items: center;
  justify-content: center;
  width: 2.5rem;
  height: 2.5rem;
}

.jhm-nav__members svg {
  display: block;
  flex-shrink: 0;
  width: 1.25rem;
  height: 1.25rem;
}

.jhm-nav__members-label {
  display: flex;
  align-items: center;
  max-width: 0;
  opacity: 0;
  overflow: hidden;
  white-space: nowrap;
  font-size: 0.875rem;
  font-weight: 500;
  transition:
    max-width 0.3s ease,
    opacity 0.3s ease,
    padding 0.3s ease;
}

.jhm-nav__members:hover,
.jhm-nav__members:focus,
.jhm-nav__members:focus-visible {
  color: var(--jhm-brand-strong);
  border-color: var(--jhm-brand);
  text-decoration: none !important;
}

.jhm-nav__members:hover .jhm-nav__members-label,
.jhm-nav__members:focus .jhm-nav__members-label,
.jhm-nav__members:focus-visible .jhm-nav__members-label {
  max-width: 4.75rem;
  padding-right: 0.75rem;
  opacity: 1;
}

.jhm-nav.is-member .jhm-nav__members,
.jhm-nav.is-member .jhm-nav__cta {
  display: none !important;
}

.jhm-nav.is-guest .jhm-nav__user-pill,
.jhm-nav.is-guest .jhm-nav__sign-out {
  display: none !important;
}

.jhm-nav__user-pill {
  display: none;
  align-items: center;
  gap: 0.625rem;
  border: 1px solid var(--jhm-line);
  border-radius: 9999px;
  background: var(--jhm-surface);
  padding: 0.25rem 0.75rem 0.25rem 0.25rem;
  text-decoration: none !important;
  color: var(--jhm-fg);
  max-width: 14rem;
  transition: border-color 0.18s ease;
}

.jhm-nav__user-pill:hover,
.jhm-nav__user-pill:focus {
  text-decoration: none !important;
  border-color: color-mix(in srgb, var(--jhm-brand) 35%, var(--jhm-line));
  color: var(--jhm-fg);
}

.jhm-nav__avatar {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.75rem;
  height: 1.75rem;
  border-radius: 9999px;
  background: var(--jhm-brand);
  color: #fff;
  font-size: 0.75rem;
  font-weight: 700;
  flex-shrink: 0;
}

.jhm-nav__user-name {
  display: none;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 0.875rem;
  font-weight: 500;
}

.jhm-nav__sign-out {
  display: none;
  align-items: center;
  justify-content: center;
  width: 2.25rem;
  height: 2.25rem;
  border: 1px solid var(--jhm-line);
  border-radius: 9999px;
  background: var(--jhm-surface);
  color: var(--jhm-muted);
  cursor: pointer;
  padding: 0;
  transition: color 0.18s ease, border-color 0.18s ease;
}

.jhm-nav__sign-out:hover {
  color: #dc2626;
  border-color: color-mix(in srgb, #dc2626 35%, var(--jhm-line));
}

.jhm-nav.is-member .jhm-nav__user-pill,
.jhm-nav.is-member .jhm-nav__sign-out {
  display: inline-flex;
}

.jhm-nav__mobile-sign-out {
  display: block;
  width: 100%;
  border: 1px solid var(--jhm-line);
  border-radius: 0.75rem;
  background: var(--jhm-surface);
  color: #dc2626;
  font-size: 1rem;
  font-weight: 500;
  padding: 0.875rem 1rem;
  cursor: pointer;
  text-align: center;
}

@media (min-width: 640px) {
  .jhm-nav.is-guest .jhm-nav__members {
    display: inline-flex;
  }

  .jhm-nav.is-member .jhm-nav__user-name {
    display: inline;
  }
}

.jhm-nav__cta {
  display: none;
  align-items: center;
  justify-content: center;
  border-radius: 5px;
  background: var(--jhm-brand);
  color: #fff;
  font-size: 0.875rem;
  font-weight: 600;
  padding: 0.625rem 1rem;
  text-decoration: none;
  transition: background 0.18s ease;
}

.jhm-nav__cta:hover {
  background: var(--jhm-brand-strong);
}

@media (min-width: 640px) {
  .jhm-nav.is-guest .jhm-nav__cta {
    display: inline-flex;
  }
}

.jhm-nav__menu-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 2.5rem;
  height: 2.5rem;
  border: 1px solid var(--jhm-line);
  border-radius: 0.5rem;
  background: var(--jhm-surface);
  color: var(--jhm-fg);
  cursor: pointer;
}

.jhm-nav__theme-wrap {
  display: none;
  align-items: center;
}

.jhm-nav__mobile-theme {
  display: flex;
  justify-content: center;
  margin-top: 1rem;
  padding: 1rem 1rem 0.5rem;
  border-top: 1px solid var(--jhm-line);
}

.jhm-theme-toggle,
.jhm-footer__theme {
  display: inline-flex;
  align-items: center;
  gap: 0;
  border: 1px solid var(--jhm-line);
  border-radius: 9999px;
  background: var(--jhm-surface);
  padding: 0.25rem;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
  transition: gap 0.2s ease;
}

.jhm-theme-toggle:hover,
.jhm-theme-toggle.is-expanded,
.jhm-footer__theme:hover,
.jhm-footer__theme.is-expanded {
  gap: 0.125rem;
}

.jhm-theme-toggle button,
.jhm-footer__theme button {
  display: flex;
  flex-shrink: 0;
  align-items: center;
  justify-content: center;
  width: 1.75rem;
  height: 1.75rem;
  min-width: 1.75rem;
  border: 0;
  border-radius: 9999px;
  background: transparent;
  color: var(--jhm-muted);
  cursor: pointer;
  overflow: hidden;
  transition:
    width 0.2s ease,
    min-width 0.2s ease,
    opacity 0.2s ease,
    color 0.18s ease,
    background 0.18s ease;
}

.jhm-theme-toggle button:not(.is-active),
.jhm-footer__theme button:not(.is-active) {
  width: 0;
  min-width: 0;
  opacity: 0;
  pointer-events: none;
}

.jhm-theme-toggle:hover button:not(.is-active),
.jhm-theme-toggle.is-expanded button:not(.is-active),
.jhm-footer__theme:hover button:not(.is-active),
.jhm-footer__theme.is-expanded button:not(.is-active) {
  width: 1.75rem;
  min-width: 1.75rem;
  opacity: 1;
  pointer-events: auto;
}

.jhm-theme-toggle button:hover,
.jhm-footer__theme button:hover {
  color: var(--jhm-fg);
}

.jhm-theme-toggle button.is-active,
.jhm-footer__theme button.is-active {
  background: var(--jhm-brand-tint);
  color: var(--jhm-brand-strong);
  opacity: 1;
  pointer-events: auto;
}

@media (min-width: 768px) {
  .jhm-nav__theme-wrap {
    display: inline-flex;
  }

  .jhm-nav__mobile-theme {
    display: none;
  }
}

@media (min-width: 768px) {
  .jhm-nav__menu-btn {
    display: none;
  }
}

.jhm-nav__mobile {
  display: none;
  position: fixed;
  inset: 3.5rem 0 auto 0;
  z-index: 9998;
  max-height: calc(100dvh - 3.5rem);
  overflow-y: auto;
  border-bottom: 1px solid var(--jhm-line);
  background: var(--jhm-surface);
  padding: 1rem;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.08);
}

@media (min-width: 640px) {
  .jhm-nav__mobile {
    inset: 4rem 0 auto 0;
    max-height: calc(100dvh - 4rem);
  }
}

.jhm-nav__mobile.is-open {
  display: block;
}

.jhm-nav__mobile a {
  display: block;
  padding: 0.875rem 1rem;
  border-radius: 0.75rem;
  font-size: 1rem;
  font-weight: 500;
  color: var(--jhm-fg);
  text-decoration: none;
}

.jhm-nav__mobile a:hover,
.jhm-nav__mobile a.is-active {
  background: var(--jhm-brand-tint);
  color: var(--jhm-brand-strong);
}

.jhm-nav__mobile-actions {
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px solid var(--jhm-line);
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.jhm-nav__backdrop {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 9997;
  background: rgba(0, 0, 0, 0.4);
}

.jhm-nav__backdrop.is-open {
  display: block;
}

.jhm-nav__mobile .jhm-nav__cta {
  display: flex;
  width: 100%;
  text-align: center;
}

.jhm-nav__mobile .jhm-nav__members {
  display: flex;
  width: 100%;
  gap: 0.5rem;
  padding: 0.875rem 1rem;
  border: 1px solid var(--jhm-line);
  border-radius: 0.75rem;
  text-align: center;
  justify-content: center;
}

.jhm-nav__mobile .jhm-nav__members-label {
  max-width: none;
  padding-right: 0;
  opacity: 1;
}

.jhm-nav__mobile .jhm-nav__cart-count {
  position: static;
  display: inline-block;
  margin-left: 0.35rem;
  vertical-align: middle;
}

/* ── Unified footer (keep in sync with Footer.tsx) ── */

body.jhm-has-unified-footer footer.footer:not(.jhm-footer),
body.jhm-has-unified-footer #footer:not(.jhm-footer),
body.jhm-has-unified-footer .footer:not(.jhm-footer),
html.jhm-has-unified-footer footer.footer:not(.jhm-footer),
html.jhm-has-unified-footer #footer:not(.jhm-footer) {
  display: none !important;
}

footer.jhm-footer {
  display: block !important;
  box-sizing: border-box;
  width: 100%;
  margin-top: auto;
  border-top: 1px solid var(--jhm-line);
  background: var(--jhm-ink-soft);
  font-family: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  font-size: 1rem;
  line-height: 1.5;
  color: var(--jhm-fg);
}

footer.jhm-footer *,
footer.jhm-footer *::before,
footer.jhm-footer *::after {
  box-sizing: border-box;
}

.jhm-footer {
  margin-top: auto;
  border-top: 1px solid var(--jhm-line);
  background: var(--jhm-ink-soft);
  font-family: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  color: var(--jhm-fg);
}

.jhm-footer__grid {
  max-width: 72rem;
  margin: 0 auto;
  display: grid !important;
  gap: 2rem;
  padding: 2.5rem 1rem;
}

@media (min-width: 640px) {
  .jhm-footer__grid {
    gap: 2.5rem;
    padding: 3.5rem 1.25rem;
  }
}

@media (min-width: 768px) {
  .jhm-footer__grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (min-width: 1024px) {
  .jhm-footer__grid {
    grid-template-columns: 1.2fr 1fr 1fr 1.4fr;
  }
}

.jhm-footer__logo {
  display: inline-flex;
  align-items: center;
  gap: 0.625rem;
  text-decoration: none;
  color: var(--jhm-heading);
  font-weight: 700;
  font-size: 1.125rem;
  letter-spacing: -0.02em;
}

.jhm-footer__logo img {
  width: 2.25rem;
  height: 2.25rem;
  object-fit: contain;
}

.jhm-footer__logo em {
  font-style: normal;
  color: var(--jhm-brand);
}

.jhm-footer__tagline {
  margin: 1rem 0 0;
  max-width: 20rem;
  font-size: 0.875rem;
  line-height: 1.5;
  color: var(--jhm-muted);
}

.jhm-footer__theme {
  display: inline-flex;
  margin-top: 1.25rem;
  border: 1px solid var(--jhm-line);
  border-radius: 9999px;
  background: var(--jhm-surface);
  padding: 0.25rem;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
}

.jhm-footer__theme button {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 2rem;
  height: 2rem;
  border: 0;
  border-radius: 9999px;
  background: transparent;
  color: var(--jhm-muted);
  cursor: pointer;
  transition: color 0.18s ease, background 0.18s ease;
}

.jhm-footer__theme button:hover {
  color: var(--jhm-fg);
}

.jhm-footer__theme button.is-active {
  background: var(--jhm-brand-tint);
  color: var(--jhm-brand-strong);
}

.jhm-footer__col h4 {
  margin: 0 0 0.75rem !important;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--jhm-heading);
}

.jhm-footer__col ul {
  margin: 0 !important;
  padding: 0 !important;
  list-style: none !important;
}

.jhm-footer__col li + li {
  margin-top: 0.5rem;
}

.jhm-footer__col a {
  font-size: 0.875rem;
  color: var(--jhm-muted);
  text-decoration: none;
  transition: color 0.18s ease;
}

.jhm-footer__col a:hover {
  color: var(--jhm-fg);
}

.jhm-footer__newsletter p {
  margin: 0 0 0.75rem;
  font-size: 0.875rem;
  line-height: 1.5;
  color: var(--jhm-muted);
}

.jhm-footer__form-row {
  display: flex;
  gap: 0.5rem;
}

.jhm-footer__form input[type="email"] {
  min-width: 0;
  flex: 1;
  border: 1px solid var(--jhm-line);
  border-radius: 9999px;
  background: var(--jhm-surface);
  color: var(--jhm-fg);
  padding: 0.5rem 1rem;
  font-size: 0.875rem;
  outline: none;
}

.jhm-footer__form input[type="email"]:focus {
  border-color: color-mix(in srgb, var(--jhm-brand) 45%, var(--jhm-line));
}

.jhm-footer__form button[type="submit"] {
  border: 0;
  border-radius: 9999px;
  background: var(--jhm-brand);
  color: #fff;
  font-size: 0.875rem;
  font-weight: 600;
  padding: 0.5rem 1rem;
  cursor: pointer;
  transition: background 0.18s ease;
}

.jhm-footer__form button[type="submit"]:hover {
  background: var(--jhm-brand-strong);
}

.jhm-footer__form button[type="submit"]:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.jhm-footer__consent {
  display: flex;
  align-items: flex-start;
  gap: 0.5rem;
  margin-top: 0.5rem;
  font-size: 0.75rem;
  line-height: 1.4;
  color: var(--jhm-muted);
}

.jhm-footer__consent input {
  margin-top: 0.15rem;
}

.jhm-footer__consent a {
  color: var(--jhm-brand-strong);
  text-decoration: underline;
}

.jhm-footer__form-msg {
  margin: 0.5rem 0 0;
  font-size: 0.75rem;
}

.jhm-footer__form-msg.is-error {
  color: #dc2626;
}

.jhm-footer__form-msg.is-ok {
  color: var(--jhm-brand-strong);
}

.jhm-footer__bar {
  border-top: 1px solid var(--jhm-line);
}

.jhm-footer__bar-inner {
  max-width: 72rem;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 1.25rem 1rem;
  font-size: 0.75rem;
  color: var(--jhm-muted);
}

@media (min-width: 640px) {
  .jhm-footer__bar-inner {
    flex-direction: row;
    padding-left: 1.25rem;
    padding-right: 1.25rem;
  }
}

.jhm-footer__bar-inner p {
  margin: 0;
}

.jhm-footer__legal {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 0.25rem 1rem;
}

.jhm-footer__legal a {
  color: var(--jhm-muted);
  text-decoration: none;
}

.jhm-footer__legal a:hover {
  color: var(--jhm-fg);
}

.jhm-footer__sep {
  display: none;
}

@media (min-width: 640px) {
  .jhm-footer__sep {
    display: inline;
  }
}

/* ── Dark mode: unified nav + WHMCS client area ── */
html.jhm-dark .jhm-nav,
html.portal-dark.jhm-has-unified-nav .jhm-nav {
  background: color-mix(in srgb, var(--jhm-ink) 92%, transparent);
  border-color: var(--jhm-line);
}

html.jhm-dark .jhm-nav__logo,
html.portal-dark.jhm-has-unified-nav .jhm-nav__logo {
  color: var(--jhm-heading);
}

html.jhm-dark .jhm-nav__members,
html.portal-dark.jhm-has-unified-nav .jhm-nav__members {
  border-color: var(--jhm-line);
  background: var(--jhm-surface);
}

html.jhm-dark .jhm-nav__members:hover,
html.jhm-dark .jhm-nav__members:focus-visible,
html.portal-dark.jhm-has-unified-nav .jhm-nav__members:hover,
html.portal-dark.jhm-has-unified-nav .jhm-nav__members:focus-visible {
  border-color: var(--jhm-brand);
  color: var(--jhm-brand-soft);
}

html.jhm-dark .jhm-nav__links a,
html.jhm-dark .jhm-nav__members,
html.portal-dark.jhm-has-unified-nav .jhm-nav__links a,
html.portal-dark.jhm-has-unified-nav .jhm-nav__members {
  color: var(--jhm-muted);
}

html.jhm-dark .jhm-nav__links a:hover,
html.jhm-dark .jhm-nav__members:hover,
html.portal-dark.jhm-has-unified-nav .jhm-nav__links a:hover,
html.portal-dark.jhm-has-unified-nav .jhm-nav__members:hover {
  color: var(--jhm-fg);
}

html.jhm-dark .jhm-nav__icon-btn,
html.jhm-dark .jhm-nav__cart-btn,
html.jhm-dark .jhm-nav__sign-out,
html.jhm-dark .jhm-nav__user-pill,
html.jhm-dark .jhm-nav__menu-btn,
html.jhm-dark .jhm-theme-toggle,
html.portal-dark.jhm-has-unified-nav .jhm-nav__icon-btn,
html.portal-dark.jhm-has-unified-nav .jhm-nav__cart-btn,
html.portal-dark.jhm-has-unified-nav .jhm-nav__sign-out,
html.portal-dark.jhm-has-unified-nav .jhm-nav__user-pill,
html.portal-dark.jhm-has-unified-nav .jhm-nav__menu-btn,
html.portal-dark.jhm-has-unified-nav .jhm-theme-toggle {
  background: var(--jhm-surface);
  border-color: var(--jhm-line);
  color: var(--jhm-muted);
}

html.jhm-dark .jhm-nav__user-pill,
html.portal-dark.jhm-has-unified-nav .jhm-nav__user-pill {
  color: var(--jhm-fg);
}

html.jhm-dark .jhm-nav__mobile,
html.portal-dark.jhm-has-unified-nav .jhm-nav__mobile {
  background: var(--jhm-surface);
  border-color: var(--jhm-line);
}

html.jhm-dark .jhm-nav__mobile a,
html.portal-dark.jhm-has-unified-nav .jhm-nav__mobile a {
  color: var(--jhm-fg);
}

html.jhm-dark .jhm-nav__mobile a:hover,
html.portal-dark.jhm-has-unified-nav .jhm-nav__mobile a:hover {
  background: var(--jhm-ink-soft);
}

html.jhm-dark body.jhm-whmcs-twenty-one,
html.jhm-dark body.jhm-whmcs-twenty-one.primary-bg-color,
html.portal-dark.jhm-has-unified-nav body.jhm-whmcs-twenty-one,
html.portal-dark.jhm-has-unified-nav body.jhm-whmcs-twenty-one.primary-bg-color {
  background-color: var(--jhm-ink-soft) !important;
  color: var(--jhm-fg);
}

html.jhm-dark body.jhm-whmcs-twenty-one h1,
html.jhm-dark body.jhm-whmcs-twenty-one h2,
html.jhm-dark body.jhm-whmcs-twenty-one h3,
html.jhm-dark body.jhm-whmcs-twenty-one h4,
html.jhm-dark body.jhm-whmcs-twenty-one h5,
html.jhm-dark body.jhm-whmcs-twenty-one .card-title,
html.portal-dark.jhm-has-unified-nav body.jhm-whmcs-twenty-one h1,
html.portal-dark.jhm-has-unified-nav body.jhm-whmcs-twenty-one h2,
html.portal-dark.jhm-has-unified-nav body.jhm-whmcs-twenty-one h3,
html.portal-dark.jhm-has-unified-nav body.jhm-whmcs-twenty-one h4,
html.portal-dark.jhm-has-unified-nav body.jhm-whmcs-twenty-one h5,
html.portal-dark.jhm-has-unified-nav body.jhm-whmcs-twenty-one .card-title {
  color: var(--jhm-heading);
}

html.jhm-dark body.jhm-whmcs-twenty-one .text-muted,
html.portal-dark.jhm-has-unified-nav body.jhm-whmcs-twenty-one .text-muted {
  color: var(--jhm-muted) !important;
}

html.jhm-dark body.jhm-whmcs-twenty-one .card,
html.jhm-dark body.jhm-whmcs-twenty-one .panel,
html.jhm-dark body.jhm-whmcs-twenty-one .panel-default,
html.jhm-dark body.jhm-whmcs-twenty-one .well,
html.portal-dark.jhm-has-unified-nav body.jhm-whmcs-twenty-one .card,
html.portal-dark.jhm-has-unified-nav body.jhm-whmcs-twenty-one .panel,
html.portal-dark.jhm-has-unified-nav body.jhm-whmcs-twenty-one .panel-default,
html.portal-dark.jhm-has-unified-nav body.jhm-whmcs-twenty-one .well {
  background-color: var(--jhm-surface) !important;
  border-color: var(--jhm-line) !important;
  color: var(--jhm-fg);
}

html.jhm-dark body.jhm-whmcs-twenty-one .card-header,
html.jhm-dark body.jhm-whmcs-twenty-one .card-footer,
html.jhm-dark body.jhm-whmcs-twenty-one .panel-heading,
html.jhm-dark body.jhm-whmcs-twenty-one .panel-footer,
html.portal-dark.jhm-has-unified-nav body.jhm-whmcs-twenty-one .card-header,
html.portal-dark.jhm-has-unified-nav body.jhm-whmcs-twenty-one .card-footer,
html.portal-dark.jhm-has-unified-nav body.jhm-whmcs-twenty-one .panel-heading,
html.portal-dark.jhm-has-unified-nav body.jhm-whmcs-twenty-one .panel-footer {
  background-color: var(--jhm-surface) !important;
  border-color: var(--jhm-line) !important;
  color: var(--jhm-fg);
}

html.jhm-dark body.jhm-whmcs-twenty-one .list-group-item,
html.portal-dark.jhm-has-unified-nav body.jhm-whmcs-twenty-one .list-group-item {
  background-color: var(--jhm-surface);
  border-color: var(--jhm-line);
  color: var(--jhm-fg);
}

html.jhm-dark body.jhm-whmcs-twenty-one .list-group-item.active,
html.portal-dark.jhm-has-unified-nav body.jhm-whmcs-twenty-one .list-group-item.active {
  background-color: var(--jhm-brand);
  border-color: var(--jhm-brand);
}

html.jhm-dark body.jhm-whmcs-twenty-one .form-control,
html.jhm-dark body.jhm-whmcs-twenty-one select.form-control,
html.jhm-dark body.jhm-whmcs-twenty-one textarea.form-control,
html.portal-dark.jhm-has-unified-nav body.jhm-whmcs-twenty-one .form-control,
html.portal-dark.jhm-has-unified-nav body.jhm-whmcs-twenty-one select.form-control,
html.portal-dark.jhm-has-unified-nav body.jhm-whmcs-twenty-one textarea.form-control {
  background-color: var(--jhm-surface);
  border-color: var(--jhm-line);
  color: var(--jhm-fg);
}

html.jhm-dark body.jhm-whmcs-twenty-one .table,
html.jhm-dark body.jhm-whmcs-twenty-one .table td,
html.jhm-dark body.jhm-whmcs-twenty-one .table th,
html.portal-dark.jhm-has-unified-nav body.jhm-whmcs-twenty-one .table,
html.portal-dark.jhm-has-unified-nav body.jhm-whmcs-twenty-one .table td,
html.portal-dark.jhm-has-unified-nav body.jhm-whmcs-twenty-one .table th {
  border-color: var(--jhm-line);
  color: var(--jhm-fg);
}

html.jhm-dark body.jhm-whmcs-twenty-one .table-striped tbody tr:nth-of-type(odd),
html.portal-dark.jhm-has-unified-nav body.jhm-whmcs-twenty-one .table-striped tbody tr:nth-of-type(odd) {
  background-color: color-mix(in srgb, var(--jhm-surface) 88%, var(--jhm-ink-soft));
}

html.jhm-dark body.jhm-whmcs-twenty-one a:not(.btn),
html.portal-dark.jhm-has-unified-nav body.jhm-whmcs-twenty-one a:not(.btn) {
  color: var(--jhm-brand-strong);
}

html.jhm-dark body.jhm-whmcs-twenty-one .btn-default,
html.portal-dark.jhm-has-unified-nav body.jhm-whmcs-twenty-one .btn-default {
  background-color: var(--jhm-surface);
  border-color: var(--jhm-line);
  color: var(--jhm-fg);
}

html.jhm-dark body.jhm-whmcs-twenty-one #main-body,
html.portal-dark.jhm-has-unified-nav body.jhm-whmcs-twenty-one #main-body {
  color: var(--jhm-fg);
}

/* ── WHMCS service details: hide upsell / billing panels ── */
body.jhm-has-unified-nav.jhm-whmcs-twenty-one.jhm-product-details .jhm-hidden-service-panel,
body.jhm-has-unified-nav.jhm-whmcs-twenty-one.jhm-product-details #tabOverview .mc-promo,
body.jhm-has-unified-nav.jhm-whmcs-twenty-one.jhm-product-details #tabOverview .mc-promo-carousel {
  display: none !important;
}

/* ── Portal sidebar (replaces WHMCS native sidebar) ── */
body.jhm-has-portal-sidebar #main-body .sidebar,
body.jhm-has-portal-sidebar #main-body .col-lg-4.col-xl-3 {
  display: none !important;
}

body.jhm-has-portal-sidebar #main-body > .container,
body.jhm-has-portal-sidebar #main-body .container {
  max-width: 72rem;
}

body.jhm-has-portal-sidebar #main-body .row.jhm-portal-row,
body.jhm-has-portal-sidebar #main-body .container > .row {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  gap: 1rem 2rem;
}

body.jhm-has-portal-sidebar #main-body .jhm-portal-primary,
body.jhm-has-portal-sidebar #main-body .primary-content {
  flex: 1 1 0;
  min-width: 0;
  max-width: none !important;
  width: auto !important;
  padding-bottom: calc(4.5rem + env(safe-area-inset-bottom));
}

@media (min-width: 1024px) {
  body.jhm-has-portal-sidebar #main-body .jhm-portal-primary,
  body.jhm-has-portal-sidebar #main-body .primary-content {
    padding-bottom: 0;
  }
}

.jhm-portal-sidebar-wrap {
  display: none;
  width: 15rem;
  flex: 0 0 15rem;
  position: sticky;
  top: calc(4rem + 1px);
  align-self: flex-start;
  transition: width 0.2s ease, flex-basis 0.2s ease;
}

.jhm-portal-sidebar-wrap.is-collapsed {
  width: 4.25rem;
  flex-basis: 4.25rem;
}

@media (min-width: 1024px) {
  .jhm-portal-sidebar-wrap {
    display: block;
  }
}

.jhm-portal-sidebar__nav {
  display: flex;
  flex-direction: column;
  gap: 0.125rem;
}

.jhm-portal-sidebar__link {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  border-radius: 0.75rem;
  padding: 0.625rem 0.75rem;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--jhm-muted);
  text-decoration: none !important;
  transition: background 0.18s ease, color 0.18s ease;
}

.jhm-portal-sidebar__link:hover {
  background: color-mix(in srgb, var(--jhm-surface) 55%, var(--jhm-ink-soft));
  color: var(--jhm-fg);
  text-decoration: none !important;
}

.jhm-portal-sidebar__link.is-active {
  background: var(--jhm-brand-tint);
  color: var(--jhm-brand-strong);
}

.jhm-portal-sidebar-wrap.is-collapsed .jhm-portal-sidebar__link {
  justify-content: center;
  padding-left: 0.625rem;
  padding-right: 0.625rem;
}

.jhm-portal-sidebar__text {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.jhm-portal-sidebar-wrap.is-collapsed .jhm-portal-sidebar__text {
  display: none;
}

.jhm-portal-sidebar__collapse {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-top: 0.5rem;
  border: 0;
  border-top: 1px solid var(--jhm-line);
  border-radius: 0;
  background: transparent;
  padding: 0.625rem 0.75rem 0;
  width: 100%;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--jhm-muted);
  cursor: pointer;
  transition: background 0.18s ease, color 0.18s ease;
}

.jhm-portal-sidebar__collapse:hover {
  color: var(--jhm-fg);
}

.jhm-portal-sidebar-wrap.is-collapsed .jhm-portal-sidebar__collapse {
  justify-content: center;
  padding-left: 0.625rem;
  padding-right: 0.625rem;
}

.jhm-portal-sidebar-wrap.is-collapsed .jhm-portal-sidebar__collapse svg {
  transform: rotate(0deg);
}

.jhm-portal-sidebar__collapse svg {
  flex-shrink: 0;
  transform: rotate(180deg);
  transition: transform 0.2s ease;
}

.jhm-portal-sidebar__mobile-bar {
  position: fixed;
  inset: auto 0 0 0;
  z-index: 40;
  display: flex;
  align-items: stretch;
  justify-content: space-around;
  border-top: 1px solid var(--jhm-line);
  background: color-mix(in srgb, var(--jhm-surface) 95%, transparent);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  padding-bottom: env(safe-area-inset-bottom);
}

@media (min-width: 1024px) {
  .jhm-portal-sidebar__mobile-bar {
    display: none;
  }
}

.jhm-portal-sidebar__mobile-link,
.jhm-portal-sidebar__mobile-more-btn {
  display: flex;
  flex: 1;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.125rem;
  min-height: 3.25rem;
  border: 0;
  background: transparent;
  padding: 0.375rem 0.25rem;
  font-size: 0.625rem;
  font-weight: 500;
  color: var(--jhm-muted);
  text-decoration: none !important;
  cursor: pointer;
}

.jhm-portal-sidebar__mobile-link.is-active,
.jhm-portal-sidebar__mobile-more-btn.is-active {
  color: var(--jhm-brand-strong);
}

.jhm-portal-sidebar__more-panel[hidden] {
  display: none !important;
}

.jhm-portal-sidebar__more-panel {
  position: fixed;
  inset: 0;
  z-index: 50;
}

.jhm-portal-sidebar__more-backdrop {
  position: absolute;
  inset: 0;
  border: 0;
  background: rgba(0, 0, 0, 0.4);
  cursor: pointer;
}

.jhm-portal-sidebar__more-sheet {
  position: absolute;
  inset: auto 0 0 0;
  max-height: 70dvh;
  overflow-y: auto;
  border-top: 1px solid var(--jhm-line);
  border-radius: 1rem 1rem 0 0;
  background: var(--jhm-surface);
  padding: 1rem 1rem calc(1rem + env(safe-area-inset-bottom));
}

.jhm-portal-sidebar__more-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.75rem;
}

.jhm-portal-sidebar__more-head p {
  margin: 0;
  font-weight: 600;
  color: var(--jhm-heading);
}

.jhm-portal-sidebar__more-head button {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 2.25rem;
  height: 2.25rem;
  border: 1px solid var(--jhm-line);
  border-radius: 0.5rem;
  background: var(--jhm-surface);
  color: var(--jhm-fg);
  cursor: pointer;
}

.jhm-portal-sidebar__more-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.5rem;
}

.jhm-portal-sidebar__more-link {
  display: flex;
  align-items: center;
  gap: 0.625rem;
  border-radius: 0.75rem;
  background: color-mix(in srgb, var(--jhm-surface) 55%, var(--jhm-ink-soft));
  padding: 0.75rem;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--jhm-fg);
  text-decoration: none !important;
}

.jhm-portal-sidebar__more-link.is-active {
  background: var(--jhm-brand-tint);
  color: var(--jhm-brand-strong);
}
