/* ============================================================
   Click · Perfil modular V2
   - Filas estrictas: el módulo siguiente baja completo.
   - Edición directa de enlaces e imagen.
   - Color independiente por módulo.
   ============================================================ */

/* 1) TRES SECCIONES INDEPENDIENTES EN PC
   Cada columna tiene su propio flujo vertical. La altura de un módulo
   de la derecha nunca empuja los módulos del centro y viceversa. */
@media(min-width:901px){
  .profile-modular-layout{
    display:grid!important;
    grid-template-columns:clamp(270px,22vw,340px) minmax(0,1fr) clamp(250px,21vw,330px)!important;
    align-items:start!important;
    gap:18px!important;
  }
  .profile-modular-fixed-column,
  .profile-modular-workspace,
  .profile-modular-right-column{
    position:relative!important;
    inset:auto!important;
    width:auto!important;
    min-width:0!important;
    max-width:none!important;
    align-self:start!important;
  }
  .profile-modular-fixed-column{grid-column:1!important}
  .profile-modular-workspace{grid-column:2!important}
  .profile-modular-right-column{grid-column:3!important}

  .profile-modular-zone-left,
  .profile-modular-zone-main,
  .profile-modular-zone-right{
    display:flex!important;
    flex-direction:column!important;
    flex-wrap:nowrap!important;
    align-items:stretch!important;
    align-content:stretch!important;
    gap:16px!important;
    width:100%!important;
    min-width:0!important;
    grid-template-columns:none!important;
    grid-auto-flow:initial!important;
  }

  .profile-modular-zone-left>.profile-modular-module,
  .profile-modular-zone-main>.profile-modular-module,
  .profile-modular-zone-right>.profile-modular-module{
    position:relative!important;
    inset:auto!important;
    width:100%!important;
    max-width:100%!important;
    min-width:0!important;
    flex:0 0 auto!important;
    grid-column:auto!important;
  }

  /* El tamaño se conserva en la configuración, pero dentro de cada
     sección el módulo ocupa el ancho completo de SU columna. */
  .profile-modular-zone-main>.profile-modular-module[data-module-size="small"],
  .profile-modular-zone-main>.profile-modular-module[data-module-size="medium"],
  .profile-modular-zone-main>.profile-modular-module[data-module-size="wide"]{
    width:100%!important;
    flex-basis:auto!important;
  }

  .profile-modular-zone-main>.profile-v396-feed-panel,
  .profile-modular-zone-main>.profile-v396-interests-panel{
    min-height:0!important;
  }

  /* La imagen vertical aprovecha toda la columna derecha sin alterar el centro. */
  .profile-modular-zone-right>.profile-image-module{
    width:100%!important;
  }
}

/* Guías visuales durante Organizar perfil. */
.profile-v396-shell.is-organizing .profile-modular-zone-right{
  min-height:150px;
  border:1px dashed rgba(202,177,255,.34);
  border-radius:20px;
  padding:8px;
}
.profile-v396-shell.is-organizing .profile-modular-zone-right:empty::before{
  content:'Columna derecha';
  min-height:120px;
  display:grid;
  place-items:center;
  color:rgba(255,255,255,.55);
  font-size:10px;
  font-weight:900;
}

/* Botones de edición directa */
.profile-links-module-head>button.profile-links-module-edit,
.profile-image-module-edit{
  appearance:none;
  -webkit-appearance:none;
  cursor:pointer;
  font-family:inherit;
}
.profile-links-module-head>button.profile-links-module-edit{
  width:34px;height:34px;flex:0 0 auto;border:0;border-radius:11px;
  display:grid;place-items:center;background:#f0eaff;color:#7147d9;
  font-size:13px;font-weight:900
}
.profile-links-empty button{
  margin-top:8px;border:0;background:transparent;color:#7047dc;
  font:inherit;font-weight:900;cursor:pointer
}
.profile-link-icon{overflow:hidden}
.profile-link-icon img{display:block;width:100%;height:100%;object-fit:cover;border-radius:inherit}
.profile-image-module-edit{border:1px solid rgba(255,255,255,.22)!important}
.profile-image-module-empty{width:100%;border:0;background:transparent;cursor:pointer;font-family:inherit}

/* 2) COLORES INDEPENDIENTES POR MÓDULO */
.profile-modular-module.has-custom-module-style{
  background:var(--click-module-bg)!important;
  color:var(--click-module-text)!important;
  border-color:var(--click-module-accent)!important;
}
.profile-modular-module.has-custom-module-style :is(h1,h2,h3,h4,p,strong,b,small,figcaption),
.profile-modular-module.has-custom-module-style>.profile-v396-level,
.profile-modular-module.has-custom-module-style .profile-links-module-head span{
  color:var(--click-module-text)!important;
}
.profile-modular-module.has-custom-module-style .profile-v396-level i em,
.profile-modular-module.has-custom-module-style .profile-v396-tabs a.active,
.profile-modular-module.has-custom-module-style .profile-badges-v2-head button,
.profile-modular-module.has-custom-module-style .profile-links-module-edit{
  background:var(--click-module-accent)!important;
}
.profile-modular-module.has-custom-module-style .profile-v396-tabs a.active,
.profile-modular-module.has-custom-module-style .profile-badges-v2-head button,
.profile-modular-module.has-custom-module-style .profile-links-module-edit{
  color:#fff!important;
}

/* 3) MODALES DE EDICIÓN */
html.profile-inline-modal-open{overflow:hidden}
.profile-inline-modal{
  position:fixed;inset:0;z-index:2400;display:grid;place-items:center;padding:18px
}
.profile-inline-modal[hidden]{display:none!important}
.profile-inline-modal-backdrop{
  position:absolute;inset:0;border:0;background:rgba(13,7,37,.72);
  backdrop-filter:blur(10px);-webkit-backdrop-filter:blur(10px);cursor:default
}
.profile-inline-modal-panel{
  position:relative;z-index:1;width:min(760px,100%);max-height:calc(100vh - 36px);
  overflow:auto;border:1px solid #e5def5;border-radius:25px;background:#fff;color:#352d62;
  box-shadow:0 30px 90px rgba(10,4,35,.38)
}
.profile-inline-modal-head{
  position:sticky;top:0;z-index:4;padding:20px 22px;border-bottom:1px solid #eee8f8;
  display:flex;align-items:flex-start;justify-content:space-between;gap:18px;
  background:rgba(255,255,255,.96);backdrop-filter:blur(12px);-webkit-backdrop-filter:blur(12px)
}
.profile-inline-modal-head>div{min-width:0}
.profile-inline-modal-head span{display:block;color:#8153e4;font-size:9px;font-weight:1000;letter-spacing:.10em}
.profile-inline-modal-head h2{margin:4px 0 3px;color:#332b66;font-size:22px;line-height:1.1}
.profile-inline-modal-head p{margin:0;color:#8b839e;font-size:10px;line-height:1.5}
.profile-inline-modal-head>button{
  width:38px;height:38px;flex:0 0 auto;border:0;border-radius:50%;display:grid;place-items:center;
  background:#f0ebfa;color:#6e43d5;font-size:22px;cursor:pointer
}
.profile-inline-modal-panel form{padding:18px 22px 22px}
.profile-inline-field{display:grid;gap:6px;margin-bottom:13px}
.profile-inline-field>span{color:#51486d;font-size:10px;font-weight:900}
.profile-inline-field input,.profile-inline-field select{
  width:100%;height:43px;border:1px solid #ded7eb;border-radius:11px;background:#fff;
  padding:0 11px;color:#443c5d;font:inherit;font-size:11px;outline:0
}
.profile-inline-field input:focus,.profile-inline-field select:focus{
  border-color:#9872ed;box-shadow:0 0 0 3px rgba(128,79,229,.08)
}
.profile-inline-modal-actions{
  display:flex;align-items:center;justify-content:flex-end;gap:8px;margin-top:18px;padding-top:15px;border-top:1px solid #eee8f7
}
.profile-inline-modal-actions button{
  min-height:42px;padding:0 16px;border:0;border-radius:12px;font:inherit;font-size:10px;font-weight:900;cursor:pointer
}
.profile-inline-modal-actions .secondary{background:#f1edf8;color:#675b80}
.profile-inline-modal-actions .primary{background:linear-gradient(135deg,#7546e9,#a248ee);color:#fff}
.profile-inline-modal-actions button[disabled]{opacity:.55;cursor:wait}
.profile-inline-status{min-height:18px;margin-top:9px;font-size:10px;font-weight:800;color:#77708c}
.profile-inline-status.saving{color:#8a65d9}.profile-inline-status.ok{color:#2e8c59}.profile-inline-status.error{color:#c65065}

/* Editor de enlaces */
.profile-inline-links-list{display:grid;gap:10px;margin-top:4px}
.profile-inline-link-row{padding:11px;border:1px solid #e5dff0;border-radius:16px;background:#fcfbfe}
.profile-inline-link-row-top{display:grid;grid-template-columns:26px 44px minmax(130px,1fr) 34px 34px 34px;gap:7px;align-items:center}
.profile-inline-link-row-top>b{display:grid;place-items:center;color:#9488a8;font-size:9px}
.profile-inline-link-logo{width:42px;height:42px;border-radius:12px;display:grid;place-items:center;overflow:hidden;background:#eee8fb;color:#6f47cf;font-size:9px;font-weight:1000}
.profile-inline-link-logo img{width:100%;height:100%;object-fit:cover}
.profile-inline-link-row select,.profile-inline-link-fields input{
  width:100%;height:39px;border:1px solid #ddd7e8;border-radius:10px;background:#fff;padding:0 9px;color:#4b435e;font:inherit;font-size:10px;outline:0
}
.profile-inline-link-row-top>button{
  width:34px;height:34px;border:0;border-radius:9px;display:grid;place-items:center;background:#efeafd;color:#7147d2;font-weight:900;cursor:pointer
}
.profile-inline-link-row-top>button.danger{background:#fff0f3;color:#ba536b}
.profile-inline-link-row-top>button[disabled]{opacity:.35;cursor:not-allowed}
.profile-inline-link-fields{display:grid;grid-template-columns:minmax(150px,.7fr) minmax(260px,1.3fr);gap:8px;margin-top:8px}
.profile-inline-link-logo-tools{display:flex;align-items:center;gap:8px;flex-wrap:wrap;margin-top:8px}
.profile-inline-link-logo-file{position:relative;display:inline-flex;min-height:34px;padding:0 11px;align-items:center;border-radius:9px;background:#eee8fb;color:#6842ca;font-size:9px;font-weight:900;cursor:pointer}
.profile-inline-link-logo-file input{position:absolute;width:1px;height:1px;opacity:0;pointer-events:none}
.profile-inline-link-logo-tools>button{min-height:34px;padding:0 10px;border:0;border-radius:9px;background:#f4f1f8;color:#746b84;font:inherit;font-size:9px;font-weight:800;cursor:pointer}
.profile-inline-links-tools{display:flex;align-items:center;justify-content:space-between;gap:12px;margin-top:12px}
.profile-inline-links-tools>button{min-height:39px;padding:0 13px;border:0;border-radius:11px;background:#eee8ff;color:#7046db;font:inherit;font-size:10px;font-weight:900;cursor:pointer}
.profile-inline-links-tools>button[disabled]{opacity:.45;cursor:not-allowed}
.profile-inline-links-tools small{color:#91899e;font-size:9px;line-height:1.45;text-align:right}

/* Editor de imagen */
.profile-inline-image-panel{width:min(680px,100%)}
.profile-inline-image-preview{height:min(46vh,430px);min-height:260px;margin-bottom:12px;border:1px dashed #d8cced;border-radius:18px;display:grid;place-items:center;overflow:hidden;background:linear-gradient(145deg,#f8f5ff,#eee8fb)}
.profile-inline-image-preview img{display:block;width:100%;height:100%;object-fit:contain}
.profile-inline-image-preview>span{font-size:54px;color:#a58cdb}
.profile-inline-file{position:relative;display:flex;min-height:43px;margin-bottom:12px;align-items:center;justify-content:center;border-radius:12px;background:#eee7ff;color:#6e43d3;font-size:10px;font-weight:900;cursor:pointer}
.profile-inline-file input{position:absolute;width:1px;height:1px;opacity:0;pointer-events:none}
.profile-inline-grid-2{display:grid;grid-template-columns:1fr 1fr;gap:10px}
.profile-inline-danger-link{border:0;background:transparent;color:#bd536a;font:inherit;font-size:10px;font-weight:900;cursor:pointer;padding:6px 0}

/* Editor de color */
.profile-inline-style-panel{width:min(560px,100%)}
.profile-inline-color-grid{display:grid;grid-template-columns:repeat(3,1fr);gap:10px}
.profile-inline-color-grid label{padding:12px;border:1px solid #e4deef;border-radius:14px;background:#fbfafe}
.profile-inline-color-grid label>span{display:block;margin-bottom:7px;color:#51486b;font-size:9px;font-weight:900}
.profile-inline-color-grid input[type="color"]{width:100%;height:52px;padding:3px;border:1px solid #ddd5e9;border-radius:10px;background:#fff;cursor:pointer}
.profile-inline-reset-check{display:flex;align-items:flex-start;gap:8px;margin-top:13px;padding:11px;border-radius:12px;background:#f7f4fb;color:#6f667e;font-size:10px;line-height:1.4}
.profile-inline-reset-check input{margin-top:1px}

@media(max-width:900px){
  .profile-modular-zone-main{display:flex!important;flex-direction:column!important;gap:12px!important;padding:0 6px!important}
  .profile-modular-zone-main>.profile-modular-module[data-module-size]{flex-basis:auto!important;width:100%!important}
  .profile-inline-modal{padding:7px;align-items:end}
  .profile-inline-modal-panel{width:100%;max-height:88vh;border-radius:22px 22px 13px 13px}
  .profile-inline-modal-head{padding:16px}
  .profile-inline-modal-panel form{padding:14px 16px 18px}
  .profile-inline-link-row-top{grid-template-columns:24px 40px minmax(100px,1fr) 31px 31px 31px;gap:5px}
  .profile-inline-link-row-top>button{width:31px;height:31px}
  .profile-inline-link-logo{width:38px;height:38px}
  .profile-inline-link-fields{grid-template-columns:1fr}
  .profile-inline-links-tools{align-items:flex-start;flex-direction:column}.profile-inline-links-tools small{text-align:left}
}

@media(max-width:520px){
  .profile-inline-modal-head h2{font-size:19px}
  .profile-inline-link-row{padding:8px}
  .profile-inline-link-row-top{grid-template-columns:22px 38px minmax(84px,1fr) 29px 29px 29px;gap:4px}
  .profile-inline-link-row-top>button{width:29px;height:29px;border-radius:8px}
  .profile-inline-link-logo{width:36px;height:36px}
  .profile-inline-color-grid{grid-template-columns:1fr}
  .profile-inline-grid-2{grid-template-columns:1fr}
  .profile-inline-modal-actions{display:grid;grid-template-columns:1fr 1fr}.profile-inline-modal-actions button{width:100%}
}

@media(max-width:900px){
  .profile-modular-layout{display:block!important}
  .profile-modular-fixed-column,
  .profile-modular-workspace,
  .profile-modular-right-column{width:100%!important;max-width:none!important}
  .profile-modular-zone-left,
  .profile-modular-zone-right{display:none!important}
}

/* ============================================================
   Click · Perfil Inline V4
   - Apariencia completa de Enlaces dentro del mismo popup.
   - Preview real antes de guardar Imagen destacada.
   - Loader/progreso de subida y conversión.
   ============================================================ */

/* Apariencia propia del módulo Enlaces. Carga después del estilo base. */
.profile-links-module.has-links-inline-style{
  background:var(--links-module-bg,#fff)!important;
  color:var(--links-module-text,#332c64)!important;
  border-color:var(--links-accent,#8b4df5)!important;
}
.profile-links-module.has-links-inline-style .profile-links-module-head h2{
  color:var(--links-module-text,#332c64)!important;
}
.profile-links-module.has-links-inline-style .profile-links-module-head span{
  color:var(--links-accent,#8b4df5)!important;opacity:.9
}
.profile-links-module.has-links-inline-style .profile-links-module-edit{
  background:var(--links-accent,#8b4df5)!important;
  color:#fff!important;
}
.profile-links-module.has-links-inline-style .profile-link-tile{
  background:var(--links-tile-bg,#fff)!important;
  color:var(--links-tile-text,#49415f)!important;
  border-color:color-mix(in srgb,var(--links-accent,#8b4df5) 24%, transparent)!important;
  border-radius:var(--links-tile-radius,16px)!important;
}
.profile-links-module.has-links-inline-style .profile-link-tile:hover{
  background:color-mix(in srgb,var(--links-tile-bg,#fff) 92%,var(--links-accent,#8b4df5) 8%)!important;
  border-color:color-mix(in srgb,var(--links-accent,#8b4df5) 48%, transparent)!important;
}
.profile-links-module.has-links-inline-style .profile-link-icon{
  background:var(--links-accent,#8b4df5)!important;
  color:#fff!important;
}
.profile-links-module.has-links-inline-style .profile-links-empty{
  background:color-mix(in srgb,var(--links-module-bg,#fff) 88%,var(--links-accent,#8b4df5) 12%)!important;
  color:var(--links-module-text,#332c64)!important;
  border-color:color-mix(in srgb,var(--links-accent,#8b4df5) 40%, transparent)!important;
}
.profile-links-module.has-links-inline-style .profile-links-empty button{
  color:var(--links-accent,#8b4df5)!important;
}

/* Caja de apariencia integrada dentro de Enlaces. */
.profile-inline-appearance-box{
  margin:2px 0 16px;padding:14px;border:1px solid #e4ddef;border-radius:18px;
  background:linear-gradient(180deg,#fbf9ff,#f7f3ff)
}
.profile-inline-appearance-head{display:flex;align-items:flex-start;justify-content:space-between;gap:12px;margin-bottom:11px}
.profile-inline-appearance-head strong{display:block;color:#41376c;font-size:12px}
.profile-inline-appearance-head small{display:block;margin-top:3px;color:#8d84a0;font-size:9px;line-height:1.45}
.profile-inline-appearance-head>button{min-height:32px;padding:0 10px;border:0;border-radius:9px;background:#ede6fb;color:#7145d1;font:inherit;font-size:9px;font-weight:900;cursor:pointer}
.profile-inline-color-grid-5{grid-template-columns:repeat(5,minmax(0,1fr))!important}
.profile-inline-range-field{display:grid;gap:7px;margin-top:11px}
.profile-inline-range-field>span{display:flex;justify-content:space-between;gap:10px;color:#51486d;font-size:10px;font-weight:900}
.profile-inline-range-field output{color:#7a50da;font-size:9px}
.profile-inline-range-field input[type="range"]{width:100%;accent-color:#8b4df5}

/* Preview de Imagen destacada. */
.profile-inline-image-preview{position:relative}
.profile-inline-image-preview img{position:relative;z-index:1;background:transparent}
.profile-inline-image-preview.is-cover img{object-fit:cover}
.profile-inline-image-preview.position-top img{object-position:center top}
.profile-inline-image-preview.position-center img{object-position:center center}
.profile-inline-image-preview.position-bottom img{object-position:center bottom}
.profile-inline-image-preview.has-preview-error::after{
  content:attr(data-preview-error);position:absolute;inset:0;z-index:2;display:grid;place-items:center;
  padding:30px;text-align:center;color:#875f99;font-size:11px;font-weight:900;background:linear-gradient(145deg,#f8f5ff,#eee8fb)
}
.profile-inline-image-loading{
  position:absolute;inset:0;z-index:6;display:flex;flex-direction:column;align-items:center;justify-content:center;
  padding:22px;background:rgba(246,241,255,.88);backdrop-filter:blur(7px);-webkit-backdrop-filter:blur(7px);text-align:center
}
.profile-inline-image-loading[hidden]{display:none!important}
.profile-inline-image-loading>i{
  width:38px;height:38px;border-radius:50%;border:4px solid rgba(125,78,222,.18);border-top-color:#8251e6;
  animation:clickInlineSpin .8s linear infinite
}
.profile-inline-image-loading strong{margin-top:12px;color:#47396d;font-size:12px}
.profile-inline-image-loading small{margin-top:4px;color:#8b80a0;font-size:9px;font-weight:800}
.profile-inline-image-loading>div{width:min(260px,82%);height:7px;margin-top:12px;border-radius:99px;overflow:hidden;background:#e3d9f5}
.profile-inline-image-loading>div>b{display:block;width:0;height:100%;border-radius:inherit;background:linear-gradient(90deg,#7548e5,#a64bf0);transition:width .18s ease}
@keyframes clickInlineSpin{to{transform:rotate(360deg)}}
.profile-inline-image-file-note{margin:-3px 0 12px;color:#8d849c;font-size:9px;text-align:center;line-height:1.45}
.profile-inline-file.is-busy{opacity:.6;pointer-events:none}

/* El botón guardar no se puede usar mientras la conversión de preview sigue activa. */
.profile-inline-image-panel.is-preview-busy .profile-inline-modal-actions .primary{opacity:.55;pointer-events:none}

@media(max-width:900px){
  .profile-inline-color-grid-5{grid-template-columns:repeat(3,minmax(0,1fr))!important}
}
@media(max-width:520px){
  .profile-inline-color-grid-5{grid-template-columns:1fr 1fr!important}
  .profile-inline-appearance-head{flex-direction:column}
  .profile-inline-appearance-head>button{width:100%}
}


/* ============================================================
   Click · Perfil Inline V5
   - Imagen destacada adapta su caja a la proporción real.
   - Altura vertical máxima 9:16, tipo Historia de Instagram.
   - Enlaces vuelve por defecto al lenguaje visual morado del perfil.
   ============================================================ */

/* Enlaces: misma familia visual que Publicaciones / Intereses / Estadísticas. */
.profile-links-module.has-links-inline-style{
  background:linear-gradient(155deg,
    color-mix(in srgb,var(--links-module-bg,#45397f) 88%,transparent),
    color-mix(in srgb,var(--links-module-bg,#45397f) 74%,#1d1d52 26%))!important;
  color:var(--links-module-text,#fff)!important;
  border:1px solid color-mix(in srgb,var(--links-accent,#a66cff) 55%,rgba(255,255,255,.22))!important;
  box-shadow:0 24px 54px rgba(5,8,34,.20)!important;
  backdrop-filter:blur(18px)!important;
  -webkit-backdrop-filter:blur(18px)!important;
}
.profile-links-module.has-links-inline-style .profile-links-module-head h2,
.profile-links-module.has-links-inline-style .profile-link-tile strong{
  color:var(--links-module-text,#fff)!important;
}
.profile-links-module.has-links-inline-style .profile-links-module-head span{
  color:color-mix(in srgb,var(--links-accent,#a66cff) 76%,#fff 24%)!important;
}
.profile-links-module.has-links-inline-style .profile-link-tile{
  background:color-mix(in srgb,var(--links-tile-bg,#584a91) 84%,transparent)!important;
  color:var(--links-tile-text,#fff)!important;
  border-color:rgba(255,255,255,.16)!important;
}
.profile-links-module.has-links-inline-style .profile-link-tile:hover{
  background:color-mix(in srgb,var(--links-tile-bg,#584a91) 92%,#fff 8%)!important;
  border-color:color-mix(in srgb,var(--links-accent,#a66cff) 60%,#fff 40%)!important;
}
.profile-links-module.has-links-inline-style .profile-link-icon{
  background:color-mix(in srgb,var(--links-accent,#a66cff) 18%,rgba(255,255,255,.13))!important;
  color:#fff!important;
}

/* Imagen destacada: anula las alturas fijas heredadas del V1. */
body.profile-premium-v396 .profile-v396-shell .profile-image-module:not(.is-empty),
.profile-premium-v396 .profile-v396-shell .profile-image-module:not(.is-empty),
.profile-v396-shell .profile-modular-zone-left>.profile-image-module:not(.is-empty),
.profile-v396-shell .profile-modular-zone-main>.profile-image-module:not(.is-empty),
.profile-v396-shell .profile-modular-zone-right>.profile-image-module:not(.is-empty){
  min-height:0!important;
  height:auto!important;
  max-height:none!important;
  aspect-ratio:var(--profile-image-aspect,1)!important;
  padding:0!important;
}
.profile-v396-shell .profile-image-module:not(.is-empty) .profile-image-module-stage{
  width:100%!important;
  height:100%!important;
  min-height:0!important;
  max-height:none!important;
  aspect-ratio:inherit!important;
}
.profile-v396-shell .profile-image-module:not(.is-empty) .profile-image-module-stage img{
  display:block!important;
  width:100%!important;
  height:100%!important;
  min-height:0!important;
  max-height:none!important;
}

/* Si la imagen cabe en su proporción real, contain ya no deja franjas.
   Solo una imagen más alta que 9:16 tendrá espacio para poder verla completa. */
.profile-v396-shell .profile-image-module.fit-contain .profile-image-module-stage img{object-fit:contain!important}
.profile-v396-shell .profile-image-module.fit-cover .profile-image-module-stage img{object-fit:cover!important}

/* El preview del popup también adopta la proporción antes de guardar. */
.profile-inline-image-preview.has-natural-ratio{
  height:auto!important;
  min-height:0!important;
  aspect-ratio:var(--preview-image-aspect,1)!important;
  max-height:min(68vh,620px)!important;
}
.profile-inline-image-preview.has-natural-ratio img{
  width:100%!important;
  height:100%!important;
}

/* En teléfono mantenemos exactamente la misma lógica de proporción. */
@media(max-width:900px){
  body.profile-premium-v396 .profile-v396-shell .profile-image-module:not(.is-empty),
  .profile-v396-shell .profile-modular-zone-main>.profile-image-module:not(.is-empty){
    min-height:0!important;
    height:auto!important;
    aspect-ratio:var(--profile-image-aspect,1)!important;
  }
}


/* ============================================================
   Click · Logos oficiales del módulo Enlaces
   WEBP normalizados en lienzo cuadrado y siempre centrados.
   ============================================================ */
.profile-links-module .profile-link-icon img,
.profile-inline-link-logo img{
  width:100%!important;
  height:100%!important;
  display:block!important;
  object-fit:contain!important;
  object-position:center!important;
  box-sizing:border-box!important;
  padding:3px!important;
  border-radius:inherit!important;
}
.profile-inline-link-logo{
  display:grid!important;
  place-items:center!important;
}
.profile-links-module .profile-link-icon{
  display:grid!important;
  place-items:center!important;
}

/* V6 · Tarjeta personalizada editable directamente desde el perfil */
.profile-custom-card{position:relative}
.profile-custom-card-edit{
  position:absolute;top:12px;right:12px;z-index:7;width:36px;height:36px;border:1px solid rgba(255,255,255,.22);
  border-radius:12px;display:grid;place-items:center;background:rgba(20,12,63,.42);color:#fff;font-size:15px;font-weight:900;
  cursor:pointer;backdrop-filter:blur(9px);-webkit-backdrop-filter:blur(9px);box-shadow:0 8px 18px rgba(9,4,36,.14)
}
.profile-custom-card-edit:hover{background:rgba(126,75,239,.72)}
.profile-custom-card-copy [data-profile-custom-link-wrap]:empty{display:none}
.profile-custom-card-copy [data-profile-custom-body]{white-space:pre-line}
.profile-inline-custom-panel{width:min(650px,100%)}
.profile-inline-field textarea{
  width:100%;min-height:130px;resize:vertical;border:1px solid #ded7eb;border-radius:11px;background:#fff;
  padding:11px;color:#443c5d;font:inherit;font-size:11px;line-height:1.55;outline:0
}
.profile-inline-field textarea:focus{border-color:#9872ed;box-shadow:0 0 0 3px rgba(128,79,229,.08)}
.profile-inline-field small{color:#91899e;font-size:9px;line-height:1.4}
html[data-theme="dark"] .profile-inline-field textarea{background:#211b49;border-color:#4a3f79;color:#f4f0ff}
html[data-theme="dark"] .profile-custom-card-edit{background:rgba(22,15,61,.72);border-color:rgba(255,255,255,.16)}
@media(max-width:640px){.profile-custom-card-edit{top:10px;right:10px;width:34px;height:34px}}

/* Click · Fix móvil V6 · editores por encima de la barra inferior */
@media(max-width:900px){
  html.profile-inline-modal-open .mobile-nav-v39,
  html.profile-inline-modal-open body.profile-premium-v396 .mobile-nav-v39{
    display:none!important;
  }
  html.profile-inline-modal-open,
  html.profile-inline-modal-open body{
    overflow:hidden!important;
  }
  .profile-inline-modal{
    z-index:20050!important;
    padding:7px 7px max(7px,env(safe-area-inset-bottom))!important;
    align-items:end!important;
  }
  .profile-inline-modal-panel{
    width:100%!important;
    max-height:calc(100dvh - 14px)!important;
    border-radius:22px 22px 14px 14px!important;
    overscroll-behavior:contain;
    padding-bottom:0!important;
  }
  .profile-inline-modal-panel form{
    padding-bottom:max(14px,env(safe-area-inset-bottom))!important;
  }
  .profile-inline-modal-actions{
    position:sticky!important;
    left:0;right:0;bottom:calc(-1 * max(14px,env(safe-area-inset-bottom)));
    z-index:12!important;
    margin-left:-16px!important;
    margin-right:-16px!important;
    margin-bottom:calc(-1 * max(14px,env(safe-area-inset-bottom)))!important;
    padding:12px 16px max(14px,env(safe-area-inset-bottom))!important;
    background:rgba(255,255,255,.97)!important;
    border-top:1px solid #eee8f7!important;
    box-shadow:0 -14px 28px rgba(22,10,58,.10);
    backdrop-filter:blur(14px);-webkit-backdrop-filter:blur(14px);
  }
  html[data-theme="dark"] body.profile-premium-v396 .profile-inline-modal-actions{
    background:rgba(29,25,63,.97)!important;
    border-top-color:#41386f!important;
    box-shadow:0 -14px 28px rgba(0,0,0,.24);
  }
}

/* V6 · Crear tarjetas visuales independientes */
.profile-module-library-list .profile-module-library-create{
  border-color:rgba(129,83,229,.28)!important;
  background:linear-gradient(145deg,rgba(132,83,233,.08),rgba(194,112,255,.06))!important;
}
.profile-module-library-list .profile-module-library-create>span{
  background:linear-gradient(145deg,#7448df,#aa56ee)!important;color:#fff!important
}
html[data-theme="dark"] body.profile-premium-v396 .profile-module-library-list .profile-module-library-create{
  background:linear-gradient(145deg,rgba(126,77,224,.18),rgba(177,87,237,.11))!important;
  border-color:rgba(154,112,238,.34)!important
}
