/* Wilduit Pre-Diagnóstico · front (v1.2 compacto, por pasos) */
.wd-diag{
	--wd-gap:10px;--wd-r:calc(var(--wd-radius) * .5);
	box-sizing:border-box;width:100%;max-width:var(--wd-max,400px);margin:0 auto;
	color:var(--wd-text);font-family:var(--wd-font,inherit);font-size:14px;line-height:1.4;
	container-type:inline-size;container-name:wd;
}
.wd-diag *,.wd-diag *::before,.wd-diag *::after{box-sizing:border-box}
.wd-diag [hidden]{display:none!important}
.wd-grid{
	background:var(--wd-bg);border-radius:var(--wd-radius);padding:16px;
	display:flex;flex-direction:column;gap:12px;
	box-shadow:0 18px 44px -22px rgba(0,0,0,.55),inset 0 0 0 1px rgba(255,255,255,.06);
}
.wd-side,.wd-form{min-width:0}

/* ---- Perfil mini ---- */
.wd-profile{display:flex;align-items:center;gap:12px}
.wd-avatar-ring{flex:0 0 auto;width:52px;height:52px;border-radius:50%;padding:2px;
	background:conic-gradient(from 210deg,var(--wd-r1),var(--wd-r2),var(--wd-r3),var(--wd-r1))}
.wd-avatar{width:100%;height:100%;border-radius:50%;overflow:hidden;border:2px solid var(--wd-bg);background:var(--wd-card);display:grid;place-items:center}
.wd-avatar img{width:100%;height:100%;object-fit:cover;display:block}
.wd-avatar span{font-size:20px;font-weight:700;color:var(--wd-accent)}
.wd-id{min-width:0}
.wd-user{font-size:15px;font-weight:700;display:flex;align-items:center;gap:5px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.wd-verified{width:14px;height:14px;color:#0095F6;flex:0 0 auto}
.wd-cat{color:var(--wd-muted);font-size:12px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.wd-bio{display:none;font-size:12.5px}
.wd-bio p{margin:0;display:-webkit-box;-webkit-line-clamp:3;-webkit-box-orient:vertical;overflow:hidden}
.wd-link{display:inline-block;margin-top:4px;color:#8AB4FF;font-weight:500;font-size:12px}
.wd-stats{display:none;list-style:none;margin:0;padding:0;gap:14px}
.wd-stats li{display:flex;flex-direction:column;font-size:11px;color:var(--wd-muted)}
.wd-stats strong{font-size:14px;color:var(--wd-text)}

/* ---- Formulario por pasos ---- */
.wd-form{display:flex;flex-direction:column;gap:8px;margin:0}
.wd-top{display:flex;align-items:baseline;justify-content:space-between;gap:10px}
.wd-title{margin:0;font-size:15.5px;line-height:1.25;font-weight:700;color:var(--wd-text)}
.wd-stepnum{font-size:11.5px;color:var(--wd-muted);font-variant-numeric:tabular-nums;flex:0 0 auto}
.wd-progress{height:3px;border-radius:3px;background:rgba(255,255,255,.08);overflow:hidden}
.wd-progress i{display:block;height:100%;background:var(--wd-accent);transition:width .3s}
.wd-step{display:flex;flex-direction:column;gap:var(--wd-gap);animation:wdin .25s ease both}
@keyframes wdin{from{opacity:0;transform:translateX(6px)}to{opacity:1;transform:none}}
.wd-intro{margin:0;color:var(--wd-muted);font-size:12.5px}
.wd-field{display:flex;flex-direction:column;gap:5px;margin:0;border:0;padding:0;min-width:0}
.wd-field>span,.wd-field legend{font-size:12.5px;font-weight:600;color:var(--wd-text);padding:0}
.wd-field legend{margin-bottom:6px}
.wd-row{display:flex;flex-direction:column;gap:var(--wd-gap)}
.wd-diag input[type=text],.wd-diag textarea{
	width:100%;font:inherit;font-size:14px;color:var(--wd-text);background:var(--wd-card);
	border:1px solid rgba(255,255,255,.10);border-radius:var(--wd-r);padding:9px 11px;margin:0;outline:none;
	transition:border-color .2s,box-shadow .2s;resize:none;
}
.wd-diag textarea{min-height:66px;max-height:110px}
.wd-diag input::placeholder,.wd-diag textarea::placeholder{color:var(--wd-muted);opacity:.75}
.wd-diag input[type=text]:focus,.wd-diag textarea:focus{border-color:var(--wd-accent);box-shadow:0 0 0 3px color-mix(in srgb,var(--wd-accent) 25%,transparent)}
.wd-invalid input,.wd-invalid textarea,.wd-choice.wd-invalid label span{border-color:#FF5C7A!important}

.wd-choice{display:grid;grid-template-columns:1fr 1fr;gap:8px}
.wd-choice legend{grid-column:1/-1}
.wd-choice label{cursor:pointer;margin:0;position:relative}
.wd-choice input{position:absolute;opacity:0;pointer-events:none}
.wd-choice label span{display:flex;align-items:center;justify-content:center;text-align:center;min-height:42px;padding:8px;
	font-size:13px;font-weight:600;border-radius:var(--wd-r);background:var(--wd-card);border:1px solid rgba(255,255,255,.10);transition:all .2s;color:var(--wd-text)}
.wd-choice input:checked+span{border-color:var(--wd-accent);background:color-mix(in srgb,var(--wd-accent) 18%,var(--wd-card));box-shadow:0 0 0 1px var(--wd-accent)}
.wd-choice input:focus-visible+span{outline:2px solid var(--wd-accent);outline-offset:2px}

.wd-nav{display:flex;align-items:center;justify-content:space-between;gap:8px;flex-wrap:wrap}
.wd-btn{display:inline-flex;align-items:center;justify-content:center;gap:7px;min-height:40px;padding:8px 16px;
	font:inherit;font-size:13.5px;font-weight:700;cursor:pointer;border:0;border-radius:var(--wd-r);
	background:var(--wd-accent);color:#fff;transition:filter .2s,transform .15s,opacity .2s;margin-left:auto}
.wd-btn:hover{filter:brightness(1.08)}.wd-btn:active{transform:scale(.98)}
.wd-btn[disabled]{opacity:.6;cursor:progress}
.wd-btn-wa{background:#25D366;color:#06210F}
.wd-btn-wa svg{width:17px;height:17px}
.wd-back,.wd-skip{background:none;border:0;padding:4px 0;font:inherit;font-size:12.5px;color:var(--wd-muted);cursor:pointer}
.wd-back:hover,.wd-skip:hover{color:var(--wd-text)}
.wd-skip{text-decoration:underline;align-self:flex-end;margin-top:-4px}
.wd-error{margin:0;color:#FF8FA3;font-size:12px}
.wd-hp{position:absolute!important;left:-9999px!important;height:0;width:0;opacity:0}
.wd-spinner{width:15px;height:15px;border-radius:50%;border:2px solid rgba(255,255,255,.35);border-top-color:#fff;animation:wdspin .8s linear infinite}
@keyframes wdspin{to{transform:rotate(360deg)}}

/* ---- Resultado IA (con scroll interno para no crecer) ---- */
.wd-result{background:var(--wd-card);border:1px solid rgba(255,255,255,.08);border-radius:var(--wd-r);padding:12px;
	max-height:190px;overflow:auto;scrollbar-width:thin}
.wd-score{display:flex;align-items:center;gap:12px}
.wd-gauge{--p:0;flex:0 0 auto;width:54px;height:54px;border-radius:50%;display:grid;place-items:center;position:relative;
	background:conic-gradient(var(--wd-accent) calc(var(--p) * 1%),rgba(255,255,255,.08) 0)}
.wd-gauge::before{content:"";position:absolute;inset:5px;border-radius:50%;background:var(--wd-card)}
.wd-gauge b{position:relative;font-size:15px;font-weight:800}
.wd-gauge b small{font-size:9px;font-weight:600;color:var(--wd-muted)}
.wd-level{font-size:10.5px;text-transform:uppercase;letter-spacing:.8px;color:var(--wd-accent);font-weight:700}
.wd-sum{margin:2px 0 0;font-size:13px}
.wd-result h4{margin:10px 0 4px;font-size:11px;text-transform:uppercase;letter-spacing:.6px;color:var(--wd-muted)}
.wd-result ul{margin:0;padding-left:16px;font-size:13px}
.wd-result li{margin:2px 0}
.wd-focus{margin:8px 0 0;padding:7px 9px;border-radius:9px;background:color-mix(in srgb,var(--wd-accent) 14%,transparent);font-size:12.5px}
.wd-next{margin:8px 0 0;font-size:12.5px;font-weight:600}
.wd-plain{white-space:pre-wrap;font-size:13px;margin:0}
.wd-disclaimer{margin:0;font-size:10.5px;color:var(--wd-muted);line-height:1.4}

/* =====================================================
 * HORIZONTAL compacto: franja de perfil a la izquierda
 * ================================================== */
@container wd (min-width:600px){
	.wd-horizontal .wd-grid{display:grid;grid-template-columns:200px 1fr;gap:0;padding:18px}
	.wd-horizontal .wd-side{padding-right:18px;border-right:1px solid rgba(255,255,255,.08);display:flex;flex-direction:column;gap:10px}
	.wd-horizontal .wd-profile{flex-direction:column;align-items:flex-start;gap:8px}
	.wd-horizontal .wd-avatar-ring{width:64px;height:64px}
	.wd-horizontal .wd-bio{display:block}
	.wd-horizontal .wd-stats{display:flex}
	.wd-horizontal .wd-side{overflow:hidden}
	.wd-horizontal .wd-id{width:100%}
	.wd-horizontal .wd-cat{white-space:normal}
	.wd-horizontal .wd-form{padding-left:20px;min-height:100%}
	.wd-horizontal .wd-row{display:grid;grid-template-columns:1fr 1fr}
	.wd-horizontal .wd-step{flex:1}
	.wd-horizontal .wd-nav{margin-top:auto}
}

/* =====================================================
 * FLOTANTE: botón en la esquina + panel acotado
 * ================================================== */
.wd-flotante{
	--wd-fx:18px;--wd-fy:96px;--wd-fxm:12px;--wd-fym:84px;
	position:fixed!important;top:auto;bottom:auto;left:auto;right:auto;z-index:2147483000;
	width:auto;max-width:none;margin:0;container-type:normal;
}
/* Posición: vertical */
.wd-flotante.wd-v-bottom{bottom:var(--wd-fy)}
.wd-flotante.wd-v-top{top:var(--wd-fy)}
.wd-flotante.wd-v-middle{top:50%;transform:translateY(-50%)}
/* Posición: horizontal */
.wd-flotante.wd-h-right{right:var(--wd-fx)}
.wd-flotante.wd-h-left{left:var(--wd-fx)}

.wd-launcher{display:flex;align-items:center;gap:9px;max-width:290px;padding:6px 16px 6px 6px;border:0;cursor:pointer;
	border-radius:999px;background:var(--wd-bg);color:var(--wd-text);font:inherit;font-size:13px;font-weight:600;text-align:left;line-height:1.25;
	box-shadow:0 10px 30px -8px rgba(0,0,0,.5),inset 0 0 0 1px rgba(255,255,255,.08);animation:wdpop .4s ease both}
.wd-launcher .wd-avatar-ring{width:40px;height:40px}
.wd-launcher .wd-avatar span{font-size:15px}
@keyframes wdpop{from{opacity:0;transform:translateY(10px)}to{opacity:1;transform:none}}
.wd-flotante.wd-open .wd-launcher{display:none}
.wd-panel{position:relative;width:min(var(--wd-max,380px),calc(100vw - 2 * var(--wd-fx)));animation:wdpop .25s ease both}
.wd-panel .wd-grid{max-height:min(560px,calc(100vh - var(--wd-fy) - 24px));overflow:auto}
.wd-v-middle .wd-panel .wd-grid{max-height:min(560px,calc(100vh - 40px))}
.wd-close{position:absolute;top:8px;right:10px;z-index:2;width:28px;height:28px;border-radius:50%;border:0;cursor:pointer;
	background:rgba(255,255,255,.08);color:var(--wd-text);font-size:18px;line-height:28px;padding:0}
.wd-flotante .wd-profile{padding-right:32px}

@media (max-width:600px){
	.wd-flotante.wd-v-bottom{bottom:var(--wd-fym)}
	.wd-flotante.wd-v-top{top:var(--wd-fym)}
	.wd-flotante.wd-h-right{right:var(--wd-fxm)}
	.wd-flotante.wd-h-left{left:var(--wd-fxm)}
	.wd-launcher{max-width:calc(100vw - 90px);font-size:12.5px}
	/* Solo la foto en celular: ocupa lo mínimo */
	.wd-m-icon .wd-launcher{padding:4px;gap:0}
	.wd-m-icon .wd-launcher>span{display:none}
	.wd-m-icon .wd-launcher .wd-avatar-ring{width:50px;height:50px}
	.wd-panel{width:min(var(--wd-max,380px),calc(100vw - 2 * var(--wd-fxm)))}
	/* En celular nunca más del 70% de la pantalla */
	.wd-panel .wd-grid{max-height:min(70vh,calc(100vh - var(--wd-fym) - 16px));max-height:min(70dvh,calc(100dvh - var(--wd-fym) - 16px))}
	.wd-v-middle .wd-panel .wd-grid{max-height:70dvh}
}
/* Punto de atención en el botón solo-foto */
.wd-m-icon .wd-launcher .wd-avatar-ring{position:relative}

/* Respaldo sin container queries */
@supports not (container-type:inline-size){
	@media (min-width:700px){
		.wd-horizontal .wd-grid{display:grid;grid-template-columns:200px 1fr;gap:0}
		.wd-horizontal .wd-side{padding-right:18px;border-right:1px solid rgba(255,255,255,.08)}
		.wd-horizontal .wd-bio{display:block}
		.wd-horizontal .wd-form{padding-left:20px}
	}
}
